libjboss-microcontainer-java-2.0.10.GA.orig/0000755000175000017500000000000011620312222020504 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/build/0000755000175000017500000000000011620312135021606 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/build/pom.xml0000644000175000017500000000557311375173343023152 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 org.jboss.microcontainer jboss-microcontainer-dist 2.0.10.GA pom JBoss Microcontainer Distribution Build The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment and configuration. dist org.apache.maven.plugins maven-assembly-plugin 2.2-beta-2 make-assembly package attached jboss-microcontainer-${project.version} src/assembly/dist.xml src/assembly/dist-with-deps.xml src/assembly/src.xml org.jboss.microcontainer jboss-aop-mc-int org.jboss.microcontainer jboss-dependency org.jboss.microcontainer jboss-kernel org.jboss.microcontainer jboss-guice-int org.jboss.microcontainer jboss-spring-int libjboss-microcontainer-java-2.0.10.GA.orig/build/.cvsignore0000644000175000017500000000002110450525643023611 0ustar twernertwernerlocal.properties libjboss-microcontainer-java-2.0.10.GA.orig/build/src/0000755000175000017500000000000011620312135022375 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/build/src/assembly/0000755000175000017500000000000011620312135024214 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/build/src/assembly/src.xml0000644000175000017500000000044211130742473025535 0ustar twernertwerner src zip .. */target/ libjboss-microcontainer-java-2.0.10.GA.orig/build/src/assembly/dist.xml0000644000175000017500000000040711130742473025712 0ustar twernertwerner zip / false libjboss-microcontainer-java-2.0.10.GA.orig/build/src/assembly/dist-with-deps.xml0000755000175000017500000000033111130742473027613 0ustar twernertwerner with-deps zip / libjboss-microcontainer-java-2.0.10.GA.orig/build/JBossORG-EULA.txt0000644000175000017500000001764610527470712024514 0ustar twernertwernerLICENSE AGREEMENT JBOSS(r) This License Agreement governs the use of the Software Packages and any updates to the Software Packages, regardless of the delivery mechanism. Each Software Package is a collective work under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to the user ("Client") a license to the applicable collective work(s) pursuant to the GNU Lesser General Public License v. 2.1 except for the following Software Packages: (a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the GNU General Public License v.2; (b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0; (c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the (open source) Sleepycat License (if Client does not wish to use the open source version of this database, it may purchase a license from Sleepycat Software); and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various royalty-free patent licenses. Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php. 1. The Software. "Software Packages" refer to the various software modules that are created and made available for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages may be comprised of hundreds of software components. The end user license agreement for each component is located in the component's source code. With the exception of certain image files identified in Section 2 below, the license terms for the components permit Client to copy, modify, and redistribute the component, in both source code and binary code forms. This agreement does not limit Client's rights under, or grant Client rights that supersede, the license terms of any particular component. 2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted. Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages. 3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular component, to the maximum extent permitted under applicable law, the Software Packages and the components are provided and licensed "as is" without warranty of any kind, expressed or implied, including the implied warranties of merchantability, non-infringement or fitness for a particular purpose. Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in materials and manufacture under normal use for a period of 30 days from the date of delivery to Client. Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements or that the operation of the Software Packages will be entirely error free or appear precisely as described in the accompanying documentation. This warranty extends only to the party that purchases the Services pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. 4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or refund the money paid by Client for the Software. To the maximum extent permitted by applicable law, Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential damages, including lost profits or lost savings arising out of the use or inability to use the Software, even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this Agreement during the twelve months preceding the action. 5. Export Control. As required by U.S. law, Client represents and warrants that it: (a) understands that the Software Packages are subject to export controls under the U.S. Commerce Department's Export Administration Regulations ("EAR"); (b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations (currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); (c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; (d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or biological weapons, or missile technology end-uses unless authorized by the U.S. Government by regulation or specific license; (e) understands and agrees that if it is in the United States and exports or transfers the Software Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and address (including country) of each transferee; and (f) understands that countries other than the United States may restrict the import, use, or export of encryption products and that it shall be solely responsible for compliance with any such import, use, or export restrictions. 6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages that are not part of the Software Packages and which Client must install separately. These third party programs are subject to their own license terms. The license terms either accompany the programs or can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable license terms for such programs, then Client may not install them. If Client wishes to install the programs on more than one system or transfer the programs to another party, then Client must contact the licensor of the programs. 7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the State of North Carolina and of the United States, without regard to any conflict of laws provisions, except that the United Nations Convention on the International Sale of Goods shall not apply. Copyright 2006 Red Hat, Inc. All rights reserved. "JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc. All other trademarks are the property of their respective owners. Page 1 of 1 18 October 2006 libjboss-microcontainer-java-2.0.10.GA.orig/build/.project0000644000175000017500000000030610450525643023266 0ustar twernertwerner build libjboss-microcontainer-java-2.0.10.GA.orig/build/eclipse.psf0000755000175000017500000000130410464257130023755 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/pom.xml0000644000175000017500000002673311375173343022054 0ustar twernertwerner 4.0.0 org.jboss jboss-parent 5 org.jboss.microcontainer jboss-microcontainer 2.0.10.GA pom JBoss Microcontainer Parent POM http://www.jboss.org/jbossmc/ The JBoss Microcontainer provides a lightweight container for managing POJOs, their deployment and configuration. scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.10.GA scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.10.GA http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontainer/tags/2.0.10.GA dependency kernel aop-mc-int spring-int guice-int build 1.5 2.2.17.GA 2.0.5.GA 2.0.5.GA 2.0.1.GA 2.1.1.SP2 3.10.0.GA 2.1.0.CR3 2.0.3.GA 2.0.2.GA 1.1.1.GA 4.4 1.0.0.CR5 1.6.5 4.0.1 3.1.1 1.0 ${microcontainer.outputDirectory} ${microcontainer.testOutputDirectory} ${artifactId} org.apache.maven.plugins maven-release-plugin 2.0-beta-9 false https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags true org.apache.maven.plugins maven-compiler-plugin 2.0.2 1.5 1.5 true true true org.codehaus.mojo findbugs-maven-plugin 2.0.1 ${project.build.sourceDirectory}/../resources/findbugs/exclude.xml true org.apache.maven.plugins maven-idea-plugin 2.2 true org.apache.maven.plugins maven-surefire-plugin 2.4.3 true org/jboss/test/**/*TestCase.java repository.jboss.org JBoss Repository default http://repository.jboss.org/maven2/ false snapshots.jboss.org JBoss Snapshots Repository default http://snapshots.jboss.org/maven2/ true false org.jboss.microcontainer jboss-aop-mc-int ${project.version} org.jboss.microcontainer jboss-dependency ${project.version} org.jboss.microcontainer jboss-kernel ${project.version} org.jboss.microcontainer jboss-kernel ${project.version} test-jar test org.jboss.man jboss-managed ${version.jboss.man} org.jboss.man jboss-metatype ${version.jboss.man} org.jboss.microcontainer jboss-spring-int ${project.version} org.jboss.microcontainer jboss-guice-int ${project.version} org.jboss jboss-common-core ${version.jboss.common.core} org.jboss.logging jboss-logging-spi ${version.jboss.logging.spi} org.jboss.logging jboss-logging-log4j ${version.jboss.logging.log4j} org.jboss jbossxb ${version.jbossxb} org.jboss jboss-reflect ${version.org.jboss.reflect} org.jboss jboss-mdr ${version.org.jboss.mdr} javassist javassist ${version.javassist} org.jboss.aop jboss-aop ${version.jboss.aop} ant ant-junit ${version.ant.junit} org.jboss.test jboss-test ${version.org.jboss.test} test junit junit ${version.junit} test jboss.profiler.jvmti jboss-profiler-jvmti ${version.jboss.profiler.jvmti} test com.google.code.guice guice ${version.google.guice} org.apache.maven.plugins maven-project-info-reports-plugin 2.1 dependencies issue-tracking license scm org.codehaus.mojo findbugs-maven-plugin 1.0.0 default true target/classes target/test-classes eclipse process-test-resources maven-eclipse-plugin eclipse process-test-resources eclipse true ${microcontainer.outputDirectory} eclipse-target/classes eclipse-target/tests-classes assembly docs libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/0000755000175000017500000000000011620312222022576 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/.classpath0000644000175000017500000000114111301257231024562 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/pom.xml0000644000175000017500000000276211375173343024142 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 jboss-spring-int jar JBoss Microcontainer Spring Int http://www.jboss.com/products/jbossmc JBoss Microcontainer Spring Integration org.jboss.microcontainer jboss-kernel org.jboss.man jboss-managed true org.jboss.logging jboss-logging-log4j test org.jboss.test jboss-test test junit junit test libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/0000755000175000017500000000000011620312221023364 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/0000755000175000017500000000000011620312221024343 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/0000755000175000017500000000000011620312221026355 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/0000755000175000017500000000000011620312221027144 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/0000755000175000017500000000000011620312221030264 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/0000755000175000017500000000000011620312221031243 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/0000755000175000017500000000000011620312221032545 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000755000175000017500000000000011620312221033445 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/InstantiateMixed2TestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000065610560365472033500 0ustar twernertwerner JavaBean ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/LazySpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000030010630031724033446 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/BeanNameAwareSpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000301210755136315033463 0ustar twernertwerner OtherBean subOtherBean intOtherBean ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/ImportSpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000033610630031724033457 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/InstantiateSpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000225510560112441033457 0ustar twernertwerner SpringBean 1 3.14159 onel twol threel ones twos ones test_key myvalue ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/DependsSpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000040510630031724033454 0ustar twernertwerner ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/AliasSpringTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000036610630031724033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/InstantiateMixedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000113610541526145033465 0ustar twernertwerner onel twol threel ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test/TestDescribe.xmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/resources/org/jboss/test/spring/test0000644000175000017500000000177310560112441033463 0ustar twernertwerner SpringBean 1 3.14159 onel twol threel ones twos ones test_key myvalue libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/0000755000175000017500000000000011620312220025263 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/0000755000175000017500000000000011620312221026053 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/0000755000175000017500000000000011620312220027172 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/0000755000175000017500000000000011620312220030151 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/0000755000175000017500000000000011620312221031454 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/0000755000175000017500000000000011620312221032433 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/AliasSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Alia0000644000175000017500000000406110630031724033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.test.spring.support.SimpleBean; /** * @author Ales Justin */ public class AliasSpringTestCase extends TempSpringMicrocontainerTest { public AliasSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(AliasSpringTestCase.class); } public void testAlias() throws Exception { SimpleBean testBean = (SimpleBean) getBean("testBean"); SimpleBean al1 = (SimpleBean) getBean("al1"); SimpleBean al2 = (SimpleBean) getBean("al2"); SimpleBean al3 = (SimpleBean) getBean("al3"); SimpleBean al4 = (SimpleBean) getBean("al4"); SimpleBean fromAlias = (SimpleBean) getBean("fromAlias"); assertEquals(testBean, al1); assertEquals(al1, al2); assertEquals(al2, al3); assertEquals(al3, al4); assertEquals(al4, fromAlias); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/DescribeSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Desc0000644000175000017500000000335411034362472033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.BeanMetaData; /** * @author Ales Justin */ public class DescribeSpringTestCase extends TempSpringSchemaTest { public DescribeSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(DescribeSpringTestCase.class); } public void testDescribe() throws Exception { BeanMetaData simpleBeanMD = unmarshal("TestDescribe.xml", BeanMetaData.class); // todo - test descriptions System.out.println("simpleBean = " + simpleBeanMD); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/TempSpringMicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Temp0000644000175000017500000000462411173121305033275 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.spring.deployment.xml.SpringSchemaInitializer; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; import org.jboss.xb.binding.resolver.MutableSchemaResolver; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * @author Ales Justin */ public class TempSpringMicrocontainerTestDelegate extends MicrocontainerTestDelegate { public TempSpringMicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } public void setUp() throws Exception { SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); MutableSchemaResolver defaultSchemaResolver = (MutableSchemaResolver) resolver; defaultSchemaResolver.mapSchemaInitializer("urn:jboss:spring-beans:2.0", new SpringSchemaInitializer()); defaultSchemaResolver.mapSchemaLocation("urn:jboss:spring-beans:2.0", "mc-spring-beans_2_0.xsd"); defaultSchemaResolver.setParseXSDAnnotations("urn:jboss:spring-beans:2.0", Boolean.FALSE); super.setUp(); } protected BasicXMLDeployer createDeployer() { return new AliasBeanXMLDeployer(kernel); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/ImportSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Impo0000644000175000017500000000330310630031724033267 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; /** * @author Ales Justin */ public class ImportSpringTestCase extends TempSpringMicrocontainerTest { public ImportSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(ImportSpringTestCase.class); } public void testImport() throws Exception { /* SimpleBean testBean = (SimpleBean) getBean("testBean", ControllerState.INSTANTIATED); SimpleBean bean1 = (SimpleBean) getBean("Bean1", ControllerState.INSTANTIATED); */ } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/TempSpringSchemaTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Temp0000644000175000017500000000676710764046354033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import java.net.URL; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * @author Ales Justin */ public class TempSpringSchemaTest extends AbstractTestCaseWithSetup { public TempSpringSchemaTest(String name) { super(name); } /** * Unmarshal some xml * * @param the expected type * @param name the name * @param expected the expected type * @return the unmarshalled object * @throws Exception for any error */ protected T unmarshal(String name, Class expected) throws Exception { Object object = unmarshal(name); if (object == null) fail("No object from " + name); assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass())); return expected.cast(object); } /** * Unmarshal some xml * * @param name the name * @return the unmarshalled object * @throws Exception for any error */ protected Object unmarshal(String name) throws Exception { String url = findXML(name); return getJBossXBDelegate().unmarshal(url); } /** * Find the xml * * @param name the name * @return the url of the xml */ protected String findXML(String name) { URL url = getResource(name); if (url == null) fail(name + " not found"); return url.toString(); } /** * Setup the test delegate * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new TempSpringSchemaTestDelegate(clazz); } protected TempSpringSchemaTestDelegate getJBossXBDelegate() { return (TempSpringSchemaTestDelegate) getDelegate(); } protected void setUp() throws Exception { super.setUp(); configureLogging(); } /** * Get the package root name * * @return the root name */ protected String getRootName() { String longName = getClass().getName(); int dot = longName.lastIndexOf('.'); if (dot != -1) return longName.substring(dot + 1); return longName; } protected void configureLogging() { //enableTrace("org.jboss.xb"); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/LazyTempSpringMicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Lazy0000644000175000017500000000432710756345524033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * @author Ales Justin */ public class LazyTempSpringMicrocontainerTestDelegate extends TempSpringMicrocontainerTestDelegate { public LazyTempSpringMicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } protected KernelControllerContext handleNotFoundContext(Controller controller, Object name, ControllerState state) { KernelControllerContext context = (KernelControllerContext)controller.getContext(name, null); if (context != null && ControllerMode.ON_DEMAND.equals(context.getMode())) { try { controller.change(context, ControllerState.INSTALLED); return context; } catch (Throwable t) { throw new Error("Unable to change on demand context to Installed.", t); } } throw new IllegalStateException("Bean not found " + name + " at state " + state); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/DependsSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Depe0000644000175000017500000000350010630031724033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.test.spring.support.SettingBean; import org.jboss.test.spring.support.WaitingBean; /** * @author Ales Justin */ public class DependsSpringTestCase extends TempSpringMicrocontainerTest { public DependsSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(DependsSpringTestCase.class); } public void testDepends() throws Exception { WaitingBean wait = (WaitingBean)getBean("wait"); assertNotNull(wait); assertTrue(WaitingBean.getFlag()); SettingBean set = (SettingBean)getBean("set"); assertNotNull(set); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/TempSpringMicrocontainerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Temp0000644000175000017500000000326210756345524033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * @author Ales Justin */ public class TempSpringMicrocontainerTest extends MicrocontainerTest { public TempSpringMicrocontainerTest(String name) { super(name); } /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new TempSpringMicrocontainerTestDelegate(clazz); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/TempSpringSchemaTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Temp0000644000175000017500000000633011173121305033271 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import org.jboss.spring.deployment.xml.SpringSchemaInitializer; import org.jboss.test.AbstractTestDelegate; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.resolver.MutableSchemaResolver; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * @author Ales Justin */ public class TempSpringSchemaTestDelegate extends AbstractTestDelegate { /** The unmarshaller factory */ protected UnmarshallerFactory unmarshallerFactory; /** The resolver */ protected SchemaBindingResolver resolver; public TempSpringSchemaTestDelegate(Class clazz) { super(clazz); } public void setUp() throws Exception { super.setUp(); unmarshallerFactory = UnmarshallerFactory.newInstance(); resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); MutableSchemaResolver defaultSchemaResolver = (MutableSchemaResolver) resolver; defaultSchemaResolver.mapSchemaInitializer("urn:jboss:spring-beans:2.0", new SpringSchemaInitializer()); defaultSchemaResolver.mapSchemaLocation("urn:jboss:spring-beans:2.0", "mc-spring-beans_2_0.xsd"); defaultSchemaResolver.setParseXSDAnnotations("urn:jboss:spring-beans:2.0", Boolean.FALSE); } /** * Unmarshal an object * * @param url the url * @return the object * @throws Exception for any error */ public Object unmarshal(String url) throws Exception { long start = System.currentTimeMillis(); Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller(); log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms"); try { Object result = unmarshaller.unmarshal(url, resolver); log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms"); return result; } catch (Exception e) { log.debug("Error during parsing: " + url, e); throw e; } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/LazySpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Lazy0000644000175000017500000000360210630031724033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.test.spring.support.SettingBean; import org.jboss.test.spring.support.WaitingBean; /** * @author Ales Justin */ public class LazySpringTestCase extends LazyTempSpringMicrocontainerTest { public LazySpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(LazySpringTestCase.class); } protected void setUp() throws Exception { WaitingBean.setFlag(false); super.setUp(); } public void testLazy() throws Exception { assertFalse(WaitingBean.getFlag()); SettingBean set = (SettingBean)getBean("set"); assertNotNull(set); assertTrue(WaitingBean.getFlag()); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/LazyTempSpringMicrocontainerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Lazy0000644000175000017500000000323010756345524033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import org.jboss.test.AbstractTestDelegate; /** * @author Ales Justin */ public class LazyTempSpringMicrocontainerTest extends TempSpringMicrocontainerTest { public LazyTempSpringMicrocontainerTest(String name) { super(name); } /** * Get the lazy test delegate * * @param clazz the test class * @return the lazy delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new LazyTempSpringMicrocontainerTestDelegate(clazz); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/BeanNameAwareSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Bean0000644000175000017500000000574610755136315033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.spring.support.BeanNameAwareBean; import org.jboss.test.spring.support.IntBeanNameAwareBean; /** * Name aware test. * * @author John Bailey * @author Davide Panelli */ public class BeanNameAwareSpringTestCase extends TempSpringMicrocontainerTest { public BeanNameAwareSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(BeanNameAwareSpringTestCase.class); } public void testConfigure() throws Exception { BeanNameAwareBean testBean = (BeanNameAwareBean) getBean("testBean", ControllerState.INSTANTIATED); assertNotNull(testBean); assertEquals("testBean" , testBean.getBeanName()); BeanNameAwareBean subTestBean = (BeanNameAwareBean) getBean("subTestBean", ControllerState.INSTANTIATED); assertNotNull(subTestBean); assertEquals("subTestBean" , subTestBean.getBeanName()); IntBeanNameAwareBean intTestBean = (IntBeanNameAwareBean) getBean("intTestBean", ControllerState.INSTANTIATED); assertNotNull(intTestBean); assertEquals("intTestBean" , intTestBean.getName()); BeanNameAwareBean otherBean = (BeanNameAwareBean) getBean("testBeanWithExisingName", ControllerState.INSTANTIATED); assertNotNull(otherBean); assertEquals("OtherBean" , otherBean.getBeanName()); BeanNameAwareBean subOtherBean = (BeanNameAwareBean) getBean("subTestBeanWithExisingName", ControllerState.INSTANTIATED); assertNotNull(subOtherBean); assertEquals("subOtherBean" , subOtherBean.getBeanName()); IntBeanNameAwareBean intOtherBean = (IntBeanNameAwareBean) getBean("intTestBeanWithExisingName", ControllerState.INSTANTIATED); assertNotNull(intOtherBean); assertEquals("intOtherBean" , intOtherBean.getName()); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/InstantiateSpringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Inst0000644000175000017500000000435010630031724033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.spring.support.SimpleBean; /** * @author Ales Justin */ public class InstantiateSpringTestCase extends TempSpringMicrocontainerTest { public InstantiateSpringTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(InstantiateSpringTestCase.class); } public void testConfigure() throws Exception { SimpleBean testBean = (SimpleBean) getBean("testBean", ControllerState.INSTANTIATED); assertNotNull(testBean); assertEquals(testBean.getX(), 1); assertEquals(testBean.getY(), 3.14159); assertEquals(testBean.getS(), "SpringBean"); // collections assertFalse(testBean.getMylist().isEmpty()); assertEquals(testBean.getMylist().size(), 3); assertFalse(testBean.getMyset().isEmpty()); assertEquals(testBean.getMyset().size(),2); // assertFalse(testBean.getMymap().values().isEmpty()); // assertEquals(testBean.getMymap().values().size(), 1); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/InstantiateMixed2TestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Inst0000644000175000017500000000405510541526145033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.test.spring.support.OldBean; import org.jboss.test.spring.support.SimpleBean; import org.jboss.dependency.spi.ControllerState; /** * Testing how MC beans can be mixed (injected, ...) with Spring beans. * * @see InstantiateMixedTestCase * @author Ales Justin */ public class InstantiateMixed2TestCase extends TempSpringMicrocontainerTest { public InstantiateMixed2TestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(InstantiateMixed2TestCase.class); } public void testInjection() throws Exception { SimpleBean simpleBean = (SimpleBean) getBean("testBean", ControllerState.INSTANTIATED); assertNotNull(simpleBean); OldBean oldBean = simpleBean.getRefBean(); assertNotNull(oldBean); assertEquals(oldBean.getJavaBeanString(), "JavaBean"); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/InstantiateMixedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Inst0000644000175000017500000000377410541526145033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import org.jboss.test.spring.support.OldBean; import org.jboss.test.spring.support.SimpleBean; /** * Testing how Spring beans can be mixed (injected, ...) with MC beans. * * @see InstantiateMixed2TestCase * @author Ales Justin */ public class InstantiateMixedTestCase extends TempSpringMicrocontainerTest { public InstantiateMixedTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(InstantiateMixedTestCase.class); } public void testInjection() throws Exception { OldBean oldBean = (OldBean) getBean("oldBean"); assertNotNull(oldBean); SimpleBean testBean = oldBean.getTestBean(); assertNotNull(testBean); assertFalse(testBean.getMylist().isEmpty()); assertEquals(testBean.getMylist().size(), 3); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/AliasBeanXMLDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Alia0000644000175000017500000000457010644630303033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.beans.metadata.spi.NamedAliasMetaData; /** * @author Ales Justin */ public class AliasBeanXMLDeployer extends BasicXMLDeployer { public AliasBeanXMLDeployer(Kernel kernel) { super(kernel); } protected void deployBeans(KernelController controller, KernelDeployment deployment) throws Throwable { super.deployBeans(controller, deployment); Set aliases = deployment.getAliases(); if (aliases != null && aliases.isEmpty() == false) { for (NamedAliasMetaData alias : aliases) controller.addAlias(alias.getAliasValue(), alias.getName()); } } protected void undeployBeans(KernelController controller, KernelDeployment deployment) { Set aliases = deployment.getAliases(); if (aliases != null && aliases.isEmpty() == false) { for (NamedAliasMetaData alias : aliases) controller.removeAlias(alias.getAliasValue()); } super.undeployBeans(controller, deployment); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/SpringTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/test/Spri0000644000175000017500000000370710755136315033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * @author Ales Justin */ public class SpringTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Spring Tests"); suite.addTest(DescribeSpringTestCase.suite()); suite.addTest(InstantiateSpringTestCase.suite()); suite.addTest(InstantiateMixedTestCase.suite()); suite.addTest(InstantiateMixed2TestCase.suite()); suite.addTest(AliasSpringTestCase.suite()); suite.addTest(DependsSpringTestCase.suite()); suite.addTest(LazySpringTestCase.suite()); suite.addTest(ImportSpringTestCase.suite()); suite.addTest(BeanNameAwareSpringTestCase.suite()); return suite; } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/0000755000175000017500000000000011620312221033170 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/MyInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/M0000644000175000017500000000235510755136315033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; import org.springframework.beans.factory.BeanNameAware; /** * Tester interface. * * @author John Bailey * @author Davide Panelli */ public interface MyInterface extends BeanNameAware { } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/IntBeanNameAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/I0000644000175000017500000000253510755136315033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; /** * Tester bean. * * @author John Bailey * @author Davide Panelli */ public class IntBeanNameAwareBean implements MyInterface { private String name; public void setBeanName(String beanName) { name = beanName; } public String getName() { return name; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/SettingBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/S0000644000175000017500000000232510630031724033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; /** * @author Ales Justin */ public class SettingBean { public SettingBean() { WaitingBean.setFlag(true); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/BeanNameAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/B0000644000175000017500000000263010755136315033315 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; import org.springframework.beans.factory.BeanNameAware; /** * Tester bean. * * @author John Bailey * @author Davide Panelli */ public class BeanNameAwareBean implements BeanNameAware { private String name; public String getBeanName() { return name; } public void setBeanName(String name) { this.name = name; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/SubBeanNameAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/S0000644000175000017500000000226610755136315033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; /** * Tester bean. * * @author John Bailey * @author Davide Panelli */ public class SubBeanNameAwareBean extends BeanNameAwareBean { } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/S0000644000175000017500000000525210756345524033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; import java.util.List; import java.util.Set; import java.util.Map; /** * @author Ales Justin */ public class SimpleBean { private int x; private double y; private String s; private List mylist; private Set myset; private Map mymap; private OldBean refBean; public SimpleBean() { } public SimpleBean(int x, double y, String s) { this.x = x; this.y = y; this.s = s; } public int getX() { return x; } public double getY() { return y; } public String getS() { return s; } public List getMylist() { return mylist; } public void setMylist(List mylist) { this.mylist = mylist; } public Set getMyset() { return myset; } public void setMyset(Set myset) { this.myset = myset; } public Map getMymap() { return mymap; } public void setMymap(Map mymap) { this.mymap = mymap; } public OldBean getRefBean() { return refBean; } public void setRefBean(OldBean refBean) { this.refBean = refBean; } public String toString() { StringBuilder builder = new StringBuilder(); builder.append(x).append(","); builder.append(y).append(","); builder.append(s).append(","); builder.append(mylist).append(","); builder.append(myset).append(","); builder.append(mymap); builder.append(refBean); return builder.toString(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/OldBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/O0000644000175000017500000000310510541526145033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; /** * @author Ales Justin */ public class OldBean { private SimpleBean testBean; private String javaBeanString; public SimpleBean getTestBean() { return testBean; } public void setTestBean(SimpleBean testBean) { this.testBean = testBean; } public String getJavaBeanString() { return javaBeanString; } public void setJavaBeanString(String javaBeanString) { this.javaBeanString = javaBeanString; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/WaitingBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/jboss/test/spring/support/W0000644000175000017500000000273110630031724033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.spring.support; /** * @author Ales Justin */ public class WaitingBean { private static boolean flag; public WaitingBean() { if (flag == false) throw new IllegalArgumentException("I depend on someone setting this flag."); } public static boolean getFlag() { return flag; } public static void setFlag(boolean f) { flag = f; } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/0000755000175000017500000000000011620312221031273 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/beans/0000755000175000017500000000000011620312221032363 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/beans/factory/libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/beans/facto0000755000175000017500000000000011620312221033400 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/beans/factory/BeanNameAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/test/java/org/springframework/beans/facto0000644000175000017500000000254010755136315033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.springframework.beans.factory; /** * Mock interface. * * @author John Bailey * @author Davide Panelli * @author Ales Justin */ public interface BeanNameAware { /** * Set the bean name. * * @param beanName the bean name */ void setBeanName(String beanName); } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/0000755000175000017500000000000011620312222024311 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/0000755000175000017500000000000011620312222026323 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/findbugs/0000755000175000017500000000000011620312222030124 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/findbugs/exclude.xml0000644000175000017500000000050011262402474032305 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/schema/0000755000175000017500000000000011620312222027563 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/schema/mc-spring-beans_2_0.xsdlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/resources/schema/mc-spring-beans_2_00000644000175000017500000013107710560425103033151 0ustar twernertwerner /' element. ]]> /' element. ]]> /' element. ]]> /' element. ]]> /' element. ]]> element (or "ref" attribute). We recommend this in most cases as it makes documentation more explicit. 2. "byName" Autowiring by property name. If a bean of class Cat exposes a dog property, Spring will try to set this to the value of the bean "dog" in the current container. If there is no matching bean by name, nothing special happens; use dependency-check="objects" to raise an error in that case. 3. "byType" Autowiring if there is exactly one bean of the property type in the container. If there is more than one, a fatal error is raised, and you cannot use byType autowiring for that bean. If there is none, nothing special happens; use dependency-check="objects" to raise an error in that case. 4. "constructor" Analogous to "byType" for constructor arguments. If there is not exactly one bean of the constructor argument type in the bean factory, a fatal error is raised. 5. "autodetect" Chooses "constructor" or "byType" through introspection of the bean class. If a default constructor is found, "byType" gets applied. Note that explicit dependencies, i.e. "property" and "constructor-arg" elements, always override autowiring. Autowire behavior can be combined with dependency checking, which will be performed after all autowiring has been completed. Note: This attribute will not be inherited by child bean definitions. Hence, it needs to be specified per concrete bean definition. ]]> " element. ]]> ..." element. ]]> ". ]]> ..." element. ]]> ". ]]> ..." element. ]]> ". ]]> libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/0000755000175000017500000000000011620312221025231 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/0000755000175000017500000000000011620312221026020 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/0000755000175000017500000000000011620312222027141 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/0000755000175000017500000000000011620312222030443 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/0000755000175000017500000000000011620312222032623 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000755000175000017500000000000011620312222033344 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/ImportInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000344510630031724033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.QName; import org.jboss.spring.metadata.AbstractImportMetaData; import org.jboss.spring.metadata.AbstractSpringDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * @author Ales Justin */ public class ImportInterceptor extends DefaultElementInterceptor { /** * The interceptor */ public static final ImportInterceptor INTERCEPTOR = new ImportInterceptor(); public void add(Object parent, Object child, QName name) { AbstractSpringDeployment deployment = (AbstractSpringDeployment)parent; AbstractImportMetaData importMD = (AbstractImportMetaData)child; deployment.addImport(importMD); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringSchemaBindingHelper.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000002062110756345524033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import org.jboss.kernel.plugins.deployment.xml.BeanPropertyInterceptor; import org.jboss.kernel.plugins.deployment.xml.DeploymentAliasInterceptor; import org.jboss.kernel.plugins.deployment.xml.DeploymentBeanInterceptor; import org.jboss.kernel.plugins.deployment.xml.DeploymentWildcardHandler; import org.jboss.kernel.plugins.deployment.xml.EntryHandler; import org.jboss.kernel.plugins.deployment.xml.EntryKeyInterceptor; import org.jboss.kernel.plugins.deployment.xml.EntryValueInterceptor; import org.jboss.kernel.plugins.deployment.xml.MapEntryInterceptor; import org.jboss.kernel.plugins.deployment.xml.NamedAliasHandler; import org.jboss.kernel.plugins.deployment.xml.NullValueElementInterceptor; import org.jboss.kernel.plugins.deployment.xml.PlainValueCharactersHandler; import org.jboss.kernel.plugins.deployment.xml.PropHandler; import org.jboss.kernel.plugins.deployment.xml.PropertiesHandler; import org.jboss.kernel.plugins.deployment.xml.PropertyCharactersHandler; import org.jboss.kernel.plugins.deployment.xml.PropertyHandler; import org.jboss.kernel.plugins.deployment.xml.ValueMetaDataElementInterceptor; import org.jboss.kernel.plugins.deployment.xml.ValueWildcardHandler; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding; /** * @author Ales Justin */ public class SpringSchemaBindingHelper { public static void initBeansHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringBeansHandler.HANDLER); // handle import typeBinding.pushInterceptor(SpringSchemaBinding.importQName, ImportInterceptor.INTERCEPTOR); // handle aliases typeBinding.pushInterceptor(SpringSchemaBinding.aliasQName, DeploymentAliasInterceptor.INTERCEPTOR); // handle beans typeBinding.pushInterceptor(SpringSchemaBinding.beanQName, DeploymentBeanInterceptor.INTERCEPTOR); // Deployment can take wildcards typeBinding.getWildcard().setWildcardHandler(DeploymentWildcardHandler.HANDLER); } public static void initAliasHandler(TypeBinding typeBinding) { typeBinding.setHandler(NamedAliasHandler.NAMED_ALIAS_HANDLER); } public static void initImportHandler(TypeBinding typeBinding) { typeBinding.setHandler(ImportHandler.HANDLER); } public static void initBeanHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringBeanHandler.HANDLER); // handle constructor-arg typeBinding.pushInterceptor(SpringSchemaBinding.constructorQName, ConstructorArgInterceptor.INTERCEPTOR); // handle properties typeBinding.pushInterceptor(SpringSchemaBinding.propertyQName, BeanPropertyInterceptor.INTERCEPTOR); // todo lookup-method // todo replaced method } public static void initRefHandler(TypeBinding typeBinding) { typeBinding.setHandler(RefHandler.HANDLER); } public static void initConstructorArgHandler(TypeBinding typeBinding) { typeBinding.setHandler(ConstructorArgHandler.HANDLER); // configure configureValueBindings(typeBinding); } public static void initPropertyHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropertyHandler.HANDLER); // property can take characters typeBinding.setSimpleType(PropertyCharactersHandler.HANDLER); // configure configureValueBindings(typeBinding); } // here value only takes simple type public static void initValueHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringPlainValueHandler.SPRING_PLAIN_VALUE_HANDLER); // value can take characters typeBinding.setSimpleType(PlainValueCharactersHandler.HANDLER); } public static void initCollectionHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringCollectionHandler.HANDLER); // configure configureValueBindings(typeBinding); } public static void initMapHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringMapHandler.HANDLER); // entry has an entry typeBinding.pushInterceptor(SpringSchemaBinding.entryQName, MapEntryInterceptor.INTERCEPTOR); } public static void initPropsHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropertiesHandler.HANDLER); // props typeBinding.pushInterceptor(SpringSchemaBinding.propQName, MapEntryInterceptor.INTERCEPTOR); } public static void initEntryHandler(TypeBinding typeBinding) { typeBinding.setHandler(EntryHandler.HANDLER); // entry has a key typeBinding.pushInterceptor(SpringSchemaBinding.keyQName, EntryKeyInterceptor.INTERCEPTOR); // entry has bean typeBinding.pushInterceptor(SpringSchemaBinding.beanQName, EntryValueInterceptor.INTERCEPTOR); // entry has ref typeBinding.pushInterceptor(SpringSchemaBinding.refQName, EntryValueInterceptor.INTERCEPTOR); // entry has value typeBinding.pushInterceptor(SpringSchemaBinding.valueQName, StringEntryValueInterceptor.STRING_ENTRY_VALUE_INTERCEPTOR); // entry can take a list typeBinding.pushInterceptor(SpringSchemaBinding.listQName, EntryValueInterceptor.INTERCEPTOR); // entry can take a set typeBinding.pushInterceptor(SpringSchemaBinding.setQName, EntryValueInterceptor.INTERCEPTOR); // entry can take a map typeBinding.pushInterceptor(SpringSchemaBinding.mapQName, EntryValueInterceptor.INTERCEPTOR); // entry has a null typeBinding.pushInterceptor(SpringSchemaBinding.nullQName, EntryValueInterceptor.INTERCEPTOR); } public static void initPropHandler(TypeBinding typeBinding) { typeBinding.setHandler(PropHandler.HANDLER); // property takes characters typeBinding.setSimpleType(PropertyCharactersHandler.HANDLER); } public static void initKeyHandler(TypeBinding typeBinding) { typeBinding.setHandler(SpringMapKeyHandler.HANDLER); // key has a value configureValueBindings(typeBinding); } public static void configureValueBindings(TypeBinding typeBinding) { // type has beans typeBinding.pushInterceptor(SpringSchemaBinding.beanQName, ValueMetaDataElementInterceptor.VALUES); // type has refs typeBinding.pushInterceptor(SpringSchemaBinding.refQName, ValueMetaDataElementInterceptor.VALUES); // type has values typeBinding.pushInterceptor(SpringSchemaBinding.valueQName, ValueMetaDataElementInterceptor.VALUES); // type can take a list typeBinding.pushInterceptor(SpringSchemaBinding.listQName, ValueMetaDataElementInterceptor.VALUES); // type can take a set typeBinding.pushInterceptor(SpringSchemaBinding.setQName, ValueMetaDataElementInterceptor.VALUES); // type can take a map typeBinding.pushInterceptor(SpringSchemaBinding.mapQName, ValueMetaDataElementInterceptor.VALUES); // type has a null typeBinding.pushInterceptor(SpringSchemaBinding.nullQName, NullValueElementInterceptor.NULLVALUES); // type has wildcard WildcardBinding wcb = typeBinding.getWildcard(); if (wcb == null) throw new IllegalStateException("Missing wildcard binding for type: " + typeBinding.getQName()); wcb.setWildcardHandler(ValueWildcardHandler.WILDCARD); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringPlainValueHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000407410756345524033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.kernel.plugins.deployment.xml.PlainValueHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * Spring has type insted of class attribute. * * @author Ales Justin */ public class SpringPlainValueHandler extends PlainValueHandler { /** The interceptor */ public static final SpringPlainValueHandler SPRING_PLAIN_VALUE_HANDLER = new SpringPlainValueHandler(); public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { StringValueMetaData value = (StringValueMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("type".equals(localName)) value.setType(attrs.getValue(i)); } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/RefHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000521410636505313033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * @author Ales Justin */ public class RefHandler extends DefaultElementHandler { /** * The beans handler */ public static final RefHandler HANDLER = new RefHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractDependencyValueMetaData(); } public void attributes(Object object, QName qName, ElementBinding elementBinding, Attributes attrs, NamespaceContext namespaceContext) { AbstractDependencyValueMetaData value = (AbstractDependencyValueMetaData) object; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("bean".equals(localName) || "local".equals(localName)) value.setValue(attrs.getValue(i)); // TODO can we treat local different? what about parent? } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractDependencyValueMetaData x = (AbstractDependencyValueMetaData) o; String name = (String) x.getUnderlyingValue(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty bean in ref."); return o; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringCollectionHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000513110540246734033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * @author Ales Justin */ public class SpringCollectionHandler extends DefaultElementHandler { /** * The handler */ public static final SpringCollectionHandler HANDLER = new SpringCollectionHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { String typeName = element.getQName().getLocalPart(); if ("list".equals(typeName)) return new AbstractListMetaData(); else if ("set".equals(typeName)) return new AbstractSetMetaData(); else throw new IllegalArgumentException("Unsupported collection type=" + typeName); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractCollectionMetaData collection = (AbstractCollectionMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("value-type".equals(localName)) collection.setElementType(attrs.getValue(i)); } } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/ConstructorArgHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000460610540314732033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.spring.metadata.AbstractConstructorArg; import org.xml.sax.Attributes; /** * @author Ales Justin */ public class ConstructorArgHandler extends DefaultElementHandler { /** * The beans handler */ public static final ConstructorArgHandler HANDLER = new ConstructorArgHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractConstructorArg(); } public void attributes(Object object, QName qName, ElementBinding elementBinding, Attributes attrs, NamespaceContext namespaceContext) { AbstractParameterMetaData value = (AbstractParameterMetaData) object; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("index".equals(localName)) value.setIndex(Integer.parseInt(attrs.getValue(i))); else if ("type".equals(localName)) value.setType(attrs.getValue(i)); // todo ref + value } } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/ConstructorArgInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000537710540314732033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.QName; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.spring.metadata.AbstractConstructorArg; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * @author Ales Justin */ public class ConstructorArgInterceptor extends DefaultElementInterceptor { /** * The interceptor */ public static final ConstructorArgInterceptor INTERCEPTOR = new ConstructorArgInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) bean.getConstructor(); if (constructor == null) { constructor = new AbstractConstructorMetaData(); bean.setConstructor(constructor); } AbstractParameterMetaData parameter = (AbstractParameterMetaData) child; List parameters = constructor.getParameters(); if (parameters == null) { parameters = new ArrayList(); constructor.setParameters(parameters); } if (parameter instanceof AbstractConstructorArg && ((AbstractConstructorArg)parameter).isExplicitIndex() == false) { // actual order is done in SpringBeanHandler parameter.setIndex(parameters.size()); } parameters.add(parameter); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringMapHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000420110537563645033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * @author Ales Justin */ public class SpringMapHandler extends DefaultElementHandler { /** * The handler */ public static final SpringMapHandler HANDLER = new SpringMapHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractMapMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractMapMetaData map = (AbstractMapMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("key-type".equals(localName)) map.setKeyType(attrs.getValue(i)); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringSchemaBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000002206510630031724033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * @author Ales Justin */ public class SpringSchemaBinding { /** * The namespace */ public static final String SPRING_DEPLOYER_NS = "urn:jboss:spring-beans:2.0"; /** * The beans binding */ public static final QName beansTypeQName = new QName(SPRING_DEPLOYER_NS, "beansType"); /** * The beans element name */ public static final QName beansQName = new QName(SPRING_DEPLOYER_NS, "beans"); /** * The alias binding */ public static final QName aliasTypeQName = new QName(SPRING_DEPLOYER_NS, "aliasType"); /** * The alias element name */ public static final QName aliasQName = new QName(SPRING_DEPLOYER_NS, "alias"); /** * The import binding */ public static final QName importTypeQName = new QName(SPRING_DEPLOYER_NS, "importType"); /** * The import element name */ public static final QName importQName = new QName(SPRING_DEPLOYER_NS, "import"); /** * The bean binding */ public static final QName beanTypeQName = new QName(SPRING_DEPLOYER_NS, "beanType"); /** * The bean element name */ public static final QName beanQName = new QName(SPRING_DEPLOYER_NS, "bean"); /** * The ref binding */ public static final QName refTypeQName = new QName(SPRING_DEPLOYER_NS, "refType"); /** * The ref element name */ public static final QName refQName = new QName(SPRING_DEPLOYER_NS, "ref"); /** * The constructor arg binding */ public static final QName constructorTypeQName = new QName(SPRING_DEPLOYER_NS, "constructorArgType"); /** * The constructor arg element name */ public static final QName constructorQName = new QName(SPRING_DEPLOYER_NS, "constructor-arg"); /** * The property binding */ public static final QName propertyTypeQName = new QName(SPRING_DEPLOYER_NS, "propertyType"); /** * The property element name */ public static final QName propertyQName = new QName(SPRING_DEPLOYER_NS, "property"); /** * The value binding */ public static final QName valueTypeQName = new QName(SPRING_DEPLOYER_NS, "valueType"); /** * The value element name */ public static final QName valueQName = new QName(SPRING_DEPLOYER_NS, "value"); /** * The null element name */ public static final QName nullQName = new QName(SPRING_DEPLOYER_NS, "null"); /** * The list binding */ public static final QName listTypeQName = new QName(SPRING_DEPLOYER_NS, "listType"); /** * The list element name */ public static final QName listQName = new QName(SPRING_DEPLOYER_NS, "list"); /** * The set binding */ public static final QName setTypeQName = new QName(SPRING_DEPLOYER_NS, "setType"); /** * The set element name */ public static final QName setQName = new QName(SPRING_DEPLOYER_NS, "set"); /** * The map binding */ public static final QName mapTypeQName = new QName(SPRING_DEPLOYER_NS, "mapType"); /** * The map element name */ public static final QName mapQName = new QName(SPRING_DEPLOYER_NS, "map"); /** * The props binding */ public static final QName propsTypeQName = new QName(SPRING_DEPLOYER_NS, "propsType"); /** * The props element name */ public static final QName propsQName = new QName(SPRING_DEPLOYER_NS, "props"); /** * The props binding */ public static final QName propTypeQName = new QName(SPRING_DEPLOYER_NS, "propType"); /** * The prop element name */ public static final QName propQName = new QName(SPRING_DEPLOYER_NS, "prop"); /** * The entry binding */ public static final QName entryTypeQName = new QName(SPRING_DEPLOYER_NS, "entryType"); /** * The entry element name */ public static final QName entryQName = new QName(SPRING_DEPLOYER_NS, "entry"); /** * The key binding */ public static final QName keyTypeQName = new QName(SPRING_DEPLOYER_NS, "keyType"); /** * The key element name */ public static final QName keyQName = new QName(SPRING_DEPLOYER_NS, "key"); public static void init(SchemaBinding schemaBinding) { // ignore XB property replacement schemaBinding.setReplacePropertyRefs(false); // init initDeployment(schemaBinding); initBean(schemaBinding); initAlias(schemaBinding); initImport(schemaBinding); initArtifacts(schemaBinding); } /** * Initialize beans part of the schema binding * * @param schemaBinding the schema binding */ public static void initDeployment(SchemaBinding schemaBinding) { // beans binding TypeBinding beansType = schemaBinding.getType(beansTypeQName); SpringSchemaBindingHelper.initBeansHandler(beansType); } /** * Initialize single bean part of the schema binding * * @param schemaBinding the schema binding */ private static void initBean(SchemaBinding schemaBinding) { // bean binding TypeBinding beanType = schemaBinding.getType(beanTypeQName); SpringSchemaBindingHelper.initBeanHandler(beanType); } /** * Initialize alias part of the schema binding * * @param schemaBinding the schema binding */ private static void initAlias(SchemaBinding schemaBinding) { // alias binding TypeBinding aliasType = schemaBinding.getType(aliasTypeQName); SpringSchemaBindingHelper.initAliasHandler(aliasType); } /** * Initialize import part of the schema binding * * @param schemaBinding the schema binding */ private static void initImport(SchemaBinding schemaBinding) { // import binding TypeBinding importType = schemaBinding.getType(importTypeQName); SpringSchemaBindingHelper.initImportHandler(importType); } /** * Initialize other parts of the schema binding * * @param schemaBinding the schema binding */ private static void initArtifacts(SchemaBinding schemaBinding) { // ref / injection TypeBinding refType = schemaBinding.getType(refTypeQName); SpringSchemaBindingHelper.initRefHandler(refType); // constructor arg TypeBinding constructorArgType = schemaBinding.getType(constructorTypeQName); SpringSchemaBindingHelper.initConstructorArgHandler(constructorArgType); // property binding TypeBinding propertyType = schemaBinding.getType(propertyTypeQName); SpringSchemaBindingHelper.initPropertyHandler(propertyType); // value binding TypeBinding valueType = schemaBinding.getType(valueTypeQName); SpringSchemaBindingHelper.initValueHandler(valueType); // list TypeBinding listType = schemaBinding.getType(listTypeQName); SpringSchemaBindingHelper.initCollectionHandler(listType); // set TypeBinding setType = schemaBinding.getType(setTypeQName); SpringSchemaBindingHelper.initCollectionHandler(setType); // map TypeBinding mapType = schemaBinding.getType(mapTypeQName); SpringSchemaBindingHelper.initMapHandler(mapType); // entry type TypeBinding entryType = schemaBinding.getType(entryTypeQName); SpringSchemaBindingHelper.initEntryHandler(entryType); // key type TypeBinding keyType = schemaBinding.getType(keyTypeQName); SpringSchemaBindingHelper.initKeyHandler(keyType); // props TypeBinding propsType = schemaBinding.getType(propsTypeQName); SpringSchemaBindingHelper.initPropsHandler(propsType); // prop TypeBinding propType = schemaBinding.getType(propTypeQName); SpringSchemaBindingHelper.initPropHandler(propType); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/StringEntryValueInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000334610756345524033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.kernel.plugins.deployment.xml.EntryValueInterceptor; /** * Spring only handles plain string value. * * @author Ales Justin */ public class StringEntryValueInterceptor extends EntryValueInterceptor { /** The interceptor */ public static final StringEntryValueInterceptor STRING_ENTRY_VALUE_INTERCEPTOR = new StringEntryValueInterceptor(); public void add(Object parent, Object child, QName name) { AbstractValueMetaData avmd = new AbstractValueMetaData(child); super.add(parent, avmd, name); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/ImportHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000471610630031724033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.spring.metadata.AbstractImportMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * The import handler. * * @author Ales Justin */ public class ImportHandler extends DefaultElementHandler { /** * The import handler */ public static final ImportHandler HANDLER = new ImportHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractImportMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractImportMetaData imd = (AbstractImportMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("resource".equals(localName)) imd.setResource(attrs.getValue(i)); } } public Object endElement(Object object, QName qName, ElementBinding elementBinding) { AbstractImportMetaData imd = (AbstractImportMetaData)object; if (imd.getResource() == null) throw new IllegalArgumentException("Missing resource: " + imd); return imd; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringBeansHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000533710630031724033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.spring.metadata.AbstractSpringDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * @author Ales Justin */ public class SpringBeansHandler extends DefaultElementHandler { /** * The beans handler */ public static final SpringBeansHandler HANDLER = new SpringBeansHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractSpringDeployment(); } public void attributes(Object object, QName qName, ElementBinding elementBinding, Attributes attrs, NamespaceContext namespaceContext) { AbstractKernelDeployment deployment = (AbstractKernelDeployment) object; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("default-init-method".equals(localName)) deployment.setCreate(new AbstractLifecycleMetaData(attrs.getValue(i))); else if ("default-destroy-method".equals(localName)) deployment.setDestroy(new AbstractLifecycleMetaData(attrs.getValue(i))); else if ("default-lazy-init".equals(localName) && Boolean.parseBoolean(attrs.getValue(i)) == true) deployment.setMode(ControllerMode.ON_DEMAND); } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringBeanHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000001711310764340107033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.TreeSet; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.spring.annotations.SpringBean; import org.jboss.spring.metadata.AbstractConstructorArg; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * * @author Ales Justin */ public class SpringBeanHandler extends DefaultElementHandler { /** * The beans handler */ public static final SpringBeanHandler HANDLER = new SpringBeanHandler(); /** * The delimiter pattern */ public static final String DELIMITER_PATTERN = "[,; ]"; public Object startElement(Object parent, QName name, ElementBinding element) { AbstractBeanMetaData bean = new AbstractBeanMetaData(); Set annotations = bean.getAnnotations(); if(annotations == null) { annotations = new HashSet(); bean.setAnnotations(annotations); } // It's a bit of a hack, but it's a transparent one AbstractAnnotationMetaData springAnnotation = new AbstractAnnotationMetaData(); springAnnotation.setAnnotation("@" + SpringBean.class.getName()); annotations.add(springAnnotation); return bean; } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractBeanMetaData bean = (AbstractBeanMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("id".equals(localName)) bean.setName(attrs.getValue(i)); else if ("name".equals(localName)) { String name = attrs.getValue(i); String[] names = name.split(DELIMITER_PATTERN); bean.setAliases(new TreeSet(Arrays.asList(names))); } else if ("class".equals(localName)) bean.setBean(attrs.getValue(i)); else if ("init-method".equals(localName)) bean.setCreate(new AbstractLifecycleMetaData(attrs.getValue(i))); else if ("lazy-init".equals(localName) && Boolean.parseBoolean(attrs.getValue(i)) == true) bean.setMode(ControllerMode.ON_DEMAND); else if ("parent".equals(localName)) bean.setParent(attrs.getValue(i)); else if ("abstract".equals(localName)) bean.setAbstract(Boolean.parseBoolean(attrs.getValue(i))); else if ("autowire".equals(localName)) bean.setAutowireType(AutowireType.getInstance(attrs.getValue(i))); else if ("autowire-candidate".equals(localName)) bean.setAutowireCandidate(Boolean.parseBoolean(attrs.getValue(i))); else if ("destroy-method".equals(localName)) bean.setDestroy(new AbstractLifecycleMetaData(attrs.getValue(i))); else if ("depends-on".equals(localName)) { Set demands = bean.getDemands(); if (demands == null) { demands = new HashSet(); bean.setDemands(demands); } String[] values = attrs.getValue(i).split(DELIMITER_PATTERN); for(String name : values) demands.add(new AbstractDemandMetaData(name)); } else if ("factory-method".equals(localName) || "factory-bean".equals(localName)) { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) bean.getConstructor(); if (constructor == null) { constructor = new AbstractConstructorMetaData(); bean.setConstructor(constructor); } if ("factory-method".equals(localName)) constructor.setFactoryMethod(attrs.getValue(i)); if ("factory-bean".equals(localName)) constructor.setFactory(new AbstractDependencyValueMetaData(attrs.getValue(i))); } } } public Object endElement(Object object, QName qName, ElementBinding elementBinding) { AbstractBeanMetaData beanMetaData = (AbstractBeanMetaData) object; ConstructorMetaData constructor = beanMetaData.getConstructor(); if (constructor != null) { List parameters = constructor.getParameters(); if (parameters != null && parameters.size() > 1) { orderParameters(parameters); } } return beanMetaData; } protected void orderParameters(List parameters) { ParameterMetaData[] pmds = new ParameterMetaData[parameters.size()]; for(ParameterMetaData pmd : parameters) { int index = pmd.getIndex(); // lets first try to set those with explicit index if (pmd instanceof AbstractConstructorArg && ((AbstractConstructorArg)pmd).isExplicitIndex()) { if (pmds[index] != null) throw new IllegalArgumentException("Argument with index: " + index + " already set!"); pmds[index] = pmd; } } int index = 0; for(ParameterMetaData pmd : parameters) { // then just put the others in the free places if ((pmd instanceof AbstractConstructorArg && ((AbstractConstructorArg)pmd).isExplicitIndex() == false)) { while(pmds[index] != null) index++; pmds[index] = pmd; } index++; } // todo clone md parameters.clear(); parameters.addAll(Arrays.asList(pmds)); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringMapKeyHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000326110537572455033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * @author Ales Justin */ public class SpringMapKeyHandler extends DefaultElementHandler { /** * The map key handler */ public static final SpringMapKeyHandler HANDLER = new SpringMapKeyHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractValueMetaData(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml/SpringSchemaInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/deployment/xml0000644000175000017500000000272210537301365033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.deployment.xml; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingInitializer; /** * @author Ales Justin */ public class SpringSchemaInitializer implements SchemaBindingInitializer { public SchemaBinding init(SchemaBinding schema) { SpringSchemaBinding.init(schema); return schema; } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/0000755000175000017500000000000011620312222032223 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/AbstractConstructorArg.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/Abstr0000644000175000017500000000310710602523533033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.metadata; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; /** * @author Ales Justin */ public class AbstractConstructorArg extends AbstractParameterMetaData { /** The serialVersionUID */ private static final long serialVersionUID = -9018964033015040870L; private boolean explicitIndex; public void setIndex(int index) { explicitIndex = true; super.setIndex(index); } public boolean isExplicitIndex() { return explicitIndex; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/AbstractImportMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/Abstr0000644000175000017500000000373110630031724033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.metadata; import java.io.Serializable; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * @author Ales Justin */ public class AbstractImportMetaData extends JBossObject implements Serializable { private static final long serialVersionUID = -5372914407585899708L; protected String resource; public String getResource() { return resource; } public void setResource(String resource) { this.resource = resource; } protected int getHashCode() { return resource.hashCode(); } protected void toString(JBossStringBuilder buffer) { buffer.append("resource=").append(resource); } public boolean equals(Object obj) { if (obj instanceof AbstractImportMetaData == false) return false; return resource.equals(((AbstractImportMetaData)obj).resource); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/AbstractSpringDeployment.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/metadata/Abstr0000644000175000017500000000403010630031724033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.metadata; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; /** * @author Ales Justin */ public class AbstractSpringDeployment extends AbstractKernelDeployment { /** The serialVersionUID */ private static final long serialVersionUID = 2L; public void addImport(AbstractImportMetaData imd) { List importedBeans = getBeans(imd.getResource()); if (importedBeans != null && importedBeans.isEmpty() == false) { List beans = getBeanFactories(); if (beans == null) { beans = new ArrayList(); setBeanFactories(beans); } beans.addAll(importedBeans); } } protected List getBeans(String resource) { return null; //todo } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/annotations/0000755000175000017500000000000011620312222033000 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/annotations/SpringBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/annotations/Sp0000644000175000017500000000260310755136315033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Marker annotation. * * @author John Bailey * @author Davide Panelli */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface SpringBean { } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/annotations/SpringBeanAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/spring/annotations/Sp0000644000175000017500000001125211063466715033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.spring.annotations; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.plugins.annotations.ClassAnnotationPlugin; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.InterfaceInfo; /** * Marker annotation plugin handler. * * @author John Bailey * @author Davide Panelli */ public class SpringBeanAnnotationPlugin extends ClassAnnotationPlugin { private static final String BNAI = "org.springframework.beans.factory.BeanNameAware"; private static final String BNP = "beanName"; public SpringBeanAnnotationPlugin() { super(SpringBean.class); } @Override protected List internalApplyAnnotation(ClassInfo info, SpringBean annotation, BeanMetaData metaData) throws Throwable { PropertyMetaData property = findBeanNameAwareInterface(info, metaData); return property != null ? Collections.singletonList(property) : null; } /** * Find the BeanNameAware interface. * * @param info the type info * @param metaData the metadata * @return bean property metadata or null if not found */ protected PropertyMetaData findBeanNameAwareInterface(ClassInfo info, BeanMetaData metaData) { InterfaceInfo[] interfaces = info.getInterfaces(); if (interfaces != null && interfaces.length > 0) { for (InterfaceInfo anInterface : interfaces) { String name = anInterface.getName(); if (BNAI.equals(name)) { AbstractInjectionValueMetaData injectionMetaData = new AbstractInjectionValueMetaData(); injectionMetaData.setFromContext(FromContext.NAME); AbstractPropertyMetaData beanNameProperty = new AbstractPropertyMetaData(BNP, injectionMetaData); Set properties = metaData.getProperties(); if (properties == null) { properties = new HashSet(); AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(metaData); abmd.setProperties(properties); } properties.add(beanNameProperty); return beanNameProperty; } // Search on super interfaces PropertyMetaData property = findBeanNameAwareInterface(anInterface, metaData); if (property != null) return property; } } // Search on super class ClassInfo superInfo = info.getSuperclass(); if (superInfo != null) return findBeanNameAwareInterface(superInfo, metaData); return null; } @Override protected boolean isMetaDataAlreadyPresent(ClassInfo info, SpringBean annotation, BeanMetaData beanMetaData) { Set properties = beanMetaData.getProperties(); if (properties != null && properties.isEmpty() == false) { for (PropertyMetaData property : properties) { if (BNP.equals(property.getName())) { return true; } } } return false; } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/0000755000175000017500000000000011620312221030420 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/0000755000175000017500000000000011620312221032101 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000755000175000017500000000000011620312221033316 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000755000175000017500000000000011620312222033317 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DependencyHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000601211034350351033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * DependencyHandler. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class DependencyHandler extends DefaultElementHandler { /** The handler */ public static final DependencyHandler HANDLER = new DependencyHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractDependencyValueMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("bean".equals(localName)) dependency.setValue(attrs.getValue(i)); else if ("property".equals(localName)) dependency.setProperty(attrs.getValue(i)); else if ("state".equals(localName)) dependency.setDependentState(new ControllerState(attrs.getValue(i))); else if ("whenRequired".equals(localName)) dependency.setWhenRequiredState(new ControllerState(attrs.getValue(i))); } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractDependencyValueMetaData x = (AbstractDependencyValueMetaData) o; String name = (String) x.getUnderlyingValue(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty bean in injection."); return o; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueWildcardHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000561111034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultWildcardHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * ValueWildcardHandler. * * @author Adrian Brock * @version $Revision: 60405 $ */ public class ValueWildcardHandler extends DefaultWildcardHandler { /** The value wildcard handler */ public static final ValueWildcardHandler WILDCARD = new ValueWildcardHandler(); public void setParent(Object parent, Object o, QName elementName, ElementBinding element, ElementBinding parentElement) { ValueMetaData value; if (o instanceof ValueMetaData) value = (ValueMetaData) o; else value = new AbstractValueMetaData(o); if (parent instanceof ValueMetaDataAware) { ValueMetaDataAware valueMetaDataAware = (ValueMetaDataAware) parent; valueMetaDataAware.setValue(value); } else if (parent instanceof AbstractCollectionMetaData) { AbstractCollectionMetaData collection = (AbstractCollectionMetaData) parent; collection.add(value); } else if (parent instanceof AbstractClassLoaderMetaData) { AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent; valueMetaData.setClassLoader(value); } else { AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent; valueMetaData.setValue(value); } } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PropHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000446411034350351033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import javax.xml.namespace.NamespaceContext; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * PropertyHandler. * * @author Ales Justin */ public class PropHandler extends DefaultElementHandler { /** The handler */ public static final PropHandler HANDLER = new PropHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new MapEntry(); } public void attributes(Object object, QName qName, ElementBinding eb, Attributes attrs, NamespaceContext nc) { MapEntry entry = (MapEntry) object; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("key".equals(localName)) entry.key = attrs.getValue(i); } } public Object endElement(Object object, QName qName, ElementBinding elementBinding) { MapEntry entry = (MapEntry) object; if (entry.key == null) throw new IllegalArgumentException("Missing key attribute: " + elementBinding); return entry; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ClassCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000407711034350351033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * ClassCharactersHandler. * * @author Ales Justin */ public class ClassCharactersHandler extends CharactersHandler { /** The interceptor */ public static final ClassCharactersHandler HANDLER = new ClassCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qname, ElementBinding element, Object owner, Object value) { AbstractClassMetaData clazz = (AbstractClassMetaData) owner; clazz.setClassName((String)value); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleParametersInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000443411034350351033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ConstructorParametersInterceptor. * * @author Adrian Brock * @version $Revision: 56022 $ */ public class LifecycleParametersInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LifecycleParametersInterceptor INTERCEPTOR = new LifecycleParametersInterceptor(); public void add(Object parent, Object child, QName name) { AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) parent; AbstractParameterMetaData parameter = (AbstractParameterMetaData) child; List parameters = lifecycle.getParameters(); if (parameters == null) { parameters = new ArrayList(); lifecycle.setParameters(parameters); } parameter.setIndex(parameters.size()); parameters.add(parameter); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DeploymentAliasInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000411611034350351033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * DeploymentAliasInterceptor. * * @author Ales Justin */ public class DeploymentAliasInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final DeploymentAliasInterceptor INTERCEPTOR = new DeploymentAliasInterceptor(); public void add(Object parent, Object child, QName name) { AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; NamedAliasMetaData alias = (NamedAliasMetaData) child; Set aliases = deployment.getAliases(); if (aliases == null) { aliases = new HashSet(); deployment.setAliases(aliases); } aliases.add(alias); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000451411034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * LifecycleHandler. * * @author Adrian Brock * @version $Revision: 63037 $ */ public class LifecycleHandler extends DefaultElementHandler { /** The handler */ public static final LifecycleHandler HANDLER = new LifecycleHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractLifecycleMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("method".equals(localName)) lifecycle.setMethodName(attrs.getValue(i)); else if ("ignored".equals(localName)) lifecycle.setIgnored(Boolean.parseBoolean(attrs.getValue(i))); } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/EntryHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000315511034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * EntryHandler. * * @author Adrian Brock * @version $Revision: 43110 $ */ public class EntryHandler extends DefaultElementHandler { /** The handler */ public static final EntryHandler HANDLER = new EntryHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new MapEntry(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/NullValueElementInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000305011034350351033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; /** * NullValueElementInterceptor. * * @author Adrian Brock * @version $Revision: 43008 $ */ public class NullValueElementInterceptor extends ValueElementInterceptor { /** The null handler */ public static final NullValueElementInterceptor NULLVALUES = new NullValueElementInterceptor(); public AbstractValueMetaData getValue() { return new AbstractValueMetaData(); } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DeploymentBeanInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000427011034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * DeploymentBeanInterceptor. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class DeploymentBeanInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final DeploymentBeanInterceptor INTERCEPTOR = new DeploymentBeanInterceptor(); public void add(Object parent, Object child, QName name) { AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; AbstractBeanMetaData bean = (AbstractBeanMetaData) child; List beans = deployment.getBeanFactories(); if (beans == null) { beans = new ArrayList(); deployment.setBeanFactories(beans); } beans.add(bean); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanPropertyInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000424411034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanPropertyInterceptor. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class BeanPropertyInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanPropertyInterceptor INTERCEPTOR = new BeanPropertyInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractPropertyMetaData property = (AbstractPropertyMetaData) child; Set properties = bean.getProperties(); if (properties == null) { properties = new HashSet(); bean.setProperties(properties); } properties.add(property); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanDependsInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000423311034350351033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanDependsInterceptor. * * @author Adrian Brock * @version $Revision: 55527 $ */ public class BeanDependsInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanDependsInterceptor INTERCEPTOR = new BeanDependsInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractDependencyMetaData dependency = (AbstractDependencyMetaData) child; Set depends = bean.getDepends(); if (depends == null) { depends = new HashSet(); bean.setDepends(depends); } depends.add(dependency); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanAliasInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000377611034350351033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanAliasInterceptor. * * @author Ales Justin */ public class BeanAliasInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanAliasInterceptor INTERCEPTOR = new BeanAliasInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AliasMetaData alias = (AliasMetaData) child; Set aliases = bean.getAliases(); if (aliases == null) { aliases = new HashSet(); bean.setAliases(aliases); } aliases.add(alias.getAliasValue()); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ConstructorParametersInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000445611034350351033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ConstructorParametersInterceptor. * * @author Adrian Brock * @version $Revision: 56022 $ */ public class ConstructorParametersInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final ConstructorParametersInterceptor INTERCEPTOR = new ConstructorParametersInterceptor(); public void add(Object parent, Object child, QName name) { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) parent; AbstractParameterMetaData parameter = (AbstractParameterMetaData) child; List parameters = constructor.getParameters(); if (parameters == null) { parameters = new ArrayList(); constructor.setParameters(parameters); } parameter.setIndex(parameters.size()); parameters.add(parameter); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DependsCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000420711034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.xb.binding.metadata.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * DependsCharactersHandler. * * @author Adrian Brock * @version $Revision: 43104 $ */ public class DependsCharactersHandler extends CharactersHandler { /** The interceptor */ public static final DependsCharactersHandler HANDLER = new DependsCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qname, ElementBinding element, Object owner, Object value) { AbstractDependencyMetaData depends = (AbstractDependencyMetaData) owner; depends.setDependency(value); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ThisValueElementInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000314011034350351033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; /** * ThisValueElementInterceptor. * * @author Adrian Brock * @version $Revision: 43008 $ */ public class ThisValueElementInterceptor extends ValueElementInterceptor { /** The this handler */ public static final ThisValueElementInterceptor THISVALUES = new ThisValueElementInterceptor(); public AbstractValueMetaData getValue() { return new ThisValueMetaData(); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DemandHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000527311034350351033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * DemandHandler. * * @author Adrian Brock * @version $Revision: 66536 $ */ public class DemandHandler extends DefaultElementHandler { /** The handler */ public static final DemandHandler HANDLER = new DemandHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractDemandMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractDemandMetaData demand = (AbstractDemandMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("state".equals(localName)) demand.setWhenRequired(new ControllerState(attrs.getValue(i))); else if ("transformer".equals(localName)) demand.setTransformer(attrs.getValue(i)); } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractDemandMetaData x = (AbstractDemandMetaData) o; String name = (String) x.getDemand(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty demand."); return o; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LazyInterfaceInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000404611034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLazyMetaData; import org.jboss.beans.metadata.spi.ClassMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * LazyInterfaceInterceptor. * * @author Ales Justin */ public class LazyInterfaceInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LazyInterfaceInterceptor INTERCEPTOR = new LazyInterfaceInterceptor(); public void add(Object parent, Object child, QName name) { AbstractLazyMetaData lazy = (AbstractLazyMetaData) parent; ClassMetaData intface = (ClassMetaData) child; Set interfaces = lazy.getInterfaces(); if (interfaces == null) { interfaces = new HashSet(); lazy.setInterfaces(interfaces); } interfaces.add(intface.getClassName()); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleCreateInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000361011034350351033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.MutableLifecycleHolder; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * LifecycleCreateInterceptor. * * @author Ales Justin */ public class LifecycleCreateInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LifecycleCreateInterceptor INTERCEPTOR = new LifecycleCreateInterceptor(); public void add(Object parent, Object child, QName name) { MutableLifecycleHolder holder = (MutableLifecycleHolder) parent; AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) child; lifecycle.setType("create"); holder.setCreate(lifecycle); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PlainValueCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000415611034350351033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * PlainValueCharactersHandler. * * @author Adrian Brock * @version $Revision: 43108 $ */ public class PlainValueCharactersHandler extends CharactersHandler { /** The interceptor */ public static final PlainValueCharactersHandler HANDLER = new PlainValueCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qName, ElementBinding element, Object owner, Object value) { StringValueMetaData valueMetaData = (StringValueMetaData) owner; valueMetaData.setValue(value); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PropertyHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000714511034350351033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * PropertyHandler. * * @author Adrian Brock * @version $Revision: 65585 $ */ public class PropertyHandler extends DefaultElementHandler { /** The handler */ public static final PropertyHandler HANDLER = new PropertyHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractPropertyMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractPropertyMetaData property = (AbstractPropertyMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("name".equals(localName)) property.setName(attrs.getValue(i)); else if ("preinstantiate".equals(localName)) property.setPreInstantiate(Boolean.parseBoolean(attrs.getValue(i))); else if ("class".equals(localName) || "replace".equals(localName) || "trim".equals(localName)) { StringValueMetaData svmd; ValueMetaData vmd = property.getValue(); if (vmd == null || vmd instanceof StringValueMetaData == false) { svmd = new StringValueMetaData(); property.setValue(svmd); } else { svmd = (StringValueMetaData)vmd; } if ("class".equals(localName)) svmd.setType(attrs.getValue(i)); else if ("replace".equals(localName)) svmd.setReplace(Boolean.parseBoolean(attrs.getValue(i))); else if ("trim".equals(localName)) svmd.setTrim(Boolean.parseBoolean(attrs.getValue(i))); } } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractPropertyMetaData x = (AbstractPropertyMetaData) o; String name = x.getName(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty property name."); return o; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/MapEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000234411034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; /** * MapEntry. * * @author Adrian Brock * @version $Revision: 43110 $ */ class MapEntry { public Object key; public Object value; }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DeploymentHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000503411034350351033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * DeploymentHandler. * * @author Adrian Brock * @version $Revision: 70559 $ */ public class DeploymentHandler extends DefaultElementHandler { /** The deployment handler */ public static final DeploymentHandler HANDLER = new DeploymentHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractKernelDeployment(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractKernelDeployment deployment = (AbstractKernelDeployment)o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("name".equals(localName)) deployment.setName(attrs.getValue(i)); else if ("scoped".equals(localName)) deployment.setScoped(Boolean.parseBoolean(attrs.getValue(i))); else if ("mode".equals(localName)) deployment.setMode(ControllerMode.getInstance(attrs.getValue(i))); } } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/AliasCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000407211034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractAliasMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * AliasCharactersHandler. * * @author Ales Justin */ public class AliasCharactersHandler extends CharactersHandler { /** The interceptor */ public static final AliasCharactersHandler HANDLER = new AliasCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qname, ElementBinding element, Object owner, Object value) { AbstractAliasMetaData alias = (AbstractAliasMetaData) owner; alias.setAliasValue(value); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/MapHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000452311034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * MapHandler. * * @author Adrian Brock * @version $Revision: 59000 $ */ public class MapHandler extends DefaultElementHandler { /** The handler */ public static final MapHandler HANDLER = new MapHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractMapMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractMapMetaData map = (AbstractMapMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("class".equals(localName)) map.setType(attrs.getValue(i)); else if ("keyClass".equals(localName)) map.setKeyType(attrs.getValue(i)); else if ("valueClass".equals(localName)) map.setValueType(attrs.getValue(i)); } } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/Holder.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000273111034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; /** * Holder. * * @author Adrian Brock * @version $Revision: 43107 $ */ class Holder { private Object object; public Holder() { } public Holder(Object object) { this.object = object; } public Object getValue() { return object; } public void setValue(Object object) { this.object = object; } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DeploymentWildcardHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000465311034350351033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultWildcardHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * DeploymentWildcardHandler. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class DeploymentWildcardHandler extends DefaultWildcardHandler { /** The handler */ public static final DeploymentWildcardHandler HANDLER = new DeploymentWildcardHandler(); public void setParent(Object parent, Object o, QName elementName, ElementBinding element, ElementBinding parentElement) { AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; if (o == null || o instanceof BeanMetaDataFactory == false) throw new IllegalArgumentException(o + " is not an instance of BeanMetaDataFactory for element " + element.getQName()); BeanMetaDataFactory bean = (BeanMetaDataFactory) o; List beans = deployment.getBeanFactories(); if (beans == null) { beans = new ArrayList(); deployment.setBeanFactories(beans); } beans.add(bean); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanDemandsInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000417311034350351033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.HashSet; import java.util.Set; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanDemandsInterceptor. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class BeanDemandsInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanDemandsInterceptor INTERCEPTOR = new BeanDemandsInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractDemandMetaData demand = (AbstractDemandMetaData) child; Set demands = bean.getDemands(); if (demands == null) { demands = new HashSet(); bean.setDemands(demands); } demands.add(demand); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueFactoryHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000745611034350351033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.List; import java.util.ArrayList; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * ValueFactoryHandler. * * @author Ales Justin */ public class ValueFactoryHandler extends DefaultElementHandler { /** The handler */ public static final ValueFactoryHandler HANDLER = new ValueFactoryHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractValueFactoryMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractValueFactoryMetaData valueFactory = (AbstractValueFactoryMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("bean".equals(localName)) valueFactory.setValue(attrs.getValue(i)); else if ("method".equals(localName)) valueFactory.setMethod(attrs.getValue(i)); else if ("state".equals(localName)) valueFactory.setDependentState(new ControllerState(attrs.getValue(i))); else if ("whenRequired".equals(localName)) valueFactory.setWhenRequiredState(new ControllerState(attrs.getValue(i))); else if ("parameter".equals(localName)) valueFactory.setParameter(attrs.getValue(i)); else if ("default".equals(localName)) valueFactory.setDefaultValue(attrs.getValue(i)); } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractValueFactoryMetaData vf = (AbstractValueFactoryMetaData)o; if (vf.getUnderlyingValue() == null || vf.getMethod() == null) throw new IllegalArgumentException("Bean or method cannot null: " + vf); if (vf.getParameter() != null && vf.getParameters() != null) throw new IllegalArgumentException("Both parameter and parameters cannot be set: " + vf); if (vf.getParameter() != null) { List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(String.class.getName(), vf.getParameter())); vf.setParameters(parameters); vf.setParameter(null); } return vf; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ConstructorHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000551611034350351033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * ConstructorHandler. * * @author Adrian Brock * @version $Revision: 43020 $ */ public class ConstructorHandler extends DefaultElementHandler { /** The handler */ public static final ConstructorHandler HANDLER = new ConstructorHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractConstructorMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("factoryClass".equals(localName)) constructor.setFactoryClass(attrs.getValue(i)); else if ("factoryMethod".equals(localName)) constructor.setFactoryMethod(attrs.getValue(i)); } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) o; if (constructor.getFactory() != null || constructor.getFactoryClass() != null) if (constructor.getFactoryMethod() == null) throw new IllegalArgumentException("Constructor needs a factoryMethod attribute when there is a factoryClass attribute or factory element."); return constructor; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ParameterCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000354111034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * ParameterCharactersHandler. * * @author Adrian Brock * @version $Revision: 60019 $ */ public class ParameterCharactersHandler extends StringValueCharactersHandler { /** The interceptor */ public static final ParameterCharactersHandler HANDLER = new ParameterCharactersHandler(); public void setValue(QName qName, ElementBinding element, Object owner, Object value) { AbstractParameterMetaData parameter = (AbstractParameterMetaData) owner; setStringValue(parameter, (StringValueMetaData)value); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ParameterHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000612211034350351033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * CollectionHandler. * * @author Adrian Brock * @version $Revision: 65585 $ */ public class ParameterHandler extends DefaultElementHandler { /** * The handler */ public static final ParameterHandler HANDLER = new ParameterHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractParameterMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractParameterMetaData parameter = (AbstractParameterMetaData)o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("class".equals(localName)) parameter.setType(attrs.getValue(i)); else if ("replace".equals(localName) || "trim".equals(localName)) { ValueMetaData vmd = parameter.getValue(); StringValueMetaData stringValueMetaData; if (vmd != null && vmd instanceof StringValueMetaData) stringValueMetaData = (StringValueMetaData)vmd; else { stringValueMetaData = new StringValueMetaData(); parameter.setValue(stringValueMetaData); } if ("replace".equals(localName)) stringValueMetaData.setReplace(Boolean.parseBoolean(attrs.getValue(i))); else if ("trim".equals(localName)) stringValueMetaData.setTrim(Boolean.parseBoolean(attrs.getValue(i))); } } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/AliasHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000424611034350351033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractAliasMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * AliasHandler. * * @author Ales Justin */ public class AliasHandler extends DefaultElementHandler { /** The handler */ public static final AliasHandler HANDLER = new AliasHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractAliasMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractAliasMetaData alias = (AbstractAliasMetaData) o; if (alias.getAliasValue() == null) { throw new IllegalArgumentException("Empty content"); } return alias; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/MapEntryInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000442011034350351033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * MapEntryInterceptor. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class MapEntryInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final MapEntryInterceptor INTERCEPTOR = new MapEntryInterceptor(); public void add(Object parent, Object child, QName name) { AbstractMapMetaData map = (AbstractMapMetaData) parent; MapEntry entry = (MapEntry) child; AbstractValueMetaData entryKey = (AbstractValueMetaData) entry.key; if (entryKey == null) throw new IllegalArgumentException("No key in map entry"); AbstractValueMetaData entryValue = (AbstractValueMetaData) entry.value; if (entryValue == null) throw new IllegalArgumentException("No value in map entry"); map.put((MetaDataVisitorNode) entryKey.getValue(), (MetaDataVisitorNode) entryValue.getValue()); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000506111034350351033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * ValueHandler. * * @author Adrian Brock * @version $Revision: 65585 $ */ public class ValueHandler extends DefaultElementHandler { /** The handler */ public static final ValueHandler HANDLER = new ValueHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractValueMetaData(new StringValueMetaData()); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractValueMetaData value = (AbstractValueMetaData) o; StringValueMetaData string = (StringValueMetaData) value.getValue(); for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("class".equals(localName)) string.setType(attrs.getValue(i)); else if ("replace".equals(localName)) string.setReplace(Boolean.parseBoolean(attrs.getValue(i))); else if ("trim".equals(localName)) string.setTrim(Boolean.parseBoolean(attrs.getValue(i))); } } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000157411034350351033334 0ustar twernertwerner

Kernel plugins, an xml deployment implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanConstructorInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000361111034350351033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanConstructorInterceptor. * * @author Adrian Brock * @version $Revision: 43013 $ */ public class BeanConstructorInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanConstructorInterceptor INTERCEPTOR = new BeanConstructorInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) child; bean.setConstructor(constructor); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleDestroyInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000361611034350351033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.MutableLifecycleHolder; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * LifecycleDestroyInterceptor. * * @author Ales Justin */ public class LifecycleDestroyInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LifecycleDestroyInterceptor INTERCEPTOR = new LifecycleDestroyInterceptor(); public void add(Object parent, Object child, QName name) { MutableLifecycleHolder holder = (MutableLifecycleHolder) parent; AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) child; lifecycle.setType("destroy"); holder.setDestroy(lifecycle); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/FactoryWildcardHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000366511034350351033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultWildcardHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * FactoryWildcardHandler. * * @author Adrian Brock * @version $Revision: 43107 $ */ public class FactoryWildcardHandler extends DefaultWildcardHandler { /** The handler */ public static final FactoryWildcardHandler WILDCARD = new FactoryWildcardHandler(); public void setParent(Object parent, Object o, QName elementName, ElementBinding element, ElementBinding parentElement) { Holder holder = (Holder) parent; if (o instanceof ValueMetaData == false) o = new AbstractValueMetaData(o); holder.setValue(o); } }././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueMetaDataElementInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000753011262402474033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.policy.AbstractBindingMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ValueMetaDataElementInterceptor. * * @author Adrian Brock * @version $Revision: 68656 $ */ public class ValueMetaDataElementInterceptor extends DefaultElementInterceptor { /** The value handler */ public static final ValueMetaDataElementInterceptor VALUES = new ValueMetaDataElementInterceptor(); public void add(Object parent, Object child, QName name) { if (parent instanceof AbstractCollectionMetaData) { AbstractCollectionMetaData collection = (AbstractCollectionMetaData) parent; ValueMetaData value = (ValueMetaData) child; collection.add(value); } else if (parent instanceof AbstractParameterMetaData) { AbstractParameterMetaData valueMetaData = (AbstractParameterMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setValue(value); } else if (parent instanceof AbstractPropertyMetaData) { AbstractPropertyMetaData valueMetaData = (AbstractPropertyMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setValue(value); } else if (parent instanceof AbstractClassLoaderMetaData) { AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setClassLoader(value); } else if (parent instanceof AbstractConstructorMetaData) { AbstractConstructorMetaData valueMetaData = (AbstractConstructorMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setValue(value); } else if (parent instanceof AbstractBindingMetaData) { AbstractBindingMetaData valueMetaData = (AbstractBindingMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setValue(value); } else { AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent; ValueMetaData value = (ValueMetaData) child; valueMetaData.setValue(value); } } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleStopInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000357411034350351033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.MutableLifecycleHolder; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * LifecycleStopInterceptor. * * @author Ales Justin */ public class LifecycleStopInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LifecycleStopInterceptor INTERCEPTOR = new LifecycleStopInterceptor(); public void add(Object parent, Object child, QName name) { MutableLifecycleHolder holder = (MutableLifecycleHolder) parent; AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) child; lifecycle.setType("stop"); holder.setStop(lifecycle); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/EntryKeyInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000315211034350351033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * EntryKeyInterceptor. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class EntryKeyInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final EntryKeyInterceptor INTERCEPTOR = new EntryKeyInterceptor(); public void add(Object parent, Object child, QName name) { MapEntry entry = (MapEntry) parent; entry.key = child; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueElementInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000547211034350351033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ValueElementInterceptor. * * @author Adrian Brock * @version $Revision: 43008 $ */ public abstract class ValueElementInterceptor extends DefaultElementInterceptor { public void add(Object parent, Object child, QName name) { if (parent instanceof AbstractCollectionMetaData) { AbstractCollectionMetaData collection = (AbstractCollectionMetaData) parent; collection.add(getValue()); } else if (parent instanceof AbstractParameterMetaData) { AbstractParameterMetaData valueMetaData = (AbstractParameterMetaData) parent; valueMetaData.setValue(getValue()); } else if (parent instanceof AbstractPropertyMetaData) { AbstractPropertyMetaData valueMetaData = (AbstractPropertyMetaData) parent; valueMetaData.setValue(getValue()); } else if (parent instanceof AbstractClassLoaderMetaData) { AbstractClassLoaderMetaData valueMetaData = (AbstractClassLoaderMetaData) parent; valueMetaData.setClassLoader(getValue()); } else { AbstractValueMetaData valueMetaData = (AbstractValueMetaData) parent; valueMetaData.setValue(getValue()); } } public abstract AbstractValueMetaData getValue(); }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PropertiesHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000327311034350351033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractPropertiesMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * PropertyHandler. * * @author Ales Justin */ public class PropertiesHandler extends DefaultElementHandler { /** The handler */ public static final PropertiesHandler HANDLER = new PropertiesHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractPropertiesMetaData(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PlainValueHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000462711034350351033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * PlainValueHandler. * * @author Adrian Brock * @version $Revision: 65585 $ */ public class PlainValueHandler extends DefaultElementHandler { /** The handler */ public static final PlainValueHandler HANDLER = new PlainValueHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new StringValueMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { StringValueMetaData value = (StringValueMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("class".equals(localName)) value.setType(attrs.getValue(i)); else if ("replace".equals(localName)) value.setReplace(Boolean.parseBoolean(attrs.getValue(i))); else if ("trim".equals(localName)) value.setTrim(Boolean.parseBoolean(attrs.getValue(i))); } } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ConstructorFactoryInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000362311034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ConstructorFactoryInterceptor. * * @author Adrian Brock * @version $Revision: 43020 $ */ public class ConstructorFactoryInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final ConstructorFactoryInterceptor INTERCEPTOR = new ConstructorFactoryInterceptor(); public void add(Object parent, Object child, QName name) { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) parent; AbstractValueMetaData value = (AbstractValueMetaData) child; constructor.setFactory(value); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/FactoryHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000616011034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * FactoryHandler. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class FactoryHandler extends DefaultElementHandler { /** The handler */ public static final FactoryHandler HANDLER = new FactoryHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new Holder(new AbstractDependencyValueMetaData()); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { Holder value = (Holder) o; AbstractDependencyValueMetaData dependency = (AbstractDependencyValueMetaData) value.getValue(); for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("bean".equals(localName)) dependency.setValue(attrs.getValue(i)); else if ("property".equals(localName)) dependency.setProperty(attrs.getValue(i)); else if ("state".equals(localName)) dependency.setDependentState(new ControllerState(attrs.getValue(i))); else if ("whenRequired".equals(localName)) dependency.setWhenRequiredState(new ControllerState(attrs.getValue(i))); } } public Object endElement(Object o, QName qName, ElementBinding element) { Holder holder = (Holder) o; ValueMetaData value = (ValueMetaData) holder.getValue(); if (value == null || value.getUnderlyingValue() == null) throw new IllegalArgumentException("Factory should have a bean attribute or nested element."); return value; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ClassLoaderHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000440511034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * ClassLoaderHandler. * * @author Adrian Brock * @version $Revision: 43020 $ */ public class ClassLoaderHandler extends DefaultElementHandler { /** The handler */ public static final ClassLoaderHandler HANDLER = new ClassLoaderHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractClassLoaderMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractClassLoaderMetaData classLoader = (AbstractClassLoaderMetaData) o; if (classLoader.getClassLoader() == null) throw new IllegalArgumentException("ClassLoader should have a nested value."); return classLoader; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/EntryValueInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000316311034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * EntryValueInterceptor. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class EntryValueInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final EntryValueInterceptor INTERCEPTOR = new EntryValueInterceptor(); public void add(Object parent, Object child, QName name) { MapEntry entry = (MapEntry) parent; entry.value = child; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/StringValueCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000501211034350351033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * Abstract StringValueMetaData helper. * Looks for previous value on the ValueMetaDataAware. * If the previous value is StringValueMD it applies its * property values to the new StringValueMetaData instance. * * @author Ales Justin */ public abstract class StringValueCharactersHandler extends CharactersHandler { public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return new StringValueMetaData(value); } protected void setStringValue(ValueMetaDataAware vmda, StringValueMetaData svmd) { ValueMetaData vmd = vmda.getValue(); if (vmd != null && vmd instanceof StringValueMetaData) { StringValueMetaData previous = (StringValueMetaData) vmd; svmd.setReplace(previous.isReplace()); svmd.setTrim(previous.isTrim()); String type = previous.getType(); if (type != null) svmd.setType(type); } vmda.setValue(svmd); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueFactoryParametersInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000444211034350351033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * ValueFactoryParametersInterceptor. * * @author Ales Justin */ public class ValueFactoryParametersInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final ValueFactoryParametersInterceptor INTERCEPTOR = new ValueFactoryParametersInterceptor(); public void add(Object parent, Object child, QName name) { AbstractValueFactoryMetaData factoryMetaData = (AbstractValueFactoryMetaData) parent; AbstractParameterMetaData parameter = (AbstractParameterMetaData) child; List parameters = factoryMetaData.getParameters(); if (parameters == null) { parameters = new ArrayList(); factoryMetaData.setParameters(parameters); } parameter.setIndex(parameters.size()); parameters.add(parameter); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LazyHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000516111034350351033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLazyMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * LazyHandler. * * @author Ales Justin */ public class LazyHandler extends DefaultElementHandler { /** The handler */ public static final LazyHandler HANDLER = new LazyHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractLazyMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractLazyMetaData lazy = (AbstractLazyMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("name".equals(localName)) lazy.setName(attrs.getValue(i)); else if ("bean".equals(localName)) lazy.setBeanName(attrs.getValue(i)); else if ("exposeClass".equals(localName)) lazy.setExposeClass(Boolean.parseBoolean(attrs.getValue(i))); } } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractLazyMetaData lazy = (AbstractLazyMetaData) o; if (lazy.getBeanName() == null) throw new IllegalArgumentException("Bean name must be set!"); return lazy; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DependsHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000441011034350351033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * DependsHandler. * * @author Adrian Brock * @version $Revision: 43104 $ */ public class DependsHandler extends DefaultElementHandler { /** The handler */ public static final DependsHandler HANDLER = new DependsHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractDependencyMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { } public Object endElement(Object o, QName qName, ElementBinding element) { AbstractDependencyMetaData x = (AbstractDependencyMetaData) o; String name = (String) x.getDependency(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty dependency."); return o; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/NamedAliasHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000521011034350351033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractNamedAliasMetaData; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.xml.sax.Attributes; /** * The named alias handler. * * @author Ales Justin */ public class NamedAliasHandler extends AliasHandler { /** * The alias handler */ public static final NamedAliasHandler NAMED_ALIAS_HANDLER = new NamedAliasHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractNamedAliasMetaData(); } public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx) { AbstractNamedAliasMetaData alias = (AbstractNamedAliasMetaData) o; for (int i = 0; i < attrs.getLength(); ++i) { String localName = attrs.getLocalName(i); if ("name".equals(localName)) alias.setName(attrs.getValue(i)); else if ("alias".equals(localName)) alias.setAliasValue(attrs.getValue(i)); } super.attributes(o, elementName, element, attrs, nsCtx); } public Object endElement(Object object, QName qName, ElementBinding elementBinding) { AbstractNamedAliasMetaData alias = (AbstractNamedAliasMetaData)object; if (alias.getName() == null) throw new IllegalArgumentException("Missing name: " + alias); return super.endElement(object, qName, elementBinding); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/PropertyCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000360111034350351033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; /** * PropertyCharactersHandler. * * @author Adrian Brock * @version $Revision: 60019 $ */ public class PropertyCharactersHandler extends StringValueCharactersHandler { /** The interceptor */ public static final PropertyCharactersHandler HANDLER = new PropertyCharactersHandler(); public void setValue(QName qName, ElementBinding element, Object owner, Object value) { AbstractPropertyMetaData property = (AbstractPropertyMetaData) owner; StringValueMetaData svmd = (StringValueMetaData) value; setStringValue(property, svmd); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanClassLoaderInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000360611034350351033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * BeanClassLoaderInterceptor. * * @author Adrian Brock * @version $Revision: 43013 $ */ public class BeanClassLoaderInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final BeanClassLoaderInterceptor INTERCEPTOR = new BeanClassLoaderInterceptor(); public void add(Object parent, Object child, QName name) { AbstractBeanMetaData bean = (AbstractBeanMetaData) parent; AbstractClassLoaderMetaData classloader = (AbstractClassLoaderMetaData) child; bean.setClassLoader(classloader); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DemandCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000413211034350351033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * DemandCharactersHandler. * * @author Adrian Brock * @version $Revision: 43105 $ */ public class DemandCharactersHandler extends CharactersHandler { /** The interceptor */ public static final DemandCharactersHandler HANDLER = new DemandCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qname, ElementBinding element, Object owner, Object value) { AbstractDemandMetaData demand = (AbstractDemandMetaData) owner; demand.setDemand(value); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/DeploymentClassLoaderInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000445711034350351033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.util.List; import java.util.ArrayList; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * DeploymentClassLoaderInterceptor. * * @author Adrian Brock * @version $Revision: 70494 $ */ public class DeploymentClassLoaderInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final DeploymentClassLoaderInterceptor INTERCEPTOR = new DeploymentClassLoaderInterceptor(); public void add(Object parent, Object child, QName name) { AbstractKernelDeployment deployment = (AbstractKernelDeployment) parent; AbstractClassLoaderMetaData classloader = (AbstractClassLoaderMetaData) child; deployment.setClassLoader(classloader); // add classloaders as value beans List beans = deployment.getBeanFactories(); if (beans == null) { beans = new ArrayList(); deployment.setBeanFactories(beans); } } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/LifecycleStartInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000360211034350351033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.MutableLifecycleHolder; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementInterceptor; /** * LifecycleStartInterceptor. * * @author Ales Justin */ public class LifecycleStartInterceptor extends DefaultElementInterceptor { /** The interceptor */ public static final LifecycleStartInterceptor INTERCEPTOR = new LifecycleStartInterceptor(); public void add(Object parent, Object child, QName name) { MutableLifecycleHolder holder = (MutableLifecycleHolder) parent; AbstractLifecycleMetaData lifecycle = (AbstractLifecycleMetaData) child; lifecycle.setType("start"); holder.setStart(lifecycle); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ValueCharactersHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000435311034350351033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.xb.binding.sunday.unmarshalling.CharactersHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; /** * ValueCharactersHandler. * * @author Adrian Brock * @version $Revision: 43109 $ */ public class ValueCharactersHandler extends CharactersHandler { /** The interceptor */ public static final ValueCharactersHandler HANDLER = new ValueCharactersHandler(); public Object unmarshal(QName qName, TypeBinding typeBinding, NamespaceContext nsCtx, org.jboss.xb.binding.metadata.ValueMetaData valueMetaData, String value) { return value; } public void setValue(QName qName, ElementBinding element, Object owner, Object value) { AbstractValueMetaData valueMetaData = (AbstractValueMetaData) owner; StringValueMetaData string = (StringValueMetaData) valueMetaData.getValue(); string.setValue(value); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deployment/xml/ClassHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/src/main/java/org/jboss/kernel/plugins/deploy0000644000175000017500000000407111034350351033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.DefaultElementHandler; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.beans.metadata.spi.ClassMetaData; import org.jboss.beans.metadata.plugins.AbstractClassMetaData; /** * ClassHandler. * * @author Ales Justin */ public class ClassHandler extends DefaultElementHandler { /** The handler */ public static final ClassHandler HANDLER = new ClassHandler(); public Object startElement(Object parent, QName name, ElementBinding element) { return new AbstractClassMetaData(); } public Object endElement(Object o, QName qName, ElementBinding element) { ClassMetaData classMetaData = (ClassMetaData) o; String name = classMetaData.getClassName(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty class/interface."); return classMetaData; } } libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/.settings/0000755000175000017500000000000011620312222024514 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/spring-int/.settings/org.eclipse.jdt.core.prefs0000644000175000017500000000032010674774740031522 0ustar twernertwerner#Fri Sep 21 17:50:55 BST 2007 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 libjboss-microcontainer-java-2.0.10.GA.orig/spring-int/.project0000644000175000017500000000111211301257231024244 0ustar twernertwerner jboss-spring-int JBoss Microcontainer Spring Integration jboss-dependency jboss-kernel org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/0000755000175000017500000000000011620312211022366 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/.classpath0000644000175000017500000000064611301257231024365 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/pom.xml0000644000175000017500000000313611375173343023730 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 jboss-guice-int jar JBoss Microcontainer Guice Int http://www.jboss.com/products/jbossmc JBoss Microcontainer Guice Int com.google.code.guice guice org.jboss.microcontainer jboss-kernel org.jboss.man jboss-managed true org.jboss.logging jboss-logging-log4j test org.jboss.test jboss-test test junit junit test libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/0000755000175000017500000000000011620312211023155 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/0000755000175000017500000000000011620312211024134 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/0000755000175000017500000000000011620312211025055 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/0000755000175000017500000000000011620312211025644 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/0000755000175000017500000000000011620312211026764 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/0000755000175000017500000000000011620312211027743 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/0000755000175000017500000000000011620312211031037 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/0000755000175000017500000000000011620312211032016 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceToMCTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceT0000644000175000017500000001041210777411017033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.test; import java.util.Collections; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.guice.spi.GuiceKernelRegistryEntryPlugin; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.guice.support.Prototype; import org.jboss.test.guice.support.Singleton; import org.jboss.test.guice.support.SingletonHolder; import com.google.inject.AbstractModule; import com.google.inject.Key; import com.google.inject.Module; import com.google.inject.name.Names; /** * Inject Guice objects into MC test. * * @author Ales Justin */ public class GuiceToMCTestCase extends AbstractGuiceTest { public GuiceToMCTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(GuiceToMCTestCase.class); } public void testGuice2MC() throws Throwable { final KernelController controller = getController(); try { AbstractBeanMetaData guicePlugin = new AbstractBeanMetaData("GuicePlugin", GuiceKernelRegistryEntryPlugin.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); AbstractArrayMetaData arrayMetaData = new AbstractArrayMetaData(); final Singleton singleton = new Singleton(); final Key prototypeKey = Key.get(Prototype.class, Names.named("prototype")); final Prototype prototype = new Prototype(); Module module = new AbstractModule() { protected void configure() { bind(Singleton.class).toInstance(singleton); bind(prototypeKey).toInstance(prototype); } }; arrayMetaData.add(new AbstractValueMetaData(module)); constructor.setParameters(Collections.singletonList((ParameterMetaData)new AbstractParameterMetaData(arrayMetaData))); guicePlugin.setConstructor(constructor); controller.install(guicePlugin); BeanMetaData holderBean = new AbstractBeanMetaData("holder", SingletonHolder.class.getName()); controller.install(holderBean); ControllerContext holderContext = controller.getInstalledContext("holder"); assertNotNull(holderContext); SingletonHolder holder = (SingletonHolder)holderContext.getTarget(); assertNotNull(holder); assertEquals(singleton, holder.getSingleton()); ControllerContext prototypeContext = controller.getInstalledContext(prototypeKey); assertNotNull(prototypeContext); assertEquals(prototype, prototypeContext.getTarget()); } finally { controller.shutdown(); } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceIntegrationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceI0000644000175000017500000001050410770675341033133 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.test; import com.google.inject.AbstractModule; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.name.Names; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.guice.spi.GuiceIntegration; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.guice.support.Prototype; import org.jboss.test.guice.support.Singleton; /** * Guice integration test case. * * @author Ales Justin */ public class GuiceIntegrationTestCase extends AbstractGuiceTest { public GuiceIntegrationTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(GuiceIntegrationTestCase.class); } protected void installBeans(KernelController controller) throws Throwable { BeanMetaData singleton = new AbstractBeanMetaData("singleton", Singleton.class.getName()); controller.install(singleton); installFactory(controller, "prototype", Prototype.class); } public void testBindFromMicrocontainer() throws Throwable { final KernelController controller = getController(); try { installBeans(controller); Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { bind(Controller.class).toInstance(controller); bind(Singleton.class).toProvider(GuiceIntegration.fromMicrocontainer(Singleton.class, "singleton")); bind(Prototype.class).toProvider(GuiceIntegration.fromMicrocontainer(Prototype.class, "prototype")); } }); assertNotNull(injector.getInstance(Singleton.class)); assertSame(injector.getInstance(Singleton.class), injector.getInstance(Singleton.class)); assertNotNull(injector.getInstance(Prototype.class)); assertNotSame(injector.getInstance(Prototype.class), injector.getInstance(Prototype.class)); } finally { controller.shutdown(); } } public void testBindAll() throws Throwable { final KernelController controller = getController(); try { installBeans(controller); Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { GuiceIntegration.bindAll(binder(), controller); } }); Key singletonKey = Key.get(Singleton.class, Names.named("singleton")); Key prototypeKey = Key.get(Prototype.class, Names.named("prototype")); assertNotNull(injector.getInstance(singletonKey)); assertSame(injector.getInstance(singletonKey), injector.getInstance(singletonKey)); assertNotNull(injector.getInstance(prototypeKey)); assertNotSame(injector.getInstance(prototypeKey), injector.getInstance(prototypeKey)); } finally { controller.shutdown(); } } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceT0000644000175000017500000000321710770675341033151 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.test; import junit.textui.TestRunner; import junit.framework.TestSuite; import junit.framework.Test; /** * Guice test suite. * * @author Ales Justin */ public class GuiceTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Guice Tests"); suite.addTest(GuiceIntegrationTestCase.suite()); suite.addTest(GuiceObjectsTestCase.suite()); suite.addTest(GuiceToMCTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceObjectsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/GuiceO0000644000175000017500000001502510770675341033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.test; import java.util.ArrayList; import java.util.List; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.name.Names; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.guice.plugins.GuiceInjectorFactory; import org.jboss.guice.plugins.GuiceObject; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.guice.support.Prototype; import org.jboss.test.guice.support.Singleton; /** * Guice test case via installed objects. * * @author Ales Justin */ public class GuiceObjectsTestCase extends AbstractGuiceTest { public GuiceObjectsTestCase(String name) { super(name); } /** * Setup the test * * @return the test */ public static Test suite() { return suite(GuiceObjectsTestCase.class); } /* // TODO - resolved when Guice Issue 49 is implemented public void testBindFromListener() throws Throwable { final KernelController controller = getController(); try { AbstractBeanMetaData injectorBean = new AbstractBeanMetaData("injector", GuiceInjectorFactory.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(GuiceInjectorFactory.class.getName()); constructor.setFactoryMethod("createInjector"); List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(new AbstractDependencyValueMetaData(KernelConstants.KERNEL_NAME))); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(new AbstractValueMetaData(GuiceObject.LISTENER)); array.add(new AbstractValueMetaData(GuiceObject.KERNEL)); parameters.add(new AbstractParameterMetaData(array)); constructor.setParameters(parameters); injectorBean.setConstructor(constructor); controller.install(injectorBean); BeanMetaData singleton = new AbstractBeanMetaData("singleton", Singleton.class.getName()); controller.install(singleton); BeanMetaData prototype = new GenericBeanFactoryMetaData("prototype", Prototype.class.getName()); controller.install(prototype); ControllerContext injectorContext = controller.getInstalledContext("injector"); assertNotNull(injectorContext); Injector injector = (Injector)injectorContext.getTarget(); assertNotNull(injector.getInstance(Singleton.class)); assertSame(injector.getInstance(Singleton.class), injector.getInstance(Singleton.class)); assertNotNull(injector.getInstance(Prototype.class)); assertNotSame(injector.getInstance(Prototype.class), injector.getInstance(Prototype.class)); } finally { controller.shutdown(); } } */ public void testBindAll() throws Throwable { final KernelController controller = getController(); try { BeanMetaData singleton = new AbstractBeanMetaData("singleton", Singleton.class.getName()); controller.install(singleton); installFactory(controller, "prototype", Prototype.class); AbstractBeanMetaData injectorBean = new AbstractBeanMetaData("injector", GuiceInjectorFactory.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(GuiceInjectorFactory.class.getName()); constructor.setFactoryMethod("createInjector"); List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(new AbstractDependencyValueMetaData(KernelConstants.KERNEL_NAME))); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(new AbstractValueMetaData(GuiceObject.ALL)); parameters.add(new AbstractParameterMetaData(array)); constructor.setParameters(parameters); injectorBean.setConstructor(constructor); controller.install(injectorBean); Key singletonKey = Key.get(Singleton.class, Names.named("singleton")); Key prototypeKey = Key.get(Prototype.class, Names.named("prototype")); ControllerContext injectorContext = controller.getInstalledContext("injector"); assertNotNull(injectorContext); Injector injector = (Injector)injectorContext.getTarget(); assertNotNull(injector.getInstance(singletonKey)); assertSame(injector.getInstance(singletonKey), injector.getInstance(singletonKey)); assertNotNull(injector.getInstance(prototypeKey)); assertNotSame(injector.getInstance(prototypeKey), injector.getInstance(prototypeKey)); } finally { controller.shutdown(); } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/AbstractGuiceTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/test/Abstra0000644000175000017500000000461010770675341033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.test; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Abstract Guice test. * * @author Ales Justin */ public abstract class AbstractGuiceTest extends MicrocontainerTest { protected AbstractGuiceTest(String name) { super(name); } protected KernelController getController() { BasicBootstrap bootstrap = new BasicBootstrap(); bootstrap.run(); return bootstrap.getKernel().getController(); } protected GenericBeanFactoryMetaData installFactory(KernelController controller, String name, Class beanClass) throws Throwable { return installFactory(controller, name, beanClass.getName()); } protected GenericBeanFactoryMetaData installFactory(KernelController controller, String name, String beanClassName) throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData(); factory.setName(name); factory.setBean(beanClassName); for (BeanMetaData bean : factory.getBeans()) controller.install(bean); return factory; } } libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/0000755000175000017500000000000011620312211032553 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/Singleton.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/Sin0000644000175000017500000000221310674271127033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.support; /** * @author Ales Justin */ public class Singleton { } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/Prototype.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/Pro0000644000175000017500000000221310674271127033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.support; /** * @author Ales Justin */ public class Prototype { } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/SingletonHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/test/java/org/jboss/test/guice/support/Sin0000644000175000017500000000276010676217217033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.guice.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; /** * @author Ales Justin */ public class SingletonHolder { private Singleton singleton; @Constructor public SingletonHolder(@Inject Singleton singleton) { this.singleton = singleton; } public Singleton getSingleton() { return singleton; } } libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/0000755000175000017500000000000011620312211024101 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/resources/0000755000175000017500000000000011620312211026113 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/resources/findbugs/0000755000175000017500000000000011620312211027714 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/resources/findbugs/exclude.xml0000644000175000017500000000126011262402453032100 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/0000755000175000017500000000000011620312211025022 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/0000755000175000017500000000000011620312211025611 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/0000755000175000017500000000000011620312211026731 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/0000755000175000017500000000000011620312211030025 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/api/0000755000175000017500000000000011620312211030576 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/api/Guice.java0000644000175000017500000000264310705673230032520 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.api; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * Marker for beans that should be binded to Guice. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Guice { } libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/0000755000175000017500000000000011620312211031506 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/InstanceBinder.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/Instance0000644000175000017500000000471610764471257033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import java.util.Map; import com.google.inject.Binder; import com.google.inject.spi.SourceProviders; import org.jboss.guice.spi.BinderHolder; /** * Microcontainer + Guice instance binder. * * @author Ales Justin */ public class InstanceBinder extends BinderHolder { static { SourceProviders.skip(InstanceBinder.class); } private Map, Object> bindings; public InstanceBinder(Binder binder) { super(binder); } @SuppressWarnings("unchecked") public void start() { if (bindings != null && bindings.isEmpty() == false) { for(Map.Entry, Object> entry : bindings.entrySet()) { Object value = entry.getValue(); if (value == null) throw new IllegalArgumentException("Null value in map: " + bindings); Class clazz = entry.getKey(); if (clazz == null) clazz = value.getClass(); if (clazz.isAssignableFrom(value.getClass()) == false) throw new IllegalArgumentException("Value " + value + " doesn't implement class " + clazz); getBinder().bind(clazz).toInstance(value); } } } public void stop() { // todo - unbind all } public void setBindings(Map, Object> bindings) { this.bindings = bindings; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/NameControllerContextBindFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/NameCont0000644000175000017500000000332610674271127033163 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import org.jboss.guice.spi.ControllerContextBindFilter; import org.jboss.dependency.spi.ControllerContext; /** * Name controller context bind filter. * * @author Ales Justin */ public abstract class NameControllerContextBindFilter implements ControllerContextBindFilter { public boolean bind(ControllerContext context) { return context != null && bind(context.getName()); } /** * Should we bind param context * with param name to Guice. * * @param name the context's name * @return true if we should bind context, false otherwise */ protected abstract boolean bind(Object name); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceObj0000644000175000017500000000333510674271127033146 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import org.jboss.kernel.Kernel; /** * Guice Objects. * * @author Ales Justin */ public interface GuiceObject { static final GuiceObject ALL = new AllGuiceObject(); static final GuiceObject KERNEL = new KernelGuiceObject(); // static final GuiceObject LISTENER = new ListenerGuiceObject(); /** * Get the name. * * @return the name */ String geName(); /** * Create new MC-Guice object. * * @param kernel the kernel * @param binder the binder * @return new MC-Guice object instance */ Object createObject(Kernel kernel, Binder binder); }././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/ListenerGuiceObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/Listener0000644000175000017500000000304210674271127033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import org.jboss.kernel.Kernel; /** * Create Guice listener. * * @author Ales Justin */ class ListenerGuiceObject implements GuiceObject { /* public static GuiceObject getInstance() { return LISTENER; } */ public String geName() { return "Guice_Listener"; } public Object createObject(Kernel kernel, Binder binder) { return new GuiceListener(kernel, binder); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceInjectorFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceInj0000644000175000017500000001241410674271127033152 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import java.util.HashSet; import com.google.inject.AbstractModule; import com.google.inject.Binding; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Provider; import com.google.inject.TypeLiteral; import com.google.inject.spi.SourceProviders; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Guice Injector factory. * * @author Ales Justin */ public class GuiceInjectorFactory implements Injector { static { SourceProviders.skip(GuiceInjectorFactory.class); } private Kernel kernel; private Injector injector; private Set objects; private GuiceInjectorFactory(Kernel kernel, Injector injector, Set objects) { this.kernel = kernel; this.injector = injector; this.objects = objects; } /** * Create injector. * Install all Guice objects. * * @param kernel the kernel * @param guiceObjects guice objects * @return injector instance */ public static Injector createInjector(final Kernel kernel, final GuiceObject... guiceObjects) { if (kernel == null) throw new IllegalArgumentException("Null kernel."); final Set objects = new HashSet(); Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { KernelController controller = kernel.getController(); List errors = null; for(GuiceObject gObject : guiceObjects) { try { String name = gObject.geName(); Object target = gObject.createObject(kernel, binder()); if (target == null) throw new IllegalArgumentException("Null target."); String beanClassName = target.getClass().getName(); AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData(name, beanClassName); KernelControllerContext context = controller.install(beanMetaData, target); objects.add(name); controller.change(context, ControllerState.INSTALLED); } catch (Throwable t) { if (errors == null) errors = new ArrayList(); errors.add(t); } } if (errors != null) throw new Error("Exception during Guice Objects installation: " + errors); } }); return new GuiceInjectorFactory(kernel, injector, objects); } /** * Uninstall Guice objects. */ public void destroy() { KernelController controller = kernel.getController(); for(String name : objects) { if (controller.getInstalledContext(name) != null) controller.uninstall(name); } objects.clear(); objects = null; kernel = null; } // injector delegate public void injectMembers(Object o) { injector.injectMembers(o); } public Map, Binding> getBindings() { return injector.getBindings(); } public Binding getBinding(Key key) { return injector.getBinding(key); } public List> findBindingsByType(TypeLiteral type) { return injector.findBindingsByType(type); } public Provider getProvider(Key key) { return injector.getProvider(key); } public Provider getProvider(Class type) { return injector.getProvider(type); } public T getInstance(Key key) { return injector.getInstance(key); } public T getInstance(Class type) { return injector.getInstance(type); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceListener.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceLis0000644000175000017500000000630711014301412033141 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import com.google.inject.spi.SourceProviders; import org.jboss.guice.spi.ControllerContextBindFilter; import org.jboss.guice.spi.GuiceIntegration; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.kernel.spi.registry.KernelRegistryEntry; /** * Microcontainer listener that binds newly added * controller context to binder. * * @author Ales Justin */ @SuppressWarnings("deprecation") public class GuiceListener extends GuiceIntegration implements KernelEventListener { static { SourceProviders.skip(GuiceListener.class); } private org.jboss.kernel.spi.registry.KernelRegistry registry; private ControllerContextBindFilter filter; public GuiceListener(Kernel kernel, Binder binder) { super(kernel, binder); this.registry = kernel.getRegistry(); } public void start() throws Throwable { registry.registerListener(this, null, null); } public void stop() throws Throwable { registry.unregisterListener(this, null, null); } public void onEvent(KernelEvent event, Object handback) { Object name = event.getContext(); String type = event.getType(); if (org.jboss.kernel.spi.registry.KernelRegistry.KERNEL_REGISTRY_REGISTERED.equals(type)) { Object source = event.getSource(); if (source instanceof org.jboss.kernel.spi.registry.KernelRegistry) { org.jboss.kernel.spi.registry.KernelRegistry registry = (org.jboss.kernel.spi.registry.KernelRegistry)source; KernelRegistryEntry entry = registry.getEntry(name); if (filter == null || filter.bind(entry)) bindContext(getBinder(), getController(), entry); } } else if (org.jboss.kernel.spi.registry.KernelRegistry.KERNEL_REGISTRY_UNREGISTERED.equals(type)) { // todo - can we unbind from binder? } } public void setFilter(ControllerContextBindFilter filter) { this.filter = filter; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/KernelInstanceBinder.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/KernelIn0000644000175000017500000000743310764471257033177 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import java.util.Map; import com.google.inject.Binder; import com.google.inject.spi.SourceProviders; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; /** * Kernel instance binder. * * @author Ales Justin */ public class KernelInstanceBinder extends InstanceBinder { static { SourceProviders.skip(KernelInstanceBinder.class); } public KernelInstanceBinder(Binder binder) { super(binder); } @MapValue( value = { @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.dependency.spi.Controller", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME)) ), @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.kernel.Kernel", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_NAME)) ), @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.kernel.spi.dependency.KernelController", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME)) ), @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.kernel.spi.registry.KernelBus", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_BUS_NAME)) ), @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.kernel.spi.registry.KernelRegistry", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_REGISTRY_NAME)) ), @EntryValue( key = @Value(type = Class.class, string = @StringValue(value="org.jboss.kernel.spi.config.KernelConfigurator", type = Class.class)), value = @Value(inject = @Inject(bean = KernelConstants.KERNEL_CONFIGURATOR_NAME)) ) } ) public void setBindings(Map, Object> bindings) { super.setBindings(bindings); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceAnnotationMarkerBindFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceAnn0000644000175000017500000000355510705673230033150 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import org.jboss.guice.spi.ControllerContextBindFilter; import org.jboss.guice.api.Guice; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; /** * Bind only context's which have @Guice annotation present. * * @author Ales Justin */ public abstract class GuiceAnnotationMarkerBindFilter implements ControllerContextBindFilter { public boolean bind(ControllerContext context) { if (context instanceof KernelControllerContext) { KernelControllerContext kcc = (KernelControllerContext)context; MetaData metaData = kcc.getScopeInfo().getMetaData(); return metaData.isAnnotationPresent(Guice.class); } return false; } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceBinder.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/GuiceBin0000644000175000017500000000373610674271127033151 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import com.google.inject.spi.SourceProviders; import org.jboss.kernel.Kernel; import org.jboss.guice.spi.GuiceIntegration; import org.jboss.guice.spi.ControllerContextBindFilter; /** * Microcontainer + Guice binder. * * @author Ales Justin */ public class GuiceBinder extends GuiceIntegration { static { SourceProviders.skip(GuiceBinder.class); } private ControllerContextBindFilter filter; public GuiceBinder(Kernel kernel, Binder binder) { super(kernel, binder); } public void start() { if (filter == null) bindAll(getBinder(), getController()); else bindAll(getBinder(), getController(), filter); } public void stop() { // todo - unbind all } public void setFilter(ControllerContextBindFilter filter) { this.filter = filter; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/AllGuiceObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/AllGuice0000644000175000017500000000301410674271127033136 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import org.jboss.kernel.Kernel; /** * Bind all current contexts. * * @author Ales Justin */ class AllGuiceObject implements GuiceObject { public static GuiceObject getInstance() { return ALL; } public String geName() { return "Guice_All"; } public Object createObject(Kernel kernel, Binder binder) { return new GuiceBinder(kernel, binder); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/KernelGuiceObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/plugins/KernelGu0000644000175000017500000000302210674271127033164 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.plugins; import com.google.inject.Binder; import org.jboss.kernel.Kernel; /** * Bind Kernel instances. * * @author Ales Justin */ class KernelGuiceObject implements GuiceObject { public static GuiceObject getInstance() { return KERNEL; } public String geName() { return "Guice_Kernel"; } public Object createObject(Kernel kernel, Binder binder) { return new KernelInstanceBinder(binder); } } libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/0000755000175000017500000000000011620312211030620 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/BinderHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/BinderHolder0000644000175000017500000000304310674271127033126 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import com.google.inject.Binder; /** * Binder ref holder. * * @author Ales Justin */ public abstract class BinderHolder { private Binder binder; protected BinderHolder(Binder binder) { if (binder == null) throw new IllegalArgumentException("Null binder."); this.binder = binder; } /** * Get the binder. * * @return the binder */ protected Binder getBinder() { return binder; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/GuiceKernelRegistryEntryPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/GuiceKernelR0000644000175000017500000000465311301242575033105 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.Module; import com.google.inject.Guice; /** * Guice kernel registry plugin. * Providing a way to inject Guice beans into MC. * * @author Ales Justin */ public class GuiceKernelRegistryEntryPlugin implements KernelRegistryPlugin { private Injector injector; public GuiceKernelRegistryEntryPlugin(Module... modules) { injector = Guice.createInjector(modules); } public void destroy() { injector = null; } @SuppressWarnings("unchecked") public KernelRegistryEntry getEntry(Object name) { KernelRegistryEntry entry = null; try { if (name instanceof Class) { Class clazz = (Class)name; entry = new AbstractKernelRegistryEntry(name, injector.getInstance(clazz)); } else if (name instanceof Key) { Key key = (Key)name; entry = new AbstractKernelRegistryEntry(name, injector.getInstance(key)); } } catch (Exception ignored) { } return entry; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/MicrocontainerProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/Microcontain0000644000175000017500000000500011037051624033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import com.google.inject.Provider; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.beans.metadata.spi.factory.BeanFactory; /** * Microcontainer provider. * * @author Ales Justin */ class MicrocontainerProvider implements Provider { private Class type; private Object name; private Controller controller; protected MicrocontainerProvider(Class type, Object name) { if (type == null) throw new IllegalArgumentException("Null type."); if (name == null) throw new IllegalArgumentException("Null name."); this.type = type; this.name = name; } void initialize(Controller controller) { this.controller = controller; } public T get() { if (controller == null) throw new IllegalArgumentException("Null controller, missing initialization."); ControllerContext context = controller.getInstalledContext(name); if (context != null) { Object target = context.getTarget(); if (target instanceof BeanFactory) { try { target = ((BeanFactory)target).createBean(); } catch (Throwable t) { throw new RuntimeException(t); } } return type.cast(target); } return null; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/InjectableMicrocontainerProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/InjectableMi0000644000175000017500000000303311037051624033102 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import com.google.inject.Inject; import org.jboss.dependency.spi.Controller; /** * Injectable Microcontainer provider. * * @author Ales Justin */ class InjectableMicrocontainerProvider extends MicrocontainerProvider { public InjectableMicrocontainerProvider(Class type, Object name) { super(type, name); } @Inject @Override void initialize(Controller controller) { super.initialize(controller); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/ControllerContextBindFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/ControllerCo0000644000175000017500000000300010674271127033163 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import org.jboss.dependency.spi.ControllerContext; /** * Controller context bind filter, * choose which conetxt;s get bind to Guice. * * @author Ales Justin */ public interface ControllerContextBindFilter { /** * Should we bind param context to Guice. * * @param context the context to check * @return true if we should bind context, false otherwise */ boolean bind(ControllerContext context); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/GuiceIntegration.javalibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/src/main/java/org/jboss/guice/spi/GuiceIntegra0000644000175000017500000001655411037051624033136 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.guice.spi; import java.util.Set; import com.google.inject.Binder; import com.google.inject.Provider; import com.google.inject.name.Names; import com.google.inject.spi.SourceProviders; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.reflect.spi.ClassInfo; /** * Microcontainer + Guice integration. * * @author Ales Justin */ public abstract class GuiceIntegration extends BinderHolder { static { SourceProviders.skip(GuiceIntegration.class); } private static final ControllerContextBindFilter ALL = new ControllerContextBindFilter() { public boolean bind(ControllerContext context) { return true; } }; private KernelController controller; protected GuiceIntegration(Kernel kernel, Binder binder) { super(binder); if (kernel == null) throw new IllegalArgumentException("Null kernel."); this.controller = kernel.getController(); } /** * Get the kernel controller. * * @return the kernel controller */ protected KernelController getController() { return controller; } /** * Creates a provider which looks up objects from Microcontainer using the given name. * Expects a binding to {@link org.jboss.dependency.spi.Controller}. Example usage: *

*

    * bind(DataSource.class).toProvider(fromMicrocontainer(DataSource.class, "dataSource"));
    * 
* * @param the class type * @param type the class type * @param name the bean name * @return Provider instance */ public static Provider fromMicrocontainer(Class type, Object name) { return new InjectableMicrocontainerProvider(type, name); } /** * Creates a provider which looks up objects from Microcontainer using the given type. * Expects a binding to {@link org.jboss.dependency.spi.Controller}. Example usage: *

*

    * bind(DataSource.class).toProvider(fromMicrocontainer(DataSource.class));
    * 
* * @param the class type * @param type the class type * @return Provider instance */ public static Provider fromMicrocontainer(Class type) { return fromMicrocontainer(type, type); } /** * Binds all Microcontainer beans from the given factory by name. For a MC bean * named "foo", this method creates a binding to the bean's type and * {@code @Named("foo")}. * * @param binder the binder * @param controller the controller * @see com.google.inject.name.Named * @see com.google.inject.name.Names#named(String) */ public static void bindAll(Binder binder, Controller controller) { bindAll(binder, controller, ALL); } /** * Binds all Microcontainer beans from the given factory by name. For a MC bean * named "foo", this method creates a binding to the bean's type and * {@code @Named("foo")}. * * @param binder the binder * @param controller the controller * @param filter the filter * @see com.google.inject.name.Named * @see com.google.inject.name.Names#named(String) */ public static void bindAll(Binder binder, Controller controller, ControllerContextBindFilter filter) { Set installedContexts = controller.getContextsByState(ControllerState.INSTALLED); if (installedContexts != null && installedContexts.isEmpty() == false) { for (ControllerContext context : installedContexts) { if (filter.bind(context)) bindContext(binder, controller, context); } } } /** * Bind controller context. * * @param binder the binder * @param controller the controller * @param context the context */ @SuppressWarnings("deprecation") protected static void bindContext(Binder binder, Controller controller, ControllerContext context) { Class targetClass = null; Object target = context.getTarget(); if (target != null) { targetClass = target.getClass(); // is target bean factory if (GenericBeanFactory.class.isAssignableFrom(targetClass)) { GenericBeanFactory gbf = (GenericBeanFactory)target; String bean = gbf.getBean(); if (bean != null && controller instanceof KernelController) { try { ClassLoader classLoader = Configurator.getClassLoader(gbf.getClassLoader()); KernelController kernelController = (KernelController)controller; KernelConfigurator configurator = kernelController.getKernel().getConfigurator(); ClassInfo info = configurator.getClassInfo(bean, classLoader); targetClass = info.getType(); } catch (Throwable t) { throw new RuntimeException(t); } } } } if (targetClass != null) { bindBean(binder, controller, context.getName().toString(), targetClass); Set aliases = context.getAliases(); if (aliases != null && aliases.isEmpty() == false) { for (Object alias : aliases) bindBean(binder, controller, alias.toString(), targetClass); } } } /** * Bind bean. * * @param binder the binder * @param controller the controller * @param name the name * @param type the type */ static void bindBean(Binder binder, Controller controller, String name, Class type) { MicrocontainerProvider provider = new MicrocontainerProvider(type, name); provider.initialize(controller); binder.bind(type).annotatedWith(Names.named(name)).toProvider(provider); } } libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/.settings/0000755000175000017500000000000011620312211024304 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/guice-int/.settings/org.eclipse.jdt.core.prefs0000644000175000017500000000032010674774740031314 0ustar twernertwerner#Fri Sep 21 17:51:07 BST 2007 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 libjboss-microcontainer-java-2.0.10.GA.orig/guice-int/.project0000644000175000017500000000110011301257231024033 0ustar twernertwerner jboss-guice-int JBoss Microcontainer Guice Int jboss-dependency jboss-kernel org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/0000755000175000017500000000000011620312211022446 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/.classpath0000644000175000017500000000114111301257231024434 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/pom.xml0000644000175000017500000006045511375173343024017 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 jboss-aop-mc-int jar JBoss Microcontainer AOP MC INT http://www.jboss.com/products/jbossmc JBoss Microcontainer maven-assembly-plugin src/assembly/impl.xml src/assembly/aspects.xml org.apache.maven.plugins maven-surefire-plugin weave test test true org/jboss/test/**/*TestCase.java true -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader ${project.build.directory}/surefire-reports/weave jboss.aop.exclude org.jboss.,org.apache. jboss.aop.include org.jboss.test. jboss-junit-configuration weave build.testlog target/log jboss.aop.verbose true weave-secure test test true ${project.build.directory}/surefire-reports/weave-secure org/jboss/test/**/*TestCase.java true -Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader jboss.aop.exclude org.jboss.,org.apache. jboss.aop.include org.jboss.test. jboss-junit-configuration weave build.testlog target/log jboss.mc.secure true no-weave test true ${project.build.directory}/surefire-reports/no-weave org/jboss/test/microcontainer/test/**/*TestCase.java org/jboss/test/microcontainer/beans/test/**/*TestCase.java org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java jboss-junit-configuration no_weave build.testlog target/log no-weave-secure test true ${project.build.directory}/surefire-reports/no-weave-secure org/jboss/test/microcontainer/test/**/*TestCase.java org/jboss/test/microcontainer/beans/test/**/*TestCase.java org/jboss/test/microcontainer/annotatedaop/test/**/*TestCase.java jboss-junit-configuration no_weave build.testlog target/log jboss.mc.secure true true always true true false org.jboss jboss-test ${version.org.jboss.test} compile junit junit ${version.junit} compile org.jboss.aop jboss-aop ant ant apache-xerces xml-apis javassist javassist org.jboss jboss-common-core org.jboss.logging jboss-logging-spi org.jboss.logging jboss-logging-log4j org.jboss.microcontainer jboss-container org.jboss.microcontainer jboss-dependency org.jboss.microcontainer jboss-kernel org.jboss.man jboss-managed true javassist javassist org.jboss.logging jboss-logging-log4j test junit junit test org.jboss.test jboss-test test org.jboss.microcontainer jboss-kernel test-jar test org.jboss.microcontainer jboss-dependency org.jboss jbossxb tests-weave aop.tests.all org.apache.maven.plugins maven-surefire-plugin weave false maven-surefire-report-plugin ${project.build.directory}/surefire-reports/weave surefire-report-weave tests-weave-secure aop.tests.all org.apache.maven.plugins maven-surefire-plugin weave-secure false maven-surefire-report-plugin ${project.build.directory}/surefire-reports/weave-secure surefire-report-weave-secure tests-no-weave aop.tests.all org.apache.maven.plugins maven-surefire-plugin no-weave false maven-surefire-report-plugin ${project.build.directory}/surefire-reports/no-weave surefire-report-no-weave tests-no-weave-secure aop.tests.all org.apache.maven.plugins maven-surefire-plugin no-weave-secure false maven-surefire-report-plugin ${project.build.directory}/surefire-reports/no-weave-secure surefire-report-no-weave-secure ant-tests-weave ant-tests-weave org.apache.maven.plugins maven-antrun-plugin 1.1 ant-tests-weave test run ant ant-junit ${version.ant.junit} junit junit ${version.junit} maven-surefire-report-plugin ${project.build.directory}/surefire-reports/ant-weave surefire-report-ant-weave ant-one-test-weave ant-one-test-weave org.apache.maven.plugins maven-antrun-plugin 1.1 ant-one-test-weave test run ant ant-junit ${version.ant.junit} junit junit ${version.junit} maven-surefire-report-plugin ${project.build.directory}/surefire-reports/ant-weave surefire-report-ant-weave ant-tests-weave-secure ant-tests-weave-secure maven-antrun-plugin ant-tests-weave-secure test run ant ant-junit ${version.ant.junit} junit junit ${version.junit} maven-surefire-report-plugin ${project.build.directory}/surefire-reports/ant-weave-secure surefire-report-ant-weave-secure libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/.cvsignore0000644000175000017500000000004310423676101024456 0ustar twernertwerneroutput build.log junit*.properties libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/0000755000175000017500000000000011620312211023235 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/0000755000175000017500000000000011620312205024217 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/0000755000175000017500000000000011620312205026231 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/0000755000175000017500000000000011620312205027020 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/0000755000175000017500000000000011620312205030140 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/0000755000175000017500000000000011620312205031117 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000145210774766014033377 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032210447261623033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployLifecycleCallbackDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000107110770516036033365 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/BeanNoDefaultCtorUsingParamTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000147710721416203033366 0ustar twernertwerner Kabir was here ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/LifecycleAopTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000570310774766014033402 0ustar twernertwerner @org.jboss.test.microcontainer.support.Configure @org.jboss.test.microcontainer.support.Create @org.jboss.test.microcontainer.support.Describe @org.jboss.test.microcontainer.support.Install @org.jboss.test.microcontainer.support.Instantiate @org.jboss.test.microcontainer.support.Start ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/DeployersInterceptedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000236710721416203033365 0ustar twernertwerner aop beans ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployLifecycleCallbackDependencyTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000044210770516036033366 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployAspectDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000071410770516036033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000171110774766014033375 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000030200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410452525647033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/SimpleAspectTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000166010721416203033360 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032210420664341033356 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JMXLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000431510774766014033400 0ustar twernertwerner @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="", exposedInterface=org.jboss.test.microcontainer.support.SimpleBean.class) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=NotBean1", exposedInterface=org.jboss.test.microcontainer.support.SimpleBeanImplMBean.class) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=DirectRegistrant", exposedInterface=org.jboss.test.microcontainer.support.JmxRegistrantDirectMBean.class,registerDirectly=true) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=NotDirectRegistrant", exposedInterface=org.jboss.test.microcontainer.support.JmxRegistrantDirectMBean.class,registerDirectly=false) ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000024410774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410454724546033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000137010774766014033376 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/IntroductionDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032210447274516033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000161510573546750033400 0ustar twernertwerner LifecycleCallback org.jboss.test.microcontainer.support.SimpleBeanImpl Configured ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000660610774766014033405 0ustar twernertwerner 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/MultipleLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000251110774766014033374 0ustar twernertwerner @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="", exposedInterface=org.jboss.test.microcontainer.support.SimpleBean.class) ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000221110774766014033371 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency") ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/DeployersInterceptedAspectManagerJMXTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000037011015560012033350 0ustar twernertwernertest.Permission.1=javax.management.MBeanPermission, *#*, getMBeanInfo,invoke,registerMBean,unregisterMBean test.Permission.2=javax.management.MBeanServerPermission, createMBeanServer test.Permission.3=javax.management.MBeanTrustPermission, register././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JMXLifecycleTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000037111015560012033351 0ustar twernertwernertest.Permission.1=javax.management.MBeanPermission, *#*, getMBeanInfo,invoke,registerMBean,unregisterMBean test.Permission.2=javax.management.MBeanServerPermission, createMBeanServer test.Permission.3=javax.management.MBeanTrustPermission, register ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000024410573546750033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/MetaDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000271710774766014033404 0ustar twernertwerner org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.Test 5 Bean 10 @org.jboss.test.microcontainer.support.Test Bean1 50 NoMetaDataBean ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000301010774766014033367 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.Containing(dependency=@org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1"), contained=@org.jboss.test.microcontainer.support.Contained(dependencies= {@org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2"), @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency3")})) @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/DeployersInterceptedAspectManagerJMXTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000404011041403066033352 0ustar twernertwerner ]]> aop beans ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000037111015560012033351 0ustar twernertwernertest.Permission.1=javax.management.MBeanPermission, *#*, getMBeanInfo,invoke,registerMBean,unregisterMBean test.Permission.2=javax.management.MBeanServerPermission, createMBeanServer test.Permission.3=javax.management.MBeanTrustPermission, register ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410454726744033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployLifecycleCallbackDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000111210770516036033361 0ustar twernertwerner ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000300210774766014033370 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.Containing(dependency=@org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1"), contained=@org.jboss.test.microcontainer.support.Contained(dependencies= {@org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2"), @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency3")})) @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000154510774766014033402 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JndiDecoratedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000333410774766014033400 0ustar twernertwerner java.naming.factory.initialorg.jboss.test.microcontainer.support.jndi.MockInitialContextFactory org.jboss.kernel.spi.dependency.KernelControllerContextAware @org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="beans/SimpleBean0", aliases={"beans/XmlAnnotatedSimpleBean0"}) bean0.prop1 bean1.prop1 ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000175610573546750033406 0ustar twernertwerner LifecycleCallback org.jboss.test.microcontainer.support.SimpleBeanImpl Configured ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/OverriddenClassLoaderTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000062011114023265033352 0ustar twernertwerner ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410454726744033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032210452465270033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032210420664341033356 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JMXDecorated-flawed.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000110010643605043033352 0ustar twernertwerner @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=FlawedRegistrant", exposedInterface=org.jboss.test.microcontainer.support.JmxRegistrant.class,registerDirectly=true) ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410454724546033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000573310774766014033405 0ustar twernertwerner org.jboss.aop.microcontainer.aspects.jmx.JMX org.jboss.kernel.spi.dependency.KernelControllerContextAware @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="", exposedInterface=org.jboss.test.microcontainer.support.SimpleBean.class) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=NotBean1", exposedInterface=org.jboss.test.microcontainer.support.SimpleBeanImplMBean.class) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=DirectRegistrant", exposedInterface=org.jboss.test.microcontainer.support.JmxRegistrantDirectMBean.class,registerDirectly=true) @org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:name=NotDirectRegistrant", exposedInterface=org.jboss.test.microcontainer.support.JmxRegistrantDirectMBean.class,registerDirectly=false) ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/MixinTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000225510721416203033361 0ustar twernertwerner org.jboss.test.microcontainer.support.SomeMixin org.jboss.test.microcontainer.support.SomeMixinImpl org.jboss.test.microcontainer.support.OtherMixin org.jboss.test.microcontainer.support.OtherMixinImpl @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/JndiLifeCycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000245110774766014033377 0ustar twernertwerner java.naming.factory.initialorg.jboss.test.microcontainer.support.jndi.MockInitialContextFactory @org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="beans/SimpleBean0", aliases={"beans/XmlAnnotatedSimpleBean0"}) bean0.prop1 bean1.prop1 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/ScopingAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000610411041411042033346 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") InterceptedAspect @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") execution(* $instanceof{org.jboss.test.microcontainer.support.SimpleBeanImpl}->*(..)) @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030410452465270033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000322010774766014033372 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency") @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency") ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/MultipleLifecycleTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000024711015560012033353 0ustar twernertwernertest.Permission.1=javax.management.MBeanPermission, *#*, getMBeanInfo,invoke,registerMBean test.Permission.2=javax.management.MBeanServerPermission, createMBeanServer ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000132110721416203033352 0ustar twernertwerner ././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032010454726744033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/IntroductionDependencyTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000224410774766014033377 0ustar twernertwerner org.jboss.test.microcontainer.support.MarkerInterface @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000030200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032010452525647033366 0ustar twernertwerner ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InitialLifecycleCallbackTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000135410774766014033400 0ustar twernertwerner Test123 ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032010452465270033361 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000130610721416203033355 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000133711024223001033346 0ustar twernertwerner @org.jboss.test.microcontainer.support.Marker ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/LifecycleDeploymentTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000633510774766014033404 0ustar twernertwerner @org.jboss.test.microcontainer.support.Configure @org.jboss.test.microcontainer.support.Create @org.jboss.test.microcontainer.support.Describe @org.jboss.test.microcontainer.support.Install @org.jboss.test.microcontainer.support.Instantiate @org.jboss.test.microcontainer.support.Start ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032010454724546033367 0ustar twernertwerner ././@LongLink0000000000000000000000000000030200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000715710774766014033407 0ustar twernertwerner 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency1") 10 @org.jboss.test.microcontainer.support.Test @org.jboss.test.microcontainer.support.TestAnnotationDependency(data="Dependency2") ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/OverriddenClassLoaderTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010711114026347033356 0ustar twernertwernertest.Permission.1=java.io.FilePermission, <>, write,delete ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000022210774766014033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployAspectDependencyTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000115210770516036033365 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/FieldAccessTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000215510774773372033405 0ustar twernertwerner foobar foobar foobar ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/MixinTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000024711015560012033353 0ustar twernertwernertest.Permission.1=javax.management.MBeanPermission, *#*, getMBeanInfo,invoke,registerMBean test.Permission.2=javax.management.MBeanServerPermission, createMBeanServer ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/NonDefaultMethodsLifecycleCallbackTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000141710774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UndeployAspectDependencyTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000044210770516036033366 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/test/UnwindLifeCycleTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001236110647401476033375 0ustar twernertwerner @org.jboss.test.microcontainer.support.Configure @org.jboss.test.microcontainer.support.Create @org.jboss.test.microcontainer.support.Describe @org.jboss.test.microcontainer.support.Install @org.jboss.test.microcontainer.support.Instantiate @org.jboss.test.microcontainer.support.Start @org.jboss.test.microcontainer.support.Error ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinExprBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000515711041411042033355 0ustar twernertwerner has(* *->method()) new org.jboss.test.microcontainer.beans.MixinImpl(this, "CUSTOM CONSTRUCTION") org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl org.jboss.test.microcontainer.beans.TestAspect execution(* $instanceof{org.jboss.test.microcontainer.beans.MixinInterface}->*(..)) advice ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010721416203033347 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectSimpleBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000334511041411042033352 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerInstanceAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000156511202060324033356 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleStackDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000274310774766014033403 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/PrecedenceDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000213010774766014033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000630211041411042033346 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestInterceptor execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000173610774766014033404 0ustar twernertwerner ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026610774766014033401 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/CFlowBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000513711041411042033353 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect CFlow false void org.jboss.test.microcontainer.beans.test.CFlowTest->notCallPOJO(..) true void org.jboss.test.microcontainer.beans.test.CFlowTest->callPOJO(..) execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) CFlow advice ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026310774766014033376 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/LightweightAspectDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000234710774766014033403 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030210774766014033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000213210774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainSimpleAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000635011005436645033371 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/UndeploySimpleAopTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000572511021241142033356 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026010774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000114710774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdviceBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000531511041411042033351 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect org.jboss.test.microcontainer.beans.TestInterceptor execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdviceAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000135610774766014033402 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DeclareAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000107310774766014033376 0ustar twernertwerner Error!!! Warning!!! Anon!!! ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DeclareDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000125510774766014033400 0ustar twernertwerner Error!!! Warning!!! Anon!!! ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinExprAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000175110774766014033401 0ustar twernertwerner new org.jboss.test.microcontainer.beans.MixinImpl(this, "CUSTOM CONSTRUCTION") org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerJoinpointAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000156611202060324033357 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NamedPointcutAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000121610774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/TypeDefDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000137510774766014033403 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000446611137570512033375 0ustar twernertwerner class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer}) false org.jboss.test.microcontainer.beans.AnnotationWithValueAspect execution(* @org.jboss.test.microcontainer.beans.AnnotationWithValue->*()) advice ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/PrecedenceBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000677611041411042033365 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestAspect advice execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionExprBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000430711041411042033351 0ustar twernertwerner has(* *->method()) org.jboss.test.microcontainer.beans.IntroductionInterface org.jboss.test.microcontainer.beans.TestAspect execution(* $instanceof{org.jboss.test.microcontainer.beans.IntroductionInterface}->*(..)) advice ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000147610774766014033405 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000726311041411042033355 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestInterceptor TestStack advice true true execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinClassesAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000156711005436645033376 0ustar twernertwerner org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainSimpleDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000710311005436645033366 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000160211121522672033357 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000226310776242271033374 0ustar twernertwerner clazz1 clazz2 default ctor method1 method2 ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000446511121522672033371 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.AspectFactoryWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency true execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..)) advice @org.jboss.test.microcontainer.beans.Annotation1 ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000315610774766014033402 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000172710774766014033404 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000027611121522672033365 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000334210721416203033357 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerClassJoinpointAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000157011202060324033352 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000331211041411042033344 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestInterceptor execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DeclareBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000300210774766014033370 0ustar twernertwerner DeclareError call(* org.acme.Foo->error(..)) Error!!! false DeclareWarning call(* org.acme.Foo->warning(..)) Warning!!! true Some-GUID-Generated-by-xml-layer call(* org.acme.Foo->anonymous(..)) Anon!!! false ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030510774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026510774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000133310774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/XmlLoadableDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000437111005412047033360 0ustar twernertwerner Here to check the parser still works hello true hello 12 hello 13 hi hi ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectSimpleDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000126410774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/CFlowAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000151010774766014033372 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000025411121522672033361 0ustar twernertwerner ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030710721416203033355 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030210721416203033350 0ustar twernertwerner ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/BeanMetaDataFactoryParserDeploymentTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000712011021261744033357 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerVmAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000155711202060324033357 0ustar twernertwerner ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000130410774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001457111041411042033355 0ustar twernertwerner PER_VM org.jboss.test.microcontainer.beans.PerVmAspect PER_CLASS org.jboss.test.microcontainer.beans.PerClassAspect PER_INSTANCE org.jboss.test.microcontainer.beans.PerInstanceAspect PER_JOINPOINT org.jboss.test.microcontainer.beans.PerJoinPointAspect PER_CLASS_JOINPOINT org.jboss.test.microcontainer.beans.PerClassJoinPointAspect execution(* org.jboss.test.microcontainer.beans.POJO*->*(..)) advice advice advice advice advice ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001735611041411042033361 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspect Factory$org.jboss.test.microcontainer.beans.TestInterceptorWithDependency org.jboss.test.microcontainer.beans.TestInterceptorWithDependency org.jboss.test.microcontainer.beans.TestInterceptor AspectStack advice true advice true InterceptorStack true true execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..)) execution(* @org.jboss.test.microcontainer.beans.Annotation2->*(..)) @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030210774766014033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/PrecedenceAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000210610774766014033374 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionClassesDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000162010774766014033374 0ustar twernertwerner org.jboss.test.microcontainer.beans.IntroductionInterface ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000171010774766014033374 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000131210774766014033372 0ustar twernertwerner ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000147211137570512033367 0ustar twernertwerner @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer}) ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DynamicCFlowAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000131010774766014033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/BeanMetaDataFactoryParserAopTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000572511021261744033370 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverrideBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000516111041411042033350 0ustar twernertwerner class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation1 false method(void org.jboss.test.microcontainer.beans.POJO->method()) @org.jboss.test.microcontainer.beans.Annotation2 false org.jboss.test.microcontainer.beans.TestAspect execution(* @org.jboss.test.microcontainer.beans.Annotation1->@org.jboss.test.microcontainer.beans.Annotation2(..)) advice ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverrideDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000215210774766014033375 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleStackAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000236110774766014033377 0ustar twernertwerner ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionClassesBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000434011041411042033346 0ustar twernertwerner org.jboss.test.microcontainer.beans.POJO org.jboss.test.microcontainer.beans.IntroductionInterface org.jboss.test.microcontainer.beans.TestAspect execution(* $instanceof{org.jboss.test.microcontainer.beans.IntroductionInterface}->*(..)) advice ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000172610774766014033403 0ustar twernertwerner PropertyA PropertyB ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionClassesAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000143610774766014033401 0ustar twernertwerner org.jboss.test.microcontainer.beans.IntroductionInterface ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyAopTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000414710774766014033403 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000556711041411042033362 0ustar twernertwerner PropertyA AspectA PropertyB AspectB execution(* org.jboss.test.microcontainer.beans.POJO->method()) advice execution(* org.jboss.test.microcontainer.beans.POJO->method(int)) advice ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026310774766014033376 0ustar twernertwerner ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026510774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/TypeDefBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000375311041411042033355 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect TypeDef class(org.jboss.test.microcontainer.beans.POJO) execution(* $typedef{TypeDef}->*(..)) advice ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainParentBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000724411037703124033366 0ustar twernertwerner Level1 true true true class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation1 false custom org.jboss.test.microcontainer.beans.TestMetaDataLoader Level2ParentFirst true true true class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation2 false Level2ParentLast false true true class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation2 false Level2Nada false false false ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinExprDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000213310774766014033374 0ustar twernertwerner new org.jboss.test.microcontainer.beans.MixinImpl(this, "CUSTOM CONSTRUCTION") org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030710774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinClassesDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000174511005436645033374 0ustar twernertwerner org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverrideAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000173010774766014033376 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionExprAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000141110774766014033372 0ustar twernertwerner org.jboss.test.microcontainer.beans.IntroductionInterface ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MixinClassesBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000500611041411042033346 0ustar twernertwerner org.jboss.test.microcontainer.beans.POJO org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl org.jboss.test.microcontainer.beans.TestAspect execution(* $instanceof{org.jboss.test.microcontainer.beans.MixinInterface}->*(..)) advice ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000166211137570512033370 0ustar twernertwerner @org.jboss.test.microcontainer.beans.AnnotationWithValue(integer=${integer}) ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010774766014033367 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000136111137570512033364 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000421511041411042033347 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030710721416203033355 0ustar twernertwerner ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030510774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleStackBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001377311041411042033360 0ustar twernertwerner true org.jboss.test.microcontainer.beans.SimpleAspectFactory org.jboss.test.microcontainer.beans.TestAspect true org.jboss.test.microcontainer.beans.SimpleInterceptorFactory org.jboss.test.microcontainer.beans.TestInterceptor TestStack advice true advice true TestStack true true execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000025610774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010721416203033347 0ustar twernertwerner ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/IntroductionExprDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000157310774766014033403 0ustar twernertwerner org.jboss.test.microcontainer.beans.IntroductionInterface ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000161610776242271033375 0ustar twernertwerner custom1 ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000431011041411042033343 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestInterceptorWithDependency org.jboss.test.microcontainer.beans.TestInterceptorWithDependency execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000244510776242271033376 0ustar twernertwerner clazz1 clazz2 default ctor method1 method2 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000145510774766014033402 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/LightweightAspectAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000216510774766014033401 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030210721416203033350 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000112610774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorSimpleDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000125010774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001102011041411042033337 0ustar twernertwerner Factory$org.jboss.test.microcontainer.beans.TestAspectWithDependency org.jboss.test.microcontainer.beans.TestAspectWithDependency" Factory$org.jboss.test.microcontainer.beans.TestInterceptorWithDependency org.jboss.test.microcontainer.beans.TestInterceptorWithDependency execution(* @org.jboss.test.microcontainer.beans.Annotation1->*(..)) advice execution(* @org.jboss.test.microcontainer.beans.Annotation2->*(..)) @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainSimpleBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000002755611041411042033364 0ustar twernertwerner AOPDomain class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation1 false class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation2 false has(* *->method()) MixinBinding new org.jboss.test.microcontainer.beans.MixinImpl(this, "CUSTOM CONSTRUCTION") org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestAspect advice NamedPointcut execution(* org.jboss.test.microcontainer.beans.POJO->*()) Prepare all(org.acme.POJO) DynamicCFlow org.jboss.test.microcontainer.beans.DynamicCFlowImpl CFlow false void org.jboss.test.microcontainer.beans.test.CFlowTest->notCallPOJO(..) true void org.jboss.test.microcontainer.beans.test.CFlowTest->callPOJO(..) TypeDef class(org.jboss.test.microcontainer.beans.POJO) This is only a test org.jboss.test.microcontainer.beans.TestAspectWithProperty org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestAspect TestStack advice true execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice org.jboss.test.microcontainer.beans.woven.test.ClassWithArray TestArrayBinding READ_WRITE custom org.jboss.test.microcontainer.beans.TestMetaDataLoader DeclareError call(* org.acme.Foo->error(..)) Error!!! false ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyTurnedOffAopTestCase#testLifecycleTurnedOff.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000324111205232155033355 0ustar twernertwerner @org.jboss.aop.microcontainer.annotations.DisableAOP({org.jboss.aop.microcontainer.annotations.DisabledType.LIFECYCLE}) @org.jboss.aop.microcontainer.annotations.DisableAOP({org.jboss.aop.microcontainer.annotations.DisabledType.LIFECYCLE}) ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NamedPointcutBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000376011041411042033353 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect NamedPointcut execution(* org.jboss.test.microcontainer.beans.POJO->*()) NamedPointcut advice ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/CFlowDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000167210774766014033403 0ustar twernertwerner ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyTurnedOffAopTestCase#testPointcutsTurnedOff.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000324111205232155033355 0ustar twernertwerner @org.jboss.aop.microcontainer.annotations.DisableAOP({org.jboss.aop.microcontainer.annotations.DisabledType.POINTCUTS}) @org.jboss.aop.microcontainer.annotations.DisableAOP({org.jboss.aop.microcontainer.annotations.DisabledType.POINTCUTS}) ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000660611041411042033355 0ustar twernertwerner true org.jboss.test.microcontainer.beans.SimpleAspectFactory org.jboss.test.microcontainer.beans.TestAspect TestStack advice true advice true execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000127310774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000346211041411042033352 0ustar twernertwerner true org.jboss.test.microcontainer.beans.SimpleInterceptorFactory execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/UndeploySimpleBeansTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000002650311041411042033353 0ustar twernertwerner class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation1 false class(org.jboss.test.microcontainer.beans.POJO) @org.jboss.test.microcontainer.beans.Annotation2 false has(* *->method()) MixinBinding new org.jboss.test.microcontainer.beans.MixinImpl(this, "CUSTOM CONSTRUCTION") org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestAspect advice NamedPointcut execution(* org.jboss.test.microcontainer.beans.POJO->*()) Prepare all(org.acme.POJO) DynamicCFlow org.jboss.test.microcontainer.beans.DynamicCFlowImpl CFlow false void org.jboss.test.microcontainer.beans.test.CFlowTest->notCallPOJO(..) true void org.jboss.test.microcontainer.beans.test.CFlowTest->callPOJO(..) TypeDef class(org.jboss.test.microcontainer.beans.POJO) This is only a test org.jboss.test.microcontainer.beans.TestAspectWithProperty org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.TestAspect TestStack advice true execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice org.jboss.test.microcontainer.beans.woven.test.ClassWithArray TestArrayBinding READ_WRITE custom org.jboss.test.microcontainer.beans.TestMetaDataLoader DeclareError call(* org.acme.Foo->error(..)) Error!!! false ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000027611121522672033365 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DynamicCFlowDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000147210774766014033401 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainParentDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000316311037703124033362 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NamedPointcutDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000140010774766014033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/UndeploySimpleDeploymentTestCaseNotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000712011021241142033345 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation1 org.jboss.test.microcontainer.beans.MixinInterface org.jboss.test.microcontainer.beans.MixinImpl This is only a test custom1 Error!!! ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ThrowawayMetaDataTest.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000137210776242271033374 0ustar twernertwerner One Two One Two Three ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000223310774766014033375 0ustar twernertwerner PropertyA PropertyB ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000151410774766014033376 0ustar twernertwerner ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectWithDependencyTurnedOffAopTestCase#testAllAopTurnedOff.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000303311205232155033354 0ustar twernertwerner @org.jboss.aop.microcontainer.annotations.DisableAOP @org.jboss.aop.microcontainer.annotations.DisableAOP ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000515211041411042033350 0ustar twernertwerner custom org.jboss.test.microcontainer.beans.TestMetaDataLoader org.jboss.test.microcontainer.beans.TestClassMetaDataAspect execution(org.jboss.test.microcontainer.beans.POJO->new(..)) OR execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerClassAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000156211202060324033353 0ustar twernertwerner ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010721416203033347 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000145211121522672033362 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdviceDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000154010774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DynamicCFlowBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000413011041411042033343 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect DynamicCFlow org.jboss.test.microcontainer.beans.DynamicCFlowImpl execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) DynamicCFlow advice ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectSimpleAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000114210774766014033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000542111041411042033347 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestClassMetaDataAspect execution(org.jboss.test.microcontainer.beans.POJO->new(..)) OR execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010774766014033367 0ustar twernertwerner ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000340010774766014033372 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000116510774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyDeploymentTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000203510774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000351111041411042033345 0ustar twernertwerner true org.jboss.test.microcontainer.beans.SimpleAspectFactory execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) advice ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/LightweightAspectBeanTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000001065611041411042033355 0ustar twernertwerner org.jboss.test.microcontainer.beans.TestAspect org.jboss.test.microcontainer.beans.LightweightAspect execution(* org.jboss.test.microcontainer.beans.POJO->*(..)) before BEFORE advice after AFTER throwing THROWING finally FINALLY ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/TypeDefAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000121310774766014033372 0ustar twernertwerner ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/TESTS.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000344210721416203033360 0ustar twernertwerner*aspect/advice AspectSimpleBeansTestCase *interceptor InterceptorSimpleBeansTestCase *interceptor w/ dependency InterceptorWithDependencyBeansTestCase InterceptorWithDependencyBeansDifferentOrderTestCase *aspect/advice with dependency AspectWithDependencyBeansTestCase AspectWithDependencyBeansDifferentOrderTestCase *multiple aspects/interceptors MultipleAdviceBeansTestCase.java *multiple aspects/interceptors w/ dependency MultipleAdvicesWithSingleDependencyBeansTestCase MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase MultipleAdvicesWithMultipleDependencyBeansTestCase MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase *interceptor/aspect factory AspectFactorySimpleBeansTestCase InterceptorFactorySimpleBeansTestCase * scoped aspects/interceptors (PER_CLASS, PER_VM etc.) ScopedAspectBeansTestCase *** SOME PROBLEMS WITH testPerClassJoinPoint() if any of the other tests are enabled?!?!?! *interceptor/aspect factory with dependency *named aspects/interceptors NonStandardNameAspectBeansTestCase *** Should maybe do one for beans with depenencies as well *cflow in bindings CFlowBeansTestCase *aspects/interceptors with attributes *** Need tests for the "magically" inserted advisor, instance advisor etc. *interceptor stacks StackBeansTestCase MultipleStackBeansTestCase *interceptor stacks where entries have dependencies StackWithSingleDependencyBeansTestCase StackWithSingleDependencyBeansDifferentOrderTestCase StackWithMultipleDependencyBeansTestCase StackWithMultipleDependencyBeansDifferentOrderTestCase *binding deployed seperately from aspect definition *domains *annotation overrides AnnotationOverrideBeansTestCase *typedefs TypeDefBeansTestCase *Named pointcuts NamedPointcutBeansTestCase././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyDeploymentTestCaseNotAutomatic2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000457110774766014033404 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031010721416203033347 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000204010776242271033365 0ustar twernertwerner custom1 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/DomainParentAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000274111037703124033363 0ustar twernertwerner @org.jboss.test.microcontainer.beans.Annotation1 @org.jboss.test.microcontainer.beans.Annotation2 @org.jboss.test.microcontainer.beans.Annotation2 ././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyDeploymentTestCaseNotAutomatic0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030710774766014033375 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/XmlLoadableAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000374711005412047033366 0ustar twernertwerner Here to check the parser still works hello true hello 12 hello 13 hi hi ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000026610774766014033401 0ustar twernertwerner ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/ArrayAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000170510774766014033400 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/PrepareBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000122510722621434033362 0ustar twernertwerner Prepare all(org.jboss.test.microcontainer.beans.POJO) ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/PrepareDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000072010774766014033374 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/ArrayDeploymentTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000216710774766014033403 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/PrepareAopTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000063610774766014033402 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/beans/woven/test/ArrayBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000657211041411042033357 0ustar twernertwerner org.jboss.test.microcontainer.beans.woven.test.TestArrayAspect org.jboss.test.microcontainer.beans.TestInterceptor org.jboss.test.microcontainer.beans.woven.test.ClassWithArray Prepare field(* org.jboss.test.microcontainer.beans.woven.test.ClassWithArray->*) READ_WRITE advice ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000123510432122672033361 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000074710432325027033367 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildAdvisedAndProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000153310446532301033361 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedNoInstanceDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030110431364452033355 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildNotAdvisedTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006410432122672033360 0ustar twernertwerner ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BasePreparedChildAdvisedAndProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000166210446532301033364 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildAdvisedAndProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000126710432310570033362 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedNoInstanceDataTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006310431364452033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/AdvisedNoInstanceDataTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000034310431364452033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BasePreparedChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildNotAdvisedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000041410432122672033357 0ustar twernertwerner ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000110310647401476033365 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006310431364452033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildAdvisedAndProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000126110432310570033354 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000124410432152725033363 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildAdvisedAndProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000125210432122672033360 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/AdvisedInstanceMetaDataContextTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000034310431364452033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildProxyTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000125210432152725033362 0ustar twernertwerner org.jboss.test.microcontainer.matrix.ChildInterface ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101010647401476033362 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/AdvisedNoInstanceDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030110431364452033355 0ustar twernertwerner ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/mc/test/AdvisedInstanceMetaDataContextTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000110110647401476033363 0ustar twernertwerner @org.jboss.test.microcontainer.support.Test 10 @org.jboss.test.microcontainer.support.Test ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedNoInstanceDataTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceIntroductionsTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedNoInstanceDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006310431364452033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceIntroductionsTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006310431364452033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceIntroductionsTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000075710431407733033374 0ustar twernertwerner ././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000006310431364452033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedNoInstanceDataTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceSimpleMetaDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000034310431364452033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceIntroductionsTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceMixinTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceMixinTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000034310431407733033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/BaseForceProxyChildAdvisedAndProxyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000073710433141071033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceSimpleMetaDataTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedNoInstanceDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000034310431364452033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/matrix/proxyfactory/test/BaseForceProxyChildAdvisedAndProxyTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000010211016776227033363 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, setSecurityManager ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312205033347 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000031510420664341033360 0ustar twernertwerner ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedIntroducedAdvisorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000157010420664341033364 0ustar twernertwerner org.jboss.test.microcontainer.advisor.test.TestIntroductionInterface ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000106310647401476033372 0ustar twernertwerner 1 One 9999 Should be ignored since singleton aspect stops creation of new instance ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000055510433576542033377 0ustar twernertwerner ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101110434320211033340 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.Singleton ././@LongLink0000000000000000000000000000027700000000000011573 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000055510434320211033354 0ustar twernertwerner ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000113410420664341033360 0ustar twernertwerner org.jboss.test.microcontainer.advisor.test.TestIntroductionInterface ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorConstructorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000101110433576542033363 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.Singleton ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000174610774766014033405 0ustar twernertwerner org.jboss.test.microcontainer.advisor.test.AnnotationWithValue ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000077710430176654033402 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.AnnotationWithValue(value=10) @org.jboss.test.microcontainer.advisor.test.AnnotationWithValue(value=50) ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000131210647401476033367 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.Singleton @org.jboss.test.microcontainer.advisor.test.Singleton @org.jboss.test.microcontainer.advisor.test.Singleton ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000144110721416203033355 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.TestAnnotation ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000045610647401476033377 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.TestIntroductionAnnotation ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedIntroducedAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000045610647401476033377 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.TestIntroductionAnnotation ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedInstanceAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000160010721416203033352 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.TestAnnotation ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorConstructorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000067210647401476033377 0ustar twernertwerner ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000051610420664341033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedInstanceAdvisorTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000052010420664341033356 0ustar twernertwerner ././@LongLink0000000000000000000000000000027300000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000133310647401476033372 0ustar twernertwerner @org.jboss.test.microcontainer.advisor.test.Singleton 1 One @org.jboss.test.microcontainer.advisor.test.Singleton 9999 Should be ignored since singleton aspect stops creation of new instance ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedNoAdvisorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000032010420664341033354 0ustar twernertwerner ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000043411041411435033354 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000040511041411435033352 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/DefaultBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000001511041411435033347 0ustar twernertwernerTypedefAspect././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000013411041411435033351 0ustar twernertwernerPrecedence1Aspect Precedence2Interceptor Precedence3Aspect Precedence4Interceptor Precedence././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000001711041411435033351 0ustar twernertwernerTestInterceptor././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000002211041411435033345 0ustar twernertwernerIntroductionAspect././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000001211041411435033344 0ustar twernertwernerTestAspect././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000004311041411435033350 0ustar twernertwernerDynamicCFlowAspect DynamicCFlowImpl././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000001511041411435033347 0ustar twernertwernerDeclareAspect././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000004411041411435033351 0ustar twernertwernerTestCFlowAspect TestCFlowInterceptor././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000043411041411435033354 0ustar twernertwerner ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000002311041411435033346 0ustar twernertwernerNamedPointcutAspect././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000755000175000017500000000000011620312207033351 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000003411041411435033350 0ustar twernertwernerAnnotationIntroductionAspect././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase-classes.txtlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000001511041411435033347 0ustar twernertwernerPrepareAspect././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/microcontai0000644000175000017500000000030111041411435033345 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/0000755000175000017500000000000011620312205031676 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/0000755000175000017500000000000011620312205033027 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/JunitSmokeTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/J0000644000175000017500000000044310420664341033154 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/MicrocontainerJunitSmokeTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/M0000644000175000017500000000122610721416203033153 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/MicrocontainerJunitSmokeTestCase-aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/resources/org/jboss/test/aop/junit/M0000644000175000017500000000007010420664341033153 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/0000755000175000017500000000000011620312176025147 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/0000755000175000017500000000000011620312176025736 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/0000755000175000017500000000000011620312176027056 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/0000755000175000017500000000000011620312177030036 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/0000755000175000017500000000000011620312204033041 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000755000175000017500000000000011620312200033221 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/AnnotationsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001134211216157032033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.aop.microcontainer.annotations.DisabledType; /** * Annotations test case. * * @author Ales Justin */ public class AnnotationsTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(AnnotationsTestCase.class); } public AnnotationsTestCase(String name) { super(name); } public void testDisabledType() throws Exception { DisabledType all = DisabledType.ALL; assertTrue(all.isDisabled(DisabledType.ALL)); assertTrue(all.isDisabled(DisabledType.LIFECYCLE)); assertTrue(all.isDisabled(DisabledType.POINTCUTS)); assertFalse(all.isEnabled(DisabledType.ALL)); assertFalse(all.isEnabled(DisabledType.LIFECYCLE)); assertFalse(all.isEnabled(DisabledType.POINTCUTS)); DisabledType lifecycle = DisabledType.LIFECYCLE; assertFalse(lifecycle.isDisabled(DisabledType.ALL)); assertTrue(lifecycle.isDisabled(DisabledType.LIFECYCLE)); assertFalse(lifecycle.isDisabled(DisabledType.POINTCUTS)); assertTrue(lifecycle.isEnabled(DisabledType.ALL)); assertFalse(lifecycle.isEnabled(DisabledType.LIFECYCLE)); assertTrue(lifecycle.isEnabled(DisabledType.POINTCUTS)); DisabledType pointcut = DisabledType.POINTCUTS; assertFalse(pointcut.isDisabled(DisabledType.ALL)); assertFalse(pointcut.isDisabled(DisabledType.LIFECYCLE)); assertTrue(pointcut.isDisabled(DisabledType.POINTCUTS)); assertTrue(pointcut.isEnabled(DisabledType.ALL)); assertTrue(pointcut.isEnabled(DisabledType.LIFECYCLE)); assertFalse(pointcut.isEnabled(DisabledType.POINTCUTS)); DisabledType[] three = {all, lifecycle, pointcut}; assertTrue(DisabledType.isDisabled(three, DisabledType.ALL)); assertTrue(DisabledType.isDisabled(three, DisabledType.LIFECYCLE)); assertTrue(DisabledType.isDisabled(three, DisabledType.POINTCUTS)); assertFalse(DisabledType.isEnabled(three, DisabledType.ALL)); assertFalse(DisabledType.isEnabled(three, DisabledType.LIFECYCLE)); assertFalse(DisabledType.isEnabled(three, DisabledType.POINTCUTS)); DisabledType[] two = {all, lifecycle}; assertTrue(DisabledType.isDisabled(two, DisabledType.ALL)); assertTrue(DisabledType.isDisabled(two, DisabledType.LIFECYCLE)); assertTrue(DisabledType.isDisabled(two, DisabledType.POINTCUTS)); assertFalse(DisabledType.isEnabled(two, DisabledType.ALL)); assertFalse(DisabledType.isEnabled(two, DisabledType.LIFECYCLE)); assertFalse(DisabledType.isEnabled(two, DisabledType.POINTCUTS)); two = new DisabledType[]{all, pointcut}; assertTrue(DisabledType.isDisabled(two, DisabledType.ALL)); assertTrue(DisabledType.isDisabled(two, DisabledType.LIFECYCLE)); assertTrue(DisabledType.isDisabled(two, DisabledType.POINTCUTS)); assertFalse(DisabledType.isEnabled(two, DisabledType.ALL)); assertFalse(DisabledType.isEnabled(two, DisabledType.LIFECYCLE)); assertFalse(DisabledType.isEnabled(two, DisabledType.POINTCUTS)); two = new DisabledType[]{lifecycle, pointcut}; assertFalse(DisabledType.isDisabled(two, DisabledType.ALL)); assertTrue(DisabledType.isDisabled(two, DisabledType.LIFECYCLE)); assertTrue(DisabledType.isDisabled(two, DisabledType.POINTCUTS)); assertTrue(DisabledType.isEnabled(two, DisabledType.ALL)); assertFalse(DisabledType.isEnabled(two, DisabledType.LIFECYCLE)); assertFalse(DisabledType.isEnabled(two, DisabledType.POINTCUTS)); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/UndeployLifecycleCallbackDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001011610764007431033241 0ustar twernertwernerpackage org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleBeanImpl; import org.jboss.test.microcontainer.support.SimpleLifecycleCallback; import org.jboss.test.microcontainer.support.SimpleLifecycleCallback.Handled; public class UndeployLifecycleCallbackDependencyTestCase extends AOPMicrocontainerTest { public UndeployLifecycleCallbackDependencyTestCase(String name) { super(name); } public static Test suite() { return suite(UndeployLifecycleCallbackDependencyTestCase.class); } /** * Validate that the * @throws Throwable for any error */ public void testUndeployAndRedeploy() throws Throwable { //Deploy first aspect deploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic0.xml"); try { boolean deployedAspect = false; //Deploy second aspect deploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic1.xml"); try { SimpleLifecycleCallback.clear(); assertEquals(0, SimpleLifecycleCallback.interceptions.size()); //Deploy bean intercepted by both aspects deploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic2.xml"); try { SimpleBeanImpl bean = (SimpleBeanImpl)getBean("Intercepted"); assertNotNull(bean); assertEquals(2, SimpleLifecycleCallback.interceptions.size()); assertTrue(hasExpectedInterception("Intercepted", ControllerState.CONFIGURED)); assertTrue(hasExpectedInterception("Intercepted", ControllerState.START)); SimpleLifecycleCallback.clear(); ControllerContext ctx = getControllerContext("Intercepted"); Controller controller = ctx.getController(); //Move the bean intercepted to pre-install state controller.change(ctx, ControllerState.PRE_INSTALL); assertEquals(2, SimpleLifecycleCallback.interceptions.size()); assertTrue(hasExpectedInterception("Intercepted", ControllerState.CONFIGURED)); assertTrue(hasExpectedInterception("Intercepted", ControllerState.START)); //Undeploy the second aspect undeploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic1.xml"); //Move the bean back to the installed state controller.change(ctx, ControllerState.INSTALLED); bean = (SimpleBeanImpl)getBean("Intercepted"); // SimpleInterceptor1.invoked = false; // SimpleInterceptor2.invoked = false; // bean.someMethod(); // assertTrue(SimpleInterceptor1.invoked); // assertFalse(SimpleInterceptor2.invoked); } finally { undeploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic2.xml"); } } finally { if (deployedAspect) { undeploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic1.xml"); } } } finally { undeploy("UndeployLifecycleCallbackDependencyTestCaseNotAutomatic0.xml"); } } private boolean hasExpectedInterception(String tgt, ControllerState state) { for (Handled handled : SimpleLifecycleCallback.interceptions) { if (handled.contextName.equals(tgt) && handled.toState.equals(state)) { return true; } } return false; } // // private void getAssertUninstalledLifecycleCallback(String callbackName) // { // InstallUninstallLifecycleCallback callback = (InstallUninstallLifecycleCallback)getBean(callbackName); // assertTrue(callback.isUninstalledContext()); // } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000003457010774766014033265 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.LifecycleCallbackWithBeanDependency; import org.jboss.test.microcontainer.support.SimpleBean; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class InitialLifecycleCallbackWithDependencyTest extends AOPMicrocontainerTest { public InitialLifecycleCallbackWithDependencyTest(String name) { super(name); } public void testLifecycleInterceptionsWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Object dependency = getCheckBeanExists("Dependency"); assertNotNull(dependency); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile1()); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile1()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } finally { undeploy(getFile0()); } } public void testLifecycleInterceptionsWithDependencyWrongOrder() throws Exception { deploy(getFile1()); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile0()); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile0()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } } finally { undeploy(getFile1()); } } public void testLifecycleInterceptionsWithDependencyRedeploy() throws Exception { deploy(getFile1()); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile0()); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile0()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile0()); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue("Should not be caching the lifecycle's callback across rebinding", dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile0()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } } finally { undeploy(getFile1()); } } public void testLifecycleInterceptionsWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Object dependency = getCheckBeanExists("Dependency"); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile1()); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue(dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile1()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } Object dependency2 = getCheckBeanExists("Dependency"); assertTrue(dependency == dependency2); LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy(getFile1()); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue(dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy(getFile1()); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } finally { undeploy(getFile0()); } } public Object getCheckBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); return bean; } protected abstract String getFile0(); protected abstract String getFile1(); } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/MultipleLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000450610760776332033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import javax.management.MBeanInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanServer; import javax.management.ObjectName; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleLifecycleCallback; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ public class MultipleLifecycleTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(MultipleLifecycleTestCase.class); } public MultipleLifecycleTestCase(String name) { super(name); } public void testBean() throws Exception { MBeanServer server = (MBeanServer) getBean("MBeanServer"); assertNotNull(server); ObjectName name = new ObjectName("test:name='Bean'"); MBeanInfo info = server.getMBeanInfo(name); assertNotNull(info); MBeanOperationInfo[] ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someMethod", ops[0].getName()); assertNotNull(SimpleLifecycleCallback.interceptions); assertEquals(1, SimpleLifecycleCallback.interceptions.size()); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/OverriddenClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001307011114756640033246 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; import junit.framework.Test; import org.jboss.aop.advice.AspectDefinition; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.advice.AspectFactoryWithClassLoader; import org.jboss.aop.microcontainer.beans.Aspect; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.ParentLastURLClassLoader; import org.jboss.test.microcontainer.support.TestAspect; /** * Checks that an aspect can have its classloader overridden * * @author Kabir Khan */ public class OverriddenClassLoaderTestCase extends AOPMicrocontainerTest { public OverriddenClassLoaderTestCase(String name) { super(name); } public static Test suite() { return suite(OverriddenClassLoaderTestCase.class); } public void testOverriddenLoader() throws Exception { ClassLoader loader = createParentLastURLClassLoader(); Class clazz = loader.loadClass(TestAspect.class.getName()); assertNotSame(TestAspect.class, clazz); assertSame(loader, clazz.getClassLoader()); Aspect aspect = assertInstanceOf(getBean("Aspect"), Aspect.class, false); AspectDefinition def = aspect.getDefinition(); AspectFactory factory = def.getFactory(); Object global = factory.createPerVM(); assertSame(getClass().getClassLoader(), global.getClass().getClassLoader()); AspectFactoryWithClassLoader factoryCl = assertInstanceOf(factory, AspectFactoryWithClassLoader.class); factoryCl.pushScopedClassLoader(loader); try { Object scoped = factory.createPerVM(); ClassLoader scopedLoader = scoped.getClass().getClassLoader(); assertSame(loader, scopedLoader); } finally { factoryCl.popScopedClassLoader(); } } private ClassLoader createParentLastURLClassLoader() throws Exception { File jarFile = createJar(); URL jarUrl = jarFile.toURL(); return new ParentLastURLClassLoader(new URL[] {jarUrl}, getClass().getClassLoader()); } private File createJar() throws Exception { String resource = TestAspect.class.getName().replace('.', '/') + ".class"; URL url = getClass().getClassLoader().getResource(resource); assertNotNull(resource + " not found.", url); File classFile = new File(url.toURI()); // File jarFile = new File("test-overridden-classloader.jar"); File jarFile = createTempFile("test-overridden-classloader", "jar"); jarFile.deleteOnExit(); if (jarFile.exists()) { assertTrue(jarFile.delete()); } JarOutputStream out = null; try { out = new JarOutputStream(new FileOutputStream(jarFile), new Manifest()); JarEntry entry = new JarEntry(resource); out.putNextEntry(entry); FileInputStream in = null; try { in = new FileInputStream(classFile); byte[] buf = new byte[200000]; while(true) { int i = in.read(buf, 0, buf.length); if (i <=0) { break; } out.write(buf, 0, i); } } finally { in.close(); } } finally { out.close(); } getLog().debug("===> Created jar " + jarFile.getAbsolutePath()); return jarFile; } private File createTempFile(final String prefix, final String suffix) throws Exception { if (System.getSecurityManager() == null) return File.createTempFile(prefix, suffix); else { try { return AccessController.doPrivileged(new PrivilegedExceptionAction() { public File run() throws Exception { return File.createTempFile(prefix, suffix); } }); } catch (PrivilegedActionException e) { throw e.getException(); } } } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/DeployersInterceptedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000741710760776332033264 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.deployers.DeployerAspects; import org.jboss.test.microcontainer.support.deployers.IMainDeployer; import org.jboss.test.microcontainer.support.deployers.SampleDeployer; import org.jboss.test.microcontainer.support.deployers.IDeployer.IDeployerMethod; /** * Tests of deployer/main deployer type of aspects. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class DeployersInterceptedTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(DeployersInterceptedTestCase.class); } public DeployersInterceptedTestCase(String name) { super(name); } public void testBean() throws Exception { IMainDeployer md = (IMainDeployer) getBean("MainDeployer"); assertNotNull(md); assertEquals("2 deployers", 2, md.getDeployers().size()); md.addDeployment("thing.xar"); md.process(); HashSet interceptedCalled = DeployerAspects.getCalled(); SampleDeployer d1 = (SampleDeployer) getBean("SampleDeployer1"); SampleDeployer d2 = (SampleDeployer) getBean("SampleDeployer2"); assertTrue("SampleDeployer1.prepareDeploy", d1.getCalled().contains(IDeployerMethod.prepareDeploy)); assertTrue("SampleDeployer1.commitDeploy", d1.getCalled().contains(IDeployerMethod.commitDeploy)); assertTrue("SampleDeployer2.prepareDeploy", d2.getCalled().contains(IDeployerMethod.prepareDeploy)); assertTrue("SampleDeployer2.commitDeploy", d2.getCalled().contains(IDeployerMethod.commitDeploy)); assertTrue("DeployerAspects.prepareDeploy", interceptedCalled.contains(IDeployerMethod.prepareDeploy)); assertTrue("DeployerAspects.commitDeploy", interceptedCalled.contains(IDeployerMethod.commitDeploy)); md.removeDeployment("thing.xar"); md.process(); assertTrue("SampleDeployer1.prepareUndeploy", d1.getCalled().contains(IDeployerMethod.prepareUndeploy)); assertTrue("SampleDeployer1.commitUndeploy", d1.getCalled().contains(IDeployerMethod.commitUndeploy)); assertTrue("SampleDeployer2.prepareUndeploy", d2.getCalled().contains(IDeployerMethod.prepareUndeploy)); assertTrue("SampleDeployer2.commitUndeploy", d2.getCalled().contains(IDeployerMethod.commitUndeploy)); assertTrue("DeployerAspects.prepareUndeploy", interceptedCalled.contains(IDeployerMethod.prepareUndeploy)); assertTrue("DeployerAspects.commitUndeploy", interceptedCalled.contains(IDeployerMethod.commitUndeploy)); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/BeanNoDefaultCtorUsingParamTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000375510760776332033265 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.BeanNoDefaultCtorUsingParam; import org.jboss.test.microcontainer.support.CalledInterceptor; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanNoDefaultCtorUsingParamTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(BeanNoDefaultCtorUsingParamTestCase.class); } public BeanNoDefaultCtorUsingParamTestCase(String name) { super(name); } public void testIntercepted() { BeanNoDefaultCtorUsingParam bean = (BeanNoDefaultCtorUsingParam) getBean("Bean"); CalledInterceptor.intercepted = false; assertEquals(14, bean.getLength()); assertTrue("Should have invoked the CalledInterceptor", CalledInterceptor.intercepted); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/JndiDecoratedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000507710760776332033264 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.jndi.SimpleBean; import org.jboss.test.microcontainer.support.jndi.SimpleBeanAnnotatedImpl; public class JndiDecoratedTestCase extends AOPMicrocontainerTest { public JndiDecoratedTestCase(String name) { super(name); } public static Test suite() { return suite(JndiDecoratedTestCase.class); } /** * Validate that the * @throws Exception */ public void testJndi() throws Exception { super.enableTrace("org.jboss"); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.test.microcontainer.support.jndi.MockInitialContextFactory"); InitialContext ctx = new InitialContext(env); SimpleBean bean0 = (SimpleBean) ctx.lookup("beans/SimpleBean0"); assertNotNull(bean0); assertEquals("bean0.prop1", bean0.getProp1()); SimpleBean alias0 = (SimpleBean) ctx.lookup("beans/XmlAnnotatedSimpleBean0"); assertNotNull(alias0); assertEquals("bean0.prop1", alias0.getProp1()); SimpleBeanAnnotatedImpl bean1 = (SimpleBeanAnnotatedImpl) ctx.lookup("beans/SimpleBean1"); assertEquals("bean1.prop1", bean1.getProp1()); SimpleBean alias1 = (SimpleBean) ctx.lookup("beans/AnnotatedSimpleBean1"); assertNotNull(alias1); assertEquals("bean1.prop1", alias1.getProp1()); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/ScopingAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000547410760776332033265 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate; import org.jboss.test.aop.junit.ScopingAOPMicrocontainerTestDelegate; import org.jboss.test.microcontainer.support.CalledInterceptor; import org.jboss.test.microcontainer.support.SimpleBean; /** * Test adding aspects to scoped beans. * * @author Ales Justin */ public class ScopingAopTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(ScopingAopTestCase.class); } public ScopingAopTestCase(String name) { super(name); } /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { String property = System.getProperty("jboss.mc.secure", "false"); boolean enableSecurity = Boolean.valueOf(property); AOPMicrocontainerTestDelegate delegate = new ScopingAOPMicrocontainerTestDelegate(clazz); delegate.enableSecurity = enableSecurity; return delegate; } public void testScopingWithAop() throws Exception { SimpleBean simple1 = (SimpleBean)getBean("simple1"); assertNotNull(simple1); CalledInterceptor.intercepted = false; simple1.someMethod(); assertTrue(CalledInterceptor.intercepted); SimpleBean simple2 = (SimpleBean)getBean("simple2"); assertNotNull(simple2); CalledInterceptor.intercepted = false; simple2.someMethod(); assertFalse(CalledInterceptor.intercepted); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/IntroductionDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001625010760776332033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithDependency; import org.jboss.test.microcontainer.support.MarkerInterface; import org.jboss.test.microcontainer.support.SimpleBean; public class IntroductionDependencyTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(IntroductionDependencyTestCase.class); } public IntroductionDependencyTestCase(String name) { super(name); } public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); try { validate(); checkPlainBean(); checkInterceptedBean(dependency); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } checkPlainBean(); bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); deploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); checkInterceptedBean(dependency); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); } checkPlainBean(); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); try { try { getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } checkPlainBean(); deploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); checkInterceptedBean(dependency); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); } try { getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } checkPlainBean(); deploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); checkInterceptedBean(dependency); checkPlainBean(); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); } checkPlainBean(); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); try { validate(); checkInterceptedBean(dependency); checkPlainBean(); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); } dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); try { checkInterceptedBean(dependency); checkPlainBean(); } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml"); } } private void checkInterceptedBean(Object dependency) { SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue(MarkerInterface.class.isAssignableFrom(bean.getClass())); InterceptorWithDependency.intercepted = null; bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } private void checkPlainBean() { SimpleBean bean = (SimpleBean) getBean("Plain"); assertNotNull(bean); assertFalse(MarkerInterface.class.isAssignableFrom(bean.getClass())); InterceptorWithDependency.intercepted = null; bean.someMethod(); assertNull(InterceptorWithDependency.intercepted); } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/SimpleAspectTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000444710760776332033264 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleBeanImpl; import org.jboss.test.microcontainer.support.TestAspect; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ public class SimpleAspectTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(SimpleAspectTestCase.class); } public SimpleAspectTestCase(String name) { super(name); } public void testIntercepted() { SimpleBeanImpl bean = (SimpleBeanImpl) getBean("Intercepted"); assertFalse(TestAspect.fooCalled); assertFalse(TestAspect.barCalled); bean.someMethod(); assertTrue("TestAspect.foo not called", TestAspect.fooCalled); assertFalse("TestAspect.bar was called", TestAspect.barCalled); TestAspect.fooCalled = false; assertFalse(TestAspect.fooCalled); assertFalse(TestAspect.barCalled); bean.someOtherMethod(); assertFalse("TestAspect.foo was called", TestAspect.fooCalled); assertTrue("TestAspect.bar was not called", TestAspect.barCalled); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithAnnotationDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000002336410760776332033263 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithAnnotationDependency; import org.jboss.test.microcontainer.support.SimpleBean; import org.jboss.test.microcontainer.support.SimpleBeanImpl; public class InterceptorWithAnnotationDependencyTestCase extends AOPMicrocontainerTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithAnnotationDependencyTestCase.class); } public InterceptorWithAnnotationDependencyTestCase(String name) { super(name); } public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception { deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); try { validate(); checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); //No way to annotate methods via xml yet //checkInterceptedAndInjected("MethodIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithAnnotationDependencyWrongOrder() throws Exception { deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkNotInstalledAndNotDescribed("Intercepted"); checkNotInstalledAndNotDescribed("AnnotatedIntercepted"); checkNotInstalledAndNotDescribed("MethodIntercepted"); checkNotInstalledAndNotDescribed("MethodAnnotatedIntercepted"); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); //No way to annotate methods via xml yet //checkInterceptedAndInjected("MethodIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithAnnotationDependencyRedeploy() throws Exception { deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); checkNotInstalledAndDescribed("MethodIntercepted"); checkNotInstalledAndDescribed("MethodAnnotatedIntercepted"); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); } checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); checkNotInstalledAndDescribed("MethodIntercepted"); checkNotInstalledAndDescribed("MethodAnnotatedIntercepted"); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithAnnotationDependencyRedeploy2() throws Exception { deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); try { validate(); checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); } dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkInterceptedAndInjected("Intercepted", dependency); checkInterceptedAndInjected("AnnotatedIntercepted", dependency); checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency); checkInterceptedAndInjectedMethodAnnotatedXml(dependency); } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } private void checkInterceptedAndInjected(String name, SimpleBean dependency) { InterceptorWithAnnotationDependency.intercepted = null; SimpleBean bean = (SimpleBean) getBean(name); assertNotNull(bean); bean.someMethod(); assertTrue(dependency + "==" + InterceptorWithAnnotationDependency.intercepted, dependency == InterceptorWithAnnotationDependency.intercepted); } private void checkInterceptedAndInjectedMethodAnnotatedXml(SimpleBean dependency) { InterceptorWithAnnotationDependency.intercepted = null; SimpleBeanImpl bean = (SimpleBeanImpl) getBean("MethodIntercepted"); assertNotNull(bean); bean.setProperty(1); assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted); } private void checkNotInstalledAndNotDescribed(String name) { SimpleBean bean; try { bean = (SimpleBean) getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean(name, ControllerState.DESCRIBED); assertNull("'" + name + "' should not be deployed until the interceptor is", bean); } private void checkNotInstalledAndDescribed(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED); assertNotNull(context); } } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001660210760776332033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithDependency; import org.jboss.test.microcontainer.support.SimpleBean; public class InterceptorWithDependencyTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(InterceptorWithDependencyTestCase.class); } public InterceptorWithDependencyTestCase(String name) { super(name); } public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); } try { bean = (SimpleBean) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); } dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/AnnotationsInProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000431110770520170033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.lang.reflect.Method; import junit.framework.Test; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.AnnotatedBean; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ public class AnnotationsInProxyTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(AnnotationsInProxyTestCase.class); } public AnnotationsInProxyTestCase(String name) { super(name); } public void testAnnotationsInProxy() throws Exception { AnnotatedBean bean = (AnnotatedBean)getBean("Bean"); assertTrue(bean instanceof AspectManaged); org.jboss.test.microcontainer.support.Test test = bean.getClass().getAnnotation(org.jboss.test.microcontainer.support.Test.class); assertNotNull(test); Method method = bean.getClass().getMethod("method"); test = method.getAnnotation(org.jboss.test.microcontainer.support.Test.class); assertNotNull(test); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/MicrocontainerAllTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000260710447510646033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import org.jboss.test.KernelAllTestSuite; import junit.framework.Test; import junit.framework.TestCase; /** * MicrocontainerAllTestCase. * * @author Adrian Brock * @version $Revision: 45818 $ */ public class MicrocontainerAllTestCase extends TestCase { public static Test suite() { return KernelAllTestSuite.suite(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InitialLifecycleCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000613510760776332033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleLifecycleCallback; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InitialLifecycleCallbackTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(InitialLifecycleCallbackTestCase.class); } public InitialLifecycleCallbackTestCase(String name) { super(name); } public void testLifecycleInterceptions() throws Exception { boolean itworked = false; try { SimpleLifecycleCallback.interceptions.clear(); deploy("InitialLifecycleCallbackTestCaseNotAutomatic.xml"); getCheckBeanExists("Intercepted"); assertEquals(1, SimpleLifecycleCallback.interceptions.size()); SimpleLifecycleCallback.Handled handled = SimpleLifecycleCallback.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); SimpleLifecycleCallback callback = (SimpleLifecycleCallback)getBean("LifecycleCallback"); assertEquals("Test123", callback.getTestProperty()); itworked = true; } finally { SimpleLifecycleCallback.interceptions.clear(); undeploy("InitialLifecycleCallbackTestCaseNotAutomatic.xml"); if (itworked) { assertEquals(1, SimpleLifecycleCallback.interceptions.size()); SimpleLifecycleCallback.Handled handled = SimpleLifecycleCallback.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } public Object getCheckBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); return bean; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/BeanCallingMethodInCtorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000370610760776332033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.BeanCallingMethodInCtor; import org.jboss.test.microcontainer.support.CalledInterceptor; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanCallingMethodInCtorTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(BeanCallingMethodInCtorTestCase.class); } public BeanCallingMethodInCtorTestCase(String name) { super(name); } public void testIntercepted() { BeanCallingMethodInCtor bean = (BeanCallingMethodInCtor) getBean("Bean"); CalledInterceptor.intercepted = false; bean.publicMethod(); assertTrue("Should have invoked the CalledInterceptor", CalledInterceptor.intercepted); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/ConstructorInterceptorWithDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000002013510760776332033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithDependency; import org.jboss.test.microcontainer.support.SimpleBean; public class ConstructorInterceptorWithDependencyTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(ConstructorInterceptorWithDependencyTestCase.class); } public ConstructorInterceptorWithDependencyTestCase(String name) { super(name); } public void testInterceptorWithDependencyCorrectOrder() throws Exception { InterceptorWithDependency.intercepted = null; deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { assertNull(InterceptorWithDependency.intercepted); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { InterceptorWithDependency.intercepted = null; deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); assertNull(InterceptorWithDependency.intercepted); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy() throws Exception { InterceptorWithDependency.intercepted = null; deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } assertNull(InterceptorWithDependency.intercepted); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { InterceptorWithDependency.intercepted = null; undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); } try { bean = (SimpleBean) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } assertNull(InterceptorWithDependency.intercepted); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == InterceptorWithDependency.intercepted); } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { InterceptorWithDependency.intercepted = null; deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { InterceptorWithDependency.intercepted = null; undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); } assertNull(InterceptorWithDependency.intercepted); dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean = (SimpleBean) getBean("Intercepted"); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithDependency.intercepted); } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("ConstructorInterceptorWithDependencyTestCaseNotAutomatic0.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/DeployersInterceptedAspectManagerJMXTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000760410760776332033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.deployers.DeployerAspects; import org.jboss.test.microcontainer.support.deployers.IMainDeployer; import org.jboss.test.microcontainer.support.deployers.SampleDeployer; import org.jboss.test.microcontainer.support.deployers.IDeployer.IDeployerMethod; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeployersInterceptedAspectManagerJMXTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(DeployersInterceptedAspectManagerJMXTestCase.class); } public DeployersInterceptedAspectManagerJMXTestCase(String name) { super(name); } public void testBean() throws Exception { IMainDeployer md = (IMainDeployer) getBean("MainDeployer"); assertNotNull(md); assertEquals("2 deployers", 2, md.getDeployers().size()); md.addDeployment("thing.xar"); md.process(); HashSet interceptedCalled = DeployerAspects.getCalled(); SampleDeployer d1 = (SampleDeployer) getBean("SampleDeployer1"); SampleDeployer d2 = (SampleDeployer) getBean("SampleDeployer2"); assertTrue("SampleDeployer1.prepareDeploy", d1.getCalled().contains(IDeployerMethod.prepareDeploy)); assertTrue("SampleDeployer1.commitDeploy", d1.getCalled().contains(IDeployerMethod.commitDeploy)); assertTrue("SampleDeployer2.prepareDeploy", d2.getCalled().contains(IDeployerMethod.prepareDeploy)); assertTrue("SampleDeployer2.commitDeploy", d2.getCalled().contains(IDeployerMethod.commitDeploy)); assertTrue("DeployerAspects.prepareDeploy", interceptedCalled.contains(IDeployerMethod.prepareDeploy)); assertTrue("DeployerAspects.commitDeploy", interceptedCalled.contains(IDeployerMethod.commitDeploy)); md.removeDeployment("thing.xar"); md.process(); assertTrue("SampleDeployer1.prepareUndeploy", d1.getCalled().contains(IDeployerMethod.prepareUndeploy)); assertTrue("SampleDeployer1.commitUndeploy", d1.getCalled().contains(IDeployerMethod.commitUndeploy)); assertTrue("SampleDeployer2.prepareUndeploy", d2.getCalled().contains(IDeployerMethod.prepareUndeploy)); assertTrue("SampleDeployer2.commitUndeploy", d2.getCalled().contains(IDeployerMethod.commitUndeploy)); assertTrue("DeployerAspects.prepareUndeploy", interceptedCalled.contains(IDeployerMethod.prepareUndeploy)); assertTrue("DeployerAspects.commitUndeploy", interceptedCalled.contains(IDeployerMethod.commitUndeploy)); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/AspectMCAllTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000600410774766014033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * All Test Suite. * * @author Adrian Brock * @version $Revision: 71634 $ */ public class AspectMCAllTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("All Tests"); suite.addTest(BeanCallingMethodInCtorTestCase.suite()); suite.addTest(BeanNoDefaultCtorUsingParamTestCase.suite()); suite.addTest(ConstructorInterceptorWithDependencyTestCase.suite()); suite.addTest(InterceptedTestCase.suite()); suite.addTest(InterceptorWithAnnotationDependencyTestCase.suite()); suite.addTest(InterceptorWithDependencyTestCase.suite()); suite.addTest(InterceptorWithNestedAnnotationDependencyTestCase.suite()); suite.addTest(InterceptorWithNestedMethodAnnotationDependencyTestCase.suite()); suite.addTest(InterceptorWithOverriddenClassAnnotationDependencyTestCase.suite()); suite.addTest(InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCase.suite()); suite.addTest(InterceptorWithOverriddenMethodAnnotationDependencyTestCase.suite()); suite.addTest(IntroductionDependencyTestCase.suite()); suite.addTest(LifecycleAopTestCase.suite()); suite.addTest(JMXDecoratedTestCase.suite()); suite.addTest(JMXLifecycleTestCase.suite()); suite.addTest(JndiDecoratedTestCase.suite()); suite.addTest(JndiLifeCycleTestCase.suite()); suite.addTest(MetaDataTestCase.suite()); suite.addTest(MixinTestCase.suite()); suite.addTest(MultipleLifecycleTestCase.suite()); suite.addTest(ScopingAopTestCase.suite()); suite.addTest(CreatedBeansLifecycleCallbackTestCase.suite()); suite.addTest(CreatedBeansLifecycleCallbackWithDependencyTestCase.suite()); suite.addTest(NonDefaultMethodsLifecycleCallbackTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/FieldAccessTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000645611015560012033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.aop.junit.AbstractTypeTest; import org.jboss.test.aop.junit.AbstractTypeTestDelegate; import org.jboss.test.microcontainer.beans.support.AccessBean; /** * AOP field test case. * * @author Ales Justin */ public class FieldAccessTestCase extends AbstractTypeTest { public FieldAccessTestCase(String name) { super(name); } public static Test suite() { return suite(FieldAccessTestCase.class); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { //Don't use security for this test AbstractTypeTestDelegate delegate = new AbstractTypeTestDelegate(clazz); return delegate; } protected void testAccessBean(String name) throws Throwable { AccessBean bean = getBean(name, AccessBean.class); AbstractTypeTestDelegate.Type type = getType(name); if (type == AbstractTypeTestDelegate.Type.PROXY) { assertNull(bean.getPriString()); assertNull(bean.getProtString()); assertNull(bean.getPubString()); } else { assertEquals("foobar", concat(bean)); } } private String concat(AccessBean bean) { String string = ""; if (bean.getPriString() != null) string += bean.getPriString(); if (bean.getProtString() != null) string += bean.getProtString(); if (bean.getPubString() != null) string += bean.getPubString(); return string; } public void testFieldAccess() throws Throwable { SecurityManager sm = suspendSecurity(); try { testAccessBean("private"); testAccessBean("protected"); testAccessBean("public"); // this should fail or something :-) on proxy AccessBean pb = getBean("public", AccessBean.class); assertEquals("foobar", pb.pubString); AbstractTypeTestDelegate.Type type = getType("public"); assertTrue(pb.getPubString() == null || type != AbstractTypeTestDelegate.Type.PROXY); } finally { resumeSecurity(sm); } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/JMXLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001206410760776332033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import javax.management.MBeanAttributeInfo; import javax.management.MBeanInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanServer; import javax.management.ObjectName; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.JmxRegistrant; public class JMXLifecycleTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(JMXLifecycleTestCase.class); } public JMXLifecycleTestCase(String name) { super(name); } public void testJMX() throws Exception { MBeanServer server = (MBeanServer) getBean("MBeanServer"); assertNotNull(server); ObjectName name = new ObjectName("test:name='Bean'"); MBeanInfo info = server.getMBeanInfo(name); assertNotNull(info); MBeanOperationInfo[] ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someMethod", ops[0].getName()); name = new ObjectName("test:name=NotBean1"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); name = new ObjectName("test:name='AnnotatedBean'"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); name = new ObjectName("test:name=AnnotatedNotBean"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); } /** * Tests that adding the registerDirectly=true attribute allows a * standard MBean to be registered directly, while not specifying it * causes a proxy to be registered (even if the bean is a standard MBean). * Also confirms a bean that isn't an MBean will fail to deploy if * registerDirectly=true. * * @throws Exception */ public void testRegisterDirectly() throws Exception { MBeanServer server = (MBeanServer) getBean("MBeanServer"); assertNotNull(server); ObjectName name = new ObjectName("test:name=DirectRegistrant"); MBeanInfo info = server.getMBeanInfo(name); assertNotNull(info); MBeanAttributeInfo[] attrs = info.getAttributes(); assertEquals(1, attrs.length); assertEquals("RegisteredInJmx", attrs[0].getName()); assertTrue(attrs[0].isReadable()); assertFalse(attrs[0].isWritable()); JmxRegistrant bean = (JmxRegistrant) getBean("DirectRegistrant"); assertTrue("MBeanRegistration callbacks invoked", bean.isRegisteredInJmx()); name = new ObjectName("test:name=NotDirectRegistrant"); info = server.getMBeanInfo(name); assertNotNull(info); attrs = info.getAttributes(); assertEquals(1, attrs.length); assertEquals("RegisteredInJmx", attrs[0].getName()); assertTrue(attrs[0].isReadable()); assertFalse(attrs[0].isWritable()); bean = (JmxRegistrant) getBean("NotDirectRegistrant"); assertFalse("MBeanRegistration callbacks not invoked", bean.isRegisteredInJmx()); // Deploy a bean that should fail as it's not an mbean deploy("JMXDecorated-flawed.xml"); try { name = new ObjectName("test:name=FlawedRegistrant"); assertFalse(name + " not registered", server.isRegistered(name)); Object broken = null; try { broken = getBean("FlawedRegistrant"); } catch (Exception good) {} assertNull("FlawedRegistrant did not deploy", broken); } finally { undeploy("JMXDecorated-flawed.xml"); } } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/NonDefaultMethodsLifecycleCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000511210760776332033252 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.NonDefaultMethodsLifecycleCallback; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NonDefaultMethodsLifecycleCallbackTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(NonDefaultMethodsLifecycleCallbackTestCase.class); } public NonDefaultMethodsLifecycleCallbackTestCase(String name) { super(name); } public void testLifecycleInterceptions() throws Exception { boolean itworked = false; try { deploy("NonDefaultMethodsLifecycleCallbackTestCaseNotAutomatic.xml"); validate(); getCheckBeanExists("Intercepted"); assertTrue(NonDefaultMethodsLifecycleCallback.inited); assertFalse(NonDefaultMethodsLifecycleCallback.uninited); itworked = true; } finally { undeploy("NonDefaultMethodsLifecycleCallbackTestCaseNotAutomatic.xml"); if (itworked) { assertTrue(NonDefaultMethodsLifecycleCallback.inited); assertTrue(NonDefaultMethodsLifecycleCallback.uninited); } } } public Object getCheckBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); return bean; } //InitialLifecycleTestCaseNotAutomatic.xml } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/LifecycleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000303610774766014033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleAopTestCase extends LifecycleTest { public LifecycleAopTestCase(String name) { super(name); } public static Test suite() { return suite(LifecycleAopTestCase.class); } @Override protected String getFile() { return "LifecycleAopTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/LifecycleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000762010774766014033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.util.ArrayList; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.Configure; import org.jboss.test.microcontainer.support.Create; import org.jboss.test.microcontainer.support.Describe; import org.jboss.test.microcontainer.support.Install; import org.jboss.test.microcontainer.support.Instantiate; import org.jboss.test.microcontainer.support.LifecycleCallback; import org.jboss.test.microcontainer.support.Start; public abstract class LifecycleTest extends AOPMicrocontainerTest { public LifecycleTest(String name) { super(name); } public void testLifecycleInterceptions() throws Exception { boolean undeployed = false; try { LifecycleCallback.interceptions.clear(); deploy(getFile()); //Verify the beans exist checkBeanExists("ConfigureBean"); checkBeanExists("CreateBean"); checkBeanExists("DescribeBean"); checkBeanExists("InstallBean"); checkBeanExists("InstantiateBean"); checkBeanExists("StartBean"); //Now check the expected lifecycle events for each bean checkExpectedAnnotations("ConfigureBean", Configure.class); checkExpectedAnnotations("CreateBean", Create.class); checkExpectedAnnotations("DescribeBean", Describe.class); checkExpectedAnnotations("InstallBean", Install.class); checkExpectedAnnotations("InstantiateBean", Instantiate.class); checkExpectedAnnotations("StartBean", Start.class); LifecycleCallback.interceptions.clear(); undeploy(getFile()); undeployed = true; checkExpectedAnnotations("ConfigureBean", Configure.class); checkExpectedAnnotations("CreateBean", Create.class); checkExpectedAnnotations("DescribeBean", Describe.class); checkExpectedAnnotations("InstallBean", Install.class); checkExpectedAnnotations("InstantiateBean", Instantiate.class); checkExpectedAnnotations("StartBean", Start.class); } finally { if (!undeployed) { undeploy(getFile()); } } } public void checkBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); } public void checkExpectedAnnotations(String name, Class annotation) { ArrayList> events = LifecycleCallback.interceptions.get(name); assertNotNull(events); assertEquals("Wrong events, expected one element only " + events, 1, events.size()); Class actualAnnotation = events.get(0); assertEquals(annotation, actualAnnotation); } protected abstract String getFile(); } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/MixinTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000472310760776332033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.OtherMixin; import org.jboss.test.microcontainer.support.OtherMixinImpl; import org.jboss.test.microcontainer.support.SimpleBean; import org.jboss.test.microcontainer.support.SomeMixin; import org.jboss.test.microcontainer.support.SomeMixinImpl; public class MixinTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(MixinTestCase.class); } public MixinTestCase(String name) { super(name); } public void testMixin() throws Exception { SimpleBean bean = (SimpleBean) getBean("Bean"); assertTrue(bean instanceof SomeMixin); assertTrue(bean instanceof OtherMixin); SomeMixinImpl.invoked = false; OtherMixinImpl.invoked = false; ((SomeMixin)bean).someMixinMethod(); assertTrue(SomeMixinImpl.invoked); assertFalse(OtherMixinImpl.invoked); SomeMixinImpl.invoked = false; OtherMixinImpl.invoked = false; ((OtherMixin)bean).otherMixinMethod(); assertFalse(SomeMixinImpl.invoked); assertTrue(OtherMixinImpl.invoked); } public void testNoMixin() throws Exception { SimpleBean bean = (SimpleBean) getBean("Bean1"); assertFalse(bean instanceof SomeMixin); assertFalse(bean instanceof OtherMixin); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000615210760776332033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleLifecycleCallback; /** * Tests the beans that are created under the hood using the etc. * configuration * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CreatedBeansLifecycleCallbackTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(CreatedBeansLifecycleCallbackTestCase.class); } public CreatedBeansLifecycleCallbackTestCase(String name) { super(name); } public void testLifecycleInterceptions() throws Exception { boolean itworked = false; try { SimpleLifecycleCallback.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackTestCaseNotAutomatic.xml"); getCheckBeanExists("Intercepted"); assertEquals(1, SimpleLifecycleCallback.interceptions.size()); SimpleLifecycleCallback.Handled handled = SimpleLifecycleCallback.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); itworked = true; } finally { SimpleLifecycleCallback.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackTestCaseNotAutomatic.xml"); if (itworked) { assertEquals(1, SimpleLifecycleCallback.interceptions.size()); SimpleLifecycleCallback.Handled handled = SimpleLifecycleCallback.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } public Object getCheckBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); return bean; } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000347710774766014033267 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InitialLifecycleCallbackWithDependencyAopTestCase extends InitialLifecycleCallbackWithDependencyTest { public InitialLifecycleCallbackWithDependencyAopTestCase(String name) { super(name); } public static Test suite() { return suite(InitialLifecycleCallbackWithDependencyAopTestCase.class); } @Override protected String getFile0() { return "InitialLifecycleCallbackWithDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "InitialLifecycleCallbackWithDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/JndiLifeCycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000311010760776332033246 0ustar twernertwernerpackage org.jboss.test.microcontainer.test; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.jndi.SimpleBean; import org.jboss.test.microcontainer.support.jndi.SimpleBeanAnnotatedImpl; public class JndiLifeCycleTestCase extends AOPMicrocontainerTest { public JndiLifeCycleTestCase(String name) { super(name); } public static Test suite() { return suite(JndiLifeCycleTestCase.class); } /** * Validate that the * @throws Exception */ public void testJndi() throws Exception { super.enableTrace("org.jboss"); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.test.microcontainer.support.jndi.MockInitialContextFactory"); InitialContext ctx = new InitialContext(env); SimpleBean bean0 = (SimpleBean) ctx.lookup("beans/SimpleBean0"); assertNotNull(bean0); assertEquals("bean0.prop1", bean0.getProp1()); SimpleBean alias0 = (SimpleBean) ctx.lookup("beans/XmlAnnotatedSimpleBean0"); assertNotNull(alias0); assertEquals("bean0.prop1", alias0.getProp1()); SimpleBeanAnnotatedImpl bean1 = (SimpleBeanAnnotatedImpl) ctx.lookup("beans/SimpleBean1"); assertEquals("bean1.prop1", bean1.getProp1()); SimpleBean alias1 = (SimpleBean) ctx.lookup("beans/AnnotatedSimpleBean1"); assertNotNull(alias1); assertEquals("bean1.prop1", alias1.getProp1()); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000337410760776332033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.CalledInterceptor; import org.jboss.test.microcontainer.support.SimpleBean; public class InterceptedTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(InterceptedTestCase.class); } public InterceptedTestCase(String name) { super(name); } public void testIntercepted() { SimpleBean bean = (SimpleBean) getBean("Intercepted"); CalledInterceptor.intercepted = false; bean.someMethod(); assertTrue("Should have invoked the CalledInterceptor", CalledInterceptor.intercepted); } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InitialLifecycleCallbackWithDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000354410774766014033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InitialLifecycleCallbackWithDependencyDeploymentTestCase extends InitialLifecycleCallbackWithDependencyTest { public InitialLifecycleCallbackWithDependencyDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(InitialLifecycleCallbackWithDependencyDeploymentTestCase.class); } @Override protected String getFile0() { return "InitialLifecycleCallbackWithDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "InitialLifecycleCallbackWithDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/UnwindLifeCycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000721110760776332033254 0ustar twernertwernerpackage org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.ErrorLifecycleCallback; import org.jboss.test.microcontainer.support.InstallUninstallLifecycleCallback; public class UnwindLifeCycleTestCase extends AOPMicrocontainerTest { public UnwindLifeCycleTestCase(String name) { super(name); } public static Test suite() { return suite(UnwindLifeCycleTestCase.class); } /** * Validate that the * @throws Exception */ public void testUnwind() throws Exception { try { deploy("UnwindLifeCycleTestCaseNotAutomatic.xml"); } catch(Exception e) { } try { getBean("Bean"); } catch (RuntimeException expected) { } getAssertInstalledLifecycleCallback("DescribeAdvice1"); getAssertInstalledLifecycleCallback("DescribeAdvice2"); getAssertInstalledLifecycleCallback("InstantiateAdvice1"); getAssertInstalledLifecycleCallback("InstantiateAdvice2"); getAssertInstalledLifecycleCallback("ConfigureAdvice1"); getAssertInstalledLifecycleCallback("ConfigureAdvice2"); getAssertInstalledLifecycleCallback("CreateAdvice1"); getAssertInstalledLifecycleCallback("CreateAdvice2"); getAssertInstalledLifecycleCallback("StartAdvice1"); getAssertInstalledLifecycleCallback("StartAdvice2"); getAssertInstalledLifecycleCallback("InstallAdvice1"); getAssertInstalledLifecycleCallback("InstallAdvice2"); //This is the bean causing the error during its install phase, make sure that both install //AND uninstall have been called since install might have had partial success before the error ErrorLifecycleCallback error = (ErrorLifecycleCallback)getBean("ErrorAdvice"); assertTrue(error.isInstalledContext()); assertTrue(error.isUninstalledContext()); //This comes after the error advice in the chain, and so should not have had install or uninstall called InstallUninstallLifecycleCallback startNotInvoked = (InstallUninstallLifecycleCallback)getBean("InstallAdviceNotInvoked"); assertFalse(startNotInvoked.isInstalledContext()); assertFalse(startNotInvoked.isUninstalledContext()); //Lifecycle callbacks from previous states should have had uninstall called getAssertUninstalledLifecycleCallback("DescribeAdvice1"); getAssertUninstalledLifecycleCallback("DescribeAdvice2"); getAssertUninstalledLifecycleCallback("InstantiateAdvice1"); getAssertUninstalledLifecycleCallback("InstantiateAdvice2"); getAssertUninstalledLifecycleCallback("ConfigureAdvice1"); getAssertUninstalledLifecycleCallback("ConfigureAdvice2"); getAssertUninstalledLifecycleCallback("CreateAdvice1"); getAssertUninstalledLifecycleCallback("CreateAdvice2"); getAssertUninstalledLifecycleCallback("StartAdvice1"); getAssertUninstalledLifecycleCallback("StartAdvice2"); getAssertUninstalledLifecycleCallback("InstallAdvice1"); getAssertUninstalledLifecycleCallback("InstallAdvice2"); } private void getAssertInstalledLifecycleCallback(String callbackName) { InstallUninstallLifecycleCallback callback = (InstallUninstallLifecycleCallback)getBean(callbackName); assertTrue(callback.isInstalledContext()); } private void getAssertUninstalledLifecycleCallback(String callbackName) { InstallUninstallLifecycleCallback callback = (InstallUninstallLifecycleCallback)getBean(callbackName); assertTrue(callback.isUninstalledContext()); } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000405110452525647033252 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; public class InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCase extends InterceptorWithOverriddenMethodAnnotationDependencyBaseTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCase.class); } public InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCase(String name) { super(name); } protected String getDependency1DD() { return "InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic0.xml"; } protected String getDependency2DD() { return "InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic1.xml"; } protected String getMainDD() { return "InterceptorWithOverriddenMethodAnnotationDependencyForChildTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/UndeployAspectDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000563010764007431033246 0ustar twernertwernerpackage org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.SimpleBeanImpl; import org.jboss.test.microcontainer.support.SimpleInterceptor1; import org.jboss.test.microcontainer.support.SimpleInterceptor2; public class UndeployAspectDependencyTestCase extends AOPMicrocontainerTest { public UndeployAspectDependencyTestCase(String name) { super(name); } public static Test suite() { return suite(UndeployAspectDependencyTestCase.class); } /** * Validate that the * @throws Throwable for any error */ public void testUndeployAndRedeploy() throws Throwable { //Deploy first aspect deploy("UndeployAspectDependencyTestCaseNotAutomatic0.xml"); try { boolean deployedAspect = false; //Deploy second aspect deploy("UndeployAspectDependencyTestCaseNotAutomatic1.xml"); try { //Deploy bean intercepted by both aspects deploy("UndeployAspectDependencyTestCaseNotAutomatic2.xml"); try { SimpleBeanImpl bean = (SimpleBeanImpl)getBean("Intercepted"); SimpleInterceptor1.invoked = false; SimpleInterceptor2.invoked = false; bean.someMethod(); assertTrue(SimpleInterceptor1.invoked); assertTrue(SimpleInterceptor2.invoked); ControllerContext ctx = getControllerContext("Intercepted"); Controller controller = ctx.getController(); //Move the bean intercepted to pre-install state controller.change(ctx, ControllerState.PRE_INSTALL); //Undeploy the second aspect undeploy("UndeployAspectDependencyTestCaseNotAutomatic1.xml"); //Move the bean back to the installed state controller.change(ctx, ControllerState.INSTALLED); bean = (SimpleBeanImpl)getBean("Intercepted"); SimpleInterceptor1.invoked = false; SimpleInterceptor2.invoked = false; bean.someMethod(); assertTrue(SimpleInterceptor1.invoked); assertFalse(SimpleInterceptor2.invoked); } finally { undeploy("UndeployAspectDependencyTestCaseNotAutomatic2.xml"); } } finally { if (deployedAspect) { undeploy("UndeployAspectDependencyTestCaseNotAutomatic1.xml"); } } } finally { undeploy("UndeployAspectDependencyTestCaseNotAutomatic0.xml"); } } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithOverriddenClassAnnotationDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000002051410760776332033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithAnnotationDependency; import org.jboss.test.microcontainer.support.SimpleBean; public class InterceptorWithOverriddenClassAnnotationDependencyTestCase extends AOPMicrocontainerTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithOverriddenClassAnnotationDependencyTestCase.class); } public InterceptorWithOverriddenClassAnnotationDependencyTestCase(String name) { super(name); } public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception { deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); } } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithAnnotationDependencyWrongOrder() throws Exception { deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalledAndNotDescribed("Intercepted"); checkNotInstalledAndNotDescribed("AnnotatedIntercepted"); } } public void testInterceptorWithAnnotationDependencyRedeploy() throws Exception { deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); } checkNotInstalledAndDescribed("Intercepted"); checkNotInstalledAndDescribed("AnnotatedIntercepted"); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); } } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalledAndNotDescribed("Intercepted"); checkNotInstalledAndNotDescribed("AnnotatedIntercepted"); } } public void testInterceptorWithAnnotationDependencyRedeploy2() throws Exception { deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); try { SimpleBean dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); } dependency = (SimpleBean) getBean("Dependency"); assertNotNull(dependency); deploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); try { checkInterceptedAndInjected("Intercepted", dependency); checkNotInstalledAndDescribed("AnnotatedIntercepted"); } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalledAndNotDescribed("Intercepted"); checkNotInstalledAndNotDescribed("AnnotatedIntercepted"); } } finally { undeploy("InterceptorWithOverriddenClassAnnotationDependencyTestCaseNotAutomatic0.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } private void checkInterceptedAndInjected(String name, SimpleBean dependency) { InterceptorWithAnnotationDependency.intercepted = null; SimpleBean bean = (SimpleBean) getBean(name); assertNotNull(bean); bean.someMethod(); assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted); } private void checkNotInstalledAndNotDescribed(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { } try { getBean(name, ControllerState.DESCRIBED); fail("'" + name + "' should not be described"); } catch(IllegalStateException expected) { } } private void checkNotInstalledAndDescribed(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED); assertNotNull(context); } } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithNestedAnnotationDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001761610760776332033266 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithAnnotationDependency; import org.jboss.test.microcontainer.support.InterceptorWithNestedAnnotationDependency; import org.jboss.test.microcontainer.support.SimpleBean; public class InterceptorWithNestedAnnotationDependencyTestCase extends AOPMicrocontainerTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithNestedAnnotationDependencyTestCase.class); } public InterceptorWithNestedAnnotationDependencyTestCase(String name) { super(name); } public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); try { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic3.xml"); try { checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic3.xml"); } } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithAnnotationDependencyWrongOrderAndRedeploy() throws Exception { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic3.xml"); try { checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); try { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); } try { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); } try { deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic2.xml"); } } finally { undeploy("InterceptorWithNestedAnnotationDependencyTestCaseNotAutomatic3.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } private void checkInterceptedAndInjected(String name) { SimpleBean dependency1 = (SimpleBean) getBean("Dependency1"); assertNotNull(dependency1); SimpleBean dependency2 = (SimpleBean) getBean("Dependency2"); assertNotNull(dependency2); SimpleBean dependency3 = (SimpleBean) getBean("Dependency3"); assertNotNull(dependency3); InterceptorWithAnnotationDependency.intercepted = null; SimpleBean bean = (SimpleBean) getBean(name); assertNotNull(bean); bean.someMethod(); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted1); assertTrue(dependency1 == InterceptorWithNestedAnnotationDependency.intercepted1); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted2); assertTrue(dependency2 == InterceptorWithNestedAnnotationDependency.intercepted2); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted3); assertTrue(dependency3 == InterceptorWithNestedAnnotationDependency.intercepted3); } private void checkNotInstalled(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED); assertNotNull(context); } } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithNestedMethodAnnotationDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000002011010760776332033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithAnnotationDependency; import org.jboss.test.microcontainer.support.InterceptorWithNestedAnnotationDependency; import org.jboss.test.microcontainer.support.SimpleBean; public class InterceptorWithNestedMethodAnnotationDependencyTestCase extends AOPMicrocontainerTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithNestedMethodAnnotationDependencyTestCase.class); } public InterceptorWithNestedMethodAnnotationDependencyTestCase(String name) { super(name); } public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); try { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic3.xml"); try { checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic3.xml"); } } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); } } public void testInterceptorWithAnnotationDependencyWrongOrderAndRedeploy() throws Exception { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic3.xml"); try { checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); try { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); } try { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); } try { deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); deploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); checkInterceptedAndInjected("AnnotatedIntercepted"); checkInterceptedAndInjected("Intercepted"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic0.xml"); checkNotInstalled("AnnotatedIntercepted"); checkNotInstalled("Intercepted"); } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic1.xml"); undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic2.xml"); } } finally { undeploy("InterceptorWithNestedMethodAnnotationDependencyTestCaseNotAutomatic3.xml"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } private void checkInterceptedAndInjected(String name) { SimpleBean dependency1 = (SimpleBean) getBean("Dependency1"); assertNotNull(dependency1); SimpleBean dependency2 = (SimpleBean) getBean("Dependency2"); assertNotNull(dependency2); SimpleBean dependency3 = (SimpleBean) getBean("Dependency3"); assertNotNull(dependency3); InterceptorWithAnnotationDependency.intercepted = null; SimpleBean bean = (SimpleBean) getBean(name); assertNotNull(bean); bean.someMethod(); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted1); assertTrue(dependency1 == InterceptorWithNestedAnnotationDependency.intercepted1); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted2); assertTrue(dependency2 == InterceptorWithNestedAnnotationDependency.intercepted2); assertNotNull(InterceptorWithNestedAnnotationDependency.intercepted3); assertTrue(dependency3 == InterceptorWithNestedAnnotationDependency.intercepted3); } private void checkNotInstalled(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED); assertNotNull(context); } } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/CreatedBeansLifecycleCallbackWithDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000003740110760776332033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.LifecycleCallbackWithBeanDependency; import org.jboss.test.microcontainer.support.SimpleBean; /** * Tests the beans that are created under the hood using the etc. * configuration * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CreatedBeansLifecycleCallbackWithDependencyTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(CreatedBeansLifecycleCallbackWithDependencyTestCase.class); } public CreatedBeansLifecycleCallbackWithDependencyTestCase(String name) { super(name); } public void testLifecycleInterceptionsWithDependencyCorrectOrder() throws Exception { deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); try { Object dependency = getCheckBeanExists("Dependency"); assertNotNull(dependency); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } finally { undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); } } public void testLifecycleInterceptionsWithDependencyWrongOrder() throws Exception { deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } } finally { undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); } } public void testLifecycleInterceptionsWithDependencyRedeploy() throws Exception { deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); try { SimpleBean bean; try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertEquals(dependency, lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); try { validate(); Object dependency = getCheckBeanExists("Dependency"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); getCheckBeanExists("Intercepted"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue("Should not be caching the lifecycle's callback across rebinding", dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } try { bean = (SimpleBean) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", bean); } } finally { undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); } } public void testLifecycleInterceptionsWithDependencyRedeploy2() throws Exception { deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); try { Object dependency = getCheckBeanExists("Dependency"); boolean itworked = false; LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue(dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } Object dependency2 = getCheckBeanExists("Dependency"); assertTrue(dependency == dependency2); LifecycleCallbackWithBeanDependency.interceptions.clear(); deploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); try { validate(); getCheckBeanExists("Intercepted"); LifecycleCallbackWithBeanDependency lifecycle = (LifecycleCallbackWithBeanDependency)getCheckBeanExists("LifecycleCallback"); assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); assertNotNull(lifecycle.getDependency()); assertTrue(dependency == lifecycle.getDependency()); itworked = true; } finally { LifecycleCallbackWithBeanDependency.interceptions.clear(); undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic1.xml"); if (itworked) { assertEquals(1, LifecycleCallbackWithBeanDependency.interceptions.size()); LifecycleCallbackWithBeanDependency.Handled handled = LifecycleCallbackWithBeanDependency.interceptions.get(0); assertEquals("Intercepted", handled.contextName); assertEquals(ControllerState.CONFIGURED, handled.toState); } } } finally { undeploy("CreatedBeansLifecycleCallbackWithDependencyTestCaseNotAutomatic0.xml"); } } public Object getCheckBeanExists(String name) { Object bean = getBean(name); assertNotNull(bean); return bean; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithDependencyTestCaseDifferentOrder.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000333110420664341033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ public class InterceptorWithDependencyTestCaseDifferentOrder extends InterceptorWithDependencyTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new InterceptorWithDependencyTestCaseDifferentOrder("testInterceptorWithDependencyWrongOrder")); suite.addTest(new InterceptorWithDependencyTestCaseDifferentOrder("testInterceptorWithDependencyCorrectOrder")); return suite; } public InterceptorWithDependencyTestCaseDifferentOrder(String name) { super(name); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/JMXDecoratedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001550510760776332033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import javax.management.MBeanAttributeInfo; import javax.management.MBeanInfo; import javax.management.MBeanOperationInfo; import javax.management.MBeanServer; import javax.management.ObjectName; import junit.framework.Test; import org.jboss.aop.microcontainer.aspects.jmx.JMX; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.JmxRegistrant; import org.jboss.test.microcontainer.support.MetaDataContextInterceptor; import org.jboss.test.microcontainer.support.SimpleBean; import org.jboss.test.microcontainer.support.SimpleBeanImplMBean; public class JMXDecoratedTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(JMXDecoratedTestCase.class); } public JMXDecoratedTestCase(String name) { super(name); } public void testJMX() throws Exception { MBeanServer server = (MBeanServer) getBean("MBeanServer"); assertNotNull(server); ObjectName name = new ObjectName("test:name='Bean'"); MBeanInfo info = server.getMBeanInfo(name); assertNotNull(info); MBeanOperationInfo[] ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someMethod", ops[0].getName()); name = new ObjectName("test:name=NotBean1"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); name = new ObjectName("test:name='AnnotatedBean'"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); name = new ObjectName("test:name=AnnotatedNotBean"); info = server.getMBeanInfo(name); assertNotNull(info); ops = info.getOperations(); assertEquals(1, ops.length); assertEquals("someOtherMethod", ops[0].getName()); } /** * Test that the two beans indeed have different metadata values * * @throws Exception for any error */ public void testJMXMetaData() throws Exception { ObjectName bean = new ObjectName("test:name='Bean'"); ObjectName notbean = new ObjectName("test:name=NotBean1"); MBeanServer server = (MBeanServer) getBean("MBeanServer"); //Check that we can access methods via the MBean interface MetaDataContextInterceptor.classAnnotation = null; server.invoke(bean, "someMethod", new Object[0], new String[0]); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertTrue(MetaDataContextInterceptor.classAnnotation instanceof JMX); JMX jmx = (JMX)MetaDataContextInterceptor.classAnnotation; assertTrue(jmx.exposedInterface().equals(SimpleBean.class)); assertTrue(jmx.name() == null || jmx.name().length() == 0); MetaDataContextInterceptor.classAnnotation = null; server.invoke(notbean, "someOtherMethod", new Object[0], new String[0]); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertTrue(MetaDataContextInterceptor.classAnnotation instanceof JMX); JMX jmx2 = (JMX)MetaDataContextInterceptor.classAnnotation; assertTrue(jmx2.exposedInterface().equals(SimpleBeanImplMBean.class)); assertEquals(jmx2.name(), "test:name=NotBean1"); MetaDataContextInterceptor.classAnnotation = null; server.invoke(bean, "someMethod", new Object[0], new String[0]); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertEquals(jmx, MetaDataContextInterceptor.classAnnotation); } /** * Tests that adding the registerDirectly=true attribute allows a * standard MBean to be registered directly, while not specifying it * causes a proxy to be registered (even if the bean is a standard MBean). * Also confirms a bean that isn't an MBean will fail to deploy if * registerDirectly=true. * * @throws Exception */ public void testRegisterDirectly() throws Exception { MBeanServer server = (MBeanServer) getBean("MBeanServer"); assertNotNull(server); ObjectName name = new ObjectName("test:name=DirectRegistrant"); MBeanInfo info = server.getMBeanInfo(name); assertNotNull(info); MBeanAttributeInfo[] attrs = info.getAttributes(); assertEquals(1, attrs.length); assertEquals("RegisteredInJmx", attrs[0].getName()); assertTrue(attrs[0].isReadable()); assertFalse(attrs[0].isWritable()); JmxRegistrant bean = (JmxRegistrant) getBean("DirectRegistrant"); assertTrue("MBeanRegistration callbacks invoked", bean.isRegisteredInJmx()); name = new ObjectName("test:name=NotDirectRegistrant"); info = server.getMBeanInfo(name); assertNotNull(info); attrs = info.getAttributes(); assertEquals(1, attrs.length); assertEquals("RegisteredInJmx", attrs[0].getName()); assertTrue(attrs[0].isReadable()); assertFalse(attrs[0].isWritable()); bean = (JmxRegistrant) getBean("NotDirectRegistrant"); assertFalse("MBeanRegistration callbacks not invoked", bean.isRegisteredInJmx()); // Deploy a bean that should fail as it's not an mbean deploy("JMXDecorated-flawed.xml"); try { name = new ObjectName("test:name=FlawedRegistrant"); assertFalse(name + " not registered", server.isRegistered(name)); Object broken = null; try { broken = getBean("FlawedRegistrant"); } catch (Exception good) {} assertNull("FlawedRegistrant did not deploy", broken); } finally { undeploy("JMXDecorated-flawed.xml"); } } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyBaseTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000002171110760776332033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.InterceptorWithAnnotationDependency; import org.jboss.test.microcontainer.support.OverriddenPropertyAnnotatedBean; import org.jboss.test.microcontainer.support.SimpleBean; public abstract class InterceptorWithOverriddenMethodAnnotationDependencyBaseTest extends AOPMicrocontainerTest { public InterceptorWithOverriddenMethodAnnotationDependencyBaseTest(String name) { super(name); } public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception { deploy(getDependency1DD()); deploy(getDependency2DD()); try { SimpleBean dependency1 = (SimpleBean) getBean("Dependency1"); assertNotNull(dependency1); SimpleBean dependency2 = (SimpleBean) getBean("Dependency2"); assertNotNull(dependency2); deploy(getMainDD()); try { checkInterceptedAndInjected("Depends1", "A", dependency1); checkInterceptedAndInjected("Depends1", "B", dependency1); checkInterceptedAndInjected("Depends2", "B", dependency2); checkInterceptedAndInjected("Depends2", "B", dependency2); checkInterceptedAndInjected("Depends1And2", "A", dependency1); checkInterceptedAndInjected("Depends1And2", "B", dependency2); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } finally { undeploy(getMainDD()); } } finally { undeploy(getDependency1DD()); undeploy(getDependency2DD()); } } public void testInterceptorWithAnnotationDependencyWrongOrderAndRedeploy() throws Exception { deploy(getMainDD()); try { checkNotInstalledAndDescribed("Depends1"); checkNotInstalledAndDescribed("Depends2"); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); deploy(getDependency1DD()); try { SimpleBean dependency1 = (SimpleBean) getBean("Dependency1"); assertNotNull(dependency1); checkInterceptedAndInjected("Depends1", "A", dependency1); checkInterceptedAndInjected("Depends1", "B", dependency1); checkNotInstalledAndDescribed("Depends2"); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } finally { undeploy(getDependency1DD()); checkNotInstalledAndDescribed("Depends1"); checkNotInstalledAndDescribed("Depends2"); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } deploy(getDependency2DD()); try { SimpleBean dependency2 = (SimpleBean) getBean("Dependency2"); assertNotNull(dependency2); checkNotInstalledAndDescribed("Depends1"); checkInterceptedAndInjected("Depends2", "A", dependency2); checkInterceptedAndInjected("Depends2", "B", dependency2); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } finally { undeploy(getDependency2DD()); checkNotInstalledAndDescribed("Depends1"); checkNotInstalledAndDescribed("Depends2"); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } deploy(getDependency1DD()); deploy(getDependency2DD()); try { SimpleBean dependency1 = (SimpleBean) getBean("Dependency1"); assertNotNull(dependency1); SimpleBean dependency2 = (SimpleBean) getBean("Dependency2"); assertNotNull(dependency2); checkInterceptedAndInjected("Depends1", "A", dependency1); checkInterceptedAndInjected("Depends1", "B", dependency1); checkInterceptedAndInjected("Depends2", "A", dependency2); checkInterceptedAndInjected("Depends2", "B", dependency2); checkInterceptedAndInjected("Depends1And2", "A", dependency1); checkInterceptedAndInjected("Depends1And2", "B", dependency2); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } finally { undeploy(getDependency1DD()); undeploy(getDependency2DD()); checkNotInstalledAndDescribed("Depends1"); checkNotInstalledAndDescribed("Depends2"); checkNotInstalledAndDescribed("Depends1And2"); checkNotInstalledAndDescribed("NotDeployable"); checkNotInstalledAndDescribed("NotDeployable1"); checkNotInstalledAndDescribed("NotDeployable2"); } } finally { undeploy(getMainDD()); checkNotInstalledAndNotDescribed("Depends1"); checkNotInstalledAndNotDescribed("Depends2"); checkNotInstalledAndNotDescribed("Depends1And2"); checkNotInstalledAndNotDescribed("NotDeployable"); checkNotInstalledAndNotDescribed("NotDeployable1"); checkNotInstalledAndNotDescribed("NotDeployable2"); } } protected void configureLogging() { //enableTrace("org.jboss.kernel.plugins.dependency"); } private void checkInterceptedAndInjected(String name, String property, SimpleBean dependency) { InterceptorWithAnnotationDependency.intercepted = null; OverriddenPropertyAnnotatedBean bean = (OverriddenPropertyAnnotatedBean) getBean(name); assertNotNull(bean); if (property.equals("A")) { bean.setPropertyA(5); } else if (property.equals("B")) { bean.setPropertyB(5); } else { throw new RuntimeException("Invalid property passed in"); } assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted); } private void checkNotInstalledAndNotDescribed(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { } try { getBean(name, ControllerState.DESCRIBED); fail("'" + name + "' should not be described"); } catch(IllegalStateException expected) { } } private void checkNotInstalledAndDescribed(String name) { try { getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext(name, ControllerState.DESCRIBED); assertNotNull(context); } } protected abstract String getDependency1DD(); protected abstract String getDependency2DD(); protected abstract String getMainDD(); } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/LifecycleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000307510774766014033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleDeploymentTestCase extends LifecycleTest { public LifecycleDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(LifecycleDeploymentTestCase.class); } @Override protected String getFile() { return "LifecycleDeploymentTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/InterceptorWithOverriddenMethodAnnotationDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000377010452525647033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import junit.textui.TestRunner; public class InterceptorWithOverriddenMethodAnnotationDependencyTestCase extends InterceptorWithOverriddenMethodAnnotationDependencyBaseTest { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { return suite(InterceptorWithOverriddenMethodAnnotationDependencyTestCase.class); } public InterceptorWithOverriddenMethodAnnotationDependencyTestCase(String name) { super(name); } protected String getDependency1DD() { return "InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic0.xml"; } protected String getDependency2DD() { return "InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic1.xml"; } protected String getMainDD() { return "InterceptorWithOverriddenMethodAnnotationDependencyTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/MethodHashingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000001732410756314477033265 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import java.lang.reflect.Method; import java.util.Iterator; import java.util.Map; import javassist.CtClass; import javassist.CtMethod; import junit.framework.TestCase; import org.jboss.aop.util.ClassInfoMethodHashing; import org.jboss.aop.util.JavassistMethodHashing; import org.jboss.aop.util.MethodHashing; import org.jboss.aop.util.ReflectToJavassist; import org.jboss.reflect.plugins.introspection.IntrospectionTypeInfoFactory; import org.jboss.reflect.plugins.javassist.JavassistTypeInfoFactory; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.test.microcontainer.support.SubClass; /** * Test to make sure that the different mechanisms of creating method hashes return the same hashes * * @author Kabir Khan * @version $Revision: 61752 $ */ public class MethodHashingTestCase extends TestCase { public MethodHashingTestCase(String arg0) { super(arg0); } @SuppressWarnings("unchecked") public void testDeclaredMethodHashing() throws Exception { Class clazz = SubClass.class; CtClass ctclass = getCtClass(clazz); ClassInfo classInfoReflect = getIntrospectTypeInfo(clazz); ClassInfo classInfoJavassist = getJavassistTypeInfo(clazz); Map reflectInfoMethods = ClassInfoMethodHashing.getDeclaredMethodMap(classInfoReflect); Map javassistInfoMethods = ClassInfoMethodHashing.getDeclaredMethodMap(classInfoJavassist); Map javassistMethods = JavassistMethodHashing.getDeclaredMethodMap(ctclass); compareMaps(reflectInfoMethods, javassistInfoMethods, 1); compareMaps(reflectInfoMethods, javassistMethods, 1); for (Iterator it = reflectInfoMethods.keySet().iterator() ; it.hasNext() ; ) { Long hash = (Long)it.next(); CtMethod ctmethod = (CtMethod)javassistMethods.get(hash); MethodInfo methodInfo = (MethodInfo)reflectInfoMethods.get(hash); compareMethods(methodInfo, ctmethod); MethodInfo methodInfo2 = (MethodInfo)javassistInfoMethods.get(hash); compareMethods(methodInfo, methodInfo2); Method method = MethodHashing.findMethodByHash(clazz, hash.longValue()); assertNotNull(method); compareMethods(methodInfo, method); Method methodB = org.jboss.util.MethodHashing.findMethodByHash(clazz, hash.longValue()); assertNotNull(methodB); compareMethods(methodInfo, methodB); } } @SuppressWarnings("unchecked") public void testMethodHashing() throws Exception { Class clazz = SubClass.class; CtClass ctclass = getCtClass(clazz); ClassInfo classInfoReflect = getIntrospectTypeInfo(clazz); ClassInfo classInfoJavassist = getJavassistTypeInfo(clazz); Map reflectInfoMethods = ClassInfoMethodHashing.getMethodMap(classInfoReflect); Map javassistInfoMethods = ClassInfoMethodHashing.getMethodMap(classInfoJavassist); Map javassistMethods = JavassistMethodHashing.getMethodMap(ctclass); compareMaps(reflectInfoMethods, javassistInfoMethods, 2); compareMaps(reflectInfoMethods, javassistMethods, 2); for (Iterator it = reflectInfoMethods.keySet().iterator() ; it.hasNext() ; ) { Long hash = (Long)it.next(); CtMethod ctmethod = (CtMethod)javassistMethods.get(hash); MethodInfo methodInfo = (MethodInfo)reflectInfoMethods.get(hash); compareMethods(methodInfo, ctmethod); MethodInfo methodInfo2 = (MethodInfo)javassistInfoMethods.get(hash); compareMethods(methodInfo, methodInfo2); Method method = MethodHashing.findMethodByHash(clazz, hash.longValue()); assertNotNull(method); compareMethods(methodInfo, method); Method methodB = org.jboss.util.MethodHashing.findMethodByHash(clazz, hash.longValue()); assertNotNull(methodB); compareMethods(methodInfo, methodB); } } private CtClass getCtClass(Class clazz) throws Exception { return ReflectToJavassist.classToJavassist(clazz); } private ClassInfo getIntrospectTypeInfo(Class clazz) { IntrospectionTypeInfoFactory typeInfoFactory = new IntrospectionTypeInfoFactory(); ClassInfo classInfo = (ClassInfo)typeInfoFactory.getTypeInfo(clazz); return classInfo; } private ClassInfo getJavassistTypeInfo(Class clazz) { JavassistTypeInfoFactory typeInfoFactory = new JavassistTypeInfoFactory(); ClassInfo classInfo = (ClassInfo)typeInfoFactory.getTypeInfo(clazz); return classInfo; } @SuppressWarnings("unchecked") private void compareMaps(Map mapA, Map mapB, int expecedSize) { assertEquals(expecedSize, mapA.size()); assertEquals(expecedSize, mapB.size()); for (Iterator it = mapA.keySet().iterator() ; it.hasNext() ; ) { Long l = (Long)it.next(); assertNotNull(mapB.get(l)); } } private void compareMethods(MethodInfo methodInfo, CtMethod method) throws Exception { System.out.println("-----> method " + method); assertEquals(methodInfo.getName(), method.getName()); assertEquals(methodInfo.getDeclaringClass().getName(), method.getDeclaringClass().getName()); assertEquals(methodInfo.getReturnType().getName(), method.getReturnType().getName()); assertEquals(methodInfo.getModifiers(), method.getModifiers()); assertEquals(methodInfo.getParameterTypes().length, method.getParameterTypes().length); } private void compareMethods(MethodInfo methodInfo, MethodInfo method) throws Exception { System.out.println("-----> method " + method); assertEquals(methodInfo.getName(), method.getName()); assertEquals(methodInfo.getDeclaringClass().getName(), method.getDeclaringClass().getName()); assertEquals(methodInfo.getReturnType().getName(), method.getReturnType().getName()); assertEquals(methodInfo.getModifiers(), method.getModifiers()); assertEquals(methodInfo.getParameterTypes().length, method.getParameterTypes().length); } private void compareMethods(MethodInfo methodInfo, Method method) throws Exception { System.out.println("-----> method " + method); assertEquals(methodInfo.getName(), method.getName()); assertEquals(methodInfo.getDeclaringClass().getName(), method.getDeclaringClass().getName()); assertEquals(methodInfo.getReturnType().getName(), method.getReturnType().getName()); assertEquals(methodInfo.getModifiers(), method.getModifiers()); assertEquals(methodInfo.getParameterTypes().length, method.getParameterTypes().length); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/test/MetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/t0000644000175000017500000000720710760776332033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.MetaDataContextInterceptor; import org.jboss.test.microcontainer.support.PropertyBean; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class MetaDataTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(MetaDataTestCase.class); } public MetaDataTestCase(String name) { super(name); } /** * Test that the two beans indeed have different metadata values * * @throws Exception for any error */ public void testBeanMetaData() throws Exception { PropertyBean bean = (PropertyBean)getBean("Bean"); MetaDataContextInterceptor.reset(); assertEquals(5, bean.getIntProperty()); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertNull(MetaDataContextInterceptor.joinpointAnnotation); MetaDataContextInterceptor.reset(); assertEquals("Bean", bean.getStringProperty()); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertNull(MetaDataContextInterceptor.joinpointAnnotation); } /** * Test that the two beans indeed have different metadata values * * @throws Exception for any error */ public void testPropertyMetaData() throws Exception { PropertyBean bean1 = (PropertyBean)getBean("Bean1"); MetaDataContextInterceptor.reset(); assertEquals(10, bean1.getIntProperty()); assertNull(MetaDataContextInterceptor.classAnnotation); assertNotNull(MetaDataContextInterceptor.joinpointAnnotation); MetaDataContextInterceptor.reset(); assertEquals("Bean1", bean1.getStringProperty()); assertNull(MetaDataContextInterceptor.classAnnotation); assertNull(MetaDataContextInterceptor.joinpointAnnotation); } /** * Test that the two beans indeed have different metadata values * * @throws Exception for any error */ public void testNoMetaData() throws Exception { PropertyBean bean1 = (PropertyBean)getBean("NoMetaDataBean"); MetaDataContextInterceptor.reset(); assertEquals(50, bean1.getIntProperty()); assertNull(MetaDataContextInterceptor.classAnnotation); assertNull(MetaDataContextInterceptor.joinpointAnnotation); MetaDataContextInterceptor.reset(); assertEquals("NoMetaDataBean", bean1.getStringProperty()); assertNull(MetaDataContextInterceptor.classAnnotation); assertNull(MetaDataContextInterceptor.joinpointAnnotation); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000755000175000017500000000000011620312204033203 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/PerVmAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264010721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PerVmAspect { public static PerVmAspect last; public Object advice(MethodInvocation mi) throws Throwable { last = this; return mi.invokeNext(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000257111137570512033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class POJO implements iPOJO { public int method(int i) { return i * 2; } public void method() { } public void defaultMethod() { } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/POJO2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000245410721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class POJO2 { public int method(int i) { return i * 2; } public void method() { } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000755000175000017500000000000011620312203033202 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000350710760776332033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.SimpleFactoryInterceptor; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class InterceptorFactorySimpleTest extends AOPMicrocontainerTest { public InterceptorFactorySimpleTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(SimpleFactoryInterceptor.invoked == 100); } }././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyDeploymentDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000346310774766014033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyDeploymentDifferentOrderTestCase extends InterceptorWithDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new InterceptorWithDependencyDeploymentTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new InterceptorWithDependencyDeploymentTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public InterceptorWithDependencyDeploymentDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainParentAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270111037703124033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainParentAopTestCase extends DomainParentTest { public DomainParentAopTestCase(String name) { super(name); } public static Test suite() { return suite(DomainParentAopTestCase.class); } } ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000357110721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyAopDifferentOrderTestCase extends MultipleAdvicesWithMultipleDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithMultipleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithMultipleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithMultipleDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionClassesDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273710774766014033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionClassesDeploymentTestCase extends IntroductionClassesTest { public static Test suite() { return suite(IntroductionClassesDeploymentTestCase.class); } public IntroductionClassesDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ThrowawayMetaDataTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000311710776242271033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ThrowawayMetaDataTest extends AOPMicrocontainerTest { public static Test suite() { return suite(ThrowawayMetaDataTest.class); } public ThrowawayMetaDataTest(String name) { super(name); } public void testMetaData() { System.out.println("Hello!!!"); } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000303011137570512033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverridePropertyReplacementBeansTestCase extends AnnotationOverridePropertyReplacementTest { public static Test suite() { return suite(AnnotationOverridePropertyReplacementBeansTestCase.class); } public AnnotationOverridePropertyReplacementBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainSimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270710722541214033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainSimpleBeansTestCase extends DomainSimpleTest { public DomainSimpleBeansTestCase(String name) { super(name); } public static Test suite() { return suite(DomainSimpleBeansTestCase.class); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270410776242271033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataAopTestCase extends ClassMetaDataTest { public static Test suite() { return suite(ClassMetaDataAopTestCase.class); } public ClassMetaDataAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000335010721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyAopTestCase extends InterceptorWithDependencyTest { public static Test suite() { return suite(InterceptorWithDependencyAopTestCase.class); } public InterceptorWithDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "InterceptorWithDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "InterceptorWithDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000453311137570512033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.aop.junit.AOPMicrocontainerTestDelegate; import org.jboss.test.microcontainer.beans.AnnotationWithValueAspect; import org.jboss.test.microcontainer.beans.POJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverridePropertyReplacementTest extends AOPMicrocontainerTest { public AnnotationOverridePropertyReplacementTest(String name) { // FIXME AnnotationOverridePropertyReplacementTest constructor super(name); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { //Run this test without security since we need to set system properties System.setProperty("integer", "100"); AOPMicrocontainerTestDelegate delegate = new AOPMicrocontainerTestDelegate(clazz); return delegate; } public void testPropertyReplacement() { AnnotationWithValueAspect.value = null; POJO pojo = (POJO)getBean("Bean"); pojo.method(2); assertNull(AnnotationWithValueAspect.value); pojo.method(); assertNotNull(AnnotationWithValueAspect.value); assertEquals(100, AnnotationWithValueAspect.value.integer()); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinClassesAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265610721416203033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinClassesAopTestCase extends MixinClassesTest { public static Test suite() { return suite(MixinClassesAopTestCase.class); } public MixinClassesAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerClassAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000433711202060324033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.ScopedFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactoryPerClassAopTestCase extends AOPMicrocontainerTest { public ScopedAspectFactoryPerClassAopTestCase(String name) { super(name); } public void testPerClass() throws Exception { POJO pojo = (POJO)getBean("POJO1A"); POJO2 pojo2 = (POJO2)getBean("POJO2"); ScopedFactoryAspect.last = null; pojo.method(); ScopedFactoryAspect a1 = ScopedFactoryAspect.last; assertNotNull(a1); ScopedFactoryAspect.last = null; pojo2.method(); ScopedFactoryAspect a2 = ScopedFactoryAspect.last; assertNotNull(a2); assertNotSame(a1, a2); ScopedFactoryAspect.last = null; pojo.method(3); ScopedFactoryAspect a3 = ScopedFactoryAspect.last; assertNotNull(a3); assertSame(a1, a3); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainSimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001232410776242271033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.DeclareDef; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; import org.jboss.test.microcontainer.beans.TestAspectWithProperty; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class DomainSimpleTest extends DomainProxyTest { public DomainSimpleTest(String name) { super(name); } public void testDomain() { TestAspect.invoked = false; TestInterceptor.invoked = false; TestAspectWithProperty.last = null; POJO pojo = (POJO)createProxy("AOPDomain", new POJO()); assertNotNull(pojo); pojo.method(); assertNotNull(TestAspectWithProperty.last); assertEquals("This is only a test", TestAspectWithProperty.last.getSomeProperty()); assertTrue(TestInterceptor.invoked); assertTrue(TestAspect.invoked); AspectManager domain = getDomain("AOPDomain"); checkArtifacts(domain, true); } public void testNoDomain() { TestInterceptor.invoked = false; TestAspectWithProperty.last = null; TestAspect.invoked = false; POJO pojo = (POJO)createProxy(new POJO()); assertNotNull(pojo); pojo.method(); assertNull(TestAspectWithProperty.last); assertFalse(TestInterceptor.invoked); assertFalse(TestAspect.invoked); AspectManager manager = getMainAspectManager(); checkArtifacts(manager, false); } @SuppressWarnings("unchecked") private void checkArtifacts(AspectManager manager, boolean shouldBeThere) { Object o = manager.getTypedef("TypeDef"); checkShouldBeThere(o, shouldBeThere); o = manager.getCFlowStack("CFlow"); checkShouldBeThere(o, shouldBeThere); o = manager.getDynamicCFlow("DynamicCFlow"); checkShouldBeThere(o, shouldBeThere); o = manager.getPointcut("Prepare"); checkShouldBeThere(o, shouldBeThere); o = manager.getPointcut("NamedPointcut"); checkShouldBeThere(o, shouldBeThere); o = manager.getInterfaceIntroduction("MixinBinding"); checkShouldBeThere(o, shouldBeThere); List coll = manager.getAnnotationIntroductions(); checkShouldBeThere(coll, shouldBeThere); coll = manager.getAnnotationOverrides(); checkShouldBeThere(coll, shouldBeThere); Map map = manager.getPrecedenceDefs(); checkShouldBeThere(map, shouldBeThere); map = manager.getArrayReplacements(); checkShouldBeThere(map, shouldBeThere); o = manager.getArrayBinding("TestArrayBinding"); checkShouldBeThere(o, shouldBeThere); checkShouldBeThere(manager.getClassMetaData().keySet(), shouldBeThere); checkShouldBeThere(manager.getClassMetaDataLoaders().keySet(), shouldBeThere); Iterator it = manager.getDeclares(); if (shouldBeThere) { assertTrue(it.hasNext()); o = it.next(); assertNotNull(o); } assertFalse(it.hasNext()); } private void checkShouldBeThere(Object o, boolean shouldBeThere) { if (shouldBeThere) assertNotNull(o); else assertNull(o); } @SuppressWarnings("unchecked") private void checkShouldBeThere(Collection coll, boolean shouldBeThere) { if (shouldBeThere) { assertNotNull(coll); assertEquals(1, coll.size()); } else { if (coll != null) { assertEquals(0, coll.size()); } } } @SuppressWarnings("unchecked") private void checkShouldBeThere(Map coll, boolean shouldBeThere) { if (shouldBeThere) { assertNotNull(coll); assertEquals(1, coll.size()); } else { if (coll != null) { assertEquals(0, coll.size()); } } } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/PrecedenceAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265010721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceAopTestCase extends PrecedenceTest { public static Test suite() { return suite(PrecedenceAopTestCase.class); } public PrecedenceAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000343210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyBeansDifferentOrderTestCase extends InterceptorWithDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new InterceptorWithDependencyBeansTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new InterceptorWithDependencyBeansTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public InterceptorWithDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000337411137570512033227 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactoryWithDependencyBeansTestCase extends AspectFactoryWithDependencyTest { public static Test suite() { return suite(AspectFactoryWithDependencyBeansTestCase.class); } public AspectFactoryWithDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectFactoryWithDependencyBeansTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/UndeploySimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000313711021241142033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class UndeploySimpleDeploymentTestCase extends UndeploySimpleTest { public UndeploySimpleDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(UndeploySimpleDeploymentTestCase.class); } @Override protected String getFileName() { return "UndeploySimpleDeploymentTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerJoinpointAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000652611202060324033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.ScopedFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactoryPerJoinpointAopTestCase extends AOPMicrocontainerTest { public ScopedAspectFactoryPerJoinpointAopTestCase(String name) { super(name); } public void testPerJoinPoint() throws Exception { POJO pojoA = (POJO)getBean("POJO1A"); POJO pojoB = (POJO)getBean("POJO1B"); POJO2 pojo2 = (POJO2)getBean("POJO2"); ScopedFactoryAspect.last = null; pojoA.method(); ScopedFactoryAspect a1 = ScopedFactoryAspect.last; assertNotNull(a1); ScopedFactoryAspect.last = null; pojoA.method(1); ScopedFactoryAspect a2 = ScopedFactoryAspect.last; assertNotNull(a2); ScopedFactoryAspect.last = null; pojoB.method(); ScopedFactoryAspect a3 = ScopedFactoryAspect.last; assertNotNull(a3); ScopedFactoryAspect.last = null; pojoB.method(1); ScopedFactoryAspect a4 = ScopedFactoryAspect.last; assertNotNull(a4); ScopedFactoryAspect.last = null; pojo2.method(); ScopedFactoryAspect a5 = ScopedFactoryAspect.last; assertNotNull(a5); ScopedFactoryAspect.last = null; pojo2.method(1); ScopedFactoryAspect a6 = ScopedFactoryAspect.last; assertNotNull(a6); assertNotSame(a1, a2); assertNotSame(a1, a3); assertNotSame(a1, a4); assertNotSame(a1, a5); assertNotSame(a1, a6); assertNotSame(a2, a3); assertNotSame(a2, a4); assertNotSame(a2, a5); assertNotSame(a2, a6); assertNotSame(a3, a4); assertNotSame(a3, a5); assertNotSame(a3, a6); assertNotSame(a4, a5); assertNotSame(a4, a6); assertNotSame(a5, a6); ScopedFactoryAspect.last = null; pojoA.method(); ScopedFactoryAspect a7 = ScopedFactoryAspect.last; assertNotNull(a7); assertSame(a1, a7); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271610721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactorySimpleBeansTestCase extends AspectFactorySimpleTest { public static Test suite() { return suite(AspectFactorySimpleBeansTestCase.class); } public AspectFactorySimpleBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/BeanMetaDataFactoryParserDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000322611021261744033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanMetaDataFactoryParserDeploymentTestCase extends BeanMetaDataFactoryParserTest { public BeanMetaDataFactoryParserDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(BeanMetaDataFactoryParserDeploymentTestCase.class); } @Override protected String getFileName() { return "BeanMetaDataFactoryParserDeploymentTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyDeploymentDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000347410774766014033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyDeploymentDifferentOrderTestCase extends StackWithSingleDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithSingleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithSingleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithSingleDependencyDeploymentDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271010721416203033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorSimpleBeansTestCase extends InterceptorSimpleTest { public static Test suite() { return suite(InterceptorSimpleBeansTestCase.class); } public InterceptorSimpleBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000450410776242271033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestClassMetaDataAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class ClassMetaDataTest extends AOPMicrocontainerTest { public void testMetaData() throws Exception { POJO pojo = (POJO)getBean("Bean"); assertNotNull(pojo); assertInvokedLastAndClass("ctor"); TestClassMetaDataAspect.reset(); pojo.method(2); assertInvokedLastAndClass("method1"); TestClassMetaDataAspect.reset(); pojo.method(); assertInvokedLastAndClass("method2"); TestClassMetaDataAspect.reset(); pojo.defaultMethod(); assertInvokedLastAndClass("default"); } private void assertInvokedLastAndClass(String last) { assertTrue(TestClassMetaDataAspect.invoked); assertEquals(last, TestClassMetaDataAspect.last); assertEquals("clazz1", TestClassMetaDataAspect.clazz1); assertEquals("clazz2", TestClassMetaDataAspect.clazz2); } public ClassMetaDataTest(String name) { super(name); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleStackTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000426610760776332033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.SimpleFactoryAspect; import org.jboss.test.microcontainer.beans.SimpleFactoryInterceptor; import org.jboss.test.microcontainer.beans.TestAspect; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MultipleStackTest extends AOPMicrocontainerTest { public MultipleStackTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; SimpleFactoryAspect.invoked = 0; TestInterceptor.invoked = false; SimpleFactoryInterceptor.invoked = 0; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(SimpleFactoryAspect.invoked == 100); assertTrue(TestAspect.invoked); assertTrue(SimpleFactoryInterceptor.invoked == 100); assertTrue(TestInterceptor.invoked); } }././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000345310721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyAopTestCase extends MultipleAdvicesWithSingleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithSingleDependencyAopTestCase.class); } public MultipleAdvicesWithSingleDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "MultipleAdvicesWithSingleDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "MultipleAdvicesWithSingleDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DeclareBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265710774766014033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeclareBeansTestCase extends DeclareTest { public DeclareBeansTestCase(String name) { super(name); } public static Test suite() { return suite(DeclareBeansTestCase.class); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionExprDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272310774766014033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionExprDeploymentTestCase extends IntroductionExprTest { public static Test suite() { return suite(IntroductionExprDeploymentTestCase.class); } public IntroductionExprDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyDeploymentDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000350610774766014033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyDeploymentDifferentOrderTestCase extends StackWithMultipleDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithMultipleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithMultipleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithMultipleDependencyDeploymentDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000276110776242271033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataLoaderDeploymentTestCase extends ClassMetaDataLoaderTest { public static Test suite() { return suite(ClassMetaDataLoaderDeploymentTestCase.class); } public ClassMetaDataLoaderDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264710774766014033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackDeploymentTestCase extends StackTest { public static Test suite() { return suite(StackDeploymentTestCase.class); } public StackDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/PrecedenceTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000404510760776332033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.List; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Interceptions; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class PrecedenceTest extends AOPMicrocontainerTest { public PrecedenceTest(String name) { super(name); } public void testIntercepted() throws Exception { Interceptions.reset(); POJO pojo = (POJO)getBean("Bean"); pojo.method(2); List interceptions = Interceptions.interceptions(); assertEquals(2, interceptions.size()); assertEquals(TestInterceptor.class, interceptions.get(0).getClass()); assertEquals(TestAspect.class, interceptions.get(1).getClass()); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000263010721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackBeansTestCase extends StackTest { public static Test suite() { return suite(StackBeansTestCase.class); } public StackBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000304711137570512033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverridePropertyReplacementDeploymentTestCase extends AnnotationOverridePropertyReplacementTest { public static Test suite() { return suite(AnnotationOverridePropertyReplacementDeploymentTestCase.class); } public AnnotationOverridePropertyReplacementDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NamedPointcutAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266210721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NamedPointcutAopTestCase extends NamedPointcutTest { public static Test suite() { return suite(NamedPointcutAopTestCase.class); } public NamedPointcutAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyDeploymentDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000362210774766014033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyDeploymentDifferentOrderTestCase extends MultipleAdvicesWithSingleDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithSingleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithSingleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithSingleDependencyDeploymentDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NamedPointcutTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000336510760776332033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class NamedPointcutTest extends AOPMicrocontainerTest { public NamedPointcutTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); pojo.method(2); assertFalse(TestAspect.invoked); pojo.method(); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000341011137570512033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactoryWithDependencyAopTestCase extends AspectFactoryWithDependencyTest { public static Test suite() { return suite(AspectFactoryWithDependencyAopTestCase.class); } public AspectFactoryWithDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectFactoryWithDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectFactoryWithDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000442010776242271033226 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestClassMetaDataAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class ClassMetaDataLoaderTest extends AOPMicrocontainerTest { public void testMetaData() throws Exception { POJO pojo = (POJO)getBean("Bean"); assertNotNull(pojo); assertTrue(TestClassMetaDataAspect.invoked); assertEquals("Ccustom1", TestClassMetaDataAspect.last); TestClassMetaDataAspect.invoked = false; TestClassMetaDataAspect.last = null; pojo.method(2); assertTrue(TestClassMetaDataAspect.invoked); assertEquals("Mcustom1", TestClassMetaDataAspect.last); TestClassMetaDataAspect.invoked = false; TestClassMetaDataAspect.last = null; pojo.method(); assertTrue(TestClassMetaDataAspect.invoked); assertEquals("Mcustom1", TestClassMetaDataAspect.last); } public ClassMetaDataLoaderTest(String name) { // FIXME ClassMetaDataLoaderTest constructor super(name); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverridePropertyReplacementAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000302211137570512033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverridePropertyReplacementAopTestCase extends AnnotationOverridePropertyReplacementTest { public static Test suite() { return suite(AnnotationOverridePropertyReplacementAopTestCase.class); } public AnnotationOverridePropertyReplacementAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/CFlowAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000262210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowAopTestCase extends CFlowTest { public static Test suite() { return suite(CFlowAopTestCase.class); } public CFlowAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DynamicCFlowDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270310774766014033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowDeploymentTestCase extends DynamicCFlowTest { public static Test suite() { return suite(DynamicCFlowDeploymentTestCase.class); } public DynamicCFlowDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinClassesTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000354210760776332033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.MixinInterface; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MixinClassesTest extends AOPMicrocontainerTest { public MixinClassesTest(String name) { super(name); } public void testIntroduced() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); assertTrue(pojo instanceof MixinInterface); pojo.method(); assertTrue(TestAspect.invoked); assertEquals("DEFAULT", ((MixinInterface)pojo).getMixinValue()); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266410721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectBeansTestCase extends ScopedAspectTest { public static Test suite() { return suite(ScopedAspectBeansTestCase.class); } public ScopedAspectBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleStackAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266210721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleStackAopTestCase extends MultipleStackTest { public static Test suite() { return suite(MultipleStackAopTestCase.class); } public MultipleStackAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdviceTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000355110760776332033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MultipleAdviceTest extends AOPMicrocontainerTest { public MultipleAdviceTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; TestInterceptor.invoked = false; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(TestAspect.invoked); assertTrue(TestInterceptor.invoked); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/CFlowDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264710774766014033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowDeploymentTestCase extends CFlowTest { public static Test suite() { return suite(CFlowDeploymentTestCase.class); } public CFlowDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000332410721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyBeansTestCase extends AspectWithDependencyTest { public static Test suite() { return suite(AspectWithDependencyBeansTestCase.class); } public AspectWithDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectWithDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectWithDependencyBeansTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000262210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackAopTestCase extends StackTest { public static Test suite() { return suite(StackAopTestCase.class); } public StackAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001736210760776332033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithDependency; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MultipleAdvicesWithSingleDependencyTest extends AOPMicrocontainerTest { public MultipleAdvicesWithSingleDependencyTest(String name) { super(name); } protected abstract String getFile0(); protected abstract String getFile1(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", pojo); deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); int called = TestAspectWithDependency.called; TestInterceptor.invoked = false; pojo.method(2); assertTrue("Interceptor was not rebound", called + 1 == TestAspectWithDependency.called); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } }././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000300710774766014033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorFactorySimpleDeploymentTestCase extends InterceptorFactorySimpleTest { public static Test suite() { return suite(InterceptorFactorySimpleDeploymentTestCase.class); } public InterceptorFactorySimpleDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NamedPointcutDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270010774766014033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NamedPointcutDeploymentTestCase extends NamedPointcutTest { public static Test suite() { return suite(NamedPointcutAopTestCase.class); } public NamedPointcutDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverrideBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271410721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverrideBeansTestCase extends AnnotationOverrideTest { public static Test suite() { return suite(AnnotationOverrideBeansTestCase.class); } public AnnotationOverrideBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000357110721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase extends MultipleAdvicesWithSingleDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithSingleDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionClassesTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000362011220434423033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.IntroductionInterface; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class IntroductionClassesTest extends AOPMicrocontainerTest { public IntroductionClassesTest(String name) { super(name); } // public void setUp() throws Exception // { // super.setUp(); // } // public void testIntroduced() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); assertTrue(pojo instanceof IntroductionInterface); pojo.method(); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000342010721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyAopDifferentOrderTestCase extends InterceptorWithDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new InterceptorWithDependencyAopTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new InterceptorWithDependencyAopTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public InterceptorWithDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/UndeploySimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001142711021241142033207 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.Map; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.DeclareDef; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class UndeploySimpleTest extends AOPMicrocontainerTest { public UndeploySimpleTest(String name) { super(name); } public void testUndeploy() throws Exception { AspectManager manager = AspectManager.instance(); checkArtifacts(manager, false); deploy(getFileName()); boolean error = true; try { checkArtifacts(manager, true); error = false; } finally { try { undeploy(getFileName()); } catch (Throwable t) { if (!error) { // AutoGenerated throw new RuntimeException(t); } } } checkArtifacts(manager, false); } @SuppressWarnings("unchecked") private void checkArtifacts(AspectManager manager, boolean shouldBeThere) { Object o = manager.getTypedef("TypeDef"); checkShouldBeThere(o, shouldBeThere); o = manager.getCFlowStack("CFlow"); checkShouldBeThere(o, shouldBeThere); o = manager.getDynamicCFlow("DynamicCFlow"); checkShouldBeThere(o, shouldBeThere); Map map = manager.getPointcuts(); checkShouldBeThere(map.keySet(), 3, shouldBeThere); map = manager.getInterfaceIntroductions(); //No name needed checkShouldBeThere(map.keySet(), shouldBeThere); List coll = manager.getAnnotationIntroductions(); //No name needed checkShouldBeThere(coll, shouldBeThere); coll = manager.getAnnotationOverrides(); //No name needed checkShouldBeThere(coll, shouldBeThere); map = manager.getPrecedenceDefs(); // No name needed checkShouldBeThere(map, shouldBeThere); map = manager.getArrayReplacements(); //No name needed checkShouldBeThere(map, shouldBeThere); checkShouldBeThere(manager.getClassMetaData().keySet(), shouldBeThere); checkShouldBeThere(manager.getClassMetaDataLoaders().keySet(), shouldBeThere); Iterator it = manager.getDeclares(); if (shouldBeThere) { assertTrue(it.hasNext()); o = it.next(); assertNotNull(o); } assertFalse(it.hasNext()); } private void checkShouldBeThere(Object o, boolean shouldBeThere) { if (shouldBeThere) assertNotNull(o); else assertNull(o); } @SuppressWarnings("unchecked") private void checkShouldBeThere(Collection coll, boolean shouldBeThere) { checkShouldBeThere(coll, 1, shouldBeThere); } @SuppressWarnings("unchecked") private void checkShouldBeThere(Collection coll, int sizeIfThere, boolean shouldBeThere) { if (shouldBeThere) { assertNotNull(coll); assertEquals(sizeIfThere, coll.size()); } else { if (coll != null) { assertEquals(0, coll.size()); } } } @SuppressWarnings("unchecked") private void checkShouldBeThere(Map coll, boolean shouldBeThere) { if (shouldBeThere) { assertNotNull(coll); assertEquals(1, coll.size()); } else { if (coll != null) { assertEquals(0, coll.size()); } } } protected abstract String getFileName(); } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerVmAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000432211202060324033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.ScopedFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactoryPerVmAopTestCase extends AOPMicrocontainerTest { public ScopedAspectFactoryPerVmAopTestCase(String name) { super(name); } public void testPerVm() throws Exception { POJO pojo = (POJO)getBean("POJO1A"); POJO2 pojo2 = (POJO2)getBean("POJO2"); ScopedFactoryAspect.last = null; pojo.method(); ScopedFactoryAspect a1 = ScopedFactoryAspect.last; assertNotNull(a1); ScopedFactoryAspect.last = null; pojo2.method(); ScopedFactoryAspect a2 = ScopedFactoryAspect.last; assertNotNull(a2); assertSame(a1, a2); ScopedFactoryAspect.last = null; pojo.method(3); ScopedFactoryAspect a3 = ScopedFactoryAspect.last; assertNotNull(a3); assertSame(a1, a3); } }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000335710721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyAopTestCase extends StackWithSingleDependencyTest { public static Test suite() { return suite(StackWithSingleDependencyAopTestCase.class); } public StackWithSingleDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithSingleDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithSingleDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000002353310760776332033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithDependency; import org.jboss.test.microcontainer.beans.TestInterceptorWithDependency; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MultipleAdvicesWithMultipleDependencyTest extends AOPMicrocontainerTest { public MultipleAdvicesWithMultipleDependencyTest(String name) { super(name); } public abstract String getFile0(); public abstract String getFile1(); public abstract String getFile2(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); deploy(getFile1()); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); try { deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile2()); try { checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { validate(); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } finally { undeploy(getFile2()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile2()); try { checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { validate(); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkNoIntercepted1(); checkIntercepted2(dependency2); checkNoIntercepted3(); deploy(getFile0()); try { validate(); Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile2()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } assertNotNull(dependency1); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } private void checkIntercepted1(Dependency dependency1) { POJO pojo1 = (POJO) getBean("Intercepted1"); assertNotNull(pojo1); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo1.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency1 == TestAspectWithDependency.invoked); assertNull(TestInterceptorWithDependency.invoked); } private void checkIntercepted2(Dependency dependency2) { POJO pojo2 = (POJO) getBean("Intercepted2"); assertNotNull(pojo2); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo2.method(2); assertNull(TestAspectWithDependency.invoked); assertNotNull(TestInterceptorWithDependency.invoked); System.out.println(TestInterceptorWithDependency.invoked); assertTrue(dependency2 == TestInterceptorWithDependency.invoked); } private void checkIntercepted3(Dependency dependency1, Dependency dependency2) { POJO pojo3 = (POJO) getBean("Intercepted3"); assertNotNull(pojo3); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo3.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency1 == TestAspectWithDependency.invoked); assertNotNull(TestInterceptorWithDependency.invoked); assertTrue(dependency2 == TestInterceptorWithDependency.invoked); } private void checkNoIntercepted1() { checkNoIntercepted("Intercepted1"); } private void checkNoIntercepted2() { checkNoIntercepted("Intercepted2"); } private void checkNoIntercepted3() { checkNoIntercepted("Intercepted3"); } private void checkNoIntercepted(String name) { POJO pojo; try { pojo = (POJO) getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean(name, ControllerState.DESCRIBED); assertNull(name + " should not be deployed until the interceptor is", pojo); } }././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerClassJoinpointAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000655111202060324033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.ScopedFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactoryPerClassJoinpointAopTestCase extends AOPMicrocontainerTest { public ScopedAspectFactoryPerClassJoinpointAopTestCase(String name) { super(name); } public void testPerClassJoinPoint() throws Exception { POJO pojoA = (POJO)getBean("POJO1A"); POJO pojoB = (POJO)getBean("POJO1B"); POJO2 pojo2 = (POJO2)getBean("POJO2"); ScopedFactoryAspect.last = null; pojoA.method(); ScopedFactoryAspect a1 = ScopedFactoryAspect.last; assertNotNull(a1); ScopedFactoryAspect.last = null; pojoA.method(1); ScopedFactoryAspect a2 = ScopedFactoryAspect.last; assertNotNull(a2); ScopedFactoryAspect.last = null; pojoB.method(); ScopedFactoryAspect a3 = ScopedFactoryAspect.last; assertNotNull(a3); ScopedFactoryAspect.last = null; pojoB.method(1); ScopedFactoryAspect a4 = ScopedFactoryAspect.last; assertNotNull(a4); ScopedFactoryAspect.last = null; pojo2.method(); ScopedFactoryAspect a5 = ScopedFactoryAspect.last; assertNotNull(a5); ScopedFactoryAspect.last = null; pojo2.method(1); ScopedFactoryAspect a6 = ScopedFactoryAspect.last; assertNotNull(a6); assertNotSame(a1, a2); assertSame(a1, a3); assertNotSame(a1, a4); assertNotSame(a1, a5); assertNotSame(a1, a6); assertNotSame(a2, a3); assertSame(a2, a4); assertNotSame(a2, a5); assertNotSame(a2, a6); assertNotSame(a3, a4); assertNotSame(a3, a5); assertNotSame(a3, a6); assertNotSame(a4, a5); assertNotSame(a4, a6); assertNotSame(a5, a6); ScopedFactoryAspect.last = null; pojoA.method(); ScopedFactoryAspect a7 = ScopedFactoryAspect.last; assertNotNull(a7); assertSame(a1, a7); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/UndeploySimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000310611021241142033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class UndeploySimpleAopTestCase extends UndeploySimpleTest { public UndeploySimpleAopTestCase(String name) { super(name); } public static Test suite() { return suite(UndeploySimpleAopTestCase.class); } @Override protected String getFileName() { return "UndeploySimpleAopTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/LightweightAspectDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000275710774766014033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LightweightAspectDeploymentTestCase extends LightweightAspectTest { public static Test suite() { return suite(LightweightAspectDeploymentTestCase.class); } public LightweightAspectDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000337110721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyBeansTestCase extends StackWithSingleDependencyTest { public static Test suite() { return suite(StackWithSingleDependencyBeansTestCase.class); } public StackWithSingleDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithSingleDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithSingleDependencyBeansTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000343510721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyBeansDifferentOrderTestCase extends AspectWithDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new AspectWithDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new AspectWithDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public AspectWithDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverrideTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000336610760776332033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverrideTest extends AOPMicrocontainerTest { public AnnotationOverrideTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); pojo.method(2); assertFalse(TestAspect.invoked); pojo.method(); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/LightweightAspectBeanTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273510721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LightweightAspectBeanTestCase extends LightweightAspectTest { public static Test suite() { return suite(LightweightAspectBeanTestCase.class); } public LightweightAspectBeanTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainSimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272610774766014033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainSimpleDeploymentTestCase extends DomainSimpleTest { public DomainSimpleDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(DomainSimpleDeploymentTestCase.class); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/UndeploySimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000311111021241142033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class UndeploySimpleBeansTestCase extends UndeploySimpleTest { public UndeploySimpleBeansTestCase(String name) { super(name); } public static Test suite() { return suite(UndeploySimpleBeansTestCase.class); } @Override protected String getFileName() { return "UndeploySimpleBeansTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverrideDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273310774766014033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverrideDeploymentTestCase extends AnnotationOverrideTest { public static Test suite() { return suite(AnnotationOverrideDeploymentTestCase.class); } public AnnotationOverrideDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainProxyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000571410760776332033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.aop.AspectManager; import org.jboss.aop.DomainDefinition; import org.jboss.aop.proxy.container.AOPProxyFactoryParameters; import org.jboss.aop.proxy.container.ContainerCache; import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainProxyTest extends AOPMicrocontainerTest { GeneratedAOPProxyFactory proxyFactory = new GeneratedAOPProxyFactory(); public DomainProxyTest(String name) { super(name); } protected AspectManager getMainAspectManager() { AspectManager manager = (AspectManager)getBean("AspectManager"); assertNotNull(manager); return manager; } protected AspectManager getDomain(String name) { AspectManager manager = getMainAspectManager(); DomainDefinition def = manager.getContainer(name); assertNotNull(def); AspectManager domain = def.getManager(); assertNotNull(domain); return domain; } protected Object createProxy(Object target) { AspectManager manager = getMainAspectManager(); return createProxy(manager, target); } protected Object createProxy(String domainName, Object target) { AspectManager domain = getDomain(domainName); return createProxy(domain, target); } private Object createProxy(AspectManager manager, Object target) { ContainerCache containerCache = ContainerCache.initialise(manager, target.getClass(), null, false); AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setTarget(target); params.setContainerCache(containerCache); return proxyFactory.createAdvisedProxy(params); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001354010760776332033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.PerClassAspect; import org.jboss.test.microcontainer.beans.PerInstanceAspect; import org.jboss.test.microcontainer.beans.PerJoinPointAspect; import org.jboss.test.microcontainer.beans.PerVmAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class ScopedAspectTest extends AOPMicrocontainerTest { public ScopedAspectTest(String name) { super(name); } public void testPerVm() throws Exception { POJO pojo = (POJO)getBean("POJO1A"); POJO2 pojo2 = (POJO2)getBean("POJO2"); PerVmAspect.last = null; pojo.method(); PerVmAspect a1 = PerVmAspect.last; assertNotNull(a1); PerVmAspect.last = null; pojo2.method(); PerVmAspect a2 = PerVmAspect.last; assertNotNull(a2); assertSame(a1, a2); PerVmAspect.last = null; pojo.method(3); PerVmAspect a3 = PerVmAspect.last; assertNotNull(a3); assertSame(a1, a3); } public void testPerClass() throws Exception { POJO pojo = (POJO)getBean("POJO1A"); POJO2 pojo2 = (POJO2)getBean("POJO2"); PerClassAspect.last = null; pojo.method(); PerClassAspect a1 = PerClassAspect.last; assertNotNull(a1); PerClassAspect.last = null; pojo2.method(); PerClassAspect a2 = PerClassAspect.last; assertNotNull(a2); assertNotSame(a1, a2); PerClassAspect.last = null; pojo.method(3); PerClassAspect a3 = PerClassAspect.last; assertNotNull(a3); assertSame(a1, a3); } public void testPerInstance() throws Exception { POJO pojoA = (POJO)getBean("POJO1A"); POJO pojoB = (POJO)getBean("POJO1B"); POJO2 pojo2 = (POJO2)getBean("POJO2"); PerInstanceAspect.last = null; pojoA.method(); PerInstanceAspect a1 = PerInstanceAspect.last; assertNotNull(a1); PerInstanceAspect.last = null; pojoA.method(2); PerInstanceAspect a2 = PerInstanceAspect.last; assertNotNull(a2); assertSame(a1, a2); PerInstanceAspect.last = null; pojoB.method(); PerInstanceAspect a3 = PerInstanceAspect.last; assertNotNull(a3); assertNotSame(a3, a2); PerInstanceAspect.last = null; pojoB.method(4); PerInstanceAspect a4 = PerInstanceAspect.last; assertNotNull(a4); assertSame(a3, a4); PerInstanceAspect.last = null; pojo2.method(); PerInstanceAspect a5 = PerInstanceAspect.last; assertNotNull(a5); assertNotSame(a5, a4); assertNotSame(a5, a2); PerInstanceAspect.last = null; pojo2.method(4); PerInstanceAspect a6 = PerInstanceAspect.last; assertNotNull(a6); assertSame(a5, a6); } public void testPerJoinPoint() throws Exception { POJO pojoA = (POJO)getBean("POJO1A"); POJO pojoB = (POJO)getBean("POJO1B"); POJO2 pojo2 = (POJO2)getBean("POJO2"); PerJoinPointAspect.last = null; pojoA.method(); PerJoinPointAspect a1 = PerJoinPointAspect.last; assertNotNull(a1); PerJoinPointAspect.last = null; pojoA.method(1); PerJoinPointAspect a2 = PerJoinPointAspect.last; assertNotNull(a2); PerJoinPointAspect.last = null; pojoB.method(); PerJoinPointAspect a3 = PerJoinPointAspect.last; assertNotNull(a3); PerJoinPointAspect.last = null; pojoB.method(1); PerJoinPointAspect a4 = PerJoinPointAspect.last; assertNotNull(a4); PerJoinPointAspect.last = null; pojo2.method(); PerJoinPointAspect a5 = PerJoinPointAspect.last; assertNotNull(a5); PerJoinPointAspect.last = null; pojo2.method(1); PerJoinPointAspect a6 = PerJoinPointAspect.last; assertNotNull(a6); assertNotSame(a1, a2); assertNotSame(a1, a3); assertNotSame(a1, a4); assertNotSame(a1, a5); assertNotSame(a1, a6); assertNotSame(a2, a3); assertNotSame(a2, a4); assertNotSame(a2, a5); assertNotSame(a2, a6); assertNotSame(a3, a4); assertNotSame(a3, a5); assertNotSame(a3, a6); assertNotSame(a4, a5); assertNotSame(a4, a6); assertNotSame(a5, a6); PerJoinPointAspect.last = null; pojoA.method(); PerJoinPointAspect a7 = PerJoinPointAspect.last; assertNotNull(a7); assertSame(a1, a7); } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000331210721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyAopTestCase extends AspectWithDependencyTest { public static Test suite() { return suite(AspectWithDependencyAopTestCase.class); } public AspectWithDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectWithDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectWithDependencyAopTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainParentTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001022211037703124033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.List; import java.util.Map; import org.jboss.aop.AspectManager; import org.jboss.aop.Domain; import org.jboss.aop.introduction.AnnotationIntroduction; import org.jboss.aop.metadata.ClassMetaDataLoader; import org.jboss.aop.microcontainer.beans.AOPDomain; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class DomainParentTest extends DomainProxyTest { public DomainParentTest(String name) { super(name); } public void testDomainWithParentInheritance() { Domain parentFirst = getDomainAndCheck("Level2ParentFirst", true, true, true); List overridesFirst = parentFirst.getAnnotationOverrides(); assertEquals(2, overridesFirst.size()); assertNotNull(parentFirst.getClassMetaDataLoaders()); assertEquals(1, parentFirst.getClassMetaDataLoaders().size()); Domain parentLast = getDomainAndCheck("Level2ParentLast", true, true, false); List overridesLast = parentLast.getAnnotationOverrides(); assertEquals(2, overridesLast.size()); assertNotNull(parentLast.getClassMetaDataLoaders()); assertEquals(1, parentLast.getClassMetaDataLoaders().size()); assertEquals(overridesFirst.get(0).getOriginalAnnotationExpr(), overridesLast.get(1).getOriginalAnnotationExpr()); assertEquals(overridesFirst.get(1).getOriginalAnnotationExpr(), overridesLast.get(0).getOriginalAnnotationExpr()); } public void testDomainWithNoInheritanceFromParent() { Domain level2 = getDomainAndCheck("Level2Nada", false, false, false); List overrides = level2.getAnnotationOverrides(); assertEquals(0, overrides.size()); Map loaders = level2.getClassMetaDataLoaders(); assertEquals(0, loaders.size()); } private Domain getDomainAndCheck(String name, boolean inheritBindings, boolean inheritDefinitions, boolean isParentFirst) { Domain level1 = (Domain)getDomain("Level1"); checkLevel1Domain(null, level1); Domain level2 = (Domain)getDomain(name); checkDomain(level1, level2, name, inheritBindings, inheritDefinitions, isParentFirst); return level2; } private void checkLevel1Domain(AspectManager parent, Domain domain) { checkDomain(parent, domain, "Level1", true, true, true); } private void checkDomain(AspectManager parent, Domain domain, String name, boolean inheritBindings, boolean inheritDefinitions, boolean isParentFirst) { AOPDomain bean = (AOPDomain)getBean(name); assertSame(domain, bean.getDomain()); assertEquals(inheritBindings, bean.isInheritBindings()); assertEquals(inheritDefinitions, bean.isInheritDefinitions()); assertEquals(isParentFirst, bean.isParentFirst()); if (parent == null) { assertNull(bean.getParent()); } else { assertSame(parent, bean.getParent().getDomain()); } } } ././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000360310721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase extends MultipleAdvicesWithMultipleDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithMultipleDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000444611037352353033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.AdviceStack; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.SimpleFactoryAspect; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class StackTest extends AOPMicrocontainerTest { public StackTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; SimpleFactoryAspect.invoked = 0; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(SimpleFactoryAspect.invoked == 100); assertTrue(TestAspect.invoked); } public void testStackExistsInManager() throws Exception { AspectManager manager = (AspectManager)getBean("AspectManager"); AdviceStack stack = manager.getAdviceStack("TestStack"); assertNotNull(stack); assertNotNull(stack.getInterceptorFactories()); assertEquals(2, stack.getInterceptorFactories().size()); } }././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000344310721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyBeansDifferentOrderTestCase extends StackWithSingleDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithSingleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithSingleDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyDeployemtDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000346210774766014033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyDeployemtDifferentOrderTestCase extends AspectWithDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new AspectWithDependencyDeployemtDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new AspectWithDependencyDeployemtDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public AspectWithDependencyDeployemtDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectSimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000331410760776332033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectSimpleTest extends AOPMicrocontainerTest { public AspectSimpleTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000002352010760776332033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithDependency; import org.jboss.test.microcontainer.beans.TestInterceptorWithDependency; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class StackWithMultipleDependencyTest extends AOPMicrocontainerTest { public StackWithMultipleDependencyTest(String name) { super(name); } protected abstract String getFile0(); protected abstract String getFile1(); protected abstract String getFile2(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); deploy(getFile1()); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); try { deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile2()); try { checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { validate(); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } finally { undeploy(getFile2()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile2()); try { checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { validate(); Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } checkNoIntercepted1(); checkNoIntercepted2(); checkNoIntercepted3(); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); checkNoIntercepted1(); checkIntercepted2(dependency2); checkNoIntercepted3(); deploy(getFile0()); try { validate(); Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile2()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency1 = (Dependency) getBean("Dependency1"); assertNotNull(dependency1); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } assertNotNull(dependency1); deploy(getFile1()); try { Dependency dependency2 = (Dependency) getBean("Dependency2"); assertNotNull(dependency2); deploy(getFile2()); try { validate(); checkIntercepted1(dependency1); checkIntercepted2(dependency2); checkIntercepted3(dependency1, dependency2); } finally { undeploy(getFile2()); } } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } private void checkIntercepted1(Dependency dependency1) { POJO pojo1 = (POJO) getBean("Intercepted1"); assertNotNull(pojo1); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo1.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency1 == TestAspectWithDependency.invoked); assertNull(TestInterceptorWithDependency.invoked); } private void checkIntercepted2(Dependency dependency2) { POJO pojo2 = (POJO) getBean("Intercepted2"); assertNotNull(pojo2); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo2.method(2); assertNull(TestAspectWithDependency.invoked); assertNotNull(TestInterceptorWithDependency.invoked); System.out.println(TestInterceptorWithDependency.invoked); assertTrue(dependency2 == TestInterceptorWithDependency.invoked); } private void checkIntercepted3(Dependency dependency1, Dependency dependency2) { POJO pojo3 = (POJO) getBean("Intercepted3"); assertNotNull(pojo3); TestAspectWithDependency.invoked = null; TestInterceptorWithDependency.invoked = null; pojo3.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency1 == TestAspectWithDependency.invoked); assertNotNull(TestInterceptorWithDependency.invoked); assertTrue(dependency2 == TestInterceptorWithDependency.invoked); } private void checkNoIntercepted1() { checkNoIntercepted("Intercepted1"); } private void checkNoIntercepted2() { checkNoIntercepted("Intercepted2"); } private void checkNoIntercepted3() { checkNoIntercepted("Intercepted3"); } private void checkNoIntercepted(String name) { POJO pojo; try { pojo = (POJO) getBean(name); fail("'" + name + "' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean(name, ControllerState.DESCRIBED); assertNull(name + " should not be deployed until the interceptor is", pojo); } }././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectFactoryPerInstanceAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000560111202060324033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.POJO2; import org.jboss.test.microcontainer.beans.ScopedFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactoryPerInstanceAopTestCase extends AOPMicrocontainerTest { public ScopedAspectFactoryPerInstanceAopTestCase(String name) { super(name); } public void testPerInstance() throws Exception { POJO pojoA = (POJO)getBean("POJO1A"); POJO pojoB = (POJO)getBean("POJO1B"); POJO2 pojo2 = (POJO2)getBean("POJO2"); ScopedFactoryAspect.last = null; pojoA.method(); ScopedFactoryAspect a1 = ScopedFactoryAspect.last; assertNotNull(a1); ScopedFactoryAspect.last = null; pojoA.method(2); ScopedFactoryAspect a2 = ScopedFactoryAspect.last; assertNotNull(a2); assertSame(a1, a2); ScopedFactoryAspect.last = null; pojoB.method(); ScopedFactoryAspect a3 = ScopedFactoryAspect.last; assertNotNull(a3); assertNotSame(a3, a2); ScopedFactoryAspect.last = null; pojoB.method(4); ScopedFactoryAspect a4 = ScopedFactoryAspect.last; assertNotNull(a4); assertSame(a3, a4); ScopedFactoryAspect.last = null; pojo2.method(); ScopedFactoryAspect a5 = ScopedFactoryAspect.last; assertNotNull(a5); assertNotSame(a5, a4); assertNotSame(a5, a2); ScopedFactoryAspect.last = null; pojo2.method(4); ScopedFactoryAspect a6 = ScopedFactoryAspect.last; assertNotNull(a6); assertSame(a5, a6); } }././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000366610721416203033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyAopTestCase extends MultipleAdvicesWithMultipleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithMultipleDependencyAopTestCase.class); } public MultipleAdvicesWithMultipleDependencyAopTestCase(String test) { super(test); } @Override public String getFile0() { return "MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic0.xml"; } @Override public String getFile1() { return "MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic1.xml"; } @Override public String getFile2() { return "MultipleAdvicesWithMultipleDependencyAopTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000346510721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyBeansTestCase extends MultipleAdvicesWithSingleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithSingleDependencyBeansTestCase.class); } public MultipleAdvicesWithSingleDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "MultipleAdvicesWithSingleDependencyBeansTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001557210760776332033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestInterceptorWithDependency; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class InterceptorWithDependencyTest extends AOPMicrocontainerTest { public InterceptorWithDependencyTest(String name) { super(name); } protected abstract String getFile0(); protected abstract String getFile1(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertNotNull(TestInterceptorWithDependency.invoked); assertTrue(dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", pojo); deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile0()); } try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); int called = TestInterceptorWithDependency.called; pojo.method(2); assertTrue("Interceptor was not rebound", called + 1 == TestInterceptorWithDependency.called); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile1()); } dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestInterceptorWithDependency.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } }././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000344310721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyAopDifferentOrderTestCase extends StackWithMultipleDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithMultipleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithMultipleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithMultipleDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectSimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266210721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectSimpleBeansTestCase extends AspectSimpleTest { public static Test suite() { return suite(AspectSimpleBeansTestCase.class); } public AspectSimpleBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273610721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactorySimpleAopTestCase extends AspectFactorySimpleTest { public static Test suite() { return suite(AspectFactorySimpleAopTestCase.class); } public AspectFactorySimpleAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NamedPointcutBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267010721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NamedPointcutBeansTestCase extends NamedPointcutTest { public static Test suite() { return suite(NamedPointcutBeansTestCase.class); } public NamedPointcutBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000364310774766014033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyDeploymentTestCase extends StackWithMultipleDependencyTest { public static Test suite() { return suite(StackWithMultipleDependencyDeploymentTestCase.class); } public StackWithMultipleDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithMultipleDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithMultipleDependencyDeploymentTestCaseNotAutomatic1.xml"; } @Override protected String getFile2() { return "StackWithMultipleDependencyDeploymentTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000275310774766014033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NonStandardNameAspectDeploymentTestCase extends NonStandardNameAspectTest { public static Test suite() { return suite(NonStandardNameAspectDeploymentTestCase.class); } public NonStandardNameAspectDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DynamicCFlowBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266410721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowBeansTestCase extends DynamicCFlowTest { public static Test suite() { return suite(DynamicCFlowBeansTestCase.class); } public DynamicCFlowBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinClassesBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266410721416203033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinClassesBeansTestCase extends MixinClassesTest { public static Test suite() { return suite(MixinClassesBeansTestCase.class); } public MixinClassesBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000027100000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyDeploymentDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000363410774766014033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyDeploymentDifferentOrderTestCase extends MultipleAdvicesWithMultipleDependencyDeploymentTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithMultipleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithMultipleDependencyDeploymentDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithMultipleDependencyDeploymentDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionClassesAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionClassesAopTestCase extends IntroductionClassesTest { public static Test suite() { return suite(IntroductionClassesAopTestCase.class); } public IntroductionClassesAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectSimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270110721416203033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectSimpleAopTestCase extends AspectSimpleTest { public static Test suite() { return suite(AspectSimpleAopTestCase.class); } public AspectSimpleAopTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000345311137570512033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactoryWithDependencyDeploymentTestCase extends AspectFactoryWithDependencyTest { public static Test suite() { return suite(AspectFactoryWithDependencyDeploymentTestCase.class); } public AspectFactoryWithDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectFactoryWithDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyBeansDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000345510721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyBeansDifferentOrderTestCase extends StackWithMultipleDependencyBeansTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithMultipleDependencyBeansDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithMultipleDependencyBeansDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectSimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272610774766014033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectSimpleDeploymentTestCase extends AspectSimpleTest { public static Test suite() { return suite(AspectSimpleDeploymentTestCase.class); } public AspectSimpleDeploymentTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionExprAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267610721416203033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionExprAopTestCase extends IntroductionExprTest { public static Test suite() { return suite(IntroductionExprAopTestCase.class); } public IntroductionExprAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/CFlowBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000263010721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowBeansTestCase extends CFlowTest { public static Test suite() { return suite(CFlowBeansTestCase.class); } public CFlowBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinClassesDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270310774766014033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinClassesDeploymentTestCase extends MixinClassesTest { public static Test suite() { return suite(MixinClassesDeploymentTestCase.class); } public MixinClassesDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DeclareTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000545510774766014033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.Iterator; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.DeclareDef; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class DeclareTest extends AOPMicrocontainerTest { public DeclareTest(String name) { super(name); } public void testDeclares() { AspectManager manager = AspectManager.instance(); boolean doneAnonymous = false; int i = 0; Iterator it = manager.getDeclares(); while (it.hasNext()) { DeclareDef def = it.next(); if (def.getName().equals("DeclareError")) { checkDeclare(def, false, "call(* org.acme.Foo->error(..))", "Error!!!"); } else if (def.getName().equals("DeclareWarning")) { checkDeclare(def, true, "call(* org.acme.Foo->warning(..))", "Warning!!!"); } else { //This one will have a GUID for its name when done from a deployment or aop xml if (doneAnonymous) { fail("Already done an anonymous DeclareDef in the deployment"); } checkDeclare(def, false, "call(* org.acme.Foo->anonymous(..))", "Anon!!!"); doneAnonymous = true; } i++; } assertEquals("Wrong number of DeclareDefs", 3, i); } private void checkDeclare(DeclareDef def, boolean isWarning, String expr, String msg) { assertEquals(isWarning, def.getWarning()); assertEquals(expr, def.getExpr()); assertEquals(msg, def.getMsg()); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainSimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270110722541214033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainSimpleAopTestCase extends DomainSimpleTest { public DomainSimpleAopTestCase(String name) { super(name); } public static Test suite() { return suite(DomainSimpleAopTestCase.class); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionExprBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270410721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionExprBeansTestCase extends IntroductionExprTest { public static Test suite() { return suite(IntroductionExprBeansTestCase.class); } public IntroductionExprBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionExprTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000346010760776332033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.IntroductionInterface; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class IntroductionExprTest extends AOPMicrocontainerTest { public IntroductionExprTest(String name) { super(name); } public void testIntroduced() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); assertTrue(pojo instanceof IntroductionInterface); pojo.method(); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/TypeDefAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000263210721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TypeDefAopTestCase extends TypeDefTest { public static Test suite() { return suite(TypeDefAopTestCase.class); } public TypeDefAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000335510774766014033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyDeploymentTestCase extends AspectWithDependencyTest { public static Test suite() { return suite(AspectWithDependencyDeploymentTestCase.class); } public AspectWithDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "AspectWithDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "AspectWithDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleStackBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267010721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleStackBeansTestCase extends MultipleStackTest { public static Test suite() { return suite(MultipleStackBeansTestCase.class); } public MultipleStackBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271210776242271033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataBeansTestCase extends ClassMetaDataTest { public static Test suite() { return suite(ClassMetaDataBeansTestCase.class); } public ClassMetaDataBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000355710721416203033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyAopDifferentOrderTestCase extends MultipleAdvicesWithSingleDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new MultipleAdvicesWithSingleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new MultipleAdvicesWithSingleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public MultipleAdvicesWithSingleDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ScopedAspectAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265610721416203033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectAopTestCase extends ScopedAspectTest { public static Test suite() { return suite(ScopedAspectAopTestCase.class); } public ScopedAspectAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272610721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorSimpleAopTestCase extends InterceptorSimpleTest { public static Test suite() { return suite(InterceptorSimpleAopTestCase.class); } public InterceptorSimpleAopTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/CFlowTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000363110760776332033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowTest extends AOPMicrocontainerTest { public CFlowTest(String name) { super(name); } public void testIntercepted() throws Exception { POJO pojo = (POJO)getBean("Bean"); TestAspect.invoked = false; callPOJO(pojo); assertTrue(TestAspect.invoked); TestAspect.invoked = false; notCallPOJO(pojo); assertFalse(TestAspect.invoked); } private void callPOJO(POJO pojo) { pojo.method(); } private void notCallPOJO(POJO pojo) { callPOJO(pojo); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinExprTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000355010760776332033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.MixinInterface; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class MixinExprTest extends AOPMicrocontainerTest { public MixinExprTest(String name) { super(name); } public void testIntroduced() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); assertTrue(pojo instanceof MixinInterface); pojo.method(); assertTrue(TestAspect.invoked); assertEquals("CUSTOM CONSTRUCTION", ((MixinInterface)pojo).getMixinValue()); } }././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000374010774766014033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyDeploymentTestCase extends MultipleAdvicesWithMultipleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithMultipleDependencyDeploymentTestCase.class); } public MultipleAdvicesWithMultipleDependencyDeploymentTestCase(String test) { super(test); } @Override public String getFile0() { return "MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override public String getFile1() { return "MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic1.xml"; } @Override public String getFile2() { return "MultipleAdvicesWithMultipleDependencyDeploymentTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000275310774766014033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorSimpleDeploymentTestCase extends InterceptorSimpleTest { public static Test suite() { return suite(InterceptorSimpleDeploymentTestCase.class); } public InterceptorSimpleDeploymentTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainParentBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270711042111650033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainParentBeansTestCase extends DomainParentTest { public DomainParentBeansTestCase(String name) { super(name); } public static Test suite() { return suite(DomainParentBeansTestCase.class); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DomainParentDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272611037703124033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DomainParentDeploymentTestCase extends DomainParentTest { public DomainParentDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(DomainParentDeploymentTestCase.class); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdviceDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273510774766014033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdviceDeploymentTestCase extends MultipleAdviceTest { public static Test suite() { return suite(MultipleAdviceDeploymentTestCase.class); } public MultipleAdviceDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyTurnedOffAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001045611205232155033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; /** * AspectWithDependencyTurnedOffAopTestCase * * @author Kabir Khan * @author Ales Justin * @version $Revision: 1.1 $ */ public class AspectWithDependencyTurnedOffAopTestCase extends AOPMicrocontainerTest { public static Test suite() { return suite(AspectWithDependencyTurnedOffAopTestCase.class); } public AspectWithDependencyTurnedOffAopTestCase(String test) { super(test); } @Override protected void afterSetUp() throws Exception { // do nothing, so we ignore validate } public void testAllAopTurnedOff() throws Exception { assertMoreDependencies("Intercepted", "NotIntercepted"); POJO pojoNotIntercepted = (POJO)getBean("NotIntercepted"); assertFalse(pojoNotIntercepted instanceof AspectManaged); assertMoreDependencies("WithLifecycle", "WithLifecycleDisabled"); } public void testPointcutsTurnedOff() throws Exception { assertMoreDependencies("Intercepted", "NotIntercepted"); POJO pojoNotIntercepted = (POJO)getBean("NotIntercepted"); assertFalse(pojoNotIntercepted instanceof AspectManaged); assertNotInstalledContext("WithLifecycle"); assertNotInstalledContext("WithLifecycleDisabled"); } public void testLifecycleTurnedOff() throws Exception { assertNotInstalledContext("Intercepted"); assertNotInstalledContext("NotIntercepted"); assertMoreDependencies("WithLifecycle", "WithLifecycleDisabled"); } private void assertMoreDependencies(String aspectCtxName, String disabledCtxName) { ControllerContext aspectCtx = assertNotInstalledContext(aspectCtxName); ControllerContext disabledCtx = assertInstalledContext(disabledCtxName); Set interceptedDependencies = new HashSet(aspectCtx.getDependencyInfo().getIDependOn(null)); Set notInterceptedDependencies = new HashSet(disabledCtx.getDependencyInfo().getIDependOn(null)); assertTrue(interceptedDependencies.size() > notInterceptedDependencies.size()); } private ControllerContext assertNotInstalledContext(String bean) { try { getControllerContext(bean); fail("'" + bean + "' should not have been installed"); } catch (Exception expected) { } ControllerContext ctx = getControllerContext(bean, null); assertNotNull(ctx); assertNotSame(ControllerState.INSTALLED, ctx.getState()); return ctx; } private ControllerContext assertInstalledContext(String bean) { ControllerContext ctx = getControllerContext(bean); assertNotNull(ctx); assertSame(ControllerState.INSTALLED, ctx.getState()); return ctx; } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000342210774766014033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyDeploymentTestCase extends StackWithSingleDependencyTest { public static Test suite() { return suite(StackWithSingleDependencyDeploymentTestCase.class); } public StackWithSingleDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithSingleDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithSingleDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/IntroductionClassesBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272010721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionClassesBeansTestCase extends IntroductionClassesTest { public static Test suite() { return suite(IntroductionClassesBeansTestCase.class); } public IntroductionClassesBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001550311015074677033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithDependency; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AspectWithDependencyTest extends AOPMicrocontainerTest { public AspectWithDependencyTest(String name) { super(name); } protected abstract String getFile0(); protected abstract String getFile1(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", pojo); deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile0()); } try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); int called = TestAspectWithDependency.called; pojo.method(2); assertEquals("Interceptor was not rebound", called + 1, TestAspectWithDependency.called); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile1()); } dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000001733610760776332033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.Dependency; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithDependency; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class StackWithSingleDependencyTest extends AOPMicrocontainerTest { public StackWithSingleDependencyTest(String name) { super(name); } protected abstract String getFile0(); protected abstract String getFile1(); public void testInterceptorWithDependencyCorrectOrder() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertNotNull(TestAspectWithDependency.invoked); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } public void testInterceptorWithDependencyWrongOrder() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("'Interceped' should not be installed yet"); } catch (IllegalStateException expected) { } pojo = (POJO) getBean("Intercepted", ControllerState.DESCRIBED); assertNull("This should not be deployed until the interceptor is", pojo); deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy() throws Exception { deploy(getFile1()); try { POJO pojo; try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed until the dependency is"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } try { pojo = (POJO) getBean("Intercepted"); fail("Bean should not be installed after the dependency is undeployed"); } catch (IllegalStateException expected) { KernelControllerContext context = getControllerContext("Intercepted", ControllerState.DESCRIBED); assertNotNull(context); } deploy(getFile0()); try { validate(); Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); int called = TestAspectWithDependency.called; TestInterceptor.invoked = false; pojo.method(2); assertTrue("Interceptor was not rebound", called + 1 == TestAspectWithDependency.called); assertTrue("Should not be caching the interceptor/dependency across rebinding", dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile0()); } } finally { undeploy(getFile1()); } } public void testInterceptorWithDependencyRedeploy2() throws Exception { deploy(getFile0()); try { Dependency dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { validate(); POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } dependency = (Dependency) getBean("Dependency"); assertNotNull(dependency); deploy(getFile1()); try { POJO pojo = (POJO) getBean("Intercepted"); assertNotNull(pojo); TestAspectWithDependency.invoked = null; TestInterceptor.invoked = false; pojo.method(2); assertTrue(dependency == TestAspectWithDependency.invoked); assertTrue(TestInterceptor.invoked); } finally { undeploy(getFile1()); } } finally { undeploy(getFile0()); } } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/LightweightAspectTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000665110760776332033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.List; import org.jboss.aop.advice.AdviceType; import org.jboss.aop.microcontainer.beans.AspectBinding; import org.jboss.aop.microcontainer.beans.BindingEntry; import org.jboss.aop.microcontainer.beans.InterceptorEntry; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class LightweightAspectTest extends AOPMicrocontainerTest { public LightweightAspectTest(String name) { super(name); } public void testBinding() throws Exception { AspectBinding binding = (AspectBinding)getBean("Binding"); assertNotNull(binding); List entries = binding.getAdvices(); assertEquals(5, entries.size()); int i = 0; for (BindingEntry entry : entries) { assertTrue(entry instanceof InterceptorEntry); InterceptorEntry ie = (InterceptorEntry)entry; i++; switch (i) { case 1: assertEquals(AdviceType.BEFORE, ie.getType()); break; case 2: assertEquals(AdviceType.AROUND, ie.getType()); break; case 3: assertEquals(AdviceType.AFTER, ie.getType()); break; case 4: assertEquals(AdviceType.THROWING, ie.getType()); break; case 5: assertEquals(AdviceType.FINALLY, ie.getType()); } } } // TODO this test should be run with weaving enabled // public void testWovenClass() throws Exception // { // POJO pojo = (POJO)getBean("Bean"); // if (pojo instanceof AspectManaged == false && pojo instanceof Advised == false) // { // fail("POJO was neither proxied nor woven"); // } // // if (pojo instanceof Advised) // { // //Only weaving supports B/A/T/F aspects // pojo.method(); // assertTrue(TestAspect.invoked); // List interceptions = Interceptions.interceptions(); // assertEquals(4, interceptions.size()); // assertTrue(interceptions.contains("BEFORE")); // assertTrue(interceptions.contains("AFTER")); // assertTrue(interceptions.contains("FINALLY")); // } // } }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinExprDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266710774766014033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinExprDeploymentTestCase extends MixinExprTest { public static Test suite() { return suite(MixinExprDeploymentTestCase.class); } public MixinExprDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinExprAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264210721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinExprAopTestCase extends MixinExprTest { public static Test suite() { return suite(MixinExprAopTestCase.class); } public MixinExprAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectWithDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000342310721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectWithDependencyAopDifferentOrderTestCase extends AspectWithDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new AspectWithDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new AspectWithDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public AspectWithDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/TypeDefTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000331210760776332033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class TypeDefTest extends AOPMicrocontainerTest { public TypeDefTest(String name) { super(name); } public void testIntercepted() throws Exception { TestAspect.invoked = false; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/PrecedenceBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265610721416203033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceBeansTestCase extends PrecedenceTest { public static Test suite() { return suite(PrecedenceBeansTestCase.class); } public PrecedenceBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/BeanMetaDataFactoryParserTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000700511021261744033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.net.URL; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class BeanMetaDataFactoryParserTest extends AOPMicrocontainerTest { public BeanMetaDataFactoryParserTest(String name) { super(name); } public void testNamesFromGetBeansRemainsTheSame() throws Exception { List beanMetaDataFactories = loadBeanMetaDataFactories(); List names1 = loadBeans(beanMetaDataFactories); assertTrue(10 < names1.size()); List names2 = loadBeans(beanMetaDataFactories); assertEquals(names1.size(), names2.size()); for (int i = 0 ; i < names1.size() ; i++) { assertEquals("Wrong name for bean number " + i + " type1: " + names1.get(i).getBean() + " " + names2.get(i).getBean() , names1.get(i).getName(), names2.get(i).getName()); } } private List loadBeanMetaDataFactories() throws Exception { SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); UnmarshallerFactory factory = UnmarshallerFactory.newInstance(); Unmarshaller unmarshaller = factory.newUnmarshaller(); URL url = getClass().getResource(getFileName()); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver); return deployment.getBeanFactories(); } private List loadBeans(List beanMetaDataFactories) throws Exception { List beans = new ArrayList(); for (BeanMetaDataFactory bmdf : beanMetaDataFactories) { for (BeanMetaData bmd : bmdf.getBeans()) { beans.add(bmd); } } return beans; } protected abstract String getFileName(); } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000274410721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorFactorySimpleBeansTestCase extends InterceptorFactorySimpleTest { public static Test suite() { return suite(InterceptorFactorySimpleBeansTestCase.class); } public InterceptorFactorySimpleBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/TypeDefDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265710774766014033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TypeDefDeploymentTestCase extends TypeDefTest { public static Test suite() { return suite(TypeDefDeploymentTestCase.class); } public TypeDefDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MixinExprBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265010721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinExprBeansTestCase extends MixinExprTest { public static Test suite() { return suite(MixinExprBeansTestCase.class); } public MixinExprBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdviceAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271010721416203033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdviceAopTestCase extends MultipleAdviceTest { public static Test suite() { return suite(MultipleAdviceAopTestCase.class); } public MultipleAdviceAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000341310774766014033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyDeploymentTestCase extends InterceptorWithDependencyTest { public static Test suite() { return suite(InterceptorWithDependencyDeploymentTestCase.class); } public InterceptorWithDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "InterceptorWithDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "InterceptorWithDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000360510721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyBeansTestCase extends StackWithMultipleDependencyTest { public static Test suite() { return suite(StackWithMultipleDependencyBeansTestCase.class); } public StackWithMultipleDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithMultipleDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithMultipleDependencyBeansTestCaseNotAutomatic1.xml"; } @Override protected String getFile2() { return "StackWithMultipleDependencyBeansTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleIfaceDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000277211137570512033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorSimpleIfaceDeploymentTestCase extends InterceptorSimpleTest { public static Test suite() { return suite(InterceptorSimpleIfaceDeploymentTestCase.class); } public InterceptorSimpleIfaceDeploymentTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DeclareDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267610774766014033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeclareDeploymentTestCase extends DeclareTest { public DeclareDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(DeclareDeploymentTestCase.class); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithMultipleDependencyAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000357110721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithMultipleDependencyAopTestCase extends StackWithMultipleDependencyTest { public static Test suite() { return suite(StackWithMultipleDependencyAopTestCase.class); } public StackWithMultipleDependencyAopTestCase(String test) { super(test); } @Override protected String getFile0() { return "StackWithMultipleDependencyAopTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "StackWithMultipleDependencyAopTestCaseNotAutomatic1.xml"; } @Override protected String getFile2() { return "StackWithMultipleDependencyAopTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DynamicCFlowAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265610721416203033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowAopTestCase extends DynamicCFlowTest { public static Test suite() { return suite(DynamicCFlowAopTestCase.class); } public DynamicCFlowAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/XmlLoadableDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272211005412047033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableDeploymentTestCase extends XmlLoadableTest { public XmlLoadableDeploymentTestCase(String name) { super(name); } public static Test suite() { return suite(XmlLoadableDeploymentTestCase.class); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AnnotationOverrideAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270610721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverrideAopTestCase extends AnnotationOverrideTest { public static Test suite() { return suite(AnnotationOverrideAopTestCase.class); } public AnnotationOverrideAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithSingleDependencyDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000351610774766014033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithSingleDependencyDeploymentTestCase extends MultipleAdvicesWithSingleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithSingleDependencyDeploymentTestCase.class); } public MultipleAdvicesWithSingleDependencyDeploymentTestCase(String test) { super(test); } @Override protected String getFile0() { return "MultipleAdvicesWithSingleDependencyDeploymentTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "MultipleAdvicesWithSingleDependencyDeploymentTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorWithDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000336210721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorWithDependencyBeansTestCase extends InterceptorWithDependencyTest { public static Test suite() { return suite(InterceptorWithDependencyBeansTestCase.class); } public InterceptorWithDependencyBeansTestCase(String test) { super(test); } @Override protected String getFile0() { return "InterceptorWithDependencyBeansTestCaseNotAutomatic0.xml"; } @Override protected String getFile1() { return "InterceptorWithDependencyBeansTestCaseNotAutomatic1.xml"; } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/StackWithSingleDependencyAopDifferentOrderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000343110721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; import junit.framework.TestSuite; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackWithSingleDependencyAopDifferentOrderTestCase extends StackWithSingleDependencyAopTestCase { public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new StackWithSingleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyWrongOrder")); suite.addTest(new StackWithSingleDependencyAopDifferentOrderTestCase("testInterceptorWithDependencyCorrectOrder")); return suite; } public StackWithSingleDependencyAopDifferentOrderTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273410721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NonStandardNameAspectBeansTestCase extends NonStandardNameAspectTest { public static Test suite() { return suite(NonStandardNameAspectBeansTestCase.class); } public NonStandardNameAspectBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272610721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NonStandardNameAspectAopTestCase extends NonStandardNameAspectTest { public static Test suite() { return suite(NonStandardNameAspectAopTestCase.class); } public NonStandardNameAspectAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorFactorySimpleAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000276210721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorFactorySimpleAopTestCase extends InterceptorFactorySimpleTest { public static Test suite() { return suite(InterceptorFactorySimpleAopTestCase.class); } public InterceptorFactorySimpleAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactoryWithDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000522711173121305033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.DependencyFactoryAspect; import org.jboss.test.microcontainer.beans.POJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AspectFactoryWithDependencyTest extends AOPMicrocontainerTest { public AspectFactoryWithDependencyTest(String name) { super(name); } public void testIntercepted() throws Exception { try { deploy(getFile0()); assertCannotFindBean("Bean"); assertCannotFindBean("Dependency"); try { deploy(getFile1()); DependencyFactoryAspect.invoked = null; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); POJO dep = (POJO)getBean("Dependency"); assertSame(dep, DependencyFactoryAspect.invoked); } finally { undeploy(getFile1()); } assertCannotFindBean("Bean"); assertCannotFindBean("Dependency"); } finally { undeploy(getFile0()); } } private void assertCannotFindBean(String name) { try { getBean(name); fail("Should not have found '" + name + "'"); } catch (Exception expected) { } } protected abstract String getFile0(); protected abstract String getFile1(); }././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/LightweightAspectAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273210721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LightweightAspectAopTestCase extends LightweightAspectTest { public static Test suite() { return suite(LightweightAspectAopTestCase.class); } public LightweightAspectAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/TypeDefBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264010721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TypeDefBeansTestCase extends TypeDefTest { public static Test suite() { return suite(TypeDefBeansTestCase.class); } public TypeDefBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/XmlLoadableAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267511005412047033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableAopTestCase extends XmlLoadableTest { public XmlLoadableAopTestCase(String name) { super(name); } public static Test suite() { return suite(XmlLoadableAopTestCase.class); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdviceBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267410721416203033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdviceBeansTestCase extends MultipleAdviceTest { public static Test suite() { return suite(MultipleAdviceBeansTestCase.class); } public MultipleAdviceBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DynamicCFlowTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000352510760776332033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.DynamicCFlowImpl; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class DynamicCFlowTest extends AOPMicrocontainerTest { public DynamicCFlowTest(String name) { super(name); } public void testIntercepted() throws Exception { POJO pojo = (POJO)getBean("Bean"); TestAspect.invoked = false; pojo.method(); assertFalse(TestAspect.invoked); DynamicCFlowImpl.execute = true; pojo.method(); assertTrue(TestAspect.invoked); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000274210776242271033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataLoaderBeansTestCase extends ClassMetaDataLoaderTest { public static Test suite() { return suite(ClassMetaDataLoaderBeansTestCase.class); } public ClassMetaDataLoaderBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/PrecedenceDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267510774766014033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceDeploymentTestCase extends PrecedenceTest { public static Test suite() { return suite(PrecedenceDeploymentTestCase.class); } public PrecedenceDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000337410760776332033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.SimpleFactoryAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactorySimpleTest extends AOPMicrocontainerTest { public AspectFactorySimpleTest(String name) { super(name); } public void testIntercepted() throws Exception { SimpleFactoryAspect.invoked = 0; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(SimpleFactoryAspect.invoked == 100); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/AspectFactorySimpleDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000276310774766014033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactorySimpleDeploymentTestCase extends AspectFactorySimpleTest { public static Test suite() { return suite(AspectFactorySimpleDeploymentTestCase.class); } public AspectFactorySimpleDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/InterceptorSimpleTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000335510760776332033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class InterceptorSimpleTest extends AOPMicrocontainerTest { public InterceptorSimpleTest(String name) { super(name); } public void testIntercepted() throws Exception { TestInterceptor.invoked = false; POJO pojo = (POJO)getBean("Bean"); int ret = pojo.method(2); assertEquals(4, ret); assertTrue(TestInterceptor.invoked); } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleStackDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270710774766014033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleStackDeploymentTestCase extends MultipleStackTest { public static Test suite() { return suite(MultipleStackDeploymentTestCase.class); } public MultipleStackDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/DeclareAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265110774766014033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeclareAopTestCase extends DeclareTest { public DeclareAopTestCase(String name) { super(name); } public static Test suite() { return suite(DeclareAopTestCase.class); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/NonStandardNameAspectTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000412510760776332033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.TestAspectWithProperty; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class NonStandardNameAspectTest extends AOPMicrocontainerTest { public NonStandardNameAspectTest(String name) { super(name); } public void testDifferentInstances() throws Exception { POJO pojo = (POJO)getBean("Intercepted"); TestAspectWithProperty.last = null; pojo.method(); TestAspectWithProperty a1 = TestAspectWithProperty.last; assertNotNull(a1); assertEquals("PropertyA", a1.getSomeProperty()); TestAspectWithProperty.last = null; pojo.method(2); TestAspectWithProperty a2 = TestAspectWithProperty.last; assertNotNull(a2); assertEquals("PropertyB", a2.getSomeProperty()); assertNotSame(a1, a2); } }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/BeanMetaDataFactoryParserAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000317511021261744033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanMetaDataFactoryParserAopTestCase extends BeanMetaDataFactoryParserTest { public BeanMetaDataFactoryParserAopTestCase(String name) { super(name); } public static Test suite() { return suite(BeanMetaDataFactoryParserAopTestCase.class); } @Override protected String getFileName() { return "BeanMetaDataFactoryParserAopTestCaseNotAutomatic.xml"; } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/MultipleAdvicesWithMultipleDependencyBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000370210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MultipleAdvicesWithMultipleDependencyBeansTestCase extends MultipleAdvicesWithMultipleDependencyTest { public static Test suite() { return suite(MultipleAdvicesWithMultipleDependencyBeansTestCase.class); } public MultipleAdvicesWithMultipleDependencyBeansTestCase(String test) { super(test); } @Override public String getFile0() { return "MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic0.xml"; } @Override public String getFile1() { return "MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic1.xml"; } @Override public String getFile2() { return "MultipleAdvicesWithMultipleDependencyBeansTestCaseNotAutomatic2.xml"; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/XmlLoadableTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000773311005412047033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import java.util.Map; import org.jboss.aop.AspectManager; import org.jboss.aop.metadata.ClassMetaDataLoader; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; import org.jboss.test.microcontainer.beans.XmlLoadableAspect; import org.jboss.test.microcontainer.beans.XmlLoadableAspect2; import org.jboss.test.microcontainer.beans.XmlLoadableClassMetaDataLoader; import org.jboss.test.microcontainer.beans.XmlLoadableInterceptor; import org.jboss.test.microcontainer.beans.XmlLoadableInterceptor2; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public /*abstract*/ class XmlLoadableTest extends AOPMicrocontainerTest { public XmlLoadableTest(String name) { super(name); } public void testClassMetaDataLoader() { Map loaders = AspectManager.instance().getClassMetaDataLoaders(); assertNotNull(loaders); assertEquals(1, loaders.size()); ClassMetaDataLoader loader = loaders.get("xxx"); assertNotNull(loader); assertInstanceOf(loader, XmlLoadableClassMetaDataLoader.class); Element element = ((XmlLoadableClassMetaDataLoader)loader).getElement(); checkXml(element, "metadata-loader", "somexml", "hello"); } public void testAspectInterceptorAndDynamicCFlow() { POJO pojo = (POJO)getBean("Bean"); pojo.defaultMethod(); assertTrue(XmlLoadableAspect.intercepted); assertTrue(XmlLoadableInterceptor.intercepted); Element element = XmlLoadableAspect.interceptedElement; checkXml(element, "aspect", "somexml", "hello"); assertEquals(12, XmlLoadableAspect.intAttr); //assertEquals("Test1", XmlLoadableAspect.mcProperty); element = XmlLoadableInterceptor.interceptedElement; checkXml(element, "interceptor", "somexml", "hello"); assertEquals(13, XmlLoadableInterceptor.intAttr); //assertEquals("Test2", XmlLoadableInterceptor.mcProperty); element = XmlLoadableAspect2.interceptedElement; checkXml(element, "aspect", "somexml", "hi"); element = XmlLoadableInterceptor2.interceptedElement; checkXml(element, "interceptor", "somexml", "hi"); assertEquals(12, XmlLoadableAspect.intAttr); assertEquals(13, XmlLoadableInterceptor.intAttr); } private void checkXml(Element element, String rootName, String childName, String childContent) { assertNotNull(element); assertEquals(rootName, element.getTagName()); NodeList list = element.getElementsByTagName(childName); assertNotNull(list); assertEquals(1, list.getLength()); Element child = (Element)list.item(0); String s = child.getTextContent(); assertEquals(childContent, s); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataLoaderAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273410776242271033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataLoaderAopTestCase extends ClassMetaDataLoaderTest { public static Test suite() { return suite(ClassMetaDataLoaderAopTestCase.class); } public ClassMetaDataLoaderAopTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/test/ClassMetaDataDeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273410776242271033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataDeploymentTestCase extends ClassMetaDataTest { public static Test suite() { return suite(ClassMetaDataDeploymentTestCase.class); } public ClassMetaDataDeploymentTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/IntroductionInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000232210721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface IntroductionInterface { } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/LightweightAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000310510721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.annotation.Thrown; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LightweightAspect { public void before() { Interceptions.add("BEFORE"); } public void after() { Interceptions.add("AFTER"); } public void throwing(@Thrown Throwable t) { Interceptions.add("THROWING"); } public void finaly() { Interceptions.add("FINALLY"); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/iPOJO.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000232511137570512033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface iPOJO { public int method(int i); public void method(); public void defaultMethod(); } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableAspect2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000343111005412047033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableAspect2 implements XmlLoadable { private Element element; public static boolean intercepted; public static Element interceptedElement; public Object invoke(Invocation invocation) throws Throwable { intercepted = true; interceptedElement = element; return invocation.invokeNext(); } public void importXml(Element element) { this.element = element; } public Element getElement() { return element; } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DynamicCFlowImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270710721416203033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.pointcut.DynamicCFlow; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowImpl implements DynamicCFlow { public static boolean execute = false; public boolean shouldExecute(Invocation invocation) { return execute; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000755000175000017500000000000011620312203033202 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000755000175000017500000000000011620312204033203 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/PrepareAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000266310722621434033226 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrepareAopTestCase extends PrepareTest { public static Test suite() { return suite(PrepareAopTestCase.class); } public PrepareAopTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/ClassWithArray.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264310722621434033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassWithArray { public int[] array = new int[10]; public void setValue(int index, int value) { array[index] = value; } public int getValue(int index) { return array[index]; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/ArrayBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000263410722621434033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ArrayBeansTestCase extends ArrayTest { public static Test suite() { return suite(ArrayBeansTestCase.class); } public ArrayBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/ArrayAopTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265310722621434033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ArrayAopTestCase extends ArrayTest { public static Test suite() { return suite(ArrayAopTestCase.class); } public ArrayAopTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/ArrayTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000413210760776332033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import org.jboss.aop.Advised; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class ArrayTest extends AOPMicrocontainerTest { public ArrayTest(String name) { super(name); } public void testIntercepted() throws Exception { ClassWithArray pojo = (ClassWithArray)getBean("Bean"); assertTrue(pojo instanceof Advised); TestInterceptor.invoked = false; TestArrayAspect.reset(); pojo.setValue(1, 100); assertEquals(1, TestArrayAspect.index); assertEquals(100, TestArrayAspect.value); assertTrue(TestInterceptor.invoked); TestInterceptor.invoked = false; TestArrayAspect.reset(); int i = pojo.getValue(1); assertEquals(1, TestArrayAspect.index); assertEquals(100, i); assertTrue(TestInterceptor.invoked); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/TestArrayAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000353410723271061033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import org.jboss.aop.array.IntArrayElementReadInvocation; import org.jboss.aop.array.IntArrayElementWriteInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestArrayAspect { public static int value; public static int index; public Object advice(IntArrayElementWriteInvocation invocation) throws Throwable { value = invocation.getIntValue(); index = invocation.getIndex(); return invocation.invokeNext(); } public Object advice(IntArrayElementReadInvocation invocation) throws Throwable { index = invocation.getIndex(); return invocation.invokeNext(); } public static void reset() { value = -1; index = -1; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/PrepareTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000312510760776332033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import org.jboss.aop.Advised; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.beans.POJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrepareTest extends AOPMicrocontainerTest { public PrepareTest(String name) { super(name); } public void testIntercepted() throws Exception { POJO pojo = (POJO)getBean("Bean"); assertTrue(pojo instanceof Advised); } }././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/woven/test/PrepareBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264410722621434033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.woven.test; import junit.framework.Test; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrepareBeansTestCase extends PrepareTest { public static Test suite() { return suite(PrepareBeansTestCase.class); } public PrepareBeansTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableInterceptor2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000362511005412047033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableInterceptor2 implements Interceptor, XmlLoadable { private Element element; public static boolean intercepted; public static Element interceptedElement; public String getName() { return null; } public Object invoke(Invocation invocation) throws Throwable { intercepted = true; interceptedElement = element; return invocation.invokeNext(); } public void importXml(Element element) { this.element = element; } public Element getElement() { return element; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestClassMetaDataAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000354010776242271033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestClassMetaDataAspect { public static boolean invoked; public static String last; public static String clazz1; public static String clazz2; public Object advice(Invocation inv) throws Throwable { Interceptions.add(this); invoked = true; last = (String)inv.getMetaData("SomeTag", "data"); clazz1 = (String)inv.resolveClassMetaData("SomeTag", "clazz1"); clazz2 = (String)inv.resolveClassMetaData("SomeTag", "clazz2"); return inv.invokeNext(); } public static void reset() { invoked = false; last = clazz1 = clazz2 = null; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/MixinInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000234510721416203033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface MixinInterface { String getMixinValue(); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/PerClassAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000264510721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PerClassAspect { public static PerClassAspect last; public Object advice(MethodInvocation mi) throws Throwable { last = this; return mi.invokeNext(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000313210721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestInterceptor implements Interceptor { public static boolean invoked; public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { Interceptions.add(this); invoked = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/PerClassJoinPointAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000267010721416203033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PerClassJoinPointAspect { public static PerClassJoinPointAspect last; public Object advice(MethodInvocation mi) throws Throwable { last = this; return mi.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000417311005412047033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableInterceptor implements Interceptor, XmlLoadable { private Element element; public static boolean intercepted; public static Element interceptedElement; public static int intAttr; public static String mcProperty; public void setIntAttr(int i) { intAttr = i; } public void setProperty(String property) { mcProperty = property; } public String getName() { return null; } public Object invoke(Invocation invocation) throws Throwable { intercepted = true; interceptedElement = element; return invocation.invokeNext(); } public void importXml(Element element) { this.element = element; } public Element getElement() { return element; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/ScopedAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000377111202060324033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedAspectFactory implements AspectFactory { public Object createPerClass(Advisor advisor) { return new ScopedFactoryAspect(); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { return new ScopedFactoryAspect(); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { return new ScopedFactoryAspect(); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { return new ScopedFactoryAspect(); } public Object createPerVM() { return new ScopedFactoryAspect(); } public String getName() { return this.getClass().getName(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000456011005412047033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableAspectFactory implements AspectFactory, XmlLoadable { Element element; public Object createPerClass(Advisor advisor) { throw new RuntimeException("PER_VM only"); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerVM() { XmlLoadableAspect2 aspect = new XmlLoadableAspect2(); aspect.importXml(element); return aspect; } public String getName() { return this.getClass().getName(); } public void importXml(Element element) { this.element = element; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000230311137570512033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface AnnotationWithValue { int integer(); } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/PerInstanceAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265410721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PerInstanceAspect { public static PerInstanceAspect last; public Object advice(MethodInvocation mi) throws Throwable { last = this; return mi.invokeNext(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/Annotation2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000231010721416203033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Annotation2 { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestInterceptorWithDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000353210721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestInterceptorWithDependency implements Interceptor { public static int called; public static Object invoked; public Dependency dependency; public Dependency getDependency() { return dependency; } public void setDependency(Dependency dependency) { this.dependency = dependency; } public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { called++; invoked = dependency; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/Interceptions.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000310210756314477033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import java.util.ArrayList; import java.util.List; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class Interceptions { private static List interceptions = new ArrayList(); public static void add(Object o) { interceptions.add(o); } public static List interceptions() { return interceptions; } public static void reset() { interceptions.clear(); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableClassMetaDataLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000451611005412047033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import javassist.CtConstructor; import javassist.CtField; import javassist.CtMethod; import org.jboss.aop.Advisor; import org.jboss.aop.metadata.ClassMetaDataBinding; import org.jboss.aop.metadata.ClassMetaDataLoader; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableClassMetaDataLoader implements ClassMetaDataLoader, XmlLoadable { Element element; public void importXml(Element element) { this.element = element; } public Element getElement() { return element; } public void bind(Advisor advisor, ClassMetaDataBinding data, CtMethod[] methods, CtField[] fields, CtConstructor[] constructors) throws Exception { } public void bind(Advisor advisor, ClassMetaDataBinding data, Method[] methods, Field[] fields, Constructor[] constructors) throws Exception { } public ClassMetaDataBinding importMetaData(Element element, String name, String tag, String classExpr) throws Exception { return null; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/SimpleInterceptorFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000415210721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleInterceptorFactory implements AspectFactory { public Object createPerClass(Advisor advisor) { throw new RuntimeException("PER_VM only"); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerVM() { return new SimpleFactoryInterceptor(100); } public String getName() { return this.getClass().getName(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/SimpleAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000414010721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleAspectFactory implements AspectFactory { public Object createPerClass(Advisor advisor) { throw new RuntimeException("PER_VM only"); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerVM() { return new SimpleFactoryAspect(100); } public String getName() { return this.getClass().getName(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/ScopedFactoryAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000261611202060324033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ScopedFactoryAspect { public static ScopedFactoryAspect last; public Object advice(MethodInvocation inv) throws Throwable { last = this; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableDynamicCflow.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000426211005412047033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.pointcut.DynamicCFlow; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; import org.w3c.dom.NodeList; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableDynamicCflow implements DynamicCFlow, XmlLoadable { Element element; public boolean shouldExecute(Invocation invocation) { try { if (element != null) { NodeList list = element.getElementsByTagName("shouldinvoke"); if (list != null) { if (list.getLength() > 0) { Element child = (Element)list.item(0); String s = child.getTextContent(); boolean b = Boolean.valueOf(s); return b; } } } } catch (Exception e) { e.printStackTrace(); } return false; } public void importXml(Element element) { this.element = element; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/SimpleFactoryAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000300610721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleFactoryAspect { public static int invoked; private int i; public SimpleFactoryAspect(int i) { this.i = i; } public Object advice(MethodInvocation inv) throws Throwable { invoked = this.i; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestAspectWithDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000340410721416203033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestAspectWithDependency { public static int called; public static Object invoked; public static TestAspectWithDependency last; public Dependency dependency; public Dependency getDependency() { return dependency; } public void setDependency(Dependency dependency) { this.dependency = dependency; } public Object advice(MethodInvocation inv) throws Throwable { called++; invoked = dependency; last = this; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestMetaDataBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000316710721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.metadata.ClassMetaDataBinding; import org.jboss.aop.metadata.ClassMetaDataLoader; /** * * @author Kabir Khan * @version $Revision$ */ public class TestMetaDataBinding extends ClassMetaDataBinding { String data; public TestMetaDataBinding(ClassMetaDataLoader loader, String name, String tag, String exp) { super(loader, name, tag, exp); } public String getData() { return data; } public void setData(String data) { this.data = data; } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/support/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000755000175000017500000000000011620312204033203 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/support/AccessBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000272111301242575033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans.support; /** * @author Ales Justin */ public class AccessBean { private String priString; protected String protString; public String pubString; public String getPriString() { return priString; } public String getProtString() { return protString; } public String getPubString() { return pubString; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AspectFactoryWithDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000430011137570512033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectFactoryWithDependency implements AspectFactory { private POJO pojo; public Object createPerClass(Advisor advisor) { throw new RuntimeException("PER_VM only"); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerVM() { return new DependencyFactoryAspect(pojo); } public String getName() { return this.getClass().getName(); } public POJO getPojo() { return pojo; } public void setPojo(POJO pojo) { this.pojo = pojo; } }././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/Dependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000230310721416203033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class Dependency { } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/DependencyFactoryAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000275711137570512033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DependencyFactoryAspect { public POJO pojo; public static POJO invoked; public DependencyFactoryAspect(POJO pojo) { this.pojo = pojo; } public Object advice(MethodInvocation inv) throws Throwable { invoked = this.pojo; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableInterceptorFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000457411005412047033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableInterceptorFactory implements AspectFactory, XmlLoadable { Element element; public Object createPerClass(Advisor advisor) { throw new RuntimeException("PER_VM only"); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { throw new RuntimeException("PER_VM only"); } public Object createPerVM() { XmlLoadableInterceptor2 icptr = new XmlLoadableInterceptor2(); icptr.importXml(element); return icptr; } public String getName() { return this.getClass().getName(); } public void importXml(Element element) { this.element = element; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000270010721416203033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestAspect { public static boolean invoked; public Object advice(MethodInvocation inv) throws Throwable { Interceptions.add(this); invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/XmlLoadableAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000377711005412047033226 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableAspect implements XmlLoadable { private Element element; public static boolean intercepted; public static Element interceptedElement; public static int intAttr; public static String mcProperty; public void setIntAttr(int i) { intAttr = i; } public void setProperty(String property) { mcProperty = property; } public Object invoke(Invocation invocation) throws Throwable { intercepted = true; interceptedElement = element; return invocation.invokeNext(); } public void importXml(Element element) { this.element = element; } public Element getElement() { return element; } }././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/MixinImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000273110721416203033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinImpl implements MixinInterface { private String mixinValue = "DEFAULT"; public MixinImpl(POJO pojo, String value) { this.mixinValue = value; } public MixinImpl() { } public String getMixinValue() { return mixinValue; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/SimpleFactoryInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000324310721416203033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleFactoryInterceptor implements Interceptor { public static int invoked; private int i; public SimpleFactoryInterceptor(int i) { this.i = i; } public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { invoked = this.i; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/PerJoinPointAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000265410721416203033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PerJoinPointAspect { public static PerJoinPointAspect last; public Object advice(MethodInvocation mi) throws Throwable { last = this; return mi.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestAspectWithProperty.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000322310721416203033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestAspectWithProperty { public static TestAspectWithProperty last; private String someProperty; public String getSomeProperty() { return someProperty; } public void setSomeProperty(String someProperty) { this.someProperty = someProperty; } public Object advice(MethodInvocation inv) throws Throwable { last = this; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/Annotation1.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000231010721416203033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Annotation1 { } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/TestMetaDataLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000617210756314477033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import javassist.CtConstructor; import javassist.CtField; import javassist.CtMethod; import org.jboss.aop.Advisor; import org.jboss.aop.metadata.ClassMetaDataBinding; import org.jboss.aop.metadata.ClassMetaDataLoader; import org.jboss.aop.util.XmlHelper; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision$ */ public class TestMetaDataLoader implements ClassMetaDataLoader { public ClassMetaDataBinding importMetaData(Element element, String name, String tag, String classExpr) throws Exception { TestMetaDataBinding data = new TestMetaDataBinding(this, name, tag, classExpr); String value = XmlHelper.getOptionalChildContent(element, "data"); data.setData(value); return data; } public void bind(Advisor advisor, ClassMetaDataBinding data, CtMethod[] methods, CtField[] fields, CtConstructor[] constructors) throws Exception { for (int i = 0 ; i < methods.length ; i++) { advisor.getMethodMetaData().addMethodMetaData(methods[i], "SomeTag", "data", "M" + ((TestMetaDataBinding)data).getData()); } for (int i = 0 ; i < constructors.length ; i++) { advisor.getConstructorMetaData().addConstructorMetaData(constructors[i], "SomeTag", "data", "C" + ((TestMetaDataBinding)data).getData()); } } @SuppressWarnings("unchecked") public void bind(Advisor advisor, ClassMetaDataBinding data, Method[] methods, Field[] fields, Constructor[] constructors) throws Exception { for (int i = 0 ; i < methods.length ; i++) { advisor.getMethodMetaData().addMethodMetaData(methods[i], "SomeTag", "data", "M" + ((TestMetaDataBinding)data).getData()); } for (int i = 0 ; i < constructors.length ; i++) { advisor.getConstructorMetaData().addConstructorMetaData(constructors[i], "SomeTag", "data", "C" + ((TestMetaDataBinding)data).getData()); } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/beans/AnnotationWithValueAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/b0000644000175000017500000000271111137570512033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.beans; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationWithValueAspect { public static AnnotationWithValue value; public Object advice(Invocation inv) throws Throwable { value = (AnnotationWithValue)inv.resolveClassAnnotation(AnnotationWithValue.class); return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000755000175000017500000000000011620312200033212 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/ChildInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000231210432122672033226 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; /** * * @author Kabir Khan * @version $Revision: 44932 $ */ public interface ChildInterface { void childOnly(); void baseOverridden(); } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/TestInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000445010446736533033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; import java.lang.reflect.Method; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.test.microcontainer.support.Test; /** * * @author Kabir Khan * @version $Revision: 45764 $ */ public class TestInterceptor implements Interceptor { public static int interceptions; public static Method invoked; public static Object classAnnotation; public static Object methodAnnotation; public static Object metadata; public static void reset() { interceptions = 0; invoked = null; classAnnotation = null; methodAnnotation = null; metadata = null; } public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { interceptions++; if (invocation instanceof MethodInvocation) { invoked = ((MethodInvocation)invocation).getMethod(); } classAnnotation = invocation.resolveClassAnnotation(Test.class); methodAnnotation = invocation.resolveAnnotation(Test.class); metadata = invocation.getMetaData("Simple", "MetaData"); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/ReturningInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000433410431407733033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; import java.lang.reflect.Method; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.aop.microcontainer.aspects.jmx.JMX; /** * * @author Kabir Khan * @version $Revision: 44912 $ */ public class ReturningInterceptor implements Interceptor { public static int interceptions; public static Method invoked; public static Object classAnnotation; public static Object methodAnnotation; public static Object metadata; public static void reset() { interceptions = 0; invoked = null; classAnnotation = null; methodAnnotation = null; metadata = null; } public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { interceptions++; if (invocation instanceof MethodInvocation) { invoked = ((MethodInvocation)invocation).getMethod(); } classAnnotation = invocation.resolveClassAnnotation(JMX.class); methodAnnotation = invocation.resolveAnnotation(JMX.class); return null; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/AnnotatedChild.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000261510434423002033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; import org.jboss.test.microcontainer.support.Test; /** * * @author Kabir Khan * @version $Revision: 45137 $ */ @Test public class AnnotatedChild extends Base { public static boolean childInvoked; public void childOnly() { childInvoked = true; } public void baseOverridden() { childInvoked = true; } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000755000175000017500000000000011620312200033212 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000755000175000017500000000000011620312200033212 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000002003610760776332033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseAdvisedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); base.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAdvisedChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 2; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseAdvisedChildAdvisedAndProxyTestCase.class); } public BaseAdvisedChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001710010760776332033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseOnlyAdvisedChildProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } public void testPlainChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 1; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseOnlyAdvisedChildProxyTestCase.class); } public BaseOnlyAdvisedChildProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildNotAdvisedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000415410760776332033250 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseNotAdvisedChildNotAdvisedTestCase extends AOPMicrocontainerTest { public void testNotAdvised() throws Exception { Base base = (Base)getBean("Base"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); Child child = (Child)getBean("Child"); assertFalse(child instanceof Advised); assertFalse(child instanceof AspectManaged); } public static Test suite() { return suite(BaseNotAdvisedChildNotAdvisedTestCase.class); } public BaseNotAdvisedChildNotAdvisedTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseOnlyAdvisedChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001713410760776332033252 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseOnlyAdvisedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } public void testAdvisedChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 1; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseOnlyAdvisedChildAdvisedAndProxyTestCase.class); } public BaseOnlyAdvisedChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BasePreparedChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001105310760776332033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BasePreparedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest { public void testNotAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } public void testAdvisedChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(1, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(1, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY = 2;//1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED = 2;//0;//Base class does not have the hooks for interception private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 2; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY, TestInterceptor.interceptions); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED, TestInterceptor.interceptions); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); } public static Test suite() { return suite(BasePreparedChildAdvisedAndProxyTestCase.class); } public BasePreparedChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001452210760776332033250 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseNotAdvisedChildProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } public void testPlainChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertFalse(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY = 0; //Base class does not have hooks woven in private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 1; public void testProxiedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertFalse(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY, TestInterceptor.interceptions); assertNull(TestInterceptor.invoked); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseNotAdvisedChildProxyTestCase.class); } public BaseNotAdvisedChildProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/AdvisedNoInstanceDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000443010760776332033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedNoInstanceDataTestCase extends AOPMicrocontainerTest { public void testNotAdvised() throws Exception { Base base = (Base)getBean("Test"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(AdvisedNoInstanceDataTestCase.class); } public AdvisedNoInstanceDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseAdvisedChildProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001674610760776332033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseAdvisedChildProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); base.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testPlainChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 1; public void testProxiedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Two bindings will apply to this method assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseAdvisedChildProxyTestCase.class); } public BaseAdvisedChildProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedInstanceMetaDataContextTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000613511024223001033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 74487 $ */ public class NotAdvisedInstanceMetaDataContextTestCase extends AOPMicrocontainerTest { public void testNoMetaDataContext() throws Exception { Base base = (Base)getBean("NotAdvised"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); DynamicAspectDeployer.removeBinding(name); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); } public void testClassMetaDataContext() throws Exception { Base base = (Base)getBean("ClassAnnotated"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); } public void testMethodMetaDataContext() throws Exception { Base base = (Base)getBean("PropertyAnnotated"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); } public static Test suite() { return suite(NotAdvisedInstanceMetaDataContextTestCase.class); } public NotAdvisedInstanceMetaDataContextTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001550610760776332033253 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseOverriddenAdvisedChildProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testPlainChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED = 0; //Base class does not have the hooks for interception private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 1; public void testProxiedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Bindings applied by subclass metadata assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Bindings applied by subclass metadata assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED, TestInterceptor.interceptions); assertNull(TestInterceptor.invoked); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseOverriddenAdvisedChildProxyTestCase.class); } public BaseOverriddenAdvisedChildProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/NotAdvisedNoInstanceDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000501410760776332033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class NotAdvisedNoInstanceDataTestCase extends AOPMicrocontainerTest { public void testNotAdvised() throws Exception { Base base = (Base)getBean("Test"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); DynamicAspectDeployer.removeBinding(name); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); } public static Test suite() { return suite(NotAdvisedNoInstanceDataTestCase.class); } public NotAdvisedNoInstanceDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseNotAdvisedChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001105210760776332033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseNotAdvisedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest { public void testNotAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertFalse(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); } public void testAdvisedChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(1, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED = 0;//Base class does not have the hooks for interception private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 2; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 2; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY, TestInterceptor.interceptions); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED, TestInterceptor.interceptions); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); } public static Test suite() { return suite(BaseNotAdvisedChildAdvisedAndProxyTestCase.class); } public BaseNotAdvisedChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/BaseOverriddenAdvisedChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001555510760776332033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.AnnotatedChild; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseOverriddenAdvisedChildAdvisedAndProxyTestCase extends AOPMicrocontainerTest { public void testAdvisedBaseClass() throws Exception { Base base = (Base)getBean("Base"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAdvisedChild() throws Exception { Child plainChild = (Child)getBean("PlainChild"); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); } private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED = 0; //Base class does not have the hooks for interception private static final int EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_ONLY = 1; private static final int EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN = 2; public void testProxiedAndAdvisedChild() throws Exception { Child proxiedChild = (Child)getBean("ProxiedChild"); assertTrue(proxiedChild instanceof Advised); assertTrue(proxiedChild instanceof AspectManaged); TestInterceptor.reset(); proxiedChild.baseOnly(); //Bindings applied by subclass metadata assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_PROXY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); proxiedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testAnnotatedChild() throws Exception { AnnotatedChild annotatedChild = (AnnotatedChild)getBean("AnnotatedChild"); assertTrue(annotatedChild instanceof Advised); assertFalse(annotatedChild instanceof AspectManaged); TestInterceptor.reset(); annotatedChild.baseOnly(); //Bindings applied by subclass metadata assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEONLY_ADVISED, TestInterceptor.interceptions); assertNull(TestInterceptor.invoked); TestInterceptor.reset(); annotatedChild.childOnly(); assertEquals(EXPECTED_ANNNOTATED_CHILD_ONLY, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); TestInterceptor.reset(); annotatedChild.baseOverridden(); assertEquals(EXPECTED_ANNNOTATED_CHILD_BASEOVERRIDDEN, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(BaseOverriddenAdvisedChildAdvisedAndProxyTestCase.class); } public BaseOverriddenAdvisedChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/mc/test/AdvisedInstanceMetaDataContextTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001010510760776332033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.mc.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested for MC since setting up the metadatacontext manually for the proxyfactory test is too cumbersome * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedInstanceMetaDataContextTestCase extends AOPMicrocontainerTest { public void testNoMetaDataContext() throws Exception { Base base = (Base)getBean("NotAdvised"); assertTrue(base instanceof Advised); assertFalse(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testClassMetaDataContext() throws Exception { Base.baseInvoked = false; Base base = (Base)getBean("ClassAnnotated"); assertTrue(base instanceof Advised); assertTrue(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertTrue(Base.baseInvoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNotNull(TestInterceptor.classAnnotation); assertTrue(TestInterceptor.classAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public void testPropertyMetaDataContext() throws Exception { Base.baseInvoked = false; Base base = (Base)getBean("PropertyAnnotated"); assertTrue(base instanceof Advised); assertTrue(base instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.setProperty(5); assertTrue(Base.baseInvoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("setProperty", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNotNull(TestInterceptor.methodAnnotation); assertTrue(TestInterceptor.methodAnnotation instanceof org.jboss.test.microcontainer.support.Test); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(AdvisedInstanceMetaDataContextTestCase.class); } public AdvisedInstanceMetaDataContextTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/DynamicAspectDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000332610756314477033253 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.AdviceBinding; import org.jboss.aop.pointcut.ast.ParseException; /** * * @author Kabir Khan * @version $Revision: 69884 $ */ public class DynamicAspectDeployer { public static String addBinding(String pointcut, Class interceptor) throws ParseException { AdviceBinding binding = new AdviceBinding(pointcut, null); String name = binding.getName(); binding.addInterceptor(interceptor); AspectManager.instance().addBinding(binding); return name; } public static void removeBinding(String name) { AspectManager.instance().removeBinding(name); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/Base.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000260210431407733033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; /** * * @author Kabir Khan * @version $Revision: 44912 $ */ public class Base { public static boolean baseInvoked; public void baseOnly() { baseInvoked = true; } public void baseOverridden() { baseInvoked = true; } public void setProperty(int i) { baseInvoked = true; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/Child.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000251210433141071033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix; /** * * @author Kabir Khan * @version $Revision: 45039 $ */ public class Child extends Base { public static boolean childInvoked; public void childOnly() { childInvoked = true; } public void baseOverridden() { childInvoked = true; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000755000175000017500000000000011620312200033212 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000755000175000017500000000000011620312200033212 5ustar twernertwerner././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceIntroductionsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001051510760776332033246 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AOPProxyFactoryMixin; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.support.OtherMixin; import org.jboss.test.microcontainer.support.OtherMixinImpl; import org.jboss.test.microcontainer.support.SimpleBean; import org.jboss.test.microcontainer.support.SomeMixin; import org.jboss.test.microcontainer.support.SomeMixinImpl; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested with proxy factory. * The only way in MC to create introductions per instance is to add metadata to that instance * and that will cause a proxy to be created anyway * * @author Kabir Khan * @version $Revision: 70090 $ */ public class NotAdvisedInstanceIntroductionsTestCase extends AbstractProxyTest { public void testIntroductions() throws Exception { Base base = new Base(); Object proxy = assertCreateProxy(base, new Class[] {SimpleBean.class}, SimpleBean.class); assertFalse(proxy instanceof Advised); assertTrue(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(0, TestInterceptor.interceptions); String name = DynamicAspectDeployer.addBinding("execution(* $instanceof{org.jboss.test.microcontainer.support.SimpleBean}->*(..))", TestInterceptor.class); TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); DynamicAspectDeployer.removeBinding(name); TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(0, TestInterceptor.interceptions); } public void testMixins() throws Exception { Base base = new Base(); AOPProxyFactoryMixin[] mixins = { new AOPProxyFactoryMixin(OtherMixinImpl.class, new Class[] {OtherMixin.class}), new AOPProxyFactoryMixin(SomeMixinImpl.class, new Class[] {SomeMixin.class}), }; Object proxy = assertCreateProxy(base, null, mixins, new Class[] {OtherMixin.class, SomeMixin.class}); assertFalse(proxy instanceof Advised); assertTrue(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(0, TestInterceptor.interceptions); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); DynamicAspectDeployer.removeBinding(name); TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(0, TestInterceptor.interceptions); } public static Test suite() { return suite(NotAdvisedInstanceIntroductionsTestCase.class); } public NotAdvisedInstanceIntroductionsTestCase(String name) { super(name); } }././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceSimpleMetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000647010760776332033253 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.metadata.SimpleMetaData; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * No MC counterpart since there is no way to create SimpleMetaData via MC * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedInstanceSimpleMetaDataTestCase extends AbstractProxyTest { public void testSimpleMetaData() throws Exception { Object proxy1 = createProxyWithSimpleMetaData("value1"); Object proxy2 = createProxyWithSimpleMetaData("value2"); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); ((Base)proxy1).baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNotNull(TestInterceptor.metadata); assertEquals("value1", TestInterceptor.metadata); TestInterceptor.reset(); ((Base)proxy2).baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNotNull(TestInterceptor.metadata); assertEquals("value2", TestInterceptor.metadata); } private Object createProxyWithSimpleMetaData(String value) throws Exception { Base base = new Base(); SimpleMetaData metaData = new SimpleMetaData(); metaData.addMetaData("Simple", "MetaData", value); Object proxy = createProxy(base, null, metaData); assertTrue(proxy instanceof Advised); assertTrue(proxy instanceof AspectManaged); return proxy; } public static Test suite() { return suite(AdvisedInstanceSimpleMetaDataTestCase.class); } public AdvisedInstanceSimpleMetaDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/BaseForceProxyChildAdvisedAndProxyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001354010760776332033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.Child; import org.jboss.test.microcontainer.matrix.ChildInterface; import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Forces a proxy to be used for the base class, which in turn makes the advisor for that class a ClassProxyContainer * The idea is to check a creation of the classadvisor for the child class when the superclass advisor is a container. * * @author Kabir Khan * @version $Revision: 70090 $ */ public class BaseForceProxyChildAdvisedAndProxyTestCase extends AbstractProxyTest { public void testProxieddBaseClass() throws Exception { Base base = new Base(); assertFalse(base instanceof Advised); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); try { Object proxy = createProxy(base); assertTrue(proxy instanceof AspectManaged); assertFalse(proxy instanceof Advised); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); base.baseOverridden(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); TestInterceptor.reset(); ((Base)proxy).baseOverridden(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); } finally { DynamicAspectDeployer.removeBinding(name); } } public void testAdvisedChild() throws Exception { String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); try { Child plainChild = new Child(); assertTrue(plainChild instanceof Advised); assertFalse(plainChild instanceof AspectManaged); TestInterceptor.reset(); plainChild.baseOnly(); assertEquals(0, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.childOnly(); assertEquals(1, TestInterceptor.interceptions); TestInterceptor.reset(); plainChild.baseOverridden(); assertEquals(1, TestInterceptor.interceptions); } finally { DynamicAspectDeployer.removeBinding(name); } } public void testProxiedAndAdvisedChild() throws Exception { System.out.println("=======> Adding Binding"); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); Object proxy = null; try { Child proxiedChild = new Child(); assertTrue(proxiedChild instanceof Advised); assertFalse(proxiedChild instanceof AspectManaged); System.out.println("=======> Creating proxy"); proxy = createProxy(proxiedChild, new Class[] {ChildInterface.class}); TestInterceptor.reset(); ((Child)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); TestInterceptor.reset(); ((Child)proxy).childOnly(); assertEquals(2, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("childOnly", TestInterceptor.invoked.getName()); TestInterceptor.reset(); ((Child)proxy).baseOverridden(); assertEquals(2, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOverridden", TestInterceptor.invoked.getName()); } finally { System.out.println("=======> Removing Binding"); DynamicAspectDeployer.removeBinding(name); } TestInterceptor.reset(); ((Child)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); } public static Test suite() { return suite(BaseForceProxyChildAdvisedAndProxyTestCase.class); } public BaseForceProxyChildAdvisedAndProxyTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedNoInstanceDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000450310760776332033246 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedNoInstanceDataTestCase extends AbstractProxyTest { public void testNotAdvised() throws Exception { Base base = new Base(); Object proxy = createProxy(base); assertTrue(proxy instanceof Advised); assertFalse(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(AdvisedNoInstanceDataTestCase.class); } public AdvisedNoInstanceDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedNoInstanceDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000505010760776332033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.DynamicAspectDeployer; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 70090 $ */ public class NotAdvisedNoInstanceDataTestCase extends AbstractProxyTest { public void testNotAdvised() throws Exception { Base base = new Base(); Object proxy = createProxy(base); assertFalse(proxy instanceof Advised); assertFalse(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); String name = DynamicAspectDeployer.addBinding("execution(* org.jboss.test.microcontainer.matrix.Base->*(..))", TestInterceptor.class); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); DynamicAspectDeployer.removeBinding(name); TestInterceptor.reset(); base.baseOnly(); assertEquals(0, TestInterceptor.interceptions); } public static Test suite() { return suite(NotAdvisedNoInstanceDataTestCase.class); } public NotAdvisedNoInstanceDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/NotAdvisedInstanceSimpleMetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000413711024223001033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.metadata.SimpleMetaData; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.matrix.Base; /** * No MC counterpart since there is no way to create SimpleMetaData via MC * * @author Kabir Khan * @version $Revision: 74487 $ */ public class NotAdvisedInstanceSimpleMetaDataTestCase extends AbstractProxyTest { public void testSimpleMetaData() throws Exception { Base base = new Base(); SimpleMetaData metaData = new SimpleMetaData(); metaData.addMetaData("Simple", "MetaData", "Value"); Object proxy = createProxy(base, null, metaData); assertFalse(proxy instanceof Advised); assertFalse(proxy instanceof AspectManaged); } public static Test suite() { return suite(NotAdvisedInstanceSimpleMetaDataTestCase.class); } public NotAdvisedInstanceSimpleMetaDataTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceMixinTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000001034710760776332033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AOPProxyFactoryMixin; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.support.OtherMixin; import org.jboss.test.microcontainer.support.OtherMixinImpl; import org.jboss.test.microcontainer.support.SomeMixin; import org.jboss.test.microcontainer.support.SomeMixinImpl; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested with proxy factory. * The only way in MC to create introductions per instance is to add metadata to that instance * and that will cause a proxy to be created anyway * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedInstanceMixinTestCase extends AbstractProxyTest { public void testMixins() throws Exception { Base base = new Base(); AOPProxyFactoryMixin[] mixins = { new AOPProxyFactoryMixin(OtherMixinImpl.class, new Class[] {OtherMixin.class}), new AOPProxyFactoryMixin(SomeMixinImpl.class, new Class[] {SomeMixin.class}), }; Object proxy = assertCreateProxy(base, null, mixins, new Class[] {OtherMixin.class, SomeMixin.class}); assertTrue(proxy instanceof Advised); assertTrue(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt Base.baseInvoked = false; TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertTrue(Base.baseInvoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); //Not the main purpose of the test but being paranoid never hurt SomeMixinImpl.invoked = false; TestInterceptor.reset(); ((SomeMixin)proxy).someMixinMethod(); assertTrue(SomeMixinImpl.invoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("someMixinMethod", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); //Not the main purpose of the test but being paranoid never hurt OtherMixinImpl.invoked = false; TestInterceptor.reset(); ((OtherMixin)proxy).otherMixinMethod(); assertTrue(OtherMixinImpl.invoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("otherMixinMethod", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); } public static Test suite() { return suite(AdvisedInstanceMixinTestCase.class); } public AdvisedInstanceMixinTestCase(String name) { super(name); } }././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/matrix/proxyfactory/test/AdvisedInstanceIntroductionsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/m0000644000175000017500000000650010760776332033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.matrix.proxyfactory.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AbstractProxyTest; import org.jboss.test.microcontainer.support.SimpleBean; import org.jboss.test.microcontainer.matrix.Base; import org.jboss.test.microcontainer.matrix.ReturningInterceptor; import org.jboss.test.microcontainer.matrix.TestInterceptor; /** * Only tested with proxy factory. * The only way in MC to create introductions per instance is to add metadata to that instance * and that will cause a proxy to be created anyway * * @author Kabir Khan * @version $Revision: 70090 $ */ public class AdvisedInstanceIntroductionsTestCase extends AbstractProxyTest { public void testIntroductions() throws Exception { Base base = new Base(); Object proxy = assertCreateProxy(base, new Class[] {SimpleBean.class}, SimpleBean.class); assertTrue(proxy instanceof Advised); assertTrue(proxy instanceof AspectManaged); //Not the main purpose of the test but being paranoid never hurt Base.baseInvoked = false; TestInterceptor.reset(); ((Base)proxy).baseOnly(); assertTrue(Base.baseInvoked); assertEquals(1, TestInterceptor.interceptions); assertNotNull(TestInterceptor.invoked); assertEquals("baseOnly", TestInterceptor.invoked.getName()); assertNull(TestInterceptor.classAnnotation); assertNull(TestInterceptor.methodAnnotation); assertNull(TestInterceptor.metadata); //Not the main purpose of the test but being paranoid never hurt Base.baseInvoked = false; ReturningInterceptor.reset(); ((SimpleBean)proxy).someMethod(); assertFalse(Base.baseInvoked); assertEquals(1, ReturningInterceptor.interceptions); assertNotNull(ReturningInterceptor.invoked); assertEquals("someMethod", ReturningInterceptor.invoked.getName()); assertNull(ReturningInterceptor.classAnnotation); assertNull(ReturningInterceptor.methodAnnotation); assertNull(ReturningInterceptor.metadata); } public static Test suite() { return suite(AdvisedInstanceIntroductionsTestCase.class); } public AdvisedInstanceIntroductionsTestCase(String name) { super(name); } }././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312200033176 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312201033177 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestIntroductionAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000231210420664341033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * TestIntroductionAnnotation. * * @author Adrian Brock * @version $Revision: 43840 $ */ public @interface TestIntroductionAnnotation { } ././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000470110760776332033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.advisor.test.some.Pojo; /** * MicrocontainerAdvisedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { Object o1 = getBean("One"); assertFalse(o1 instanceof Advised); assertTrue(o1 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o1.getClass())); Pojo pojo1 = (Pojo)o1; Object o2 = getBean("Two"); assertFalse(o2 instanceof Advised); assertTrue(o2 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o2.getClass())); Pojo pojo2 = (Pojo)o2; assertTrue(pojo1.getInstance() == pojo2.getInstance()); assertEquals(1, pojo1.getI()); assertEquals("One", pojo1.getS()); assertEquals(1, pojo2.getI()); assertEquals("One", pojo2.getS()); } public static Test suite() { return suite(MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase.class); } public MicrocontainerNotAdvisedProxyAdvisorOverloadedConstructorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestIntroductionInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000302410420664341033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * TestIntroductionInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class TestIntroductionInterceptor implements Interceptor { public static int intercepted = 0; public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { ++intercepted; return null; } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedIntroducedAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000463510760776332033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerAdvisedIntroducedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedIntroducedAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { TestObject o = (TestObject) getBean("Test"); assertTrue(o instanceof Advised); assertTrue(o instanceof AspectManaged); DummyInterceptor.intercepted = 0; TestIntroductionInterceptor.intercepted = 0; o.doSomething(); assertEquals(1, DummyInterceptor.intercepted); assertEquals(1, TestIntroductionInterceptor.intercepted); assertTrue(o instanceof TestIntroductionInterface); TestIntroductionInterface i = (TestIntroductionInterface) o; DummyInterceptor.intercepted = 0; TestIntroductionInterceptor.intercepted = 0; i.doIntroduced(); assertEquals(1, DummyInterceptor.intercepted); assertEquals(1, TestIntroductionInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerAdvisedIntroducedAdvisorTestCase.class); } public MicrocontainerAdvisedIntroducedAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/DummyInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000302510420664341033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * DummyInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class DummyInterceptor implements Interceptor { public static int intercepted = 0; public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { intercepted++; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/Singleton.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000223510433576542033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * * @author Kabir Khan * @version $Revision: 45105 $ */ public @interface Singleton { } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000363310760776332033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerAdvisedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { TestObject o = (TestObject) getBean("Test"); assertTrue(o instanceof Advised); assertFalse(o instanceof AspectManaged); TestInterceptor.intercepted = 0; o.doSomething(); assertEquals(1, TestInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerAdvisedAdvisorTestCase.class); } public MicrocontainerAdvisedAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/another/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312200033176 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/another/Pojo.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000227010433576542033227 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test.another; /** * @author Kabir Khan * @version $Revision: 45105 $ */ public class Pojo { public Pojo() { } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000301710420664341033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * TestInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class TestInterceptor implements Interceptor { public static int intercepted = 0; public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { ++intercepted; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000612610760776332033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.support.MetaDataContextInterceptor; /** * Tests that annotation overrides from AOP are readable * * @author Kabir Khan * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { SomeBean o = (SomeBean) getBean("Intercepted"); //Annotations added with overrides act the same as class annotations, by the stage the bean class //is loaded all the bindings will have been deployed assertTrue(o instanceof Advised); assertFalse(o instanceof AspectManaged); MetaDataContextInterceptor.reset(); o.doSomething(); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertTrue(MetaDataContextInterceptor.classAnnotation instanceof AnnotationWithValue); assertEquals(10, ((AnnotationWithValue)MetaDataContextInterceptor.classAnnotation).value()); assertNull(MetaDataContextInterceptor.joinpointAnnotation); MetaDataContextInterceptor.reset(); o.doSomethingElse(); assertNotNull(MetaDataContextInterceptor.classAnnotation); assertTrue(MetaDataContextInterceptor.classAnnotation instanceof AnnotationWithValue); assertEquals(10, ((AnnotationWithValue)MetaDataContextInterceptor.classAnnotation).value()); assertNotNull(MetaDataContextInterceptor.joinpointAnnotation); assertTrue(MetaDataContextInterceptor.joinpointAnnotation instanceof AnnotationWithValue); assertEquals(50, ((AnnotationWithValue)MetaDataContextInterceptor.joinpointAnnotation).value()); } public static Test suite() { return suite(MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase.class); } public MicrocontainerAdvisedAnnotationOverrideProxyAdvisorTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorConstructorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000573510760776332033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.advisor.test.some.Pojo; /** * MicrocontainerAdvisedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedAdvisorConstructorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { Object o1 = getBean("One"); assertTrue(o1 instanceof Advised); assertFalse(o1 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o1.getClass())); Pojo pojo1 = (Pojo)o1; Object o2 = getBean("Two"); assertTrue(o2 instanceof Advised); assertFalse(o2 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o2.getClass())); Pojo pojo2 = (Pojo)o2; Object o3 = getBean("Three"); assertFalse(o3 instanceof Advised); assertFalse(o3 instanceof AspectManaged); assertTrue(org.jboss.test.microcontainer.advisor.test.another.Pojo.class.equals(o3.getClass())); org.jboss.test.microcontainer.advisor.test.another.Pojo pojo3 = (org.jboss.test.microcontainer.advisor.test.another.Pojo)o3; Object o4 = getBean("Four"); assertFalse(o4 instanceof Advised); assertFalse(o4 instanceof AspectManaged); assertTrue(org.jboss.test.microcontainer.advisor.test.another.Pojo.class.equals(o4.getClass())); org.jboss.test.microcontainer.advisor.test.another.Pojo pojo4 = (org.jboss.test.microcontainer.advisor.test.another.Pojo)o4; assertTrue(pojo1.getInstance() == pojo2.getInstance()); assertFalse(pojo3 == pojo4); } public static Test suite() { return suite(MicrocontainerAdvisedAdvisorConstructorTestCase.class); } public MicrocontainerAdvisedAdvisorConstructorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/AnnotationWithValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000226710430127271033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * * @author Kabir Khan * @version $Revision: 44689 $ */ public @interface AnnotationWithValue { int value(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/some/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312201033177 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/some/Pojo.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000306110434320211033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test.some; /** * * @author Kabir Khan * @version $Revision: 45129 $ */ public class Pojo { int i; String s; public Pojo() { System.out.println("********** Created " + this); } public Pojo(int i) { this.i = i; } public Pojo(int i, String s) { this.i = i; this.s = s; } public int getI() { return i; } public String getS() { return s; } public Pojo getInstance() { return this; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/UnadvisedTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000232310420664341033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * TestIntercepted. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class UnadvisedTest { public void doSomething() { } } ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000554310760776332033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.advisor.test.some.Pojo; /** * MicrocontainerAdvisedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { Object o1 = getBean("One"); assertFalse(o1 instanceof Advised); assertTrue(o1 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o1.getClass())); Pojo pojo1 = (Pojo)o1; Object o2 = getBean("Two"); assertFalse(o2 instanceof Advised); assertTrue(o2 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o2.getClass())); Pojo pojo2 = (Pojo)o2; Object o3 = getBean("Three"); assertFalse(o3 instanceof Advised); assertFalse(o3 instanceof AspectManaged); assertTrue(Pojo.class.equals(o3.getClass())); Pojo pojo3 = (Pojo)o3; Object o4 = getBean("Four"); assertFalse(o4 instanceof Advised); assertTrue(o4 instanceof AspectManaged); assertTrue(org.jboss.test.microcontainer.advisor.test.another.Pojo.class.isAssignableFrom(o4.getClass())); assertTrue(o4 instanceof org.jboss.test.microcontainer.advisor.test.another.Pojo); assertTrue(pojo1.getInstance() == pojo2.getInstance()); assertFalse(pojo1.getInstance() == pojo3.getInstance()); } public static Test suite() { return suite(MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase.class); } public MicrocontainerNotAdvisedProxyAdvisorConstructorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000226410445607345033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * Test Annotation * * @author Kabir Khan * @version $Revision: 45668 $ */ public @interface TestAnnotation { } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/SingletonAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000346210433576542033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import org.jboss.aop.joinpoint.ConstructorInvocation; /** * A simple implementation of a singleton.

* * This advice should be PER_CLASS scoped

* * e.g. *

  
 * 
 *
 * 
 *     
 * 
 * 
* * * @author Adrian Brock * @version $Revision: 45105 $ */ public class SingletonAspect { private Object singleton; public synchronized Object constructorAdvice(ConstructorInvocation invocation) throws Throwable { System.out.println("---------> SingletonAspect " + this); if (singleton == null) singleton = invocation.invokeNext(); return singleton; } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedNoAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000366610760776332033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerNotAdvisedNoAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerNotAdvisedNoAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { UnadvisedTest o = (UnadvisedTest) getBean("Test"); assertFalse(o instanceof AspectManaged); assertFalse(o instanceof Advised); TestInterceptor.intercepted = 0; o.doSomething(); assertEquals(0, TestInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerNotAdvisedNoAdvisorTestCase.class); } public MicrocontainerNotAdvisedNoAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/SomeBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000240510430127271033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * * @author Kabir Khan * @version $Revision: 44689 $ */ public class SomeBean { public int field; public void doSomething() { } public void doSomethingElse() { } } ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000440410760776332033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { TestObject o = (TestObject) getBean("Test"); assertFalse(o instanceof Advised); assertTrue(o instanceof AspectManaged); TestIntroductionInterceptor.intercepted = 0; o.doSomething(); assertEquals(1, TestIntroductionInterceptor.intercepted); assertTrue(o instanceof TestIntroductionInterface); TestIntroductionInterface i = (TestIntroductionInterface) o; TestIntroductionInterceptor.intercepted = 0; i.doIntroduced(); assertEquals(1, TestIntroductionInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase.class); } public MicrocontainerNotAdvisedIntroducedProxyAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestIntroductionInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000234510420664341033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * TestIntroductionInterface. * * @author Adrian Brock * @version $Revision: 43840 $ */ public interface TestIntroductionInterface { public void doIntroduced(); } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerNotAdvisedProxyAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000370110760776332033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerNotAdvisedProxyAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerNotAdvisedProxyAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { UnadvisedTest o = (UnadvisedTest) getBean("Test"); assertTrue(o instanceof AspectManaged); assertFalse(o instanceof Advised); TestInterceptor.intercepted = 0; o.doSomething(); assertEquals(1, TestInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerNotAdvisedProxyAdvisorTestCase.class); } public MicrocontainerNotAdvisedProxyAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/TestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000232010420664341033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; /** * TestIntercepted. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class TestObject { public void doSomething() { } } ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000464310760776332033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.test.aop.junit.AOPMicrocontainerTest; import org.jboss.test.microcontainer.advisor.test.some.Pojo; /** * MicrocontainerAdvisedAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { Object o1 = getBean("One"); assertTrue(o1 instanceof Advised); assertFalse(o1 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o1.getClass())); Pojo pojo1 = (Pojo)o1; Object o2 = getBean("Two"); assertTrue(o2 instanceof Advised); assertFalse(o2 instanceof AspectManaged); assertTrue(Pojo.class.isAssignableFrom(o2.getClass())); Pojo pojo2 = (Pojo)o2; assertTrue(pojo1.getInstance() == pojo2.getInstance()); assertEquals(1, pojo1.getI()); assertEquals("One", pojo1.getS()); assertEquals(1, pojo2.getI()); assertEquals("One", pojo2.getS()); } public static Test suite() { return suite(MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase.class); } public MicrocontainerAdvisedAdvisorOverloadedConstructorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/advisor/test/MicrocontainerAdvisedInstanceAdvisorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000434110760776332033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.advisor.test; import junit.framework.Test; import org.jboss.aop.Advised; import org.jboss.test.aop.junit.AOPMicrocontainerTest; /** * MicrocontainerAdvisedInstanceAdvisorTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerAdvisedInstanceAdvisorTestCase extends AOPMicrocontainerTest { public void testAdvisor() throws Exception { TestObject o = (TestObject) getBean("Test"); assertTrue(o instanceof Advised); TestInterceptor.intercepted = 0; DummyInterceptor.intercepted = 0; o.doSomething(); assertEquals(1, TestInterceptor.intercepted); assertEquals(1, DummyInterceptor.intercepted); o = (TestObject) getBean("TestNoAnnotation"); assertTrue(o instanceof Advised); TestInterceptor.intercepted = 0; DummyInterceptor.intercepted = 0; o.doSomething(); assertEquals(0, TestInterceptor.intercepted); assertEquals(1, DummyInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerAdvisedInstanceAdvisorTestCase.class); } public MicrocontainerAdvisedInstanceAdvisorTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312205033203 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/ExternalizableMixin.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000376411041411435033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; /** * * @author Kabir Khan * @version $Revision: 46162 $ */ public class ExternalizableMixin implements Externalizable { public static boolean read = false; public static boolean write = false; SimplePOJO pojo; public ExternalizableMixin(SimplePOJO pojo) { System.out.println("ExternalizableMixin constructor"); this.pojo = pojo; } public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { System.out.println("ExternalizableMixin readExternal"); read = true; pojo.stuff = in.readUTF(); } public void writeExternal(ObjectOutput out) throws IOException { System.out.println("ExternalizableMixin writeExternal"); write = true; out.writeUTF(pojo.stuff); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312204033202 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/DynamicCFlowTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000357511041411435033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.DynamicCFlowAspect; import org.jboss.test.microcontainer.annotatedaop.DynamicCFlowImpl; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowTestCase extends AnnotatedAOPMicrocontainerTest { public DynamicCFlowTestCase(String name) { super(name); } public void testIntrodution() { DynamicCFlowAspect.reset(); SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); assertFalse(DynamicCFlowAspect.invoked); DynamicCFlowImpl.setFlag(true); pojo.method(); assertTrue(DynamicCFlowAspect.invoked); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/DeclareTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000457211041411435033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import java.util.Iterator; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.DeclareDef; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeclareTestCase extends AnnotatedAOPMicrocontainerTest { public DeclareTestCase(String name) { super(name); } public void testDeclare() { AspectManager am = (AspectManager)getBean("AspectManager"); Iterator it = am.getDeclares(); int declares = 0; boolean gotError = false; boolean gotWarning = false; while (it.hasNext()) { DeclareDef def = it.next(); declares++; if (def.getWarning()) { gotWarning = true; checkDeclare(def,"call(void org.acme.Warning->warning())", "warning"); } else { gotError = true; checkDeclare(def, "call(void org.acme.Error->error())", "error"); } } assertEquals(2, declares); assertTrue(gotError); assertTrue(gotWarning); } private void checkDeclare(DeclareDef def, String pointcut, String msg) { assertEquals(def.getExpr(), pointcut); assertEquals(def.getMsg(), msg); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/CFlowTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000414511041411435033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; import org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect; import org.jboss.test.microcontainer.annotatedaop.TestCFlowInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowTestCase extends AnnotatedAOPMicrocontainerTest { public CFlowTestCase(String name) { super(name); } public void testCFlowMatch() { TestCFlowAspect.reset(); TestCFlowInterceptor.reset(); makeCall(); assertTrue(TestCFlowAspect.invoked); assertTrue(TestCFlowInterceptor.invoked); } public void testCFlowNotMatch() { TestCFlowAspect.reset(); TestCFlowInterceptor.reset(); makeCall(); assertFalse(TestCFlowAspect.invoked); assertFalse(TestCFlowInterceptor.invoked); } private void makeCall() { SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/IntroductionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000531211041411435033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import java.util.Arrays; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.EmptyInterface1; import org.jboss.test.microcontainer.annotatedaop.EmptyInterface2; import org.jboss.test.microcontainer.annotatedaop.EmptyInterface3; import org.jboss.test.microcontainer.annotatedaop.MixinA; import org.jboss.test.microcontainer.annotatedaop.MixinInterface1; import org.jboss.test.microcontainer.annotatedaop.MixinInterface2; import org.jboss.test.microcontainer.annotatedaop.MixinInterface3; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class IntroductionTestCase extends AnnotatedAOPMicrocontainerTest { public IntroductionTestCase(String name) { super(name); } public void testIntroductionsAndMixins() throws Exception { SimplePOJO pojo = getBean(); System.out.println("-------------->" + Arrays.asList(pojo.getClass().getInterfaces())); assertInstanceOf(pojo, EmptyInterface1.class); assertInstanceOf(pojo, EmptyInterface2.class); assertInstanceOf(pojo, EmptyInterface3.class); assertInstanceOf(pojo, MixinInterface1.class); assertEquals(1, ((MixinInterface1)pojo).mixin1()); assertInstanceOf(pojo, MixinInterface2.class); assertEquals(2, ((MixinInterface2)pojo).mixin2()); assertInstanceOf(pojo, MixinInterface3.class); assertEquals(3, ((MixinInterface3)pojo).mixin3()); assertNotNull(MixinA.pojo); } private SimplePOJO getBean() { return (SimplePOJO)getBean("Bean"); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/PrecedenceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000433111041411435033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import java.util.List; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.Interceptions; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceTestCase extends AnnotatedAOPMicrocontainerTest { public PrecedenceTestCase(String name) { super(name); } public void testPrecedence() { Interceptions.clear(); SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); List interceptions = Interceptions.getInterceptions(); assertEquals(4, interceptions.size()); for (int i = 0 ; i < 4 ; i++) { int res = interceptions.get(i); switch (i) { case 0: assertEquals(1, res); break; case 1: assertEquals(3, res); break; case 2: assertEquals(2, res); break; case 3: assertEquals(4, res); break; } } } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/InterceptorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000420211041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; import org.jboss.test.microcontainer.annotatedaop.TestInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InterceptorTestCase extends AnnotatedAOPMicrocontainerTest { public InterceptorTestCase(String name) { super(name); } public void testInterceptor() { TestInterceptor.reset(); SimplePOJO pojoA = (SimplePOJO)getBean("BeanA"); pojoA.method(); assertEquals(1, TestInterceptor.invoked); //Now check that the scope was honoured TestInterceptor testA = TestInterceptor.last; TestInterceptor.reset(); pojoA.method(); assertEquals(1, TestInterceptor.invoked); assertSame(testA, TestInterceptor.last); TestInterceptor.reset(); SimplePOJO pojoB = (SimplePOJO)getBean("BeanB"); pojoB.method(); assertEquals(1, TestInterceptor.invoked); assertNotSame(testA, TestInterceptor.last); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/TypedefTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000324411041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; import org.jboss.test.microcontainer.annotatedaop.TypedefAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TypedefTestCase extends AnnotatedAOPMicrocontainerTest { public TypedefTestCase(String name) { super(name); } public void testTypedef() { TypedefAspect.reset(); SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); assertTrue(TypedefAspect.invoked); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/AspectTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000431011041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; import org.jboss.test.microcontainer.annotatedaop.TestAspect; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectTestCase extends AnnotatedAOPMicrocontainerTest { public AspectTestCase(String name) { super(name); } public void testAspect() { TestAspect.reset(); SimplePOJO pojoA = (SimplePOJO)getBean("BeanA"); pojoA.method(); assertEquals(1, TestAspect.invoked); assertEquals(1, TestAspect.advice); //Now check that the scope was honoured TestAspect testA = TestAspect.last; TestAspect.reset(); pojoA.anotherMethod(); assertEquals(1, TestAspect.invoked); assertEquals(2, TestAspect.advice); assertSame(testA, TestAspect.last); TestAspect.reset(); SimplePOJO pojoB = (SimplePOJO)getBean("BeanB"); pojoB.method(); assertEquals(1, TestAspect.invoked); assertEquals(1, TestAspect.advice); assertNotSame(testA, TestAspect.last); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/test/NamedPointcutTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000330611041411435033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.NamedPointcutAspect; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NamedPointcutTestCase extends AnnotatedAOPMicrocontainerTest { public NamedPointcutTestCase(String name) { super(name); } public void testIntrodution() { NamedPointcutAspect.reset(); SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); assertTrue(NamedPointcutAspect.invoked); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000304511041411435033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.DynamicCFlowDef; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.pointcut.DynamicCFlow; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @DynamicCFlowDef public class DynamicCFlowImpl implements DynamicCFlow { static boolean flag; public static void setFlag(boolean flag) { DynamicCFlowImpl.flag = flag; } public boolean shouldExecute(Invocation invocation) { return flag; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312204033202 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000755000175000017500000000000011620312204033202 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/test/AnnotationIntroductionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000337711041411435033221 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.woven.test; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.woven.AnnotationIntroductionAspect; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationIntroductionTestCase extends AnnotatedAOPMicrocontainerTest { public AnnotationIntroductionTestCase(String name) { super(name); } public void testIntrodution() { AnnotationIntroductionAspect.reset(); SimplePOJO pojo = (SimplePOJO)getBean("Bean"); pojo.method(); assertTrue(AnnotationIntroductionAspect.invoked); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/test/PrepareTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000311311041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.woven.test; import org.jboss.aop.Advised; import org.jboss.test.aop.junit.AnnotatedAOPMicrocontainerTest; import org.jboss.test.microcontainer.annotatedaop.SimplePOJO; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrepareTestCase extends AnnotatedAOPMicrocontainerTest { public PrepareTestCase(String name) { super(name); } public void testPrepare() { SimplePOJO pojo = (SimplePOJO)getBean("Bean"); assertInstanceOf(pojo, Advised.class); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/PrepareAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000262111041411435033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.woven; import org.jboss.aop.Aspect; import org.jboss.aop.Prepare; import org.jboss.aop.advice.Scope; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class PrepareAspect { @Prepare("all(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)") public Object prepare; } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/TestAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000263011041411435033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.woven; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface TestAnnotation { } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/woven/AnnotationIntroductionAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000371511041411435033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop.woven; import org.jboss.aop.AnnotationIntroductionDef; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class AnnotationIntroductionAspect { public static boolean invoked; public static void reset() { invoked = false; } @AnnotationIntroductionDef(expr="class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)", annotation="@org.jboss.test.microcontainer.annotatedaop.woven.TestAnnotation", invisible=false) Object intro; @Bind(pointcut="execution(* @org.jboss.test.microcontainer.annotatedaop.woven.TestAnnotation->method())") public Object advice(MethodInvocation inv) throws Throwable { invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/TestInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000360011041411435033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @InterceptorDef(scope=Scope.PER_INSTANCE) @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public class TestInterceptor implements Interceptor { public static int invoked; public static TestInterceptor last; public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { invoked++; last = this; return invocation.invokeNext(); } public static void reset() { invoked = 0; last = null; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/EmptyInterface1.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000226311041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface EmptyInterface1 { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Precedence1Aspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000311011041411435033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class Precedence1Aspect { @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public Object advice(MethodInvocation inv) throws Throwable { Interceptions.add(1); return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/SimplePOJO.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000244211041411435033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimplePOJO { public String stuff; public void method() { } public void anotherMethod() { } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/DeclareAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000304111042111650033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.DeclareError; import org.jboss.aop.DeclareWarning; import org.jboss.aop.advice.Scope; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class DeclareAspect { @DeclareError(expr="call(void org.acme.Error->error())", msg="error") public Object error; @DeclareWarning(expr="call(void org.acme.Warning->warning())", msg="warning") public Object warning; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/ComparableMixin.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000257111041411435033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * Mixin that implements the Comparable interface. * * @author Flavia Rainone */ public class ComparableMixin implements Comparable { public static boolean compared = false; public int compareTo(Object o) { compared = true; return 0; } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/DynamicCFlowAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000335711041411435033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class DynamicCFlowAspect { public static boolean invoked; public static void reset() { invoked = false; } @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.DynamicCFlowImpl") public Object advice(MethodInvocation inv) throws Throwable { invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/MixinB.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000236211041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinB implements MixinInterface3 { public int mixin3() { return 3; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/EmptyInterface3.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000226311041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface EmptyInterface3 { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Precedence4Interceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000334311041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @InterceptorDef(scope=Scope.PER_VM) @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public class Precedence4Interceptor implements Interceptor { public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { Interceptions.add(4); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/IntroductionAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000375211042111650033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Introduction; import org.jboss.aop.Mixin; import org.jboss.aop.advice.Scope; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class IntroductionAspect { @Introduction (target=SimplePOJO.class, interfaces={EmptyInterface1.class}) public static Object noInterfacesPOJOIntro; @Introduction (typeExpression="has(* *->method(..))", interfaces={EmptyInterface2.class, EmptyInterface3.class}) public static Object noInterfacesPOJO2Intro; @Mixin (target=SimplePOJO.class, interfaces={MixinInterface1.class, MixinInterface2.class}) public static MixinA createExternalizableMixin(SimplePOJO pojo) { return new MixinA(pojo); } @Mixin (typeExpression="has(* *->method(..))", interfaces={MixinInterface3.class}) public static MixinB createComparableMixin() { return new MixinB(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Interceptions.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000310411041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import java.util.ArrayList; import java.util.List; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class Interceptions { static List interceptions = new ArrayList(); public static void clear() { interceptions.clear(); } public static void add(Integer i) { System.out.println("---> Adding " + i); interceptions.add(i); } public static List getInterceptions() { return interceptions; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/TestCFlowInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000361411041411435033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @InterceptorDef(scope=Scope.PER_VM) @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect.cflowDef") public class TestCFlowInterceptor implements Interceptor { public static boolean invoked; public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { invoked = true; return invocation.invokeNext(); } public static void reset() { invoked = false; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Precedence.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000303511041411435033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.PrecedenceAdvice; import org.jboss.aop.PrecedenceInterceptor; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @org.jboss.aop.Precedence public class Precedence { @PrecedenceAdvice ("advice") Precedence1Aspect advice1; @PrecedenceAdvice ("advice") Precedence3Aspect advice2; @PrecedenceInterceptor Precedence2Interceptor interceptor2; @PrecedenceInterceptor Precedence4Interceptor interceptor4; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/MixinInterface1.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000230311041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface MixinInterface1 { int mixin1(); } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/TestCFlowAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000413611041411435033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.CFlowDef; import org.jboss.aop.CFlowStackDef; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class TestCFlowAspect { @CFlowStackDef(cflows= {@CFlowDef(expr="void org.jboss.test.microcontainer.annotatedaop.test.CFlowTestCase->testCFlowMatch()", called=true), @CFlowDef(expr="void org.jboss.test.microcontainer.annotatedaop.test.CFlowTestCase->makeCall()", called=true)}) public static Object cflowDef; public static boolean invoked; public static void reset() { invoked = false; } @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())", cflow="org.jboss.test.microcontainer.annotatedaop.TestCFlowAspect.cflowDef") public Object advice1(MethodInvocation inv) throws Throwable { invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/MixinInterface2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000230311041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface MixinInterface2 { int mixin2(); } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Precedence3Aspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000311011041411435033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class Precedence3Aspect { @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public Object advice(MethodInvocation inv) throws Throwable { Interceptions.add(3); return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/EmptyInterface2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000226311041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface EmptyInterface2 { } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/NamedPointcutAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000347511041411435033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.PointcutDef; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class NamedPointcutAspect { public static boolean invoked; public static void reset() { invoked = false; } @PointcutDef("execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") Object pointcut; @Bind(pointcut="org.jboss.test.microcontainer.annotatedaop.NamedPointcutAspect.pointcut") public Object advice(MethodInvocation inv) throws Throwable { invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/TypedefAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000347011041411435033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.TypeDef; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_VM) public class TypedefAspect { public static boolean invoked; public static void reset() { invoked = false; } @TypeDef("class(org.jboss.test.microcontainer.annotatedaop.SimplePOJO)") Object typedef; @Bind(pointcut="execution(* $typedef{org.jboss.test.microcontainer.annotatedaop.TypedefAspect.typedef}->method())") public Object advice(MethodInvocation inv) throws Throwable { invoked = true; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/Precedence2Interceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000334311041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @InterceptorDef(scope=Scope.PER_VM) @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public class Precedence2Interceptor implements Interceptor { public String getName() { return this.getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { Interceptions.add(2); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/MixinA.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000264511041411435033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinA implements MixinInterface1, MixinInterface2 { public static SimplePOJO pojo; public MixinA(SimplePOJO pojo) { MixinA.pojo = pojo; } public int mixin1() { return 1; } public int mixin2() { return 2; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/TestAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000413511041411435033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Aspect(scope=Scope.PER_INSTANCE) public class TestAspect { public static TestAspect last; public static int invoked; public static int advice; public static void reset() { last = null; invoked = 0; advice = 0; } @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->method())") public Object advice1(MethodInvocation inv) throws Throwable { last = this; invoked++; advice = 1; return inv.invokeNext(); } @Bind(pointcut="execution(* org.jboss.test.microcontainer.annotatedaop.SimplePOJO->anotherMethod())") public Object advice2(Invocation inv) throws Throwable { last = this; invoked++; advice = 2; return inv.invokeNext(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/annotatedaop/MixinInterface3.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/a0000644000175000017500000000230311041411435033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.annotatedaop; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface MixinInterface3 { int mixin3(); } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000755000175000017500000000000011620312204033224 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/MethodAnnotatedSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000244010420664341033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ @Test public class MethodAnnotatedSimpleBeanImpl extends SimpleBeanImpl { @TestAnnotationDependency(data="Dependency") public void someMethod() { } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Configure.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000231010553201260033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Configure { } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/BeanCallingMethodInCtor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000273510526072201033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanCallingMethodInCtor { public BeanCallingMethodInCtor() { publicMethod(); privateMethod(); } public void publicMethod() { System.out.println("public"); } private void privateMethod() { System.out.println("private"); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/LifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000601410756314477033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleCallback { public static Map>> interceptions = new HashMap>>(); @SuppressWarnings("unchecked") Class[] lifecycleAnnotations = new Class[] {Configure.class, Create.class, Describe.class, Install.class, Instantiate.class, Start.class}; public String getName() { return this.getClass().getName(); } public void install(ControllerContext context) { handle(context); } public void uninstall(ControllerContext context) { handle(context); } @SuppressWarnings("unchecked") private void handle(ControllerContext context) { if (context instanceof KernelControllerContext) { for (int i = 0 ; i < lifecycleAnnotations.length ; i++) { MetaData metaData = context.getScopeInfo().getMetaData(); Object cur = metaData.getAnnotation(lifecycleAnnotations[i]); if (cur != null) { addInterception(context, lifecycleAnnotations[i]); } } } else { throw new RuntimeException(context + " is not a KCC!"); } } private void addInterception(ControllerContext context, Class annotation) { String name = (String)context.getName(); ArrayList> beanInterceptions = interceptions.get(name); if (beanInterceptions == null) { beanInterceptions = new ArrayList>(); interceptions.put(name, beanInterceptions); } beanInterceptions.add(annotation); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000257210524140526033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.microcontainer.aspects.jmx.JMX; /** * SimpleBeanImpl. * * @author Adrian Brock * @version $Revision: 44470 $ */ @JMX(name="test:name=AnnotatedNotBean", exposedInterface=SimpleBeanImplMBean.class) public class SimpleBeanAnnotatedImpl2 extends SimpleBeanImpl { } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/MarkerInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000223510525356105033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 58257 $ */ public interface MarkerInterface { } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/OtherMixinImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000242110431407733033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 44912 $ */ public class OtherMixinImpl implements OtherMixin { public static boolean invoked; public void otherMixinMethod() { invoked = true; } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Create.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230510553201260033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Create { } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Error.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230410631053020033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Error { } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Start.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230410553201260033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Start { } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleBeanAnnotatedImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000252610524140526033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.microcontainer.aspects.jmx.JMX; /** * SimpleBeanImpl. * * @author Adrian Brock * @version $Revision: 58184 $ */ @JMX(exposedInterface=SimpleBeanImplMBean.class) public class SimpleBeanAnnotatedImpl extends SimpleBeanImpl { } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/TestAnnotationDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000260710763225372033253 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import org.jboss.beans.metadata.api.annotations.Dependency; /** * * @author Kabir Khan * @version $Revision: 70355 $ */ @Retention(RetentionPolicy.RUNTIME) @Dependency(name="data") public @interface TestAnnotationDependency { String data(); } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/AspectManagerBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000256510573546750033263 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.AspectManager; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectManagerBean { AspectManager manager = AspectManager.instance(); public AspectManager getManager() { return manager; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/InterceptorWithNestedAnnotationDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000524610631321110033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; import org.jboss.dependency.spi.Controller; /** * A Interceptor with a dependency from an annotation * * @author Adrian Brock * @version $Revision: 63359 $ */ public class InterceptorWithNestedAnnotationDependency extends AbstractInterceptor { public static final String SRC_CLASS = "class"; public static final String SRC_METHOD = "method"; public static SimpleBean intercepted1 = null; public static SimpleBean intercepted2 = null; public static SimpleBean intercepted3 = null; private static Controller controller; public void setController(Controller controller) { InterceptorWithNestedAnnotationDependency.controller = controller; } public Object invoke(Invocation invocation) throws Throwable { log.debug("InterceptorWithNestedAnnotationDependency: " + invocation); Containing annotation = (Containing) invocation.resolveClassAnnotation(Containing.class); if (annotation == null) { annotation = (Containing) invocation.resolveAnnotation(Containing.class); } if (annotation != null) { intercepted1 = (SimpleBean) controller.getInstalledContext(annotation.dependency().data()).getTarget(); TestAnnotationDependency[] dependencies = annotation.contained().dependencies(); intercepted2 = (SimpleBean) controller.getInstalledContext(dependencies[0].data()).getTarget(); intercepted3 = (SimpleBean) controller.getInstalledContext(dependencies[1].data()).getTarget(); } return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SubClass.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000233310631320157033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46050 $ */ public class SubClass extends BaseClass { public void method() { super.method(); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/OverriddenPropertyAnnotatedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000267010452465270033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46046 $ */ @Test public class OverriddenPropertyAnnotatedBean { int a; int b; @Test @TestAnnotationDependency(data="OverriddenByXml") public void setPropertyA(int i) { a = i; } @Test @TestAnnotationDependency(data="OverriddenByXml") public void setPropertyB(int i) { b = i; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SomeMixinImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000241610431407733033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 44912 $ */ public class SomeMixinImpl implements SomeMixin { public static boolean invoked; public void someMixinMethod() { invoked = true; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Containing.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000252510454724546033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * * @author Kabir Khan * @version $Revision: 46191 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface Containing { TestAnnotationDependency dependency(); Contained contained(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Marker.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230510770520043033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Marker { } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000446410763553123033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.util.ArrayList; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleLifecycleCallback { public static ArrayList interceptions = new ArrayList(); private String testProperty; public void install(ControllerContext context) { interceptions.add(new Handled((String)context.getName(), context.getState())); } public void uninstall(ControllerContext context) { interceptions.add(new Handled((String)context.getName(), context.getState())); } public String getTestProperty() { return testProperty; } public void setTestProperty(String testProperty) { this.testProperty = testProperty; } public static void clear() { interceptions.clear(); } public static class Handled { public String contextName; public ControllerState toState; public Handled(String contextName, ControllerState toState) { super(); this.contextName = contextName; this.toState = toState; } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/AnnotatedSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000244610644731670033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 63948 $ */ @Test @TestAnnotationDependency(data="Dependency") public class AnnotatedSimpleBeanImpl extends SimpleBeanImpl { public AnnotatedSimpleBeanImpl() { super(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/AspectManagerHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000270210525356335033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.AspectManager; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectManagerHolder { AspectManager manager; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleInterceptor1.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000270610763553123033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleInterceptor1 extends AbstractInterceptor { public static boolean invoked; public Object invoke(Invocation invocation) throws Throwable { invoked = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Contained.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000247610454724546033263 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * * @author Kabir Khan * @version $Revision: 46191 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface Contained { TestAnnotationDependency[] dependencies(); } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/InstallUninstallLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000352110631053020033226 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.dependency.spi.ControllerContext; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class InstallUninstallLifecycleCallback { boolean installedContext; boolean uninstalledContext; boolean error; public boolean isInstalledContext() { return installedContext; } public boolean isUninstalledContext() { return uninstalledContext; } public void install(ControllerContext context) { installedContext = true; } public void uninstall(ControllerContext context) { uninstalledContext = true; throw new RuntimeException("InstallUninstallLifecycleCallback throwing exception during uninstall phase!"); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/AnnotatedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000236310770520043033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @Test public class AnnotatedBean { @Test public void method() {} } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/ParentLastURLClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000644111173121305033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLClassLoader; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ParentLastURLClassLoader extends URLClassLoader { ClassLoader parent; URLClassLoader delegate; public ParentLastURLClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); delegate = new URLClassLoader(urls); this.parent = parent; } @Override public URL findResource(String name) { URL url = delegate.findResource(name); if (url == null && parent instanceof URLClassLoader) { url = ((URLClassLoader)parent).findResource(name); } return url; } @Override public URL getResource(String name) { URL url = delegate.getResource(name); if (url == null) { url = parent.getResource(name); } return url; } @Override public Class loadClass(String name) throws ClassNotFoundException { Class clazz = findLoadedClass(name); if (clazz != null) { return clazz; } String resourceName = name.replace('.', '/') + ".class"; URL mine = delegate.findResource(resourceName); parent.getResource(resourceName); if (mine == null || mine.equals(parent)) { return delegate.loadClass(name); } else { byte[] bytes = loadBytes(name, resourceName); return defineClass(name, bytes, 0, bytes.length); } } private byte[] loadBytes(String name, String resourceName) { InputStream in = delegate.getResourceAsStream(resourceName); try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] tmp = new byte[1024]; int read = 0; while ( (read = in.read(tmp)) >= 0 ) baos.write(tmp, 0, read); return baos.toByteArray(); } catch (IOException e) { throw new RuntimeException("Unable to load class byte code " + name, e); } finally { try { in.close(); } catch (IOException e) { } } } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/OverriddenAnnotationSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000254110452465270033246 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46046 $ */ @Test @TestAnnotationDependency(data="OverriddenByXml") public class OverriddenAnnotationSimpleBeanImpl implements SimpleBean, SimpleBeanImplMBean { public void someMethod() { } public void someOtherMethod() { } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/NonDefaultMethodsLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000402610630747123033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.dependency.spi.ControllerContext; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NonDefaultMethodsLifecycleCallback { public static boolean inited; public static boolean uninited; public void install(ControllerContext context) { throw new IllegalStateException("install should not have been called"); } public void uninstall(ControllerContext context) { throw new IllegalStateException("uninstall should not have been called"); } public void init(ControllerContext context) { if (inited) { throw new IllegalStateException("Has already been installed"); } inited = true; } public void uninit(ControllerContext context) { if (uninited) { throw new IllegalStateException("Has already been uninstalled"); } uninited = true; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Install.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230610553201260033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Install { } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/InterceptorWithDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000357110454724546033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; /** * A Interceptor with a dependency. * * @author Adrian Brock * @version $Revision: 46191 $ */ public class InterceptorWithDependency extends AbstractInterceptor { public static SimpleBean intercepted = null; private SimpleBean bean; public SimpleBean getSimpleBean() { return bean; } public void setSimpleBean(SimpleBean bean) { log.debug("setBean " + bean); this.bean = bean; } public Object invoke(Invocation invocation) throws Throwable { log.debug("InterceptorWithDependency: " + invocation); System.out.println("-----> bean " + bean); intercepted = bean; System.out.println("-----> intercepted " + intercepted); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/OverriddenPropertyAnnotatedChild.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000232110452525647033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46052 $ */ public class OverriddenPropertyAnnotatedChild extends OverriddenPropertyAnnotatedBean { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/BeanNoDefaultCtorUsingParam.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000261110526210351033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class BeanNoDefaultCtorUsingParam { int length; public BeanNoDefaultCtorUsingParam(String s) { length = s.length(); } public int getLength() { return length; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Instantiate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000231210553201260033227 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Instantiate { } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JmxRegistrantDirect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000250410643605043033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * StandardMBean version of JmxRegistrantImpl. * * @author Brian Stansberry * @version $Revision: 63898 $ */ public class JmxRegistrantDirect extends JmxRegistrantImpl implements JmxRegistrantDirectMBean { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/ErrorLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000374710631053020033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.dependency.spi.ControllerContext; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ErrorLifecycleCallback { boolean installedContext; boolean uninstalledContext; boolean error; public boolean isInstalledContext() { return installedContext; } public boolean isUninstalledContext() { return uninstalledContext; } public void install(ControllerContext context) { installedContext = true; throw new RuntimeException("ErrorLifecycleCallback throwing exception!"); } public void uninstall(ControllerContext context) { uninstalledContext = true; throw new RuntimeException("ErrorLifecycleCallback throwing exception during uninstall phase!"); } public void setErrorOnInstall(boolean error) { this.error = error; } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/CalledInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000320610420664341033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * A CalledInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class CalledInterceptor implements Interceptor { public static boolean intercepted = false; public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { System.out.println("CalledInterceptor: " + invocation); intercepted = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000302710420664341033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * SimpleBeanImpl. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class SimpleBeanImpl implements SimpleBean, SimpleBeanImplMBean { public SimpleBeanImpl() { } public void someMethod() { System.out.println("someMethod"); } public void someOtherMethod() { System.out.println("someOtherMethod"); } public void setProperty(int i) {} public int getProperty() {return 0;} } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Describe.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000230710553201260033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public @interface Describe { } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000755000175000017500000000000011620312204033224 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/JMXKernel.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000456210602523533033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import javax.management.MBeanServer; import javax.management.MBeanServerFactory; import org.jboss.kernel.Kernel; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class JMXKernel { Kernel kernel; JBossServer serverImpl; MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer(); public JMXKernel() throws Exception { try { mbeanServer = AccessController.doPrivileged(new PrivilegedExceptionAction() { public MBeanServer run() throws Exception { return MBeanServerFactory.createMBeanServer(); } }); } catch (PrivilegedActionException e) { throw (Exception)e.getCause(); } } public Kernel getKernel() { return kernel; } public void setKernel(Kernel kernel) { this.kernel = kernel; } public void setServerImpl(JBossServer serverImpl) { this.serverImpl = serverImpl; } public MBeanServer getMbeanServer() { return mbeanServer; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/DeployerAspects.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000750110560707656033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.util.HashSet; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.logging.Logger; import org.jboss.test.microcontainer.support.deployers.IDeployer.IDeployerMethod; /** * IDeployer aspects * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class DeployerAspects { private static Logger log = Logger.getLogger(DeployerAspects.class); private static HashSet called = new HashSet(); private static DeployerAspects instance; public static HashSet getCalled() { return called; } public static synchronized DeployerAspects getInstance() { if( instance == null ) instance = new DeployerAspects(); return instance; } public DeployerAspects() { log.debug("ctor"); instance = this; } public Object invoke(Invocation invocation) throws Throwable { log.debug(invocation); MethodInvocation mi = (MethodInvocation) invocation; String methodName = mi.getMethod().getName(); Object value = null; if( methodName.equals("prepareDeploy") ) value = prepareDeploy(mi); else if( methodName.equals("commitDeploy") ) value = commitDeploy(mi); else if( methodName.equals("prepareUndeploy") ) value = prepareUndeploy(mi); else if( methodName.equals("commitUndeploy") ) value = commitUndeploy(mi); else { log.debug("Method " + methodName + " is not advised"); value = invocation.invokeNext(); } return value; } public Object prepareDeploy(MethodInvocation invocation) throws Throwable { Object target = invocation.getTargetObject(); log.debug("prepareDeploy, target="+target); called.add(IDeployerMethod.prepareDeploy); return invocation.invokeNext(); } public Object commitDeploy(MethodInvocation invocation) throws Throwable { Object target = invocation.getTargetObject(); Object value = invocation.invokeNext(); log.debug("commitDeploy, target="+target); called.add(IDeployerMethod.commitDeploy); return value; } public Object prepareUndeploy(MethodInvocation invocation) throws Throwable { Object target = invocation.getTargetObject(); log.debug("prepareUndeploy, target="+target); called.add(IDeployerMethod.prepareUndeploy); return invocation.invokeNext(); } public Object commitUndeploy(MethodInvocation invocation) throws Throwable { Object target = invocation.getTargetObject(); Object value = invocation.invokeNext(); log.debug("commitUndeploy, target="+target); called.add(IDeployerMethod.commitUndeploy); return value; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/JBossServer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000231610560707656033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class JBossServer { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/AspectManagerBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000001037310602523533033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.InputStream; import javax.management.MBeanServer; import javax.management.ObjectName; import org.jboss.aop.AspectManager; import org.jboss.aop.AspectXmlLoader; import org.w3c.dom.Document; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectManagerBean { AspectMan delegate = new AspectMan(); MBeanServer server; String bootstrapXml; public AspectManagerBean(String bootstrapXml) { this.bootstrapXml = bootstrapXml; try { if (bootstrapXml != null) { InputStream in = new BufferedInputStream(new ByteArrayInputStream(bootstrapXml.getBytes())); try { Document doc = AspectXmlLoader.loadDocument(new BufferedInputStream(in)); AspectXmlLoader loader = new AspectXmlLoader(); loader.setManager(getAspectManager()); loader.deployXML(doc, null); } finally { if (in != null) { in.close(); } } } } catch (Exception e) { // AutoGenerated throw new RuntimeException("Problem starting AspectManager", e); } } public void setMbeanServer(MBeanServer server) { this.server = server; } public MBeanServer getMbeanServer() { return server; } public AspectManager getAspectManager() { return AspectManager.getTopLevelAspectManager(); } public void start() throws Exception { try { server.registerMBean(delegate, new ObjectName("jboss.aop:service=AspectManager")); } catch (Exception e) { throw new RuntimeException("Problem registering jboss.aop:service=AspectManager with JMXServer", e); } } public void destroy() { if (this.server == null) { try { if (bootstrapXml != null) { InputStream in = new BufferedInputStream(new ByteArrayInputStream(bootstrapXml.getBytes())); try { Document doc = AspectXmlLoader.loadDocument(new BufferedInputStream(in)); AspectXmlLoader loader = new AspectXmlLoader(); loader.setManager(getAspectManager()); loader.deployXML(doc, null); } finally { if (in != null) { in.close(); } } } server.unregisterMBean(new ObjectName("jboss.aop:service=AspectManager")); } catch (Exception e) { throw new RuntimeException("Problem unregistering jboss.aop:service=AspectManager with JMXServer", e); } } } public interface AspectManMBean { } public static class AspectMan implements AspectManMBean { } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/SampleDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000416410557223272033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.util.HashSet; import org.jboss.logging.Logger; /** * Sample IDeployer. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class SampleDeployer implements IDeployer { private static Logger log = Logger.getLogger(SampleDeployer.class); private HashSet called = new HashSet(); private String type; public SampleDeployer() { log.debug("ctor"); } public HashSet getCalled() { return called; } public String getType() { return type; } public void setType(String type) { this.type = type; } public void commitDeploy(String unit) throws Exception { called.add(IDeployerMethod.commitDeploy); } public void commitUndeploy(String unit) { called.add(IDeployerMethod.commitUndeploy); } public void prepareDeploy(String unit) throws Exception { called.add(IDeployerMethod.prepareDeploy); } public void prepareUndeploy(String unit) { called.add(IDeployerMethod.prepareUndeploy); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/MainDeployerAspects.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000437010602523533033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.logging.Logger; /** * IMainDeployer aspects. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class MainDeployerAspects { private static Logger log = Logger.getLogger(MainDeployerAspects.class); private static boolean processCalled; public static boolean isProcessCalled() { return processCalled; } public static void setProcessCalled(boolean processCalled) { MainDeployerAspects.processCalled = processCalled; } public Object invoke(Invocation invocation) throws Throwable { log.debug(invocation); MethodInvocation mi = (MethodInvocation) invocation; String methodName = mi.getMethod().getName(); Object value = null; if( methodName.equals("process") ) value = process(mi); else value = invocation.invokeNext(); return value; } public Object process(MethodInvocation invocation) throws Throwable { Object target = invocation.getTargetObject(); log.debug("process, target="+target); processCalled = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/SampleMainDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000512510557223272033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.util.ArrayList; import java.util.List; import org.jboss.logging.Logger; /** * Sample IMainDeployer * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class SampleMainDeployer implements IMainDeployer { private static Logger log = Logger.getLogger(SampleMainDeployer.class); private ArrayList deployers = new ArrayList(); private ArrayList added = new ArrayList(); private ArrayList removed = new ArrayList(); public List getDeployers() { return new ArrayList(deployers); } public void setDeployers(List list) { this.deployers.clear(); this.deployers.addAll(list); log.debug("setDeployers, size="+deployers.size()); } public void addDeployer(IDeployer deployer) { deployers.add(deployer); } public void removeDeployer(IDeployer deployer) { deployers.remove(deployer); } public void addDeployment(String unit) { added.add(unit); } public void removeDeployment(String unit) { added.remove(unit); removed.add(unit); } public void process() throws Exception { for(IDeployer d : deployers) { for(String unit : removed) { d.prepareUndeploy(unit); d.commitUndeploy(unit); } } for(IDeployer d : deployers) { for(String unit : added) { d.prepareDeploy(unit); d.commitDeploy(unit); } } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/IMainDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000274010557223272033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; import java.util.List; /** * Test main deployer interface * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface IMainDeployer { public List getDeployers(); public void addDeployer(IDeployer deployer); public void removeDeployer(IDeployer deployer); public void addDeployment(String unit); public void removeDeployment(String unit); public void process() throws Exception; } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/deployers/IDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000273610557223272033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.deployers; /** * Test deployer interface * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface IDeployer { public enum IDeployerMethod { prepareDeploy, prepareUndeploy, commitDeploy, commitUndeploy } void prepareDeploy(String unit) throws Exception; void prepareUndeploy(String unit); void commitDeploy(String unit) throws Exception; void commitUndeploy(String unit); } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JmxRegistrant.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000241410643605043033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * A MBeanRegistrationListener. * * @author Brian Stansberry * @version $Revision: 63898 $ */ public interface JmxRegistrant { boolean isRegisteredInJmx(); } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JustClassAnnotatedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000235610775411124033247 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * Just class annotation. * * @author Ales Justin */ @Test public class JustClassAnnotatedBean { public void method() {} }././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000755000175000017500000000000011620312204033224 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/SimpleBeanAnnotatedImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000261210525053510033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.jndi; import org.jboss.aop.microcontainer.aspects.jndi.JndiBinding; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ @JndiBinding(name="beans/SimpleBean1", aliases={"beans/AnnotatedSimpleBean1"}) public class SimpleBeanAnnotatedImpl extends SimpleBean { private static final long serialVersionUID = 1; } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/ISimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000044510525053510033236 0ustar twernertwernerpackage org.jboss.test.microcontainer.support.jndi; public interface ISimpleBean { public String getProp1(); public void setProp1(String prop1); public int getProp2(); public void setProp2(int prop2); public float getProp3(); public void setProp3(float prop3); } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/MockInitialContextFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000276410525053510033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.jndi; import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingException; import javax.naming.spi.InitialContextFactory; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class MockInitialContextFactory implements InitialContextFactory { public Context getInitialContext(Hashtable env) throws NamingException { return new MockJndiProvider(env); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/MockJndiProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000001257210644731670033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.jndi; import java.io.IOException; import java.rmi.MarshalledObject; import java.util.Hashtable; import java.util.concurrent.ConcurrentHashMap; import javax.naming.Binding; import javax.naming.Context; import javax.naming.Name; import javax.naming.NameClassPair; import javax.naming.NameParser; import javax.naming.NamingEnumeration; import javax.naming.NamingException; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class MockJndiProvider implements Context { private static ConcurrentHashMap bindings = new ConcurrentHashMap(); private Hashtable env; MockJndiProvider(Hashtable env) { this.env = env; } public Object addToEnvironment(String propName, Object propVal) throws NamingException { return null; } public void bind(Name name, Object obj) throws NamingException { String sname = name.toString(); bind(sname, obj); } public void bind(String name, Object obj) throws NamingException { try { MarshalledObject mo = new MarshalledObject(obj); bindings.put(name, mo); } catch(IOException e) { NamingException ex = new NamingException("Failed to bind name: "+name); ex.setRootCause(e); throw ex; } } public void close() throws NamingException { } public Name composeName(Name name, Name prefix) throws NamingException { return null; } public String composeName(String name, String prefix) throws NamingException { return null; } public Context createSubcontext(Name name) throws NamingException { return null; } public Context createSubcontext(String name) throws NamingException { return null; } public void destroySubcontext(Name name) throws NamingException { } public void destroySubcontext(String name) throws NamingException { } public Hashtable getEnvironment() throws NamingException { return env; } public String getNameInNamespace() throws NamingException { return null; } public NameParser getNameParser(Name name) throws NamingException { return new MockNameParser(); } public NameParser getNameParser(String name) throws NamingException { return new MockNameParser(); } public NamingEnumeration list(Name name) throws NamingException { return null; } public NamingEnumeration list(String name) throws NamingException { return null; } public NamingEnumeration listBindings(Name name) throws NamingException { return null; } public NamingEnumeration listBindings(String name) throws NamingException { return null; } public Object lookup(Name name) throws NamingException { String sname = name.toString(); return lookup(sname); } public Object lookup(String name) throws NamingException { MarshalledObject mo = (MarshalledObject) bindings.get(name); Object value = null; if( mo != null ) { try { value = mo.get(); } catch(Exception e) { NamingException ex = new NamingException(); ex.setRootCause(e); throw ex; } } return value; } public Object lookupLink(Name name) throws NamingException { return null; } public Object lookupLink(String name) throws NamingException { return null; } public void rebind(Name name, Object obj) throws NamingException { } public void rebind(String name, Object obj) throws NamingException { bindings.put(name, obj); } public Object removeFromEnvironment(String propName) throws NamingException { return null; } public void rename(Name oldName, Name newName) throws NamingException { } public void rename(String oldName, String newName) throws NamingException { } public void unbind(Name name) throws NamingException { unbind(name.toString()); } public void unbind(String name) throws NamingException { bindings.remove(name); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000345610525053510033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support.jndi; import java.io.Serializable; /** * Test of the jndi binding aspect * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class SimpleBean implements ISimpleBean, Serializable { public static final long serialVersionUID = 1; private String prop1; private int prop2; private float prop3; public String getProp1() { return prop1; } public void setProp1(String prop1) { this.prop1 = prop1; } public int getProp2() { return prop2; } public void setProp2(int prop2) { this.prop2 = prop2; } public float getProp3() { return prop3; } public void setProp3(float prop3) { this.prop3 = prop3; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/jndi/MockNameParser.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000107610525053510033237 0ustar twernertwernerpackage org.jboss.test.microcontainer.support.jndi; import java.util.Properties; import javax.naming.CompoundName; import javax.naming.Name; import javax.naming.NameParser; import javax.naming.NamingException; public class MockNameParser implements NameParser { private static final Properties syntax = new Properties(); static { syntax.setProperty("jndi.syntax.direction", "flat"); } public Name parse(String name) throws NamingException { CompoundName cn = new CompoundName(name, syntax); return cn; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/OtherMixin.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000226310431364452033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 44908 $ */ public interface OtherMixin { void otherMixinMethod(); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SomeNonIA.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000262610774433312033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) public @interface SomeNonIA { } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/NestedAnnotatedSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000261610454724546033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46191 $ */ @Test @Containing(dependency=@TestAnnotationDependency(data="Dependency1"), contained=@Contained(dependencies= {@TestAnnotationDependency(data="Dependency2"), @TestAnnotationDependency(data="Dependency3")})) public class NestedAnnotatedSimpleBeanImpl extends SimpleBeanImpl { } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/LifecycleCallbackWithBeanDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000433110630747123033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.util.ArrayList; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleCallbackWithBeanDependency { Object dependency; public static ArrayList interceptions = new ArrayList(); public void install(ControllerContext context) { interceptions.add(new Handled((String)context.getName(), context.getState())); } public void uninstall(ControllerContext context) { interceptions.add(new Handled((String)context.getName(), context.getState())); } public static class Handled { public String contextName; public ControllerState toState; public Handled(String contextName, ControllerState toState) { super(); this.contextName = contextName; this.toState = toState; } } public Object getDependency() { return dependency; } public void setDependency(Object dependency) { this.dependency = dependency; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000234110420664341033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * SimpleBean. * * @author Adrian Brock * @version $Revision: 43840 $ */ public interface SimpleBean { void someMethod(); } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/AbstractInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000265710420664341033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.advice.Interceptor; import org.jboss.logging.Logger; /** * AbstractInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public abstract class AbstractInterceptor implements Interceptor { protected Logger log = Logger.getLogger(AbstractInterceptor.class); public String getName() { return getClass().getName(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleBeanImplMBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000231010420664341033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * SimpleMBean. * * @author Adrian Brock * @version $Revision: 43840 $ */ public interface SimpleBeanImplMBean { void someOtherMethod(); } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JmxRegistrantImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000352010643605043033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import javax.management.MBeanRegistration; import javax.management.MBeanServer; import javax.management.ObjectName; /** * A JmxRegistrantImpl. * * @author Brian Stansberry * @version $Revision: 63898 $ */ public class JmxRegistrantImpl implements JmxRegistrant, MBeanRegistration { private boolean registered; public boolean isRegisteredInJmx() { return registered; } public void postDeregister() { registered = false; } public void postRegister(Boolean registrationDone) { registered = true; } public void preDeregister() throws Exception { // no-op } public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { return name; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SimpleInterceptor2.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000270610763553123033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class SimpleInterceptor2 extends AbstractInterceptor { public static boolean invoked; public Object invoke(Invocation invocation) throws Throwable { invoked = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/NestedMethodAnnotatedSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000273010454726744033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 46194 $ */ @Test public class NestedMethodAnnotatedSimpleBeanImpl extends SimpleBeanImpl { @Containing(dependency=@TestAnnotationDependency(data="Dependency1"), contained=@Contained(dependencies= {@TestAnnotationDependency(data="Dependency2"), @TestAnnotationDependency(data="Dependency3")})) public void someMethod() { super.someMethod(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JustMethodAnnotatedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000236310775411124033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * Just method annotation. * * @author Ales Justin */ public class JustMethodAnnotatedBean { @Test public void method() {} }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/InterceptorWithAnnotationDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000450110631321110033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; import org.jboss.dependency.spi.Controller; /** * A Interceptor with a dependency from an annotation * * @author Adrian Brock * @version $Revision: 63359 $ */ public class InterceptorWithAnnotationDependency extends AbstractInterceptor { public static final String SRC_CLASS = "class"; public static final String SRC_METHOD = "method"; public static SimpleBean intercepted = null; private static Controller controller; public void setController(Controller controller) { InterceptorWithAnnotationDependency.controller = controller; } public Object invoke(Invocation invocation) throws Throwable { log.debug("InterceptorWithAnnotationDependency: " + invocation); TestAnnotationDependency annotation = (TestAnnotationDependency) invocation.resolveClassAnnotation(TestAnnotationDependency.class); if (annotation == null) { annotation = (TestAnnotationDependency) invocation.resolveAnnotation(TestAnnotationDependency.class); } String data = annotation.data(); log.debug("Data=" + data); intercepted = (SimpleBean) controller.getInstalledContext(data).getTarget(); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/BaseClass.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000375310631320157033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 62884 $ */ public class BaseClass { public int method( BaseClass bc, java.lang.String s, byte by, char ch, double db, float fl, int i, long l, short sh, boolean b, BaseClass[] bca, java.lang.String[] sa, byte[] bya, char[] cha, double[] dba, float[] fla, int[] ia, long[] la, short[] sha, boolean[] ba, BaseClass[][] bcaa, java.lang.String[][] saa, byte[][] byaa, char[][] chaa, double[][] dbaa, float[][] flaa, int[][] iaa, long[][] laa, short[][] shaa, boolean[][] baa) { return i; } public void method() { } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/TestAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000373110563432035033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TestAspect { public static boolean fooCalled; public static boolean barCalled; boolean shouldInvoke; public Object foo(Invocation inv) throws Throwable { System.out.println("--- foo"); fooCalled = true; if (shouldInvoke) { return inv.invokeNext(); } else { return null; } } public Object bar(Invocation inv) throws Throwable { System.out.println("--- bar"); barCalled = true; if (shouldInvoke) { return inv.invokeNext(); } else { return null; } } public void setShouldInvoke(boolean shouldInvoke) { this.shouldInvoke = shouldInvoke; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/Test.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000241310420664341033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface Test { } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/PropertyBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000305710420664341033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 43840 $ */ public class PropertyBean { int intProperty; String stringProperty; public int getIntProperty() { return intProperty; } public void setIntProperty(int intProperty) { this.intProperty = intProperty; } public String getStringProperty() { return stringProperty; } public void setStringProperty(String stringProperty) { this.stringProperty = stringProperty; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/SomeMixin.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000226110431364452033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * * @author Kabir Khan * @version $Revision: 44908 $ */ public interface SomeMixin { void someMixinMethod(); } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/MetaDataContextInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000432510770540162033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; import java.lang.annotation.Annotation; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author Kabir Khan * @version $Revision: 71097 $ */ public class MetaDataContextInterceptor implements Interceptor { public static Object classAnnotation; public static Object joinpointAnnotation; private Class annotationType; public static void reset() { classAnnotation = null; joinpointAnnotation = null; } @SuppressWarnings("unchecked") public void setAnnotation(String annotationType) { try { this.annotationType = (Class) Thread.currentThread().getContextClassLoader().loadClass(annotationType); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { classAnnotation = invocation.resolveClassAnnotation(annotationType); joinpointAnnotation = invocation.resolveAnnotation(annotationType); return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/support/JmxRegistrantDirectMBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/s0000644000175000017500000000245310643605043033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.support; /** * Interface for StandardMBean version of JmxRegistrantImpl. * * @author Brian Stansberry * @version $Revision: 63898 $ */ public interface JmxRegistrantDirectMBean extends JmxRegistrant { } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/validateschema/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/v0000755000175000017500000000000011620312204033227 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/validateschema/test/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/v0000755000175000017500000000000011620312204033227 5ustar twernertwerner././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/validateschema/test/ValidateAOPSchemaTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/microcontainer/v0000644000175000017500000000552610775141075033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.microcontainer.validateschema.test; import java.io.InputStream; import junit.framework.Test; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ValidateAOPSchemaTestCase extends MicrocontainerTest { public static Test suite() { return suite(ValidateAOPSchemaTestCase.class); } public ValidateAOPSchemaTestCase(String name) { super(name); } public void testSchemaIsValid() throws Exception { InputStream aopbeans = Thread.currentThread().getContextClassLoader().getResourceAsStream("schema/aop-beans_1_0.xsd"); assertNotNull(aopbeans); org.jboss.xb.binding.Util.loadSchema(aopbeans, null, new SchemaBindingResolver() { public String getBaseURI() { return null; } public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation) { return null; } public org.w3c.dom.ls.LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation) { if (schemaLocation.equals("jboss-beans-common_2_0.xsd")) { schemaLocation = "schema/" + schemaLocation; } InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(schemaLocation); assertNotNull(stream); return new org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor(stream, null); } public void setBaseURI(String baseURI) { } }); } } libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/0000755000175000017500000000000011620312176030614 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/0000755000175000017500000000000011620312177031746 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Annota0000644000175000017500000001455211042111650033107 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; import java.net.URL; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.jboss.aop.AspectAnnotationLoader; import org.jboss.aop.AspectManager; import org.jboss.aop.microcontainer.beans.metadata.AspectManagerAwareBeanMetaDataFactory; import org.jboss.aop.microcontainer.beans.metadata.MicrocontainerAnnotationLoaderStrategy; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; import org.jboss.util.file.ArchiveBrowser; import org.jboss.util.file.ClassFileFilter; import org.jboss.util.file.Files; /** * * An AOPMicrocontainerTestDelegate. * * @author Adrian Brock * @version $Revision: 75380 $ */ public class AnnotatedAOPMicrocontainerTestDelegate extends MicrocontainerTestDelegate { private static final String BOOTSTRAP_FILE = "org/jboss/test/microcontainer/annotatedaop/test/BootstrapAspectManagerForAnnotationTests.xml"; private File tempDir; private List deployedBeans; /** * Create a new AOPMicrocontainerTestDelegate. * * @param clazz the class * @throws Exception for any error */ public AnnotatedAOPMicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } public void setUp() throws Exception { super.setUpLogging(); //Create a temporary directory with the classes listed in the file before we turn on security String testName = clazz.getName(); testName = testName.replace('.', '/') + "-classes.txt"; int slash = testName.lastIndexOf('/'); slash = testName.lastIndexOf('/', slash - 1); String annotatedClassesFolder = testName.substring(0, slash + 1); URL url = clazz.getClassLoader().getResource(testName); if (url == null) { log.debug("No test specific file containing classes with annoations " + testName); } else { tempDir = getTemporaryDirectory(); File file = new File(url.toURI()); copyAnnotatedClassesToTempDir(annotatedClassesFolder, file); } super.setUp(); log.debug("Security enabled: " + enableSecurity); } private File getTemporaryDirectory() throws IOException { File dir = File.createTempFile("annotated", "aop"); if (dir.exists() && !dir.delete()) throw new IOException("Could not delete temp file " + dir); if (!dir.mkdir()) throw new IOException("Could not create temporary directory " + dir); dir.deleteOnExit(); return dir; } private void copyAnnotatedClassesToTempDir(String annotatedClassesFolder, File inputFile) throws IOException, URISyntaxException { log.debug("Copying annotated classes from " + annotatedClassesFolder + " to " + tempDir); BufferedReader reader = new BufferedReader(new FileReader(inputFile)); String clazz = reader.readLine(); while (clazz != null) { clazz = clazz.trim(); if (clazz.length() == 0) { continue; } log.debug("Copying " + clazz); String path = annotatedClassesFolder + clazz + ".class"; URL url = getClass().getClassLoader().getResource(path); File src = new File(url.toURI()); File dest = new File(tempDir + "/" + clazz + ".class"); Files.copy(src, dest); clazz = reader.readLine(); } } protected void deploy() throws Exception { URL url = getTestResource(BOOTSTRAP_FILE); deploy(url); if (tempDir != null) deployAOP(); else log.debug("No test specific deployment tempDir"); super.deploy(); } protected void undeploy() { super.undeploy(); if (tempDir != null) undeployAOP(); } /** * Deploy the aop config * * @throws Exception for any error */ @SuppressWarnings("unchecked") protected void deployAOP() throws Exception { log.debug("Deploying annotations from " + tempDir); MicrocontainerAnnotationLoaderStrategy strategy = new MicrocontainerAnnotationLoaderStrategy(); AspectAnnotationLoader loader = new AspectAnnotationLoader(AspectManager.instance(), strategy); URL url = tempDir.toURL(); Iterator it = ArchiveBrowser.getBrowser(url, new ClassFileFilter()); loader.deployInputStreamIterator(it); List factories = strategy.getFactories(); if (factories != null && factories.size() > 0) { deployedBeans = new ArrayList(); for (AspectManagerAwareBeanMetaDataFactory factory : factories) { for (BeanMetaData bean : factory.getBeans()) { deployedBeans.add(deploy(bean)); } } } } /** * Undeploy the aop config */ protected void undeployAOP() { if (deployedBeans != null && deployedBeans.size() > 0) { for (KernelControllerContext bean : deployedBeans) { undeploy(bean); } } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AnnotatedAOPMicrocontainerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Annota0000644000175000017500000000404111041411435033102 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotatedAOPMicrocontainerTest extends MicrocontainerTest { /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { String property = System.getProperty("jboss.mc.secure", "false"); boolean enableSecurity = Boolean.valueOf(property).booleanValue(); AnnotatedAOPMicrocontainerTestDelegate delegate = new AnnotatedAOPMicrocontainerTestDelegate(clazz); delegate.enableSecurity = enableSecurity; return delegate; } /** * Create a new AnnotatedAOPMicrocontainer test * * @param name the test name */ public AnnotatedAOPMicrocontainerTest(String name) { super(name); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestIn0000644000175000017500000000301210420664341033073 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * TestInterceptor. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class TestInterceptor implements Interceptor { public static boolean intercepted = false; public String getName() { return getClass().getName(); } public Object invoke(Invocation invocation) throws Throwable { intercepted = true; return invocation.invokeNext(); } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestIntercepted.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestIn0000644000175000017500000000230310420664341033075 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; /** * TestIntercepted. * * @author Adrian Brock * @version $Revision: 43840 $ */ public class TestIntercepted { public void doSomething() { } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestSchemaResolver.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/TestSc0000644000175000017500000000533511173121305033076 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.util.HashMap; import org.jboss.logging.Logger; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.w3c.dom.ls.LSInput; /** * TestSchemaResolver. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestSchemaResolver implements SchemaBindingResolver { private static final Logger log = Logger.getLogger(TestSchemaResolver.class); private HashMap bindings = new HashMap(); public String getBaseURI() { return null; } public void addSchemaBinding(SchemaBinding schemaBinding) { schemaBinding.setSchemaResolver(this); String nsURI = schemaBinding.getNamespaces().iterator().next(); bindings.put(nsURI, schemaBinding); if (log.isTraceEnabled()) { String schema = SchemaPrinter.printSchema(schemaBinding); log.trace("Bound: " + nsURI + "\n" + schema); } } public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation) { SchemaBinding result = bindings.get(nsUri); if (result == null) throw new RuntimeException("Schema not bound: " + nsUri + " available: " + bindings.keySet()); return result; } public LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation) { throw new UnsupportedOperationException(); } public void setBaseURI(String baseURI) { throw new org.jboss.util.NotImplementedException("setBaseURI"); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AbstractTypeTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Abstra0000644000175000017500000001025410774433312033113 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * AbstractTypeTest. * * @author Ales Justin */ public abstract class AbstractTypeTest extends AbstractTestCaseWithSetup { public AbstractTypeTest(String name) { super(name); } /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { String property = System.getProperty("jboss.mc.secure", "false"); boolean enableSecurity = Boolean.valueOf(property); AbstractTypeTestDelegate delegate = new AbstractTypeTestDelegate(clazz); delegate.enableSecurity = enableSecurity; return delegate; } protected KernelController getController() { AbstractTypeTestDelegate delegate = (AbstractTypeTestDelegate)getDelegate(); return delegate.getKernel().getController(); } protected ControllerContext getControllerContext(String name) throws Throwable { return getControllerContext(name, null); } protected ControllerContext getControllerContext(String name, ControllerState state) throws Throwable { return getController().getContext(name, state); } protected ControllerContext assertControllerContext(String name, ControllerState state) throws Throwable { ControllerContext context = getControllerContext(name, state); assertNotNull(context); return context; } protected T getBean(String name, Class expectedType) throws Throwable { ControllerContext context = assertControllerContext(name, null); Object target = context.getTarget(); assertNotNull(target); return assertInstanceOf(target, expectedType); } protected AbstractTypeTestDelegate.Type getType(Object name) { AbstractTypeTestDelegate delegate = (AbstractTypeTestDelegate)getDelegate(); AbstractTypeTestDelegate.Type type = delegate.getTypes().get(name); if (type == null) throw new IllegalArgumentException("No such context installed by name: " + name); return type; } protected void assertIsProxy(Object name) { assertEquals(name + " is not proxy.", AbstractTypeTestDelegate.Type.PROXY, getType(name)); } protected void assertIsPojo(Object name) { assertEquals(name + " is not pojo.", AbstractTypeTestDelegate.Type.POJO, getType(name)); } protected void assertIsWoven(Object name) { assertEquals(name + " is not woven.", AbstractTypeTestDelegate.Type.WOVEN, getType(name)); } protected void assertIsAspectized(Object name) { AbstractTypeTestDelegate.Type type = getType(name); assertTrue(name + " is not aspectized.", AbstractTypeTestDelegate.Type.WOVEN == type || AbstractTypeTestDelegate.Type.PROXY == type); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AOPMicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AOPMic0000644000175000017500000000711511033371247032746 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.net.URL; import java.util.Iterator; import java.util.concurrent.CopyOnWriteArrayList; import org.jboss.aop.AspectXmlLoader; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; /** * * An AOPMicrocontainerTestDelegate. * * @author Adrian Brock * @version $Revision: 75380 $ */ public class AOPMicrocontainerTestDelegate extends MicrocontainerTestDelegate { /** The deployed urls */ private static final CopyOnWriteArrayList urls = new CopyOnWriteArrayList(); /** * Create a new AOPMicrocontainerTestDelegate. * * @param clazz the class * @throws Exception for any error */ public AOPMicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } public void setUp() throws Exception { super.setUp(); log.debug("Security enabled: " + enableSecurity); } protected void deploy() throws Exception { String testName = clazz.getName(); testName = testName.replace('.', '/') + "-aop.xml"; URL url = clazz.getClassLoader().getResource(testName); if (url != null) deployAOP(url); else log.debug("No test specific deployment " + testName); super.deploy(); } protected void undeploy() { super.undeploy(); for (Iterator i = urls.iterator(); i.hasNext();) { URL url = i.next(); undeployAOP(url); } } /** * Deploy the aop config * * @param url the url * @throws Exception for any error */ protected void deployAOP(URL url) throws Exception { log.debug("Deploying " + url); urls.add(url); AspectXmlLoader.deployXML(url); } /** * Undeploy the aop config * * @param url the url */ protected void undeployAOP(URL url) { try { log.debug("Undeploying " + url); urls.remove(url); AspectXmlLoader.undeployXML(url); } catch (Exception e) { log.warn("Ignored error undeploying " + url, e); } } // @Override // protected BasicXMLDeployer createDeployer() // { // if (useJaxbDeployer) // { // return new JBossXBDeployer(kernel, defaultMode, clazz); // } // return super.createDeployer(); // } // // protected KernelDeployment unmarshal(final URL url) throws Exception // { // if (!useJaxbDeployer) // { // throw new IllegalStateException("useJaxbDeployer needs to be true"); // } // return ((JBossXBDeployer)deployer).unmarshal(url); // } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AOPMicrocontainerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AOPMic0000644000175000017500000000377111033372111032741 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * An AOPMicrocontainerTest. * * @author Adrian Brock * @version $Revision: 75383 $ */ public class AOPMicrocontainerTest extends MicrocontainerTest { /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { String property = System.getProperty("jboss.mc.secure", "false"); boolean enableSecurity = Boolean.valueOf(property).booleanValue(); AOPMicrocontainerTestDelegate delegate = new AOPMicrocontainerTestDelegate(clazz); delegate.enableSecurity = enableSecurity; return delegate; } /** * Create a new AOPMicrocontainer test * * @param name the test name */ public AOPMicrocontainerTest(String name) { super(name); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AbstractProxyTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Abstra0000644000175000017500000000752710760776332033133 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.net.URL; import org.jboss.aop.AspectXmlLoader; import org.jboss.test.AbstractTestDelegate; /** * AbstractProxyTestDelegate. * * @author Adrian Brock * @version $Revision: 44908 $ */ public class AbstractProxyTestDelegate extends AbstractTestDelegate { /** * Create a new AbstractProxyTestDelegate. * * @param clazz the test class * @throws Exception for any error */ public AbstractProxyTestDelegate(Class clazz) throws Exception { super(clazz); } public void setUp() throws Exception { super.setUp(); log.debug("Security enabled: " + enableSecurity); try { deploy(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new RuntimeException(e); } } public void tearDown() throws Exception { super.tearDown(); undeploy(); } /** * Deploy the aop config * * @throws Exception for any error */ protected void deploy() throws Exception { String testName = clazz.getName(); testName = testName.replace('.', '/') + ".xml"; URL url = clazz.getClassLoader().getResource(testName); if (url != null) deploy(url); else throw new RuntimeException("No test specific deployment " + testName); } /** * Undeploy the aop config */ protected void undeploy() { String testName = clazz.getName(); testName = testName.replace('.', '/') + ".xml"; URL url = clazz.getClassLoader().getResource(testName); if (url != null) undeploy(url); else log.debug("No test specific deployment " + testName); } /** * Get the test url * * @return the test url */ protected URL getTestURL() { String testName = clazz.getName(); testName = testName.replace('.', '/') + ".xml"; return clazz.getClassLoader().getResource(testName); } /** * Deploy the aop config * * @param url the url * @throws Exception for any error */ protected void deploy(URL url) throws Exception { log.debug("Deploying " + url); AspectXmlLoader.deployXML(url); } /** * Undeploy the aop config * * @param url the url */ protected void undeploy(URL url) { try { log.debug("Undeploying " + url); AspectXmlLoader.undeployXML(url); } catch (Exception e) { log.warn("Ignored error undeploying " + url, e); } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AbstractProxyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Abstra0000644000175000017500000003202010760776332033115 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.util.HashSet; import java.util.Set; import org.jboss.aop.metadata.SimpleMetaData; import org.jboss.aop.proxy.container.AOPProxyFactory; import org.jboss.aop.proxy.container.AOPProxyFactoryMixin; import org.jboss.aop.proxy.container.AOPProxyFactoryParameters; import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * AbstractProxyTest. * * @author Adrian Brock * @version $Revision: 45764 $ */ public abstract class AbstractProxyTest extends AbstractTestCaseWithSetup { /** The proxy factory */ protected AOPProxyFactory proxyFactory; /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { String property = System.getProperty("jboss.mc.secure", "false"); boolean enableSecurity = Boolean.valueOf(property).booleanValue(); AbstractProxyTestDelegate delegate = new AbstractProxyTestDelegate(clazz); delegate.enableSecurity = enableSecurity; return delegate; } /** * Create a new AbstractProxyTest. * * @param name the test name */ public AbstractProxyTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); configureLogging(); proxyFactory = new GeneratedAOPProxyFactory(); } /** * Create a proxy * * @param target the target * @return the proxy * @throws Exception for any error */ protected Object createProxy(Object target) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setTarget(target); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param target the target * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateProxy(Object target, Class expected) throws Exception { Object proxy = createProxy(target); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @return the proxy * @throws Exception for any error */ protected Object createProxy(Object target, Class[] interfaces) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setInterfaces(interfaces); params.setTarget(target); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param target the target * @param mixins the mixins * @return the proxy * @throws Exception for any error */ protected Object createProxy(Object target, AOPProxyFactoryMixin[] mixins) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setMixins(mixins); params.setTarget(target); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @param mixins the mixins * @return the proxy * @throws Exception for any error */ protected Object createProxy(Object target, Class[] interfaces, AOPProxyFactoryMixin[] mixins) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setInterfaces(interfaces); params.setMixins(mixins); params.setTarget(target); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param target the target * @param mixins the mixins * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateProxy(Object target, AOPProxyFactoryMixin[] mixins, Class expected) throws Exception { Object proxy = createProxy(target, mixins); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @param mixins the mixins * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateProxy(Object target, Class[] interfaces, AOPProxyFactoryMixin[] mixins, Class[] expected) throws Exception { Object proxy = createProxy(target, interfaces, mixins); assertNotNull(proxy); for (int i = 0 ; i < expected.length ; i++) { assertTrue("Proxy " + proxy + " should implement " + expected[i].getName() + " interfaces=" + getInterfaces(proxy), expected[i].isInstance(proxy)); } return proxy; } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateProxy(Object target, Class[] interfaces, Class expected) throws Exception { Object proxy = createProxy(target, interfaces); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @param metaData the metadata * @return the proxy * @throws Exception for any error */ protected Object createProxy(Object target, Class[] interfaces, SimpleMetaData metaData) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setProxiedClass(target.getClass()); params.setInterfaces(interfaces); params.setSimpleMetaData(metaData); params.setTarget(target); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param target the target * @param interfaces the interfaces * @param metaData the metadata * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateProxy(Object target, Class[] interfaces, SimpleMetaData metaData, Class expected) throws Exception { Object proxy = createProxy(target, interfaces, metaData); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param interfaces the interfaces * @param metaData the metadata * @return the proxy * @throws Exception for any error */ protected Object createHollowProxy(Class[] interfaces, SimpleMetaData metaData) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setInterfaces(interfaces); params.setSimpleMetaData(metaData); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param mixins the mixins * @param metaData the metadata * @return the proxy * @throws Exception for any error */ protected Object createHollowProxy(AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setMixins(mixins); params.setSimpleMetaData(metaData); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param interfaces the interfaces * @param mixins the mixins * @param metaData the metadata * @return the proxy * @throws Exception for any error */ protected Object createHollowProxy(Class[] interfaces, AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData) throws Exception { AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setInterfaces(interfaces); params.setMixins(mixins); params.setSimpleMetaData(metaData); return proxyFactory.createAdvisedProxy(params); } /** * Create a proxy * * @param interfaces the interfaces * @param metaData the metadata * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateHollowProxy(Class[] interfaces, SimpleMetaData metaData, Class expected) throws Exception { Object proxy = createHollowProxy(interfaces, metaData); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param mixins the mixins * @param metaData the metadata * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateHollowProxy(AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData, Class expected) throws Exception { Object proxy = createHollowProxy(mixins, metaData); assertNotNull(proxy); assertTrue("Proxy " + proxy + " should implement " + expected.getName() + " interfaces=" + getInterfaces(proxy), expected.isInstance(proxy)); return proxy; } /** * Create a proxy * * @param interfaces the interfaces * @param mixins the mixins * @param metaData the meta data * @param expected the expected class * @return the proxy * @throws Exception for any error */ protected Object assertCreateHollowProxy(Class[] interfaces, AOPProxyFactoryMixin[] mixins, SimpleMetaData metaData, Class[] expected) throws Exception { Object proxy = createHollowProxy(interfaces, mixins, metaData); assertNotNull(proxy); for (int i = 0 ; i < expected.length ; i++) { assertTrue("Proxy " + proxy + " should implement " + expected[i].getName() + " interfaces=" + getInterfaces(proxy), expected[i].isInstance(proxy)); } return proxy; } /** * Get the interfaces for an object * * @param object the object * @return the set of interfaces */ protected Set> getInterfaces(Object object) { Set> interfaces = new HashSet>(); addInterfaces(interfaces, object.getClass()); return interfaces; } /** * Add interfaces * * @param interfaces the interfaces to add to * @param clazz the class */ protected void addInterfaces(Set> interfaces, Class clazz) { Class[] intfs = clazz.getInterfaces(); for (int i = 0; i < intfs.length; ++i) interfaces.add(intfs[i]); Class superClass = clazz.getSuperclass(); if (superClass != null) addInterfaces(interfaces, superClass); } /** * Get the delegate * * @return the delegate */ protected AbstractProxyTestDelegate getMCDelegate() { return (AbstractProxyTestDelegate) getDelegate(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/ScopingAOPMicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Scopin0000644000175000017500000000433411033514576033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.GraphController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * * A ScopingAOPMicrocontainerTestDelegate. * * @author Ales Justin */ public class ScopingAOPMicrocontainerTestDelegate extends AOPMicrocontainerTestDelegate { public ScopingAOPMicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } protected KernelControllerContext getControllerContext(final Object name, final ControllerState state) { try { Controller controller = kernel.getController(); GraphController gc = (GraphController)controller; KernelControllerContext context = (KernelControllerContext)gc.getContext(name, state, Search.DEPTH); if (context == null) throw new IllegalStateException("Bean not found " + name + " at state " + state); return context; } catch (Throwable t) { throw new Error(t); } } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/MicrocontainerJunitSmokeTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Microc0000644000175000017500000000331210760776332033117 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import junit.framework.Test; /** * MicrocontainerJunitSmokeTestCase. * * @author Adrian Brock * @version $Revision: 70090 $ */ public class MicrocontainerJunitSmokeTestCase extends AOPMicrocontainerTest { public void testIntercepted() throws Exception { TestIntercepted intercepted = (TestIntercepted) getBean("TestIntercepted"); assertFalse(TestInterceptor.intercepted); intercepted.doSomething(); assertTrue(TestInterceptor.intercepted); } public static Test suite() { return suite(MicrocontainerJunitSmokeTestCase.class); } public MicrocontainerJunitSmokeTestCase(String test) { super(test); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/AbstractTypeTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Abstra0000644000175000017500000001124110770317100033100 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.util.Map; import java.util.HashMap; import org.jboss.kernel.plugins.bootstrap.AbstractBootstrap; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.plugins.dependency.AbstractKernelController; import org.jboss.kernel.plugins.dependency.InstantiateAction; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.Kernel; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.aop.proxy.container.AspectManaged; import org.jboss.aop.Advised; /** * AbstractTypeTestDelegate. * * @author Ales Justin */ public class AbstractTypeTestDelegate extends MicrocontainerTestDelegate { /** Is proxy, woven or pojo map -> */ private Map types = new HashMap(); public AbstractTypeTestDelegate(Class clazz) throws Exception { super(clazz); } protected AbstractBootstrap getBootstrap() throws Exception { return new BasicBootstrap(createKernelConfig()); } Map getTypes() { return types; } Kernel getKernel() { return kernel; } protected KernelConfig createKernelConfig() { return new TestKernelConfig(); } private class TestKernelConfig extends PropertyKernelConfig { public TestKernelConfig() { super(null); } public KernelController createKernelController() throws Throwable { return new TestController(); } } private class TestController extends AbstractKernelController { private TestInstantiateAction instantiate = new TestInstantiateAction(); public TestController() throws Exception { } protected void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { if (ControllerState.INSTANTIATED.equals(toState)) instantiate.install(context); else super.install(context, fromState, toState); } protected void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { if (ControllerState.INSTANTIATED.equals(fromState)) instantiate.uninstall(context); else super.uninstall(context, fromState, toState); } } private class TestInstantiateAction extends InstantiateAction { protected void installActionInternal(KernelControllerContext context) throws Throwable { super.installActionInternal(context); checkTargetType(context.getName(), context.getTarget()); } protected void uninstallActionInternal(KernelControllerContext context) { types.remove(context.getName()); super.uninstallActionInternal(context); } } protected void checkTargetType(Object name, Object target) throws Throwable { Type type; if (target instanceof AspectManaged) { type = Type.PROXY; } else if (target instanceof Advised) { type = Type.WOVEN; } else { type = Type.POJO; } types.put(name, type); } public enum Type { PROXY, WOVEN, POJO } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/SchemaPrinter.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/test/java/org/jboss/test/aop/junit/Schema0000644000175000017500000002400511301242575033072 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.aop.junit; import java.util.Collection; import java.util.Iterator; import javax.xml.XMLConstants; import org.jboss.xb.binding.sunday.unmarshalling.AllBinding; import org.jboss.xb.binding.sunday.unmarshalling.AttributeBinding; import org.jboss.xb.binding.sunday.unmarshalling.ChoiceBinding; import org.jboss.xb.binding.sunday.unmarshalling.ElementBinding; import org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding; import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding; import org.jboss.xb.binding.sunday.unmarshalling.TermBinding; import org.jboss.xb.binding.sunday.unmarshalling.TypeBinding; import org.jboss.xb.binding.sunday.unmarshalling.WildcardBinding; /** * SchemaPrinter. * * TODO finish this off properly * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class SchemaPrinter { public static String printSchema(SchemaBinding schemaBinding) { String nsURI = schemaBinding.getNamespaces().iterator().next(); StringBuilder builder = new StringBuilder(); builder.append("\n"); int pad=3; Iterator elements = schemaBinding.getElementParticles(); while (elements != null && elements.hasNext()) printElement(builder, pad, elements.next()); Iterator types = schemaBinding.getTypes(); while (types != null && types.hasNext()) printType(builder, pad, types.next()); builder.append(""); return builder.toString(); } public static void printElement(StringBuilder builder, int pad, ParticleBinding particle) { ElementBinding element = (ElementBinding) particle.getTerm(); pad(builder, pad); builder.append(""); if (type != null && type.getQName() == null) printAnonymousType(builder, pad + 3, type); pad(builder, pad); builder.append(""); } public static void printAnonymousType(StringBuilder builder, int pad, TypeBinding type) { pad(builder, pad); builder.append(""); TypeBinding baseTypeBinding = type.getBaseType(); String qName; if (baseTypeBinding != null) qName = baseTypeBinding.getQName().toString(); else qName = "xsd:anyType"; pad(builder, pad); builder.append(" "); printTypeInfo(builder, pad+6, type); pad(builder, pad); builder.append(" "); pad(builder, pad); builder.append(""); } public static void printType(StringBuilder builder, int pad, TypeBinding type) { if (type.isSimple()) printSimpleType(builder, pad, type); else printComplexType(builder, pad, type); } public static void printSimpleType(StringBuilder builder, int pad, TypeBinding type) { pad(builder, pad); builder.append(""); printTypeInfo(builder, pad+3, type); pad(builder, pad); builder.append(""); } public static void printComplexType(StringBuilder builder, int pad, TypeBinding type) { pad(builder, pad); builder.append(""); printTypeInfo(builder, pad+3, type); pad(builder, pad); builder.append(""); } public static void printTypeInfo(StringBuilder builder, int pad, TypeBinding type) { ParticleBinding particle = type.getParticle(); if (particle != null) { printParticle(builder, pad, particle); } Collection attributes = type.getAttributes(); if (attributes != null) { for (AttributeBinding attribute : attributes) { printAttribute(builder, pad, attribute); } } } public static void printParticle(StringBuilder builder, int pad, ParticleBinding particle) { TermBinding term = particle.getTerm(); if (term instanceof ElementBinding) printElement(builder, pad, particle); else if (term instanceof WildcardBinding) printWildcard(builder, pad, particle); else if (term instanceof SequenceBinding) printModel(builder, pad, particle, "sequence"); else if (term instanceof AllBinding) printModel(builder, pad, particle, "all"); else if (term instanceof ChoiceBinding) printModel(builder, pad, particle, "choice"); } public static void printModel(StringBuilder builder, int pad, ParticleBinding particle, String prefix) { pad(builder, pad); builder.append("<").append(prefix); int minOccurs = particle.getMinOccurs(); if (minOccurs != 1) builder.append(" minOccurs=\"").append(minOccurs).append("\""); int maxOccurs = particle.getMaxOccurs(); if (maxOccurs != 1) { builder.append(" maxOccurs=\""); if (maxOccurs == -1) builder.append("unbounded"); else builder.append(maxOccurs); builder.append("\""); } builder.append(">"); ModelGroupBinding model = (ModelGroupBinding) particle.getTerm(); Collection particles = model.getParticles(); boolean newLine = true; if (particles != null) { for (ParticleBinding component : particles) printParticle(builder, pad+3, component); } else { newLine = false; } pad(builder, pad, newLine); builder.append(""); } public static void printWildcard(StringBuilder builder, int pad, ParticleBinding particle) { pad(builder, pad); builder.append(""); } public static void printAttribute(StringBuilder builder, int pad, AttributeBinding attribute) { pad(builder, pad); TypeBinding typeBinding = attribute.getType(); String qName = null; if (typeBinding != null && typeBinding.getQName() != null) qName = typeBinding.getQName().toString(); else qName = "CDATA"; builder.append(""); } public static void pad(StringBuilder builder, int pad) { pad(builder, pad, true); } public static void pad(StringBuilder builder, int pad, boolean newLine) { if (newLine) builder.append("\n"); for (int i = 0; i < pad; ++ i) builder.append(' '); } } libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/etc/0000755000175000017500000000000011620312211024010 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/etc/default.mf0000644000175000017500000000073410420664341025777 0ustar twernertwernerManifest-Version: 1.0 Created-By: @java.vm.version@ (@java.vm.vendor@) Specification-Title: @specification.title@ Specification-Version: @specification.version@ Specification-Vendor: @specification.vendor@ Implementation-Title: @implementation.title@ Implementation-URL: @implementation.url@ Implementation-Version: @implementation.version@ Implementation-Vendor: @implementation.vendor@ Implementation-Vendor-Id: @implementation.vendor.id@ Main-Class: org.jboss.embedded.Mainlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/etc/conf/0000755000175000017500000000000011620312211024735 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/etc/conf/log4j.properties0000644000175000017500000000140510420664341030105 0ustar twernertwerner### ====================================================================== ### ## ## ## JBoss Bootstrap Log4j Configuration ## ## ## ### ====================================================================== ### ### $Id: log4j.properties 43840 2006-04-17 10:07:29Z adrian $ ### log4j.rootCategory=DEBUG, CONSOLE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Threshold=INFO log4j.appender.CONSOLE.Target=System.out log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/assembly/0000755000175000017500000000000011620312176025066 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/assembly/aspects.xml0000644000175000017500000000061210600031655027246 0ustar twernertwerner aspects jar false target/classes org/jboss/aop/microcontainer/aspects/** libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/assembly/impl.xml0000644000175000017500000000062610770514552026564 0ustar twernertwerner impl jar false target/classes org/jboss/aop/microcontainer/aspects/** libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/0000755000175000017500000000000011620312211024161 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/resources/0000755000175000017500000000000011620312211026173 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/resources/findbugs/0000755000175000017500000000000011620312211027774 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/resources/findbugs/exclude.xml0000644000175000017500000001134511262401357032167 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/resources/schema/0000755000175000017500000000000011620312211027433 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/resources/schema/aop-beans_1_0.xsd0000644000175000017500000012161111015565263032500 0ustar twernertwerner An extension value An extension value An extension value Similar to the beans beanfactoryType, but with an optional class. The elements from abstractBeanfactoryType have been duplicated, rather than using a xsd:extension since we need to use mixed=true libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/0000755000175000017500000000000011620312207025107 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/0000755000175000017500000000000011620312207025676 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/0000755000175000017500000000000011620312207027016 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/0000755000175000017500000000000011620312207027575 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/0000755000175000017500000000000011620312211032604 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000755000175000017500000000000011620312211033113 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/LifecycleRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000327111005412047033125 0ustar twernertwerner/* * 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.microcontainer.beans; /** * This does not interact with the AspectManager. It is picked up by the deployers in AS * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleRepository { private String name; private String repositoryName; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getRepositoryName() { return repositoryName; } public void setRepositoryName(String repositoryName) { this.repositoryName = repositoryName; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/InterceptorEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000723511262401357033140 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.advice.AdviceFactory; import org.jboss.aop.advice.AdviceType; import org.jboss.aop.advice.InterceptorFactory; import org.jboss.aop.advice.ScopedInterceptorFactory; /** * An interceptor-ref or advice entry. Installs an InterceptorFactory into its binding and into aop * * @author Kabir Khan * @version $Revision: 1.1 $ */ public final class InterceptorEntry extends BindingEntry implements Cloneable { Aspect aspect; String aspectMethod; InterceptorFactory interceptorFactory; boolean forStack; AdviceType type = AdviceType.AROUND; public AdviceType getType() { return type; } public void setType(AdviceType type) { this.type = type; } public Aspect getAspect(Aspect aspect) { return aspect; } public void setAspect(Aspect aspect) { this.aspect = aspect; } public void setForStack(boolean forStack) { this.forStack = forStack; } public String getAspectMethod() { return aspectMethod; } public void setAspectMethod(String aspectMethod) { this.aspectMethod = aspectMethod; } public InterceptorFactory[] getInterceptorFactories() { return new InterceptorFactory[] {interceptorFactory}; } public InterceptorFactory getInterceptorFactory() { return interceptorFactory; } public void start() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (binding == null && !forStack) { throw new IllegalArgumentException("Null aspect binding"); } if (aspect == null) { throw new IllegalArgumentException("Null aspect"); } interceptorFactory = (aspectMethod == null) ? new ScopedInterceptorFactory(aspect.getDefinition()) : new AdviceFactory(aspect.getDefinition(), aspectMethod); manager.addInterceptorFactory(name, interceptorFactory); if (binding != null) { aspect.addBinding(binding); } } public void stop() { manager.removeInterceptorFactory(name); if (binding != null) { aspect.removeBinding(binding); } interceptorFactory = null; } public Object clone() { InterceptorEntry entry = new InterceptorEntry(); entry.manager = manager; entry.binding = binding; entry.aspect = aspect; entry.aspectMethod = aspectMethod; return entry; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Prepare.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000520711021255066033132 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.Pointcut; import org.jboss.aop.pointcut.PointcutExpression; import org.jboss.aop.pointcut.ast.ParseException; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class Prepare { protected AspectManager manager; protected String name; protected String expr; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getExpr() { return expr; } public void setExpr(String pointcut) { this.expr = pointcut; } public void start() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (expr == null || expr.length() == 0) { throw new IllegalArgumentException("No pointcut"); } if (name == null) { name = GUID.asString(); } Pointcut p = null; try { p = new PointcutExpression(name, expr); } catch (ParseException ex) { throw new RuntimeException(" failed", ex); } manager.addPointcut(p); } public void stop() { manager.removePointcut(name); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BindingEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000404410722621434033133 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.InterceptorFactory; import org.jboss.util.id.GUID; /** * Abstract base class for things that can go inside bindings (stack refs, advice and interceptor-ref) * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class BindingEntry { String name = new GUID().toString(); AspectManager manager; Binding binding; public abstract InterceptorFactory[] getInterceptorFactories(); public abstract void start(); public abstract void stop(); public Binding getBinding() { return binding; } public void setBinding(Binding binding) { this.binding = binding; } public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AbstractAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000533010721416203033125 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.introduction.AnnotationIntroduction; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AbstractAnnotation { protected AspectManager manager; private String expr; private String annotation; private boolean invisible = false; protected AnnotationIntroduction intro; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } public String getAnnotation() { return annotation; } public void setAnnotation(String annotation) { this.annotation = annotation; } public boolean isInvisible() { return invisible; } public void setInvisible(boolean invisible) { this.invisible = invisible; } public abstract void start(); protected AnnotationIntroduction validateAndCreate() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (expr == null) { throw new IllegalArgumentException("Null expr"); } if (annotation == null) { throw new IllegalArgumentException("Null annotation"); } intro = AnnotationIntroduction.createComplexAnnotationIntroduction(expr, annotation, invisible); return intro; } public abstract void stop(); } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AnnotationIntroduction.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000270210721416203033125 0ustar twernertwerner/* * 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.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationIntroduction extends AbstractAnnotation { public void start() { validateAndCreate(); manager.addAnnotationIntroduction(intro); } @Override public void stop() { manager.removeAnnotationIntroduction(intro); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000676211114756640033150 0ustar twernertwerner/* * 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.microcontainer.beans; import java.security.AccessController; import java.security.PrivilegedAction; /** * CL security actions. * * @author Kabir Khan * @version $Revision: 1.1 $ */ class SecurityActions { private interface GetContextClassLoaderAction { ClassLoader getContextClassLoader(); GetContextClassLoaderAction PRIVILEGED = new GetContextClassLoaderAction() { public ClassLoader getContextClassLoader() { return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); } }; GetContextClassLoaderAction NOT_PRIVILEGED = new GetContextClassLoaderAction() { public ClassLoader getContextClassLoader() { return Thread.currentThread().getContextClassLoader(); } }; } public static ClassLoader getContextClassLoader() { if (System.getSecurityManager() == null) { return GetContextClassLoaderAction.NOT_PRIVILEGED.getContextClassLoader(); } else { return GetContextClassLoaderAction.PRIVILEGED.getContextClassLoader(); } } private interface GetClassLoaderAction { ClassLoader getClassLoader(Class clazz); GetClassLoaderAction PRIVILEGED = new GetClassLoaderAction(){ public ClassLoader getClassLoader(final Class clazz) { return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { return clazz.getClassLoader(); } }); } }; GetClassLoaderAction NOT_PRIVILEGED = new GetClassLoaderAction(){ public ClassLoader getClassLoader(Class clazz) { return clazz.getClassLoader(); } }; } public static ClassLoader getClassLoader(Class clazz) { if (System.getSecurityManager() == null) { return GetClassLoaderAction.NOT_PRIVILEGED.getClassLoader(clazz); } else { return GetClassLoaderAction.PRIVILEGED.getClassLoader(clazz); } } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000755000175000017500000000000011620312210033112 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/FinallyAdviceData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000276311262401357033141 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.advice.AdviceType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="finallyAdviceType", propOrder={}) public class FinallyAdviceData extends AdviceData { private static final long serialVersionUID = 1L; public FinallyAdviceData() { setType(AdviceType.FINALLY); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AspectManagerAwareBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000740211301242575033133 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AspectManagerAwareBeanMetaDataFactory extends GenericBeanFactoryMetaData { /** The serialVersionUID */ private static final long serialVersionUID = -8946356687511317226L; /** Unless specified use the bean with this name as the aspect manager */ protected final static String DEFAULT_ASPECT_MANAGER = "AspectManager"; /** The bean name of the aspect manager to use */ protected String managerBean; /** Whether the managerBean was set using the setManagerBean accessor */ protected boolean managerBeanSet; /** The property of the aspect manager bean, if any, containing the aspect manager */ protected String managerProperty; /** Whether the managerProperty was set using the setManagerBean accessor */ protected boolean managerPropertySet; @XmlAttribute(name="manager-bean") public void setManagerBean(String managerBean) { this.managerBean = managerBean; managerBeanSet = true; } public String getManagerBean() { return managerBean; } @XmlAttribute(name="manager-property") public void setManagerProperty(String aspectManagerProperty) { this.managerProperty = aspectManagerProperty; managerPropertySet = true; } public String getManagerProperty() { return managerProperty; } protected void setAspectManagerProperty(BeanMetaDataBuilder builder) { setAspectManagerProperty(builder, "manager"); } protected void setAspectManagerProperty(BeanMetaDataBuilder builder, String propertyName) { String bean = managerBeanSet ? managerBean : DefaultAspectManager.getManagerBeanName(); String property = managerPropertySet ? managerProperty : DefaultAspectManager.getManagerPropertyName(); setAspectManagerProperty(builder, propertyName, bean, property); } protected void setAspectManagerProperty(BeanMetaDataBuilder builder, String managerBean, String managerProperty) { setAspectManagerProperty(builder, "manager", managerBean, managerProperty); } protected void setAspectManagerProperty(BeanMetaDataBuilder builder, String propertyName, String managerBean, String managerProperty) { ValueMetaData value = builder.createInject(managerBean, managerProperty); builder.addPropertyMetaData(propertyName, value); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/BindBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001405711205241312033126 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.AspectBinding; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerState; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="bind") @XmlType(name="bindType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "interceptors", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class BindBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String pointcut; private String cflow; private List interceptors = new ArrayList(); public BindBeanMetaDataFactory() { } @XmlAttribute public void setPointcut(String pointcut) { this.pointcut = pointcut; } @XmlAttribute public void setCflow(String cflow) { this.cflow = cflow; } @Override public List getBeans() { ArrayList result = new ArrayList(); //Create AspectBinding if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder bindingBuilder = AOPBeanMetaDataBuilder.createBuilder(name, AspectBinding.class.getName()); bindingBuilder.addPropertyMetaData("name", name); if (cflow != null) { bindingBuilder.addPropertyMetaData("cflow", cflow); } bindingBuilder.addPropertyMetaData("pointcut", pointcut); setAspectManagerProperty(bindingBuilder); result.add(bindingBuilder.getBeanMetaData()); if (interceptors.size() > 0) { List bindingInterceptors = bindingBuilder.createList(); int i = 0; for (BaseInterceptorData interceptor : interceptors) { String intName = name + "$" + i++; BeanMetaDataBuilder interceptorBuilder = AOPBeanMetaDataBuilder.createBuilder(intName, interceptor.getBeanClassName()); setAspectManagerProperty(interceptorBuilder); ValueMetaData injectBinding = interceptorBuilder.createInject(name, null, null, ControllerState.INSTANTIATED); interceptorBuilder.addPropertyMetaData("binding", injectBinding); if (interceptor instanceof AdviceOrInterceptorData) { ValueMetaData injectAspect = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("aspect", injectAspect); if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null) { interceptorBuilder.addPropertyMetaData("aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod()); } interceptorBuilder.addPropertyMetaData("type", ((AdviceOrInterceptorData)interceptor).getType()); } else { ValueMetaData injectStack = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("stack", injectStack); } result.add(interceptorBuilder.getBeanMetaData()); ValueMetaData injectInterceptor = bindingBuilder.createInject(intName); bindingInterceptors.add(injectInterceptor); } bindingBuilder.addPropertyMetaData("advices", bindingInterceptors); } return result; } @XmlElements ({ @XmlElement(name="advice", type=AdviceData.class), @XmlElement(name="around", type=AdviceData.class), @XmlElement(name="before", type=BeforeAdviceData.class), @XmlElement(name="after", type=AfterAdviceData.class), @XmlElement(name="throwing", type=ThrowingAdviceData.class), @XmlElement(name="finally", type=FinallyAdviceData.class), @XmlElement(name="interceptor-ref", type=InterceptorRefData.class), @XmlElement(name="stack-ref", type=StackRefData.class) }) public List getInterceptors() { return interceptors; } public void setInterceptors(List interceptors) { this.interceptors = interceptors; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/StackBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001254011205241312033121 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.Stack; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="stack") @XmlType(name="stackType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "interceptors", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class StackBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private List interceptors = new ArrayList(); public StackBeanMetaDataFactory() { } @Override public List getBeans() { ArrayList result = new ArrayList(); //Create Stack BeanMetaDataBuilder stackBuilder = AOPBeanMetaDataBuilder.createBuilder(name, Stack.class.getName()); stackBuilder.addPropertyMetaData("name", name); setAspectManagerProperty(stackBuilder); result.add(stackBuilder.getBeanMetaData()); if (interceptors.size() > 0) { List advices = stackBuilder.createList(); int i = 0; for (BaseInterceptorData interceptor : interceptors) { String intName = name + "$" + i++; BeanMetaDataBuilder interceptorBuilder = AOPBeanMetaDataBuilder.createBuilder(intName, interceptor.getBeanClassName()); setAspectManagerProperty(interceptorBuilder); interceptorBuilder.addPropertyMetaData("forStack", Boolean.TRUE); if (interceptor instanceof AdviceOrInterceptorData) { ValueMetaData injectAspect = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("aspect", injectAspect); if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null) { interceptorBuilder.addPropertyMetaData("aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod()); } interceptorBuilder.addPropertyMetaData("type", ((AdviceOrInterceptorData)interceptor).getType()); } else { ValueMetaData injectStack = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("stack", injectStack); } result.add(interceptorBuilder.getBeanMetaData()); ValueMetaData injectAdvice = stackBuilder.createInject(intName); advices.add(injectAdvice); } stackBuilder.addPropertyMetaData("advices", advices); } return result; } public void addInterceptor(BaseInterceptorData interceptorData) { interceptors.add(interceptorData); } @XmlElements ({ @XmlElement(name="advice", type=AdviceData.class), @XmlElement(name="around", type=AdviceData.class), @XmlElement(name="before", type=BeforeAdviceData.class), @XmlElement(name="after", type=AfterAdviceData.class), @XmlElement(name="throwing", type=ThrowingAdviceData.class), @XmlElement(name="finally", type=FinallyAdviceData.class), @XmlElement(name="interceptor-ref", type=InterceptorRefData.class), @XmlElement(name="stack-ref", type=StackRefData.class) }) public List getInterceptors() { return interceptors; } public void setInterceptors(List interceptors) { this.interceptors = interceptors; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/XmlLoadableRootElementUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000514011016766757033150 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.io.BufferedWriter; import java.io.StringWriter; import java.util.List; import java.util.Map; import org.jboss.util.xml.DOMWriter; import org.w3c.dom.DOMException; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class XmlLoadableRootElementUtil { public static String getRootElementString(List elements, String elementName, Map elementAttributes) { try { StringWriter writer = new StringWriter(); StringBuffer contents = writer.getBuffer(); contents.append("<" + elementName + " "); if (elementAttributes != null && elementAttributes.size() > 0) { for (Map.Entry entry : elementAttributes.entrySet()) { contents.append(entry.getKey() + "=\"" + entry.getValue() + "\" "); } } contents.append(">"); DOMWriter domWriter = new DOMWriter(new BufferedWriter(writer)); if (elements != null && elements.size() > 0) { for (Element child : elements) { domWriter.print(child); } } contents.append(""); String fullDocument = writer.getBuffer().toString(); return fullDocument; } catch (DOMException e) { e.printStackTrace(); throw e; } } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/MixinData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000443511262401357033137 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.io.Serializable; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(propOrder= {}) public class MixinData implements Serializable { private static final long serialVersionUID = 1L; String mixin; boolean isTransient = true; String construction; String interfaces; public boolean getTransient() { return isTransient; } @XmlAttribute public void setTransient(boolean isTransient) { this.isTransient = isTransient; } public String getMixin() { return mixin; } @XmlElement(name="class") public void setMixin(String mixin) { this.mixin = mixin; } public String getConstruction() { return construction; } public void setConstruction(String construction) { this.construction = construction; } public String getInterfaces() { return interfaces; } public void setInterfaces(String interfaces) { this.interfaces = interfaces; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/StackRefData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000303011262401357033125 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.StackEntry; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="stackRefType", propOrder={}) public class StackRefData extends BaseInterceptorData { private static final long serialVersionUID = 1L; @Override public String getBeanClassName() { return StackEntry.class.getName(); } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/TypeDefBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000557011205241312033126 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.TypeDef; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="typedef") @XmlType(name="typedefType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class TypeDefBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String expr; public TypeDefBeanMetaDataFactory() { } public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } @Override public List getBeans() { ArrayList beans = new ArrayList(); BeanMetaDataBuilder typedefBuilder = AOPBeanMetaDataBuilder.createBuilder(getName(), TypeDef.class.getName()); typedefBuilder.addPropertyMetaData("name", getName()); typedefBuilder.addPropertyMetaData("expr", expr); setAspectManagerProperty(typedefBuilder); beans.add(typedefBuilder.getBeanMetaData()); return beans; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/MetaDataLoaderBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000710011220434423033121 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.ClassMetaDataLoader; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="metadata") @XmlType(name="metadataLoaderType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class MetaDataLoaderBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String tag; private List elements; public String getTag() { return tag; } @XmlAttribute public void setTag(String tag) { this.tag = tag; } public List getElements() { return elements; } @XmlAnyElement(lax=true) public void setElements(List elements) { this.elements = elements; } @Override public List getBeans() { List beans = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, ClassMetaDataLoader.class.getName()); builder.addPropertyMetaData("tag", tag); builder.addPropertyMetaData("className", bean); HashMap attributes = new HashMap(); attributes.put("tag", tag); attributes.put("name", name); if (elements != null && elements.size() > 0) { builder.addPropertyMetaData("element", XmlLoadableRootElementUtil.getRootElementString(elements, "metadata-loader", attributes)); } setAspectManagerProperty(builder); beans.add(builder.getBeanMetaData()); return beans; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/CreateLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000401711202040346033122 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-create") @XmlType(name="createLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class CreateLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.CREATE; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/package-info.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000347011147522315033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ @JBossXmlAdaptedTypes ({ @JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class), @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class), @JBossXmlAdaptedType(type=SearchInfo.class, valueAdapter=SearchInfoValueAdapter.class) }) package org.jboss.aop.microcontainer.beans.metadata; import org.jboss.beans.metadata.plugins.CardinalityValueAdapter; import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter; import org.jboss.beans.metadata.plugins.SearchInfoValueAdapter; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.xb.annotations.JBossXmlAdaptedType; import org.jboss.xb.annotations.JBossXmlAdaptedTypes; ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/BaseInterceptorData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000326511262401357033137 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.io.Serializable; import javax.xml.bind.annotation.XmlAttribute; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class BaseInterceptorData implements Serializable { private static final long serialVersionUID = 1L; String refName; public BaseInterceptorData() { super(); } public String getRefName() { return refName; } @XmlAttribute(name="name") public void setRefName(String name) { this.refName = name; } public abstract String getBeanClassName(); }././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DescribeLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000403011202040346033115 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-describe") @XmlType(name="describeLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class DescribeLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.DESCRIBED; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/ThrowingAdviceData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000276711262401357033145 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.advice.AdviceType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="throwingAdviceType", propOrder={}) public class ThrowingAdviceData extends AdviceData { private static final long serialVersionUID = 1L; public ThrowingAdviceData() { setType(AdviceType.THROWING); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/InstantiateLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000404411202040346033122 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-instantiate") @XmlType(name="instantiateLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class InstantiateLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.INSTANTIATED; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/CFlowCalled.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000252311262401357033133 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowCalled extends CFlowEntry { private static final long serialVersionUID = 1L; public boolean getCalled() { return true; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/PrepareMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000377411202040346033133 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.Prepare; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="prepare") @XmlType(name="prepareType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class PrepareMetaDataFactory extends AbstractPointcutBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected String getBeanClass() { return Prepare.class.getName(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AdviceOrInterceptorData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000400111262401357033124 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import org.jboss.aop.advice.AdviceType; import org.jboss.aop.microcontainer.beans.InterceptorEntry; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AdviceOrInterceptorData extends BaseInterceptorData { private static final long serialVersionUID = 1L; AdviceType type = AdviceType.AROUND; @XmlAttribute(name = "aspect") public void setRefName(String name) { super.setRefName(name); } public AdviceType getType() { return type; } @XmlTransient public void setType(AdviceType type) { this.type = type; } @Override public String getBeanClassName() { return InterceptorEntry.class.getName(); } public String getAdviceMethod() { return null; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/LifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001041711262401357033134 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.aop.microcontainer.beans.LifecycleBinding; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerState; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class LifecycleBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String classes; private String expr; private String installMethod; private String uninstallMethod; @XmlAttribute public void setClasses(String classes) { this.classes = classes; } @XmlAttribute public void setExpr(String classes) { this.expr = classes; } @XmlAttribute(name="install") public void setInstallMethod(String installMethod) { this.installMethod = installMethod; } @XmlAttribute(name="uninstall") public void setUninstallMethod(String uninstallMethod) { this.uninstallMethod = uninstallMethod; } protected abstract ControllerState getState(); public List getBeans() { ArrayList result = new ArrayList(); //Do not include the bean factory here, just install the bean directly and the binding BeanMetaDataBuilder lifecycleBuilder = AOPBeanMetaDataBuilder.createBuilder(name, getBean()); if (properties != null && properties.size() > 0) { for (PropertyMetaData pmd : properties) { lifecycleBuilder.addPropertyMetaData(pmd.getName(), pmd.getValue()); } } Set depends = getDepends(); if (depends != null && depends.size() > 0) { for (DependencyMetaData depend : depends) { lifecycleBuilder.addDependency(depend.getDependency()); } } result.add(lifecycleBuilder.getBeanMetaData()); String aspectBindingName = name + "$AspectBinding"; BeanMetaDataBuilder bindingBuilder = AOPBeanMetaDataBuilder.createBuilder(aspectBindingName, LifecycleBinding.class.getName()); bindingBuilder.addPropertyMetaData("callbackBean", name); setAspectManagerProperty(bindingBuilder); if (expr != null) { bindingBuilder.addPropertyMetaData("expr", expr); } else if (classes != null) { bindingBuilder.addPropertyMetaData("classes", classes); } bindingBuilder.addPropertyMetaData("state", getState()); if (installMethod != null) { bindingBuilder.addPropertyMetaData("installMethod", installMethod); } if (uninstallMethod != null) { bindingBuilder.addPropertyMetaData("uninstallMethod", uninstallMethod); } result.add(bindingBuilder.getBeanMetaData()); return result; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/LoaderRepositoryBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000560411205241312033124 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.aop.microcontainer.beans.LifecycleRepository; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="precedence") @XmlType(name="loaderRepositoryType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class LoaderRepositoryBeanMetaDataFactory extends GenericBeanFactoryMetaData { private static final long serialVersionUID = 1L; String contents; @XmlValue public void setContents(String contents) { this.contents = contents; } @Override public List getBeans() { if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, LifecycleRepository.class.getName()); builder.addPropertyMetaData("repositoryName", contents); builder.addPropertyMetaData("name", name); List beans = new ArrayList(); beans.add(builder.getBeanMetaData()); return beans; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/NamedPointcutBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000403111202040346033116 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.NamedPointcut; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="pointcut") @XmlType(name="namedPointcutType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class NamedPointcutBeanMetaDataFactory extends AbstractPointcutBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected String getBeanClass() { return NamedPointcut.class.getName(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/InterceptorRefData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000315011262401357033130 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="interceptorRefType", propOrder={}) public class InterceptorRefData extends AdviceOrInterceptorData { private static final long serialVersionUID = 1L; public InterceptorRefData() { super(); } @XmlAttribute(name="name") public void setRefName(String name) { super.refName = name; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/StartLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000401311202040346033116 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-start") @XmlType(name="startLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class StartLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.START; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DefaultAspectManager.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000332511015047476033140 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; /** * Bean to allow overriding of the aspect manager name and property in different environments * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DefaultAspectManager { private static String managerBean = "AspectManager"; private static String managerProperty; public void setManagerBean(String name) { managerBean = name; } public void setManagerProperty(String name) { managerProperty = name; } public static String getManagerBeanName() { return managerBean; } public static String getManagerPropertyName() { return managerProperty; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DeclareErrorBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000370211202040346033122 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="declare-error") @XmlType(name="declareErrorType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "message", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class DeclareErrorBeanMetaDataFactory extends AbstractDeclareBeanMetaDataFactory { private static final long serialVersionUID = 1L; protected boolean isWarning() { return false; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AOPBeanMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000651211205241312033123 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import org.jboss.aop.microcontainer.annotations.DisableAOP; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; /** * Wrapper factory class to obtain a {@link BeanMetaDataBuilder} which adds the @{@link DisableAOP} annotation * to the underlying bean being built * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AOPBeanMetaDataBuilder { /** * Create builder from bean name and add the @{@link DisableAOP} annotation * to the underlying bean being built. * * @param bean bean class name * @return new Builder */ public static BeanMetaDataBuilder createBuilder(String bean) { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(bean); addDisableAopAnnotation(builder); return builder; } /** * Create builder from name and bean and add the @{@link DisableAOP} annotation * to the underlying bean being built. * @param name bean name * @param bean bean class name * @return new Builder */ public static BeanMetaDataBuilder createBuilder(String name, String bean) { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(name, bean); addDisableAopAnnotation(builder); return builder; } /** * Create builder from BeanMetaData and add the @{@link DisableAOP} annotation * to the underlying bean being built. * * @param beanMetaData the bean metadata * @return new Builder() */ public static BeanMetaDataBuilder createBuilder(BeanMetaData beanMetaData) { if (beanMetaData instanceof AbstractBeanMetaData) { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder((AbstractBeanMetaData)beanMetaData); addDisableAopAnnotation(builder); return builder; } else { throw new IllegalArgumentException("Invalid type of bean metadata: " + beanMetaData); } } private static void addDisableAopAnnotation(BeanMetaDataBuilder builder) { builder.addAnnotation("@" + DisableAOP.class.getName()); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AOPDeployment.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001142011010325776033130 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.managed.api.annotation.ManagementObject; import org.jboss.managed.api.annotation.ManagementProperties; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @ManagementObject(properties = ManagementProperties.EXPLICIT) // TODO - explicitly add props we want to manage @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="aop") @XmlType(propOrder={"annotations", "classLoader", "beanFactories", "create", "start", "stop", "destroy", "aliases"}) public class AOPDeployment extends AbstractKernelDeployment { private static final long serialVersionUID = 1L; @XmlElements ({ @XmlElement(name="annotation", type=AnnotationOverrideBeanMetaDataFactory.class), @XmlElement(name="annotation-introduction", type=AnnotationIntroductionBeanMetaDataFactory.class), @XmlElement(name="arrayreplacement", type=ArrayReplacementBeanMetaDataFactory.class), @XmlElement(name="arraybind", type=ArrayBindBeanMetaDataFactory.class), @XmlElement(name="aspect", type=AspectBeanMetaDataFactory.class), @XmlElement(name="bind", type=BindBeanMetaDataFactory.class), @XmlElement(name="cflow-stack", type=CFlowStackBeanMetaDataFactory.class), @XmlElement(name="declare-error", type=DeclareErrorBeanMetaDataFactory.class), @XmlElement(name="declare-warning", type=DeclareWarningBeanMetaDataFactory.class), @XmlElement(name="dynamic-cflow", type=DynamicCflowBeanMetaDataFactory.class), @XmlElement(name="domain", type=DomainBeanMetaDataFactory.class), @XmlElement(name="interceptor", type=InterceptorBeanMetaDataFactory.class), @XmlElement(name="introduction", type=IntroductionBeanMetaDataFactory.class), @XmlElement(name="lifecycle-configure", type=ConfigureLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-create", type=CreateLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-describe", type=DescribeLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-install", type=InstallLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-instantiate", type=InstantiateLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-preinstall", type=PreInstallLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-start", type=StartLifecycleBeanMetaDataFactory.class), @XmlElement(name="loader-repository", type=LoaderRepositoryBeanMetaDataFactory.class), @XmlElement(name="metadata", type=MetaDataBeanMetaDataFactory.class), @XmlElement(name="metadata-loader", type=MetaDataLoaderBeanMetaDataFactory.class), @XmlElement(name="pointcut", type=NamedPointcutBeanMetaDataFactory.class), @XmlElement(name="precedence", type=PrecedenceBeanMetaDataFactory.class), @XmlElement(name="prepare", type=PrepareMetaDataFactory.class), @XmlElement(name="stack", type=StackBeanMetaDataFactory.class), @XmlElement(name="typedef", type=TypeDefBeanMetaDataFactory.class) }) @XmlAnyElement public void setBeanFactories(List beanFactories) { super.setBeanFactories(beanFactories); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DomainBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001767611205241312033140 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.AOPDomain; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="domain") //Use the same propOrder as the GenericBeanMetaDataFactory, but remove the annotations part since we don't want that to be handled by the super class @XmlType(name="domainType", propOrder={"aliases", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class DomainBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; //Same defaults as org.jboss.aop.Domain Boolean parentFirst; Boolean inheritDefinitions = true; Boolean inheritBindings; String extendz; List childBeans; public DomainBeanMetaDataFactory() { } @XmlAttribute(name="parentFirst") public void setParentFirst(boolean parentFirst) { this.parentFirst = parentFirst; } public boolean getParentFirst() { return parentFirst; } @XmlAttribute(name="inheritDefinitions") public void setInheritDefinitions(boolean inheritDefinitions) { this.inheritDefinitions = inheritDefinitions; } public boolean getInheritDefinitions() { return inheritDefinitions; } @XmlAttribute(name="inheritBindings") public void setInheritBindings(boolean inheritBindings) { this.inheritBindings = inheritBindings; } public boolean getInheritBindings() { return inheritBindings; } @XmlAttribute public void setExtends(String extendz) { this.extendz = extendz; } public String getExtends() { return extendz; } @XmlElements ({ @XmlElement(name="annotation", type=AnnotationOverrideBeanMetaDataFactory.class), @XmlElement(name="annotation-introduction", type=AnnotationIntroductionBeanMetaDataFactory.class), @XmlElement(name="arrayreplacement", type=ArrayReplacementBeanMetaDataFactory.class), @XmlElement(name="arraybind", type=ArrayBindBeanMetaDataFactory.class), @XmlElement(name="aspect", type=AspectBeanMetaDataFactory.class), @XmlElement(name="bind", type=BindBeanMetaDataFactory.class), @XmlElement(name="cflow-stack", type=CFlowStackBeanMetaDataFactory.class), @XmlElement(name="declare-error", type=DeclareErrorBeanMetaDataFactory.class), @XmlElement(name="declare-warning", type=DeclareWarningBeanMetaDataFactory.class), @XmlElement(name="dynamic-cflow", type=DynamicCflowBeanMetaDataFactory.class), @XmlElement(name="interceptor", type=InterceptorBeanMetaDataFactory.class), @XmlElement(name="introduction", type=IntroductionBeanMetaDataFactory.class), @XmlElement(name="lifecycle-configure", type=ConfigureLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-create", type=CreateLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-describe", type=DescribeLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-install", type=InstallLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-instantiate", type=InstantiateLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-preinstall", type=PreInstallLifecycleBeanMetaDataFactory.class), @XmlElement(name="lifecycle-start", type=StartLifecycleBeanMetaDataFactory.class), @XmlElement(name="metadata", type=MetaDataBeanMetaDataFactory.class), @XmlElement(name="metadata-loader", type=MetaDataLoaderBeanMetaDataFactory.class), @XmlElement(name="pointcut", type=NamedPointcutBeanMetaDataFactory.class), @XmlElement(name="precedence", type=PrecedenceBeanMetaDataFactory.class), @XmlElement(name="prepare", type=PrepareMetaDataFactory.class), @XmlElement(name="stack", type=StackBeanMetaDataFactory.class), @XmlElement(name="typedef", type=TypeDefBeanMetaDataFactory.class) }) @XmlAnyElement public void setChildren(List childBeans) { this.childBeans = childBeans; } public List getChildren() { return childBeans; } @Override public List getBeans() { ArrayList result = new ArrayList(); BeanMetaDataBuilder domainBuilder = AOPBeanMetaDataBuilder.createBuilder(getName(), AOPDomain.class.getName()); domainBuilder.addPropertyMetaData("name", getName()); if (parentFirst != null) { domainBuilder.addPropertyMetaData("parentFirst", parentFirst); } if (inheritDefinitions != null) { domainBuilder.addPropertyMetaData("inheritDefinitions", inheritDefinitions); } if (inheritBindings != null) { domainBuilder.addPropertyMetaData("inheritBindings", inheritBindings); } if (extendz != null) { ValueMetaData value = domainBuilder.createInject(extendz); domainBuilder.addPropertyMetaData("parent", value); } setAspectManagerProperty(domainBuilder); result.add(domainBuilder.getBeanMetaData()); if (childBeans != null && childBeans.size() > 0) { for (BeanMetaDataFactory child : childBeans) { if (child instanceof AspectManagerAwareBeanMetaDataFactory) { //Set this domain as the manager of the child beans AspectManagerAwareBeanMetaDataFactory amChild = (AspectManagerAwareBeanMetaDataFactory)child; amChild.setManagerBean(name); amChild.setManagerProperty("domain"); amChild.setAspectManagerProperty(AOPBeanMetaDataBuilder.createBuilder(bean)); } List childResult = child.getBeans(); if (childResult != null && childBeans.size() > 0) { result.addAll(childResult); } } } return result; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/InstallLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000402511202040346033121 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-install") @XmlType(name="installLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class InstallLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.INSTALLED; } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/InterceptorBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000367611202040346033134 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="interceptor") @XmlType(name="interceptorType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class InterceptorBeanMetaDataFactory extends AspectBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected String getTagName() { return "interceptor"; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/IntroductionBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001360611262401357033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.IntroductionBinding; import org.jboss.aop.microcontainer.beans.MixinEntry; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * AspectBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 61194 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="introduction") //@XmlType(name="introductionType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) @XmlType(name="introductionType", propOrder={}) public class IntroductionBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String expr; private String interfaces; private List mixins = new ArrayList(); public IntroductionBeanMetaDataFactory() { } public String getExpr() { return expr; } @XmlAttribute(name="expr") public void setExpr(String expr) { this.expr = expr; } public String getInterfaces() { return interfaces; } public void setInterfaces(String interfaces) { this.interfaces = interfaces; } public List getMixins() { return mixins; } @XmlElement(name="mixin") public void setMixins(List mixins) { this.mixins = mixins; } @Override @XmlTransient public List getBeans() { ArrayList result = new ArrayList(); //Add the Introduction if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder introductionBuilder = AOPBeanMetaDataBuilder.createBuilder(name, IntroductionBinding.class.getName()); introductionBuilder.addPropertyMetaData("name", name); setAspectManagerProperty(introductionBuilder); if (bean != null) { introductionBuilder.addPropertyMetaData("classes", bean); } if (expr != null) { introductionBuilder.addPropertyMetaData("expr", expr); } result.add(introductionBuilder.getBeanMetaData()); if (interfaces != null) { addInterfaces(introductionBuilder, interfaces); } if (mixins != null) { addMixins(introductionBuilder, result); } return result; } private void addInterfaces(BeanMetaDataBuilder introductionBuilder, String interfaces) { addInterfaces(introductionBuilder, "interfaces", interfaces); } private void addInterfaces(BeanMetaDataBuilder introductionBuilder, String propertyName, String interfaces) { List ifs = introductionBuilder.createList(ArrayList.class.getName(), String.class.getName()); introductionBuilder.addPropertyMetaData(propertyName, ifs); for (String token : interfaces.split(",")) { ifs.add(introductionBuilder.createValue(token.trim())); } } private void addMixins(BeanMetaDataBuilder introductionBuilder, List result) { List mixinList = introductionBuilder.createList(ArrayList.class.getName(), null); introductionBuilder.addPropertyMetaData("mixins", mixinList); int i = 0; for (MixinData mixin : mixins) { String name = introductionBuilder.getBeanMetaData().getName() + "$" + i++; BeanMetaDataBuilder mixinBuilder = AOPBeanMetaDataBuilder.createBuilder(name, MixinEntry.class.getName()); mixinBuilder.addPropertyMetaData("mixin", mixin.getMixin()); addInterfaces(mixinBuilder, "interfaces", mixin.getInterfaces()); mixinBuilder.addPropertyMetaData("transient", mixin.getTransient()); if (mixin.getConstruction() != null) { mixinBuilder.addPropertyMetaData("construction", mixin.getConstruction()); } result.add(mixinBuilder.getBeanMetaData()); ValueMetaData injectMixin = introductionBuilder.createInject(name); mixinList.add(injectMixin); } } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/ConfigureLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000372410774766014033152 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-configure") @XmlType(propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls"}) public class ConfigureLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.CONFIGURED; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AnnotationIntroductionBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000412211202040346033117 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.AnnotationIntroduction; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="annotation-introduction") @XmlType(name="annotationIntroductionType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class AnnotationIntroductionBeanMetaDataFactory extends AbstractAnnotationBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected String getBeanClassName() { return AnnotationIntroduction.class.getName(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/CFlowEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000333411262401357033134 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.io.Serializable; import javax.xml.bind.annotation.XmlAttribute; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowEntry implements Serializable { private static final long serialVersionUID = 1L; private String expr; private boolean called; public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } public boolean getCalled() { return called; } public void setCalled(boolean called) { this.called = called; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/PreInstallLifecycleBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000402311202040346033117 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlSchema; /** * PreInstall lifecycle callback. * * @author Ales Justin */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lifecycle-preinstall") @XmlType(name="preinstallLifeycleType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class PreInstallLifecycleBeanMetaDataFactory extends LifecycleBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected ControllerState getState() { return ControllerState.PRE_INSTALL; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/CFlowStackBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001013111262401357033125 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.CFlowStack; import org.jboss.aop.microcontainer.beans.CFlowStackEntry; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * AspectBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 61194 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="cflow") @XmlType(name="cflowStackType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "calledEntries", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class CFlowStackBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private List calledEntries = new ArrayList(); public CFlowStackBeanMetaDataFactory() { } @Override public List getBeans() { ArrayList result = new ArrayList(); //Add the Aspect BeanMetaDataBuilder cflowStackBuilder = AOPBeanMetaDataBuilder.createBuilder(getName(), CFlowStack.class.getName()); cflowStackBuilder.addPropertyMetaData("name", getName()); setAspectManagerProperty(cflowStackBuilder); result.add(cflowStackBuilder.getBeanMetaData()); List entryList = cflowStackBuilder.createList(null, ArrayList.class.getName()); cflowStackBuilder.addPropertyMetaData("entries", entryList); int i = 0; if (calledEntries != null) { for (CFlowEntry entry : calledEntries) { String entryName = getName() + "$" + i++; BeanMetaDataBuilder entryBuilder = AOPBeanMetaDataBuilder.createBuilder(entryName, CFlowStackEntry.class.getName()); entryBuilder.addPropertyMetaData("called", entry.getCalled()); entryBuilder.addPropertyMetaData("expr", entry.getExpr()); ValueMetaData injectEntry = entryBuilder.createInject(entryName); entryList.add(injectEntry); result.add(entryBuilder.getBeanMetaData()); } } return result; } public List getCalledEntries() { return calledEntries; } @XmlElements({ @XmlElement(name="called", type=CFlowCalled.class), @XmlElement(name="not-called", type=CFlowNotCalled.class) }) public void setCalledEntries(List calledEntries) { this.calledEntries = calledEntries; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AbstractAnnotationBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000560311205241312033123 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AbstractAnnotationBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; String expr; boolean invisible; String annotation; public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } public boolean isInvisible() { return invisible; } @XmlAttribute public void setInvisible(boolean invisible) { this.invisible = invisible; } public String getAnnotation() { return annotation; } @XmlValue public void setAnnotation(String annotation) { this.annotation = annotation; } @Override public List getBeans() { ArrayList result = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, getBeanClassName()); builder.addPropertyMetaData("invisible", invisible); builder.addPropertyMetaData("expr", expr); builder.addPropertyMetaData("annotation", annotation); setAspectManagerProperty(builder); result.add(builder.getBeanMetaData()); return result; } protected abstract String getBeanClassName(); } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/MicrocontainerAnnotationLoaderStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000002541311262401357033136 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.jboss.aop.AspectAnnotationLoader; import org.jboss.aop.AspectAnnotationLoaderStrategy; import org.jboss.aop.AspectAnnotationLoaderStrategySupport; import org.jboss.aop.advice.AdviceType; import org.jboss.aop.advice.PrecedenceDefEntry; import org.jboss.aop.advice.Scope; import org.jboss.aop.pointcut.ast.ASTCFlowExpression; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MicrocontainerAnnotationLoaderStrategy extends AspectAnnotationLoaderStrategySupport { List factories = new ArrayList(); public List getFactories() { return factories; } @Override public void deployAspect(AspectAnnotationLoader loader, boolean isFactory, String name, Scope scope) { AspectBeanMetaDataFactory aspect = new AspectBeanMetaDataFactory(); deployAspectOrInterceptor(aspect, isFactory, name, scope); } @Override public void undeployAspect(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployInterceptor(AspectAnnotationLoader loader, boolean isFactory, String name, Scope scope) { InterceptorBeanMetaDataFactory aspect = new InterceptorBeanMetaDataFactory(); deployAspectOrInterceptor(aspect, isFactory, name, scope); } @Override public void undeployInterceptor(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployAspectMethodBinding(AspectAnnotationLoader loader, AdviceType internalAdviceType, String aspectDefName, String methodName, String bindingName, String pointcutString, String cflow, ASTCFlowExpression cflowExpression) throws Exception { AdviceData entry = null; if (internalAdviceType == AdviceType.AROUND) { entry = new AdviceData(); } else if (internalAdviceType == AdviceType.BEFORE) { entry = new BeforeAdviceData(); } else if (internalAdviceType == AdviceType.AFTER) { entry = new AfterAdviceData(); } else if (internalAdviceType == AdviceType.THROWING) { entry = new ThrowingAdviceData(); } else if (internalAdviceType == AdviceType.FINALLY) { entry = new FinallyAdviceData(); } else { throw new IllegalStateException("Invalid advice type " + internalAdviceType); } entry.setAdviceMethod(methodName); entry.setRefName(aspectDefName); deployBinding(bindingName, pointcutString, cflow, entry); } @Override public void undeployAspectMethodBinding(AspectAnnotationLoader loader, String bindingName, String className, String methodName) { //Noop } @Override public void deployInterceptorBinding(AspectAnnotationLoader loader, String name, String pointcutString, String cflow, ASTCFlowExpression cflowExpression) throws Exception { InterceptorRefData entry = new InterceptorRefData(); entry.setRefName(name); deployBinding(name, pointcutString, cflow, entry); } @Override public void undeployInterceptorBinding(AspectAnnotationLoader loader, String name) { //Noop } private void deployAspectOrInterceptor(AspectBeanMetaDataFactory aspect, boolean isFactory, String name, Scope scope) { aspect.setScope(scope.name()); aspect.setName(name); if (isFactory) { aspect.setFactory(name); } else { aspect.setBean(name); } factories.add(aspect); } private void deployBinding(String name, String pointcutString, String cflow, BaseInterceptorData entry) { BindBeanMetaDataFactory bind = new BindBeanMetaDataFactory(); bind.setName("Binding$" + name); bind.setPointcut(pointcutString); bind.setCflow(cflow); bind.setInterceptors(Collections.singletonList(entry)); factories.add(bind); } @Override public void deployCFlow(AspectAnnotationLoader loader, CFlowStackInfo stack) { CFlowStackBeanMetaDataFactory cflow = new CFlowStackBeanMetaDataFactory(); cflow.setName(stack.getName()); CFlowInfo[] cflows = stack.getCFlows(); if (cflows != null) { List entries = new ArrayList(); for (CFlowInfo current : cflows) { CFlowEntry entry = new CFlowEntry(); entry.setExpr(current.getExpr()); entry.setCalled(!current.isNot()); entries.add(entry); } cflow.setCalledEntries(entries); } factories.add(cflow); } @Override public void undeployCFlow(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployAnnotationIntroduction(AspectAnnotationLoader loader, String expr, String annotation, boolean invisible) { AnnotationIntroductionBeanMetaDataFactory intro = new AnnotationIntroductionBeanMetaDataFactory(); intro.setExpr(expr); intro.setAnnotation(annotation); intro.setInvisible(invisible); factories.add(intro); } @Override public void undeployAnnotationIntroduction(AspectAnnotationLoader loader, String expr, String annotation, boolean invisible) { //Noop } @Override public void deployTypedef(AspectAnnotationLoader loader, String name, String expr) throws Exception { TypeDefBeanMetaDataFactory typedef = new TypeDefBeanMetaDataFactory(); typedef.setName(name); typedef.setExpr(expr); factories.add(typedef); } @Override public void undeployTypedef(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployDynamicCFlow(AspectAnnotationLoader loader, String name, String clazz) { DynamicCflowBeanMetaDataFactory dcflow = new DynamicCflowBeanMetaDataFactory(); dcflow.setName(name); dcflow.setBean(clazz); factories.add(dcflow); } @Override public void undeployDynamicCFlow(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployInterfaceIntroduction(AspectAnnotationLoader loader, AspectAnnotationLoaderStrategy.InterfaceIntroductionInfo introduction) { IntroductionBeanMetaDataFactory intro = new IntroductionBeanMetaDataFactory(); intro.setName(introduction.getName()); intro.setExpr(introduction.getExpr()); intro.setBean(introduction.getTarget()); if (introduction.getInterfaces() != null) { intro.setInterfaces(createCommaSeparatedInterfaceString(introduction.getInterfaces())); } if (introduction.getMixins() != null) { List mixinDatas = new ArrayList(); for (InterfaceIntroductionMixinInfo mixin : introduction.getMixins()) { MixinData mixinData = new MixinData(); mixinData.setMixin(mixin.getClassname()); mixinData.setInterfaces(createCommaSeparatedInterfaceString(mixin.getInterfaces())); mixinData.setConstruction(mixin.getConstruction()); mixinDatas.add(mixinData); } intro.setMixins(mixinDatas); } factories.add(intro); } @Override public void undeployInterfaceIntroduction(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployPointcut(AspectAnnotationLoader loader, String name, String expr) throws Exception { NamedPointcutBeanMetaDataFactory pointcut = new NamedPointcutBeanMetaDataFactory(); pointcut.setName(name); pointcut.setExpr(expr); factories.add(pointcut); } @Override public void undeployPointcut(AspectAnnotationLoader loader, String name) { //Noop } @Override public void deployPrecedence(AspectAnnotationLoader loader, String name, PrecedenceDefEntry[] pentries) { PrecedenceBeanMetaDataFactory precedence = new PrecedenceBeanMetaDataFactory(); List entries = new ArrayList(); for (PrecedenceDefEntry pentry : pentries) { String clazz = pentry.getInterceptorClass(); String advice = pentry.getAdviceMethod(); BaseInterceptorData entry = null; if (advice == null) { entry = new InterceptorRefData(); entry.setRefName(clazz); } else { entry = new AdviceData(); entry.setRefName(clazz); ((AdviceData)entry).setAdviceMethod(advice); } entries.add(entry); precedence.setEntries(entries); } factories.add(precedence); } @Override public void undeployPrecedence(AspectAnnotationLoader loader, String name) { super.undeployPrecedence(loader, name); } @Override public void deployDeclare(AspectAnnotationLoader loader, String name, String expr, boolean warning, String msg) throws Exception { AbstractDeclareBeanMetaDataFactory declare = warning ? new DeclareWarningBeanMetaDataFactory() : new DeclareErrorBeanMetaDataFactory(); declare.setName(name); declare.setExpr(expr); declare.setMessage(msg); factories.add(declare); } private String createCommaSeparatedInterfaceString(String[] interfaces) { StringBuilder sb = new StringBuilder(); for (int i = 0 ; i < interfaces.length ; i++) { if (i > 0) { sb.append(", "); } sb.append(interfaces[i]); } return sb.toString(); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/PrecedenceBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001043411205241312033121 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.PrecedenceDef; import org.jboss.aop.microcontainer.beans.PrecedenceDefEntry; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="precedence") @XmlType(name="precedenceType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "entries", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class PrecedenceBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private List entries = new ArrayList(); public PrecedenceBeanMetaDataFactory() { } @Override public List getBeans() { ArrayList result = new ArrayList(); //Add the PrecedenceDef if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder precedenceBuilder = AOPBeanMetaDataBuilder.createBuilder(name, PrecedenceDef.class.getName()); precedenceBuilder.addPropertyMetaData("name", getName()); setAspectManagerProperty(precedenceBuilder); result.add(precedenceBuilder.getBeanMetaData()); List entryList = precedenceBuilder.createList(ArrayList.class.getName(), null); precedenceBuilder.addPropertyMetaData("entries", entryList); int i = 0; for (BaseInterceptorData entry : entries) { String entryName = name + "$" + i++; BeanMetaDataBuilder entryBuilder = AOPBeanMetaDataBuilder.createBuilder(entryName, PrecedenceDefEntry.class.getName()); entryBuilder.addPropertyMetaData("aspectName", entry.getRefName()); if (entry instanceof AdviceOrInterceptorData) { entryBuilder.addPropertyMetaData("aspectMethod", ((AdviceOrInterceptorData)entry).getAdviceMethod()); } ValueMetaData injectEntry = precedenceBuilder.createInject(entryName); entryList.add(injectEntry); result.add(entryBuilder.getBeanMetaData()); } return result; } @XmlElements ({ @XmlElement(name="advice", type=AdviceData.class), @XmlElement(name="interceptor-ref", type=InterceptorRefData.class) }) public List getEntries() { return entries; } public void setEntries(List entries) { this.entries = entries; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AnnotationOverrideBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000406511202040346033125 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.AnnotationOverride; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="annotation") @XmlType(name="annotationOverrideType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class AnnotationOverrideBeanMetaDataFactory extends AbstractAnnotationBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected String getBeanClassName() { return AnnotationOverride.class.getName(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/CFlowNotCalled.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000252711262401357033137 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowNotCalled extends CFlowEntry { private static final long serialVersionUID = 1L; public boolean getCalled() { return false; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AbstractDeclareBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000546311301242575033140 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlValue; import org.jboss.aop.microcontainer.beans.DeclareDefinition; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AbstractDeclareBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { /** The serialVersionUID */ private static final long serialVersionUID = 40496477255281807L; String expr; String message; public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } public String getMessage() { return message; } @XmlValue public void setMessage(String message) { this.message = message; } @Override public List getBeans() { ArrayList beans = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, DeclareDefinition.class.getName()); builder.addPropertyMetaData("expr", expr); builder.addPropertyMetaData("name", name); builder.addPropertyMetaData("message", message); builder.addPropertyMetaData("warning", isWarning()); setAspectManagerProperty(builder); beans.add(builder.getBeanMetaData()); return beans; } protected abstract boolean isWarning(); } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AspectBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001665511262401357033146 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.Aspect; import org.jboss.aop.microcontainer.beans.ClassLoaderAwareGenericBeanFactory; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; import org.w3c.dom.Element; /** * AspectBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 61194 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="aspect") @XmlType(name="aspectType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class AspectBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private String scope = "PER_VM"; private String factory; private String aspectName; private boolean initialisedName; private List elements; @XmlAttribute public void setScope(String scope) { this.scope = scope; } public String getScope() { return scope; } @XmlAttribute public void setFactory(String clazz) { this.factory = clazz; if (getBean() != null) { throw new RuntimeException("Cannot set both factory and clazz"); } //Meeded to satisfy validation in BeanFactoryHandler.endElement() super.setBean(clazz); } public String getFactory() { return factory; } @Override @XmlAttribute(name="class") public void setBean(String bean) { if (factory != null) { throw new RuntimeException("Cannot set both factory and clazz"); } super.setBean(bean); } public List getElements() { return elements; } @XmlAnyElement(lax=true) public void setElements(List elements) { this.elements = elements; } @Override public List getBeans() { ArrayList result = new ArrayList(); if (this.name == null) { this.name = super.getBean(); } //Add the bean factory if (!initialisedName) { aspectName = this.name; this.name = "Factory$" + name; initialisedName = true; } List beans = super.getBeans(); if (beans.size() != 1) { throw new RuntimeException("Wrong number of beans" + beans); } BeanMetaData factory = beans.get(0); BeanMetaDataBuilder factoryBuilder = AOPBeanMetaDataBuilder.createBuilder(factory); factoryBuilder.setBean(ClassLoaderAwareGenericBeanFactory.class.getName()); result.add(factory); //Add the Aspect BeanMetaDataBuilder aspectBuilder = AOPBeanMetaDataBuilder.createBuilder(aspectName, Aspect.class.getName()); aspectBuilder.addPropertyMetaData("scope", scope); aspectBuilder.addPropertyMetaData("name", aspectName); HashMap attributes = new HashMap(); attributes.put("name", name); if (this.factory != null) { attributes.put("factory", this.factory); } else { attributes.put("class", bean); } attributes.put("scope", scope); if (elements != null && elements.size() > 0) { aspectBuilder.addPropertyMetaData("element", XmlLoadableRootElementUtil.getRootElementString(elements, getTagName(), attributes)); } setAspectManagerProperty(aspectBuilder); if (this.factory != null) { aspectBuilder.addPropertyMetaData("factory", Boolean.TRUE); } result.add(aspectBuilder.getBeanMetaData()); if (hasInjectedBeans(factory)) { configureWithDependencies(factoryBuilder, aspectBuilder); } else { configureNoDependencies(aspectBuilder); } return result; } private void configureWithDependencies(BeanMetaDataBuilder factoryBuilder, BeanMetaDataBuilder aspectBuilder) { aspectBuilder.addPropertyMetaData("adviceBean", name); factoryBuilder.addInstallWithThis("install", aspectBuilder.getBeanMetaData().getName()); factoryBuilder.addUninstall("uninstall", aspectBuilder.getBeanMetaData().getName()); } private void configureNoDependencies(BeanMetaDataBuilder aspectBuilder) { ValueMetaData inject = aspectBuilder.createInject(name); aspectBuilder.addPropertyMetaData("advice", inject); } private boolean hasInjectedBeans(BeanMetaData beanMetaData) { ArrayList dependencies = new ArrayList(); getDependencies(dependencies, beanMetaData); for (ValueMetaData dep : dependencies) { if(!((String)dep.getUnderlyingValue()).startsWith("jboss.kernel:service=")) { return true; } } return false; } private void getDependencies(ArrayList dependencies, MetaDataVisitorNode node) { if (node instanceof AbstractDependencyValueMetaData) { dependencies.add((AbstractDependencyValueMetaData)node); } Iterator children = node.getChildren(); if (children != null) { while (children.hasNext()) { MetaDataVisitorNode child = children.next(); getDependencies(dependencies, child); } } } protected String getTagName() { return "aspect"; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AdviceData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000323211262401357033131 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="aroundAdviceType", propOrder={}) public class AdviceData extends AdviceOrInterceptorData { private static final long serialVersionUID = 1L; String adviceMethod; public String getAdviceMethod() { return adviceMethod; } @XmlAttribute(name="name") public void setAdviceMethod(String method) { this.adviceMethod = method; } }././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DynamicCflowBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000643111220434423033127 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.DynamicCFlowDef; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.xb.annotations.JBossXmlSchema; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="dynamic-cflow") @XmlType(name="dynamicCflowType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class DynamicCflowBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; private List elements; public List getElements() { return elements; } @XmlAnyElement(lax=true) public void setElements(List elements) { this.elements = elements; } @Override public List getBeans() { ArrayList result = new ArrayList(); BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, DynamicCFlowDef.class.getName()); builder.addPropertyMetaData("name", name); builder.addPropertyMetaData("className", bean); HashMap attributes = new HashMap(); attributes.put("name", name); attributes.put("class", bean); if (elements != null && elements.size() > 0) { builder.addPropertyMetaData("element", XmlLoadableRootElementUtil.getRootElementString(elements, "dynamic-cflow", attributes)); } setAspectManagerProperty(builder); result.add(builder.getBeanMetaData()); return result; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AfterAdviceData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000275311262401357033140 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.advice.AdviceType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="afterAdviceType", propOrder={}) public class AfterAdviceData extends AdviceData { private static final long serialVersionUID = 1L; public AfterAdviceData() { setType(AdviceType.AFTER); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/ArrayReplacementBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000572711220434423033136 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.ArrayReplacement; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="arrayreplacement") @XmlType(name="arrayReplacementType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class ArrayReplacementBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; String expr; public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } @Override public List getBeans() { ArrayList beans = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, ArrayReplacement.class.getName()); builder.addPropertyMetaData("name", name); builder.addPropertyMetaData("classes", bean); builder.addPropertyMetaData("expr", expr); setAspectManagerProperty(builder); beans.add(builder.getBeanMetaData()); return beans; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/AbstractPointcutBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000462211301242575033134 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public abstract class AbstractPointcutBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { /** The serialVersionUID */ private static final long serialVersionUID = -4049866162732734833L; String expr; public String getExpr() { return expr; } @XmlAttribute public void setExpr(String expr) { this.expr = expr; } protected abstract String getBeanClass(); @Override public List getBeans() { ArrayList result = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, getBeanClass()); builder.addPropertyMetaData("name", name); builder.addPropertyMetaData("expr", expr); setAspectManagerProperty(builder); result.add(builder.getBeanMetaData()); return result; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/DeclareWarningBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000372511202040346033127 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="declare-warning") @XmlType(name="declareWarningType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "message", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class DeclareWarningBeanMetaDataFactory extends AbstractDeclareBeanMetaDataFactory { private static final long serialVersionUID = 1L; @Override protected boolean isWarning() { return true; } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/MetaDataBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000750011220434423033125 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.ClassMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="metadata") //Set a random proporder since we don't want to set any of the properties in GenericBeanFactoryMetaData in the //freeform xml contained in this element @XmlType(name="metaDataType", propOrder={"non$$existant$$property"}) public class MetaDataBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; String tag; //It would have been nice to handle the normal metadata elements handled by the SimpleMetaDataElements in a typed //way, but what if we have a custom metadata loader that expects elements with the same names? List elements; public String getTag() { return tag; } @XmlAttribute public void setTag(String tag) { this.tag = tag; } public List getElements() { return elements; } @XmlAnyElement(lax=true) public void setElements(List elements) { this.elements = elements; } @Override public List getBeans() { List beans = new ArrayList(); if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder builder = AOPBeanMetaDataBuilder.createBuilder(name, ClassMetaData.class.getName()); builder.addPropertyMetaData("tag", tag); builder.addPropertyMetaData("className", bean); HashMap attributes = new HashMap(); attributes.put("tag", tag); attributes.put("class", bean); builder.addPropertyMetaData("element", XmlLoadableRootElementUtil.getRootElementString(elements, "metadata", attributes)); setAspectManagerProperty(builder); beans.add(builder.getBeanMetaData()); return beans; } /** * Here to match the @XMLType.propOrder * @param ignored ??? */ public void setNon$$existant$$property(String ignored) { } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/ArrayBindBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001351011205241312033117 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.microcontainer.beans.ArrayBinding; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerState; import org.jboss.util.id.GUID; import org.jboss.xb.annotations.JBossXmlSchema; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="arraybind") @XmlType(name="arrayBindType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "interceptors", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class ArrayBindBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory { private static final long serialVersionUID = 1L; String type; private List interceptors = new ArrayList(); public ArrayBindBeanMetaDataFactory() { } @XmlAttribute public void setType(String type) { this.type = type; } @Override public List getBeans() { ArrayList result = new ArrayList(); //Create AspectBinding if (name == null) { name = GUID.asString(); } BeanMetaDataBuilder bindingBuilder = AOPBeanMetaDataBuilder.createBuilder(name, ArrayBinding.class.getName()); bindingBuilder.addPropertyMetaData("name", name); bindingBuilder.addPropertyMetaData("type", type); setAspectManagerProperty(bindingBuilder); result.add(bindingBuilder.getBeanMetaData()); if (interceptors.size() > 0) { List bindingInterceptors = bindingBuilder.createList(); int i = 0; for (BaseInterceptorData interceptor : interceptors) { String intName = name + "$" + i++; BeanMetaDataBuilder interceptorBuilder = AOPBeanMetaDataBuilder.createBuilder(intName, interceptor.getBeanClassName()); setAspectManagerProperty(interceptorBuilder); ValueMetaData injectBinding = interceptorBuilder.createInject(name, null, null, ControllerState.INSTANTIATED); interceptorBuilder.addPropertyMetaData("binding", injectBinding); if (interceptor instanceof AdviceOrInterceptorData) { ValueMetaData injectAspect = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("aspect", injectAspect); if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null) { interceptorBuilder.addPropertyMetaData("aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod()); } interceptorBuilder.addPropertyMetaData("type", ((AdviceOrInterceptorData)interceptor).getType()); } else { ValueMetaData injectStack = interceptorBuilder.createInject(interceptor.getRefName()); interceptorBuilder.addPropertyMetaData("stack", injectStack); } result.add(interceptorBuilder.getBeanMetaData()); ValueMetaData injectInterceptor = bindingBuilder.createInject(intName); bindingInterceptors.add(injectInterceptor); } bindingBuilder.addPropertyMetaData("advices", bindingInterceptors); } return result; } @XmlElements ({ @XmlElement(name="advice", type=AdviceData.class), @XmlElement(name="around", type=AdviceData.class), @XmlElement(name="before", type=BeforeAdviceData.class), @XmlElement(name="after", type=AfterAdviceData.class), @XmlElement(name="throwing", type=ThrowingAdviceData.class), @XmlElement(name="finally", type=FinallyAdviceData.class), @XmlElement(name="interceptor-ref", type=InterceptorRefData.class), @XmlElement(name="stack-ref", type=StackRefData.class) }) public List getInterceptors() { return interceptors; } public void setInterceptors(List interceptors) { this.interceptors = interceptors; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/metadata/BeforeAdviceData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000275711262401357033144 0ustar twernertwerner/* * 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.microcontainer.beans.metadata; import javax.xml.bind.annotation.XmlType; import org.jboss.aop.advice.AdviceType; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ @XmlType(name="beforeAdviceType", propOrder={}) public class BeforeAdviceData extends AdviceData { private static final long serialVersionUID = 1L; public BeforeAdviceData() { setType(AdviceType.BEFORE); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Binding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000240010722621434033125 0ustar twernertwerner/* * 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.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface Binding { String getName(); void rebind() throws Exception; } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Stack.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000616111037352353033136 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.ArrayList; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.AdviceStack; import org.jboss.aop.advice.InterceptorFactory; /** * Defines an interceptor stack * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class Stack { private AspectManager manager; private String name; private List advices; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List getAdvices() { return advices; } public void setAdvices(List advices) { this.advices = advices; } public List getClonedAdvices(Binding binding) { List entries = new ArrayList(); for (InterceptorEntry entry : advices) { InterceptorEntry cloned = (InterceptorEntry)entry.clone(); cloned.setBinding(binding); entries.add(cloned); } return entries; } public void start() { if (manager == null) { throw new IllegalStateException("Null manager"); } if (name == null) { throw new IllegalStateException("Null name"); } if (advices == null) { throw new IllegalStateException("Null advices"); } ArrayList factories = new ArrayList(); for (InterceptorEntry advice : advices) { factories.add(advice.getInterceptorFactory()); } AdviceStack stack = new AdviceStack(name, factories); manager.addAdviceStack(stack); } public void stop() { manager.removeInterceptorStack(name); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/PrecedenceDefEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000320610721416203033125 0ustar twernertwerner/* * 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.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceDefEntry { private String aspectName; private String aspectMethod; public String getAspectName() { return aspectName; } public void setAspectName(String aspectName) { this.aspectName = aspectName; } public String getAspectMethod() { return aspectMethod; } public void setAspectMethod(String aspectMethod) { this.aspectMethod = aspectMethod; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/StackEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000473610722621434033143 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.List; import org.jboss.aop.advice.InterceptorFactory; /** * A stack-ref entry. * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class StackEntry extends BindingEntry { Stack stack; List advices; InterceptorFactory[] factories; public Stack getStack() { return stack; } public void setStack(Stack stack) { this.stack = stack; } public InterceptorFactory[] getInterceptorFactories() { return factories; } public void start() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (binding == null) { throw new IllegalArgumentException("Null aspect binding"); } if (stack == null) { throw new IllegalArgumentException("Null stack"); } advices = stack.getClonedAdvices(binding); if (advices == null) { throw new IllegalArgumentException("Null advices"); } factories = new InterceptorFactory[advices.size()]; int i = 0; for (InterceptorEntry entry : advices) { entry.start(); factories[i++] = entry.getInterceptorFactory(); } } public void stop() { advices = null; factories = null; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AspectManagerFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000664711053266520033145 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.Domain; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.stack.MetaDataStack; import org.jboss.util.JBossStringBuilder; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AspectManagerFactory { public static AspectManager getAspectManager() { return getAspectManager(MetaDataStack.peek()); } public static AspectManager getAspectManager(MetaData md) { AspectManager manager = AspectManager.instance(); if (md != null) { AspectManager metaDataManager = md.getMetaData(AspectManager.class); if (metaDataManager != null) { return metaDataManager; } ApplicationScope app = md.getMetaData(ApplicationScope.class); DeploymentScope dep = md.getMetaData(DeploymentScope.class); if (app != null && dep != null) { JBossStringBuilder fqn = new JBossStringBuilder("/"); AspectManager sub = null; if (app != null) { String name="APPLICATION=" + app.value(); fqn.append(name); fqn.append("/"); sub = manager.findManagerByName(fqn.toString()); if (sub == null) { sub = createNewDomain(manager, name); } } if (dep != null) { String name="DEPLOYMENT=" + dep.value(); fqn.append(name); fqn.append("/"); AspectManager parent = sub; sub = manager.findManagerByName(fqn.toString()); if (sub == null) { sub = createNewDomain(parent, name); } } return sub; } } return manager; } private static AspectManager createNewDomain(AspectManager parent, String name) { Domain domain = new Domain(parent, name, true); domain.setInheritsBindings(true); domain.setInheritsDeclarations(true); return domain; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DynamicCFlowDef.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000542711021241142033124 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.DynamicCFlowDefinition; import org.w3c.dom.Element; /** * Bean to install a DynamicCFlow * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DynamicCFlowDef { /** * The AspectManager */ private AspectManager manager; /** * The name of the resulting DynamicCFlow */ private String name; /** * The name of the class implementing the dynamic cflow */ private String className; Element element; public void setElement(Element element) { this.element = element; } public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public void start() { if (name == null || name.length() == 0) throw new IllegalArgumentException("Null name"); if (className == null || className.length() == 0) throw new IllegalArgumentException("Null className"); if (manager == null) throw new IllegalArgumentException("Null manager"); DynamicCFlowDefinition dynamic = new DynamicCFlowDefinition(element, className, name); manager.addDynamicCFlow(name, dynamic); } public void stop() { manager.removeDynamicCFlow(name); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/Aspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000002135311121467520033133 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.Map; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.AspectDefinition; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.advice.Scope; import org.jboss.aop.advice.ScopeUtil; import org.jboss.aop.instrument.Untransformable; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; import org.w3c.dom.Element; /** * An Aspect. * This installs the AspectDefinition and AspectFactory into aop * * @author Adrian Brock * @version $Revision: 82280 $ */ public class Aspect implements Untransformable, KernelControllerContextAware { private static final Logger log = Logger.getLogger(Aspect.class); /** * The AspectManager/Domain we are creating this aspect for */ protected AspectManager manager; /** * True if aspect is an aspect factory, rather than the aspect itself */ protected boolean factory; /** * The scope of the aspect we are creating */ protected Scope scope; protected ManagedAspectDefinition definition; /** * The beanfactory representing the advice. This should be used if the advice has no dependencies, * in which case we have a real dependency on the beanfactory. If the advice has dependencies we need * to use adviceBean instead; */ protected GenericBeanFactory advice; /** * The name of the beanfactory representing the advice. This should be used if the advice has dependencies, * in which case we have no real dependency on the beanfactory. If the advice has no dependencies we need * to use advice instead; */ protected String adviceBean; /** * The name of the aspect definition. This should be the same as the raw form of this bean's name * (when run in AS, the name is massaged to avoid name clashes) */ protected String name; /** * All the AspectBindings referencing this Aspect */ protected Map bindings = new LinkedHashMap(); /** * The element representing the interceptor in case we need to load xml */ private Element element; /** * The KernelControllerContext */ private KernelControllerContext context; /** * Get the name. * * @return the adviceName. */ public String getName() { return name; } /** * Sets if we are an aspect factory or not * * @param factory true if we are a factory */ public void setFactory(boolean factory) { this.factory = factory; } /** * Set the name. * * @param name The name to set. */ public void setName(String name) { this.name = name; } /** * Get the adviceBean. * * @return the adviceBean. */ public String getAdviceBean() { return adviceBean; } /** * Set the adviceBean. * * @param adviceBean the adviceBean. */ public void setAdviceBean(String adviceBean) { this.adviceBean = adviceBean; } /** * Get the definition. * * @return the definition. */ public AspectDefinition getDefinition() { return definition; } /** * Get the manager. * * @return the manager. */ public AspectManager getManager() { return manager; } /** * Set the manager. * * @param manager The manager to set. */ public void setManager(AspectManager manager) { this.manager = manager; } /** * Get the advice. * * @return the advice. */ public GenericBeanFactory getAdvice() { return advice; } /** * Set the advice. * * @param advice The advice to set. */ public void setAdvice(GenericBeanFactory advice) { this.advice = advice; } /** * Get the scope. * * @return the scope. */ public String getScope() { return scope.toString(); } /** * Set the scope. * * @param scope The scope to set. */ public void setScope(String scope) { this.scope = ScopeUtil.parse(scope); } public void setElement(Element element) { this.element = element; } public void install(GenericBeanFactory factory) throws Exception { this.advice = factory; start(); } public void start() throws Exception { if (definition == null) { if (manager == null) throw new IllegalArgumentException("Null manager"); if (name == null) throw new IllegalArgumentException("Null name"); if (advice != null) { definition = getAspectDefinitionNoDependencies(); } else if (adviceBean != null) { definition = getAspectDefintionDependencies(); } else { throw new IllegalStateException("Unknown type of managed aspects"); } addDefinitionToManager(); } if (adviceBean != null && advice != null) { definition.setDeployed(true); BeanFactoryAwareAspectFactory factory = (BeanFactoryAwareAspectFactory)definition.getFactory(); factory.setBeanFactory(advice); } setDefinitionControllerContext(context); //Copy the aspectbindings to avoid ConcurrentModificationExceptions ArrayList clonedBindings = new ArrayList(); for (Binding aspectBinding : bindings.values()) { clonedBindings.add(aspectBinding); } for (Binding binding : clonedBindings) { binding.rebind(); } log.debug("Bound aspect " + name + "; deployed:" + definition.isDeployed()); } protected ManagedAspectDefinition getAspectDefinitionNoDependencies() { AspectFactory factory = this.factory ? new DelegatingBeanAspectFactory(name, advice, element) : new GenericBeanAspectFactory(name, advice, element); return new ManagedAspectDefinition(name, scope, factory); } protected ManagedAspectDefinition getAspectDefintionDependencies() { AspectFactory factory = this.factory ? new DelegatingBeanAspectFactory(name, advice, element) : new GenericBeanAspectFactory(name, advice, element); return new ManagedAspectDefinition(name, scope, factory, adviceBean, false); } protected void addDefinitionToManager() { manager.addAspectDefinition(definition); } public void uninstall() throws Exception { stop(); } public void stop() { log.debug("Unbinding aspect " + name); manager.removeAspectDefinition(name); if (definition != null) { setDefinitionControllerContext(null); definition.undeploy(); definition = null; } } void addBinding(Binding binding) { bindings.put(binding.getName(), binding); } void removeBinding(Binding binding) { bindings.remove(binding.getName()); } public void setKernelControllerContext(KernelControllerContext context) throws Exception { this.context = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { this.context = null; } protected void setDefinitionControllerContext(KernelControllerContext context) { try { if (definition != null) { ((KernelControllerContextAware)definition.getFactory()).setKernelControllerContext(context); } } catch (Exception e) { throw new RuntimeException(e); } } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/PrecedenceDef.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000541711021255066033135 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class PrecedenceDef { private AspectManager manager; private List entries; private String name; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public List getEntries() { return entries; } public void setEntries(List precedenceEntries) { this.entries = precedenceEntries; } public String getName() { return name; } public void setName(String name) { this.name = name; } public void start() { if (manager == null) throw new IllegalArgumentException("Null manager"); if (entries == null) throw new IllegalArgumentException("Null entries"); if (entries.size() == 0) throw new IllegalArgumentException("No entries"); if (name == null) name = GUID.asString(); org.jboss.aop.advice.PrecedenceDefEntry[] pentries = new org.jboss.aop.advice.PrecedenceDefEntry[entries.size()]; int i = 0; for (PrecedenceDefEntry entry : entries) { pentries[i++] = new org.jboss.aop.advice.PrecedenceDefEntry(entry.getAspectName(), entry.getAspectMethod()); } manager.addPrecedence(new org.jboss.aop.advice.PrecedenceDef(name, pentries)); } public void stop() { manager.removePrecedence(name); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/BeanFactoryAwareAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000243711137570512033140 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.beans.metadata.spi.factory.BeanFactory; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface BeanFactoryAwareAspectFactory { void setBeanFactory(BeanFactory factory); } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ManagedAdviceFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000260010647363447033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import org.jboss.aop.advice.AdviceFactory; import org.jboss.aop.advice.AspectDefinition; /** * * @author Kabir Khan * @version $Revision: 64112 $ */ public class ManagedAdviceFactory extends AdviceFactory { public ManagedAdviceFactory(AspectDefinition aspect, String adviceName) { super(aspect, adviceName); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DelegatingBeanAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001471611262401357033142 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DelegatingBeanAspectFactory implements AspectFactory, KernelControllerContextAware, BeanFactoryAwareAspectFactory { private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); protected BeanFactory factory; protected String name; protected Element element; protected KernelControllerContext context; protected AspectFactory aspectFactory; public DelegatingBeanAspectFactory(String name, BeanFactory factory, Element element) { this.name = name; this.factory = factory; this.element = element; } public void setKernelControllerContext(KernelControllerContext context) { this.context = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { this.context = null; } public void setBeanFactory(BeanFactory factory) { this.factory = factory; } public String getName() { return name; } public Object createPerVM() { AspectFactory factory = doCreate(); return factory.createPerVM(); } public Object createPerClass(Advisor advisor) { AspectFactory factory = doCreate(); return factory.createPerClass(advisor); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { AspectFactory factory = doCreate(); return factory.createPerInstance(advisor, instanceAdvisor); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { AspectFactory factory = doCreate(); return factory.createPerJoinpoint(advisor, jp); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { AspectFactory factory = doCreate(); return factory.createPerJoinpoint(advisor, instanceAdvisor, jp); } protected synchronized AspectFactory doCreate() { try { if (aspectFactory == null) { log.debug("Creating advice " + name); PushedClassLoaderMetaData pcmd = null; if (((GenericBeanFactory)factory).getClassLoader() == null) { pcmd = new PushedClassLoaderMetaData(); ((GenericBeanFactory)factory).setClassLoader(pcmd); } Object object = null; try { //Try without looking at the context first which is what shold be used when running scoped in AS object = factory.createBean(); } catch(Throwable t) { if (pcmd != null) { pcmd.setLookAtContext(true); } else { throw new RuntimeException(t); } object = factory.createBean(); } aspectFactory = (AspectFactory)object; if (aspectFactory instanceof XmlLoadable) { ((XmlLoadable)aspectFactory).importXml(element); } } return aspectFactory; } catch (Throwable throwable) { throw new RuntimeException(throwable); } } /** * Gets any classloaders for the thread */ private class PushedClassLoaderMetaData extends AbstractClassLoaderMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 1L; boolean lookAtContext; void setLookAtContext(boolean look) { lookAtContext = look; } @Override public ValueMetaData getClassLoader() { ClassLoader loader = null; if (lookAtContext && context != null) { try { loader = context.getClassLoader(); } catch (Throwable t) { log.trace("Unable to retrieve classloader from " + context); } if (loader == null) { try { loader = Configurator.getClassLoader(((GenericBeanFactory)factory).getClassLoader()); } catch (Throwable e) { log.trace("Unable to retrieve classloader from " + factory); } } } return loader != null ? new AbstractValueMetaData(loader) : null; } } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AspectBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000754611021255066033142 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.AdviceBinding; import org.jboss.aop.advice.InterceptorFactory; import org.jboss.logging.Logger; import org.jboss.util.id.GUID; /** * An AspectBinding. * * @author Adrian Brock * @author Kabir Khan * @version $Revision: 74002 $ */ public class AspectBinding implements Binding { private static final Logger log = Logger.getLogger(AspectBinding.class); protected AspectManager manager; protected String name; protected String pointcut; protected List advices; protected String cflow; /** * Get the manager. * * @return the manager. */ public AspectManager getManager() { return manager; } /** * Set the manager. * * @param manager The manager to set. */ public void setManager(AspectManager manager) { this.manager = manager; } public String getCflow() { return cflow; } public void setCflow(String cflow) { this.cflow = cflow; } /** * Get the pointcut. * * @return the pointcut. */ public String getPointcut() { return pointcut; } public String getName() { return name; } public void setName(String name) { this.name = name; } /** * Set the pointcut. * * @param pointcut The pointcut to set. */ public void setPointcut(String pointcut) { this.pointcut = pointcut; } public List getAdvices() { return advices; } public void setAdvices(List advices) { this.advices = advices; } public void start() throws Exception { if (pointcut == null) throw new IllegalArgumentException("Null pointcut"); if (manager == null) throw new IllegalArgumentException("Null manager"); if (name == null) name = GUID.asString(); AdviceBinding binding = new AdviceBinding(name, pointcut, cflow); if (advices != null) { for (BindingEntry entry : advices) { entry.start(); InterceptorFactory[] factories = entry.getInterceptorFactories(); for (InterceptorFactory ifac : factories) { binding.addInterceptorFactory(ifac); } } } manager.addBinding(binding); log.debug("Bound binding " + name); } public void stop() throws Exception { manager.removeBinding(name); if (advices != null) { for (BindingEntry entry : advices) { entry.stop(); } } } public void uninstall() throws Exception { stop(); } public void rebind() throws Exception { stop(); start(); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ClassLoaderAwareGenericBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000413711114756640033142 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.kernel.spi.config.KernelConfigurator; /** * CL aware GBF. * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassLoaderAwareGenericBeanFactory extends GenericBeanFactory { private ThreadLocal pushedLoader = new ThreadLocal(); public ClassLoaderAwareGenericBeanFactory(KernelConfigurator configurator) { super(configurator); } /** * Push classloader into thread local. * * @param loader the loader */ public void pushLoader(ClassLoader loader) { pushedLoader.set(loader); } /** * Pop loader from thread local. */ public void popLoader() { pushedLoader.set(null); } @Override public Object createBean() throws Throwable { ClassLoader loader = pushedLoader.get(); if (loader == null) { return super.createBean(); } else { return super.createBean(loader); } } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AOPDomain.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000600211037703124033124 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.DomainDefinition; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AOPDomain { String name; AspectManager manager; boolean parentFirst=false; boolean inheritDefinitions=true; boolean inheritBindings=false; AOPDomain parent; DomainDefinition definition; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isParentFirst() { return parentFirst; } public void setParentFirst(boolean parentFirst) { this.parentFirst = parentFirst; } public boolean isInheritDefinitions() { return inheritDefinitions; } public void setInheritDefinitions(boolean inheritDefinitions) { this.inheritDefinitions = inheritDefinitions; } public boolean isInheritBindings() { return inheritBindings; } public void setInheritBindings(boolean inheritBindings) { this.inheritBindings = inheritBindings; } public AOPDomain getParent() { return parent; } public void setParent(AOPDomain parent) { this.parent = parent; } public AspectManager getDomain() { return definition.getManager(); } public void start() { AspectManager parent = manager; if (this.parent != null) { parent = this.parent.getDomain(); } definition = new DomainDefinition(name, parent, parentFirst, inheritDefinitions, inheritBindings); manager.addContainer(definition); } public void stop() { manager.removeContainer(name); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/AnnotationOverride.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000270410721416203033127 0ustar twernertwerner/* * 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.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AnnotationOverride extends AbstractAnnotation { @Override public void start() { validateAndCreate(); manager.addAnnotationOverride(intro); } @Override public void stop() { manager.removeAnnotationOverride(intro); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/NamedPointcut.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000532610721416203033132 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.Pointcut; import org.jboss.aop.pointcut.PointcutExpression; import org.jboss.aop.pointcut.ast.ParseException; /** * Defines a named pointcut in the underlying aspectmanager * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class NamedPointcut { AspectManager manager; String name; String expr; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } public void start() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (name == null || name.length() == 0) { throw new IllegalArgumentException("No name"); } if (expr == null || expr.length() == 0) { throw new IllegalArgumentException("No expr"); } Pointcut p = null; try { p = new PointcutExpression(name, expr); manager.addPointcut(p); } catch (ParseException ex) { throw new RuntimeException(" failed", ex); } } public void stop() { manager.removePointcut(name); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/CFlowStackEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000305010721416203033122 0ustar twernertwerner/* * 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.microcontainer.beans; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowStackEntry { private boolean called; private String expr; public boolean getCalled() { return called; } public void setCalled(boolean called) { this.called = called; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/CFlowStack.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000537010722541214033133 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.CFlow; /** * Bean to install a CFlowStack * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CFlowStack { /** * The AspectManager */ private AspectManager manager; /** * The name of the resulting CFlowStack */ private String name; /** * The CFlowStack entries */ private List entries; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public List getEntries() { return entries; } public void setEntries(List entries) { this.entries = entries; } public void start() { if (name == null || name.length() == 0) { throw new IllegalArgumentException("Null name"); } if (entries == null || entries.size() == 0) { throw new IllegalArgumentException("No entries"); } org.jboss.aop.pointcut.CFlowStack stack = new org.jboss.aop.pointcut.CFlowStack(name); for (CFlowStackEntry entry : entries) { boolean notCalled = !entry.getCalled(); stack.addCFlow(new CFlow(entry.getExpr(), notCalled)); } manager.addCFlowStack(stack); } public void stop() { manager.removeCFlowStack(name); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/LifecycleBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000656011021255066033135 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.microcontainer.lifecycle.LifecycleCallbackBinding; import org.jboss.dependency.spi.ControllerState; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class LifecycleBinding { protected String name; protected AspectManager manager; private String classes; private String expr; private String callbackBean; private ControllerState state; private String installMethod = "install"; private String uninstallMethod = "uninstall"; public void setClasses(String classes) { this.classes = classes; } public String getExpr() { return expr; } public void setExpr(String classes) { this.expr = classes; } public void setCallbackBean(String name) { callbackBean = name; } public void setManager(AspectManager manager) { this.manager = manager; } public void setState(ControllerState state) { this.state = state; } public void setInstallMethod(String installMethod) { this.installMethod = installMethod; } public void setUninstallMethod(String uninstallMethod) { this.uninstallMethod = uninstallMethod; } public void start() throws Exception { if (expr == null && classes == null) throw new IllegalArgumentException("Null classes and null expr"); if (expr != null && classes != null) throw new IllegalArgumentException("Both classes and expr were set"); if (manager == null) throw new IllegalArgumentException("Null manager"); if (callbackBean == null) throw new IllegalArgumentException("Null callback bean"); if (state == null) throw new IllegalArgumentException("Null controller state"); if (name == null) name = GUID.asString(); LifecycleCallbackBinding binding = new LifecycleCallbackBinding(name, classes, expr, state); binding.addLifecycleCallback(callbackBean, installMethod, uninstallMethod); manager.addLifecycleBinding(binding); } public void stop() throws Exception { manager.removeLifecycleBinding(name); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ClassMetaDataLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000577011005412047033133 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaDataLoader { AspectManager manager; String tag; String className; Element element; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getTag() { return tag; } public void setTag(String tag) { this.tag = tag; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public Element getElement() { return element; } public void setElement(Element element) { this.element = element; } public void start() { if (manager == null) throw new IllegalArgumentException("Null manager"); if (tag == null) throw new IllegalArgumentException("Null tag"); if (className == null) throw new IllegalArgumentException("Null className"); try { //FIXME Probably need to use something else ClassLoader cl = SecurityActions.getContextClassLoader(); Class clazz = cl.loadClass(className); org.jboss.aop.metadata.ClassMetaDataLoader loader = (org.jboss.aop.metadata.ClassMetaDataLoader)clazz.newInstance(); if (loader instanceof XmlLoadable) { ((XmlLoadable) loader).importXml(element); } manager.addClassMetaDataLoader(tag, loader); } catch (Exception e) { throw new RuntimeException(e); } } public void stop() { manager.removeClassMetaDataLoader(tag); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/DeclareDefinition.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000604410774766014033150 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.DeclareDef; import org.jboss.aop.pointcut.ast.ParseException; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class DeclareDefinition { AspectManager manager; String name; String expr; String message; boolean isWarning; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } public String getMessage() { return message; } public void setMessage(String warning) { this.message = warning; } public boolean isWarning() { return isWarning; } public void setWarning(boolean isWarning) { this.isWarning = isWarning; } public void start() { if (name == null || name.length() == 0) { throw new IllegalArgumentException("Null name"); } if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (expr == null) { throw new IllegalArgumentException("Null expr"); } if (message == null) { throw new IllegalArgumentException("Null message"); } try { DeclareDef def = new DeclareDef(name, expr, isWarning, message); manager.addDeclare(def); } catch(ParseException e) { throw new IllegalArgumentException("The expression '" + expr + "' did not parse", e); } } public void stop() { manager.removeDeclare(name); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/MixinEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000441010721416203033123 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.List; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class MixinEntry { /** The interfaces implemented by the mixin */ protected List interfaces; /** The mixin class name */ protected String mixin; /** How to construct the mixin class */ protected String construction; /** Should the mixin be transient or not */ protected boolean trans = true; public String getMixin() { return mixin; } public void setMixin(String mixinClass) { this.mixin = mixinClass; } public String getConstruction() { return construction; } public void setConstruction(String construction) { this.construction = construction; } public boolean isTransient() { return trans; } public void setTransient(boolean trans) { this.trans = trans; } public List getInterfaces() { return interfaces; } public void setInterfaces(List interfaces) { this.interfaces = interfaces; } public void start() { } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ArrayReplacement.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000644611021255066033140 0ustar twernertwerner/* * 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.microcontainer.beans; import java.io.StringReader; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.ast.ASTStart; import org.jboss.aop.pointcut.ast.ParseException; import org.jboss.aop.pointcut.ast.TypeExpressionParser; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ArrayReplacement { AspectManager manager; String name; String classes; String expr; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClasses() { return classes; } public void setClasses(String classes) { this.classes = classes; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } public void start() { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (classes == null && expr == null) { throw new IllegalArgumentException("Must define either expr or classes"); } if (classes != null && expr != null) { throw new IllegalArgumentException("Cannot define both expr and classes"); } if (name == null) { name = GUID.asString(); } org.jboss.aop.array.ArrayReplacement pcut = null; if (classes != null) { pcut = new org.jboss.aop.array.ArrayReplacement(name, classes); } else { try { ASTStart start = new TypeExpressionParser(new StringReader(expr)).Start(); pcut = new org.jboss.aop.array.ArrayReplacement(name, start); } catch (ParseException e) { throw new IllegalArgumentException("Could not parse type expression " + expr, e); } } manager.addArrayReplacement(pcut); } public void stop() { manager.removeArrayReplacement(name); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/GenericBeanAspectFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001145111173121305033124 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.GenericAspectFactory; import org.jboss.aop.joinpoint.Joinpoint; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; import org.jboss.util.xml.XmlLoadable; import org.w3c.dom.Element; /** * A GenericBeanAspectFactory. * * @author Adrian Brock * @version $Revision: 87586 $ */ public class GenericBeanAspectFactory extends GenericAspectFactory implements KernelControllerContextAware, BeanFactoryAwareAspectFactory { private static final Logger log = Logger.getLogger(GenericBeanAspectFactory.class); protected BeanFactory factory; protected String name; protected String classname; protected Element element; protected KernelControllerContext context; public GenericBeanAspectFactory(String name, BeanFactory factory, Element element) { super(null, element); this.name = name; this.element = element; setBeanFactory(factory); } public void setBeanFactory(BeanFactory factory) { if (factory != null && factory instanceof GenericBeanFactory) { classname = ((GenericBeanFactory)factory).getBean(); } this.factory = factory; } public String getAspectName() { return name; } public String getName() { //This must return the classname of the aspect, aop depends on that return classname; } @Override public String getClassname() { return classname; } public Object createPerVM() { return doCreate(null, null, null); } public Object createPerClass(Advisor advisor) { return doCreate(advisor, null, null); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { return doCreate(advisor, instanceAdvisor, null); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { return doCreate(advisor, null, jp); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { return doCreate(advisor, instanceAdvisor, jp); } public void setKernelControllerContext(KernelControllerContext context) { this.context = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { this.context = null; } protected Object doCreate(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { try { final ClassLoader loader = getCreatingClassLoader(advisor); log.debug("Creating advice " + name + " with loader " + loader); if (factory instanceof ClassLoaderAwareGenericBeanFactory) { ((ClassLoaderAwareGenericBeanFactory)factory).pushLoader(loader); } Object object = factory.createBean(); if (object instanceof XmlLoadable) { ((XmlLoadable)object).importXml(element); } configureInstance(object, advisor, instanceAdvisor, jp); return object; } catch (Throwable throwable) { throw new RuntimeException(throwable); } finally { if (factory instanceof ClassLoaderAwareGenericBeanFactory) { ((ClassLoaderAwareGenericBeanFactory)factory).popLoader(); } } } private ClassLoader getCreatingClassLoader(Advisor advisor) { if (advisor == null) { return getLoader(); } return advisor.getClassLoader(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ClassMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000617011021255066033132 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.metadata.ClassMetaDataBinding; import org.jboss.aop.metadata.ClassMetaDataLoader; import org.jboss.util.id.GUID; import org.w3c.dom.Element; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ClassMetaData { AspectManager manager; String name; //Should we read these from the element instead? String tag; String className; Element element; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTag() { return tag; } public void setTag(String tag) { this.tag = tag; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public Element getElement() { return element; } public void setElement(Element element) { this.element = element; } public void start() { if (manager == null) throw new IllegalArgumentException("Null manager"); if (tag == null) throw new IllegalArgumentException("Null tag"); if (className == null) throw new IllegalArgumentException("Null className"); if (name == null) name = GUID.asString(); ClassMetaDataLoader loader = manager.findClassMetaDataLoader(tag); try { ClassMetaDataBinding data = loader.importMetaData(element, name, tag, className); manager.addClassMetaData(data); } catch (Exception e) { // AutoGenerated throw new RuntimeException(e); } } public void stop() { manager.removeClassMetaData(name); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/IntroductionBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000001150311021255066033126 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import java.io.StringReader; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.aop.introduction.InterfaceIntroduction; import org.jboss.aop.pointcut.ast.ASTStart; import org.jboss.aop.pointcut.ast.TypeExpressionParser; import org.jboss.util.id.GUID; /** * An AspectBinding. * * @author Adrian Brock * @version $Revision: 74002 $ */ public class IntroductionBinding { protected AspectManager manager; protected String name; protected String classes; protected String expr; protected List interfaces; protected List mixins; public IntroductionBinding() { super(); } /** * Get the interfaces. * * @return the interfaces. */ public List getInterfaces() { return interfaces; } /** * Set the interfaces. * * @param interfaces The interfaces to set. */ public void setInterfaces(List interfaces) { this.interfaces = interfaces; } public List getMixins() { return mixins; } public void setMixins(List mixins) { this.mixins = mixins; } public String getName() { return name; } public void setName(String name) { this.name = name; } /** * Get the classes. * * @return the classes. */ public String getClasses() { return classes; } /** * Set the classes. * * @param classes The classes to set. */ public void setClasses(String classes) { this.classes = classes; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } /** * Get the manager. * * @return the manager. */ public AspectManager getManager() { return manager; } /** * Set the manager. * * @param manager The manager to set. */ public void setManager(AspectManager manager) { this.manager = manager; } public void start() throws Exception { if (manager == null) throw new IllegalArgumentException("Null manager"); if (classes == null && expr == null) throw new IllegalArgumentException("Neither classes nor expr set"); if (classes != null && expr != null) throw new IllegalArgumentException("Cannot set both classes and expr"); if (interfaces == null && mixins == null) throw new IllegalArgumentException("Neither interfaces nor mixins set"); if (name == null) name = GUID.asString(); String[] intfs = (interfaces != null) ? interfaces.toArray(new String[interfaces.size()]) : null; InterfaceIntroduction introduction = null; if (classes != null) { introduction = new InterfaceIntroduction(name, classes, intfs); } else { ASTStart start = new TypeExpressionParser(new StringReader(expr)).Start(); introduction = new InterfaceIntroduction(name, start, intfs); } if (mixins != null) { for (MixinEntry entry : mixins) { if (entry.getInterfaces() == null) throw new IllegalArgumentException("MixinEntry with null interfaces"); if (entry.getMixin() == null) throw new IllegalArgumentException("MixinEntry with null mixin"); String[] intfaces = entry.getInterfaces().toArray(new String[entry.getInterfaces().size()]); introduction.addMixin(new InterfaceIntroduction.Mixin(entry.getMixin(), intfaces, entry.getConstruction(), entry.isTransient())); } } manager.addInterfaceIntroduction(introduction); } public void stop() throws Exception { manager.removeInterfaceIntroduction(name); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/TypeDef.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000533610721416203033133 0ustar twernertwerner/* * 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.microcontainer.beans; import org.jboss.aop.AspectManager; import org.jboss.aop.pointcut.Typedef; import org.jboss.aop.pointcut.TypedefExpression; import org.jboss.aop.pointcut.ast.ParseException; /** * Installs a typedef into the underlying aspect manager * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class TypeDef { private AspectManager manager; private String name; private String expr; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getExpr() { return expr; } public void setExpr(String expr) { this.expr = expr; } public void start() { if (manager == null) { throw new IllegalArgumentException("No manager"); } if (name == null || name.length() == 0) { throw new IllegalArgumentException("No name"); } if (expr == null || expr.length() == 0) { throw new IllegalArgumentException("No expr"); } try { Typedef typedef = new TypedefExpression(name, expr); manager.addTypedef(typedef); } catch(ParseException e) { throw new IllegalArgumentException(""); } catch(Exception e) { throw new RuntimeException(e); } } public void stop() { manager.removeTypedef(name); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ArrayBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000744311021255066033136 0ustar twernertwerner/* * 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.microcontainer.beans; import java.util.ArrayList; import java.util.List; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.InterceptorFactory; import org.jboss.aop.array.Type; import org.jboss.logging.Logger; import org.jboss.util.id.GUID; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ArrayBinding implements Binding { private static final Logger log = Logger.getLogger(ArrayBinding.class); AspectManager manager; String name; String type; List advices; public AspectManager getManager() { return manager; } public void setManager(AspectManager manager) { this.manager = manager; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getType() { return type; } public void setType(String type) { this.type = type; } public List getAdvices() { return advices; } public void setAdvices(List advices) { this.advices = advices; } public void start() throws Exception { if (manager == null) { throw new IllegalArgumentException("Null manager"); } if (type == null) { throw new IllegalArgumentException("Null type"); } if (name == null) { name = GUID.asString(); } Type theType = Type.valueOf(type); ArrayList interceptors = null; if (advices != null) { interceptors = new ArrayList(); for (BindingEntry entry : advices) { entry.start(); InterceptorFactory[] factories = entry.getInterceptorFactories(); for (InterceptorFactory ifac : factories) { interceptors.add(ifac); } } } InterceptorFactory[] facs = interceptors != null ? interceptors.toArray(new InterceptorFactory[interceptors.size()]) : new InterceptorFactory[0]; org.jboss.aop.array.ArrayBinding binding = new org.jboss.aop.array.ArrayBinding(name, facs, theType); manager.addArrayBinding(binding); log.debug("Bound array binding " + name); } public void stop() throws Exception { manager.removeArrayBinding(name); if (advices != null) { for (BindingEntry entry : advices) { entry.stop(); } } } public void uninstall() throws Exception { stop(); } public void rebind() throws Exception { stop(); start(); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/beans/ManagedAspectDefinition.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/be0000644000175000017500000000434611262401357033140 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.beans; import org.jboss.aop.advice.AspectDefinition; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.advice.Scope; /** * * @author Kabir Khan * @version $Revision: 94372 $ */ public class ManagedAspectDefinition extends AspectDefinition { private String dependentAspectName; public ManagedAspectDefinition() { super(); } public ManagedAspectDefinition(String name, Scope scope, AspectFactory factory) { this(name, scope, factory, null, true); } public ManagedAspectDefinition(String name, Scope scope, AspectFactory factory, String dependentAdviceName, boolean deployed) { super(name, scope, factory); super.deployed = deployed; this.dependentAspectName = dependentAdviceName; } public void setDeployed(boolean deployed) { this.deployed = true; } public String getDependentAspectName() { return dependentAspectName; } @Override public int hashCode() { //super class hashcode is what we want return super.hashCode(); } @Override public boolean equals(Object obj) { //super class equals is what we want return super.equals(obj); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000755000175000017500000000000011620312207033135 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/AbstractIntroduction.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000654111262401357033154 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.aspects; import java.lang.annotation.Annotation; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Abstract helper class for [Aspect]Introduction. * * @param the annotation type * @author Ales Justin */ public abstract class AbstractIntroduction implements Interceptor { public String getName() { return getClass().getName(); } protected abstract Class getBindingAnnotation(); protected boolean isBindingInfoPresent(Invocation invocation) { return invocation.resolveClassAnnotation(getBindingAnnotation()) != null; } protected T resolveBindingInfo(Invocation invocation) { Class bindingClass = getBindingAnnotation(); Object bindingInfo = invocation.resolveClassAnnotation(bindingClass); return bindingClass.cast(bindingInfo); } protected void onRegistration(Invocation invocation, KernelControllerContext context) { onRegistration(context, resolveBindingInfo(invocation)); } protected void onRegistration(KernelControllerContext context, T annotation) { } protected void onUnregistration(Invocation invocation, KernelControllerContext context) { onUnregistration(context, resolveBindingInfo(invocation)); } protected void onUnregistration(KernelControllerContext context, T annotation) { } public Object invoke(Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation == false) throw new IllegalStateException("Invocation is not an instance of MethodInvocation: " + invocation); MethodInvocation mi = (MethodInvocation) invocation; KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0]; String methodName = mi.getMethod().getName(); boolean infoPresent = isBindingInfoPresent(invocation); if ("setKernelControllerContext".equals(methodName) && infoPresent) { onRegistration(invocation, context); } else if (infoPresent) { onUnregistration(invocation, context); } return null; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/util/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000755000175000017500000000000011620312207033135 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/util/ProxyUtils.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000305610602523533033150 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.microcontainer.aspects.util; import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory; /** * AOP proxy utils. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class ProxyUtils { /** * Create a proxy * * @param the expected type * @param target the target * @param interfaceClass the interface class * @return the proxy */ public static T createProxy(T target, Class interfaceClass) { return GeneratedAOPProxyFactory.createProxy(target, interfaceClass); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jmx/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000755000175000017500000000000011620312207033135 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jmx/JMX.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000444011040631223033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.aspects.jmx; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * A temporary home for this annotation interface * * @author Kabir Khan * @author Brian Stansberry * * @version $Revision: 76021 $ */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) public @interface JMX { /** * The mbean interface the annotated object should expose. Ignored if * {@link #registerDirectly()} is true. * * @return the mbean interface */ Class exposedInterface(); /** * String form of the ObjectName for the mbean. * * @return the object name */ String name() default ""; /** * Should the annotated object itself be directly registered with * the MBeanServer, or should a javax.management.StandardMBean * be created using the object and the * {@link #exposedInterface() exposed interface}? * * @return true if the object should be registered directly, * false if a StandardMBean should be created. */ boolean registerDirectly() default false; } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jmx/JMXIntroduction.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000767411262401357033164 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.aspects.jmx; import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.StandardMBean; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; /** * A JMXIntroduction. * * @TODO This is a very stupid implementation. It should be based on * annotations but they are not there yet, either in the integration * or even the basic xml parsing. * @author Adrian Brock * @version $Revision: 94372 $ * @deprecated Should use JMXLifecycleCallback instead */ public class JMXIntroduction implements Interceptor { private static final Logger log = Logger.getLogger(JMXIntroduction.class); private MBeanServer server; public String getName() { return getClass().getName(); } public void setMbeanServer(MBeanServer server) { this.server = server; } @SuppressWarnings("unchecked") public Object invoke(Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation == false) throw new IllegalStateException("Invocation is not an instance of MethodInvocation: " + invocation); MethodInvocation mi = (MethodInvocation) invocation; KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0]; JMX jmx = (JMX)invocation.resolveClassAnnotation(JMX.class); ObjectName objectName = null; if (jmx != null) { String jmxName = jmx.name(); if (jmxName != null && jmxName.length() > 0) objectName = new ObjectName(jmxName); } if (objectName == null) { // try to build one from the bean name String name = (String) context.getName(); if (name.contains(":")) { objectName = new ObjectName(name); } else { objectName = new ObjectName("test:name='" + name + "'"); } } if (server == null) { throw new RuntimeException("No MBeanServer was injected"); } if ("setKernelControllerContext".equals(mi.getMethod().getName())) { Class intfClass = null; boolean registerDirectly = false; if (jmx != null) { intfClass = jmx.exposedInterface(); registerDirectly = jmx.registerDirectly(); } Object mbean = (registerDirectly ? context.getTarget() : new StandardMBean(context.getTarget(), intfClass)); server.registerMBean(mbean, objectName); log.info("Registered MBean " + objectName); } else { log.info("Unregistering MBean " + objectName); server.unregisterMBean(objectName); } return null; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jmx/JMXObjectName.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000263311114756640033156 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.aspects.jmx; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark getter as ObjectName creator. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) public @interface JMXObjectName { }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jmx/JMXLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000745410741763423033166 0ustar twernertwerner/* * 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.microcontainer.aspects.jmx; import javax.management.MBeanServer; import javax.management.ObjectName; import javax.management.StandardMBean; import org.jboss.dependency.spi.ControllerContext; import org.jboss.logging.Logger; import org.jboss.metadata.spi.MetaData; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class JMXLifecycleCallback { private static final Logger log = Logger.getLogger(JMXLifecycleCallback.class); private MBeanServer server; public void setMbeanServer(MBeanServer server) { this.server = server; } @SuppressWarnings("unchecked") public void install(ControllerContext context) throws Exception { validateServer(); JMX jmx = readJmxAnnotation(context); ObjectName objectName = createObjectName(context, jmx); Class intfClass = null; boolean registerDirectly = false; if (jmx != null) { intfClass = jmx.exposedInterface(); registerDirectly = jmx.registerDirectly(); } Object mbean = (registerDirectly ? context.getTarget() : new StandardMBean(context.getTarget(), intfClass)); server.registerMBean(mbean, objectName); log.debug("Registered MBean " + objectName); } public void uninstall(ControllerContext context) throws Exception { validateServer(); JMX jmx = readJmxAnnotation(context); ObjectName objectName = createObjectName(context, jmx); log.debug("Unregistering MBean " + objectName); server.unregisterMBean(objectName); } private void validateServer() { if (server == null) { throw new RuntimeException("No MBeanServer was injected"); } } private JMX readJmxAnnotation(ControllerContext context) throws Exception { MetaData metaData = context.getScopeInfo().getMetaData(); if (metaData != null) return metaData.getAnnotation(JMX.class); return null; } private ObjectName createObjectName(ControllerContext context, JMX jmx) throws Exception { ObjectName objectName = null; if (jmx != null) { String jmxName = jmx.name(); if (jmxName != null && jmxName.length() > 0) objectName = new ObjectName(jmxName); } if (objectName == null) { // try to build one from the bean name String name = (String) context.getName(); if (name.contains(":")) { objectName = new ObjectName(name); } else { objectName = new ObjectName("test:name='" + name + "'"); } } return objectName; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000755000175000017500000000000011620312207033135 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiIntroduction.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000001144511262401357033153 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.microcontainer.aspects.jndi; import java.io.Serializable; import java.util.Properties; import javax.naming.InitialContext; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.util.naming.Util; /** * A JNDI binding aspect that creates bindings on interception of the kernel setKernelControllerContext * callback, and removes them on any other method. The expectation is that this is applied to the * org.jboss.kernel.spi.dependency.KernelControllerContextAware interface so that unbinding occurs on * the unsetKernelControllerContext method. * * @author Scott.Stark@jboss.org * @version $Revision: 46386 $ * @deprecated Should use JndiLifecycleCallback instead */ public class JndiIntroduction implements Interceptor, Serializable { private static final long serialVersionUID = 1; private static final Logger log = Logger.getLogger(JndiIntroduction.class); private Properties env; public String getName() { return getClass().getName(); } /** * Get the InitialContext properties to use for binding/unbinding * @return the InitialContext ctor env */ public Properties getEnv() { return env; } /** * Set the InitialContext properties to use for binding/unbinding * @param env - the InitialContext ctor env */ public void setEnv(Properties env) { this.env = env; } /** * Bind the target on setKernelControllerContext, unbind on any other method provided that * the invocation has a JndiBinding annotation. */ public Object invoke(Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation == false) throw new IllegalStateException("Invocation is not an instance of MethodInvocation: " + invocation); MethodInvocation mi = (MethodInvocation) invocation; KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0]; boolean trace = log.isTraceEnabled(); JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class); if( trace ) log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo); // If this is the setKernelControllerContext callback, bind the target into jndi if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null) { InitialContext ctx = new InitialContext(env); Object target = context.getTarget(); Util.bind(ctx, bindingInfo.name(), target); if( trace ) log.trace("Bound to: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.bind(ctx, name, target); if( trace ) log.trace("Bound to alias: "+bindingInfo.name()); } } } // If this is the unsetKernelControllerContext callback, unbind the target else if( bindingInfo != null ) { InitialContext ctx = new InitialContext(env); Util.unbind(ctx, bindingInfo.name()); if( trace ) log.trace("Unbound: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.unbind(ctx, name); if( trace ) log.trace("Unbound alias: "+bindingInfo.name()); } } } else if ( trace ) { log.trace("Ignoring null binding info"); } return null; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000000331410602523533033145 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.microcontainer.aspects.jndi; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * An annotation that indicates an object should be bound into JNDI * * @author Scott.Stark@jboss.org * @version $Revision: 46386 $ */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.FIELD}) public @interface JndiBinding { /** * the name under which the binding will be located * * @return the name */ String name() ; /** * Optional additional aliases to also bind * * @return the aliases */ String[] aliases() default {}; } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/aspects/jndi/JndiLifecycleCallback.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/as0000644000175000017500000001475611262401357033163 0ustar twernertwerner/* * 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.microcontainer.aspects.jndi; import java.util.Properties; import javax.naming.InitialContext; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.metadata.spi.MetaData; import org.jboss.util.naming.Util; /** * The jndi lifecycle callback. * This puts the beans marked with @JndiBinding into jndi. * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class JndiLifecycleCallback { private static final Logger log = Logger.getLogger(JndiLifecycleCallback.class); private Properties env; public String getName() { return getClass().getName(); } /** * Get the InitialContext properties to use for binding/unbinding * @return the InitialContext ctor env */ public Properties getEnv() { return env; } /** * Set the InitialContext properties to use for binding/unbinding * @param env - the InitialContext ctor env */ public void setEnv(Properties env) { this.env = env; } /** * Bind the target on setKernelControllerContext, unbind on any other method provided that * the invocation has a JndiBinding annotation. * * @param invocation the invocation * @return the result * @throws Throwable for any error */ public Object invoke(Invocation invocation) throws Throwable { if (invocation instanceof MethodInvocation == false) throw new IllegalStateException("Invocation is not an instance of MethodInvocation: " + invocation); MethodInvocation mi = (MethodInvocation) invocation; KernelControllerContext context = (KernelControllerContext) mi.getArguments()[0]; boolean trace = log.isTraceEnabled(); JndiBinding bindingInfo = (JndiBinding) invocation.resolveClassAnnotation(JndiBinding.class); if( trace ) log.trace("Checking method: "+mi.getMethod()+", bindingInfo: "+bindingInfo); // If this is the setKernelControllerContext callback, bind the target into jndi if ("setKernelControllerContext".equals(mi.getMethod().getName()) && bindingInfo != null) { InitialContext ctx = new InitialContext(env); Object target = context.getTarget(); Util.bind(ctx, bindingInfo.name(), target); if( trace ) log.trace("Bound to: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.bind(ctx, name, target); if( trace ) log.trace("Bound to alias: "+bindingInfo.name()); } } } // If this is the unsetKernelControllerContext callback, unbind the target else if( bindingInfo != null ) { InitialContext ctx = new InitialContext(env); Util.unbind(ctx, bindingInfo.name()); if( trace ) log.trace("Unbound: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.unbind(ctx, name); if( trace ) log.trace("Unbound alias: "+bindingInfo.name()); } } } else if ( trace ) { log.trace("Ignoring null binding info"); } return null; } public void install(ControllerContext context) throws Exception { JndiBinding bindingInfo = readJndiAnnotation(context); boolean trace = log.isTraceEnabled(); if( trace ) log.trace("Binding into JNDI: " + context.getName() + ", bindingInfo: " + bindingInfo); // If this is the setKernelControllerContext callback, bind the target into jndi InitialContext ctx = new InitialContext(env); Object target = context.getTarget(); Util.bind(ctx, bindingInfo.name(), target); if( trace ) log.trace("Bound to: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.bind(ctx, name, target); if( trace ) log.trace("Bound to alias: "+bindingInfo.name()); } } } public void uninstall(ControllerContext context) throws Exception { JndiBinding bindingInfo = readJndiAnnotation(context); boolean trace = log.isTraceEnabled(); InitialContext ctx = new InitialContext(env); Util.unbind(ctx, bindingInfo.name()); if( trace ) log.trace("Unbound: "+bindingInfo.name()); String[] aliases = bindingInfo.aliases(); if( aliases != null ) { for(String name : aliases) { Util.unbind(ctx, name); if( trace ) log.trace("Unbound alias: "+bindingInfo.name()); } } } private JndiBinding readJndiAnnotation(ControllerContext context) { MetaData metaData = context.getScopeInfo().getMetaData(); if (metaData != null) return metaData.getAnnotation(JndiBinding.class); return null; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000755000175000017500000000000011620312210033132 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/LifecycleAspectDependencyBuilderListItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000652110764007431033156 0ustar twernertwerner/* * 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.microcontainer.integration; import java.util.List; import org.jboss.dependency.plugins.AbstractLifecycleCallbackItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.LifecycleCallbackItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ class LifecycleAspectDependencyBuilderListItem extends AspectDependencyBuilderListItem { ControllerState state; String installMethod; String uninstallMethod; LifecycleAspectDependencyBuilderListItem(String beanName, ControllerState state, String installMethod, String uninstallMethod) { super(beanName); this.state = state; this.installMethod = installMethod; this.uninstallMethod = uninstallMethod; } public boolean equals(Object o) { if (super.equals(o)) { if (o instanceof LifecycleAspectDependencyBuilderListItem) { return state.equals(((LifecycleAspectDependencyBuilderListItem)o).state); } } return false; } public int hashCode() { return dependencyName.hashCode(); } @Override public void addDependency(KernelControllerContext context) { AbstractLifecycleCallbackItem callback = new AbstractLifecycleCallbackItem(dependencyName, state, ControllerState.INSTALLED, installMethod, uninstallMethod); DependencyInfo di = context.getDependencyInfo(); di.addLifecycleCallback(callback); super.addDependency(context); } @Override public void removeDependency(KernelControllerContext context) { DependencyInfo di = context.getDependencyInfo(); List items = di.getLifecycleCallbacks(); for (int i = 0 ; i < items.size(); i++) { try { if (items.get(i).getBean().equals(dependencyName)) { items.remove(i); } } catch (RuntimeException e) { log.warn("Problem uninstalling dependency " + dependencyName + " for " + context, e); } } super.removeDependency(context); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AOPJoinpointFactoryBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000277110540110763033154 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.integration; import org.jboss.joinpoint.spi.JoinpointFactory; import org.jboss.joinpoint.spi.JoinpointFactoryBuilder; import org.jboss.reflect.spi.ClassInfo; /** * AOPJoinpointFactoryBuilder. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class AOPJoinpointFactoryBuilder implements JoinpointFactoryBuilder { public JoinpointFactory createJoinpointFactory(ClassInfo classInfo) { return new AOPJoinpointFactory(classInfo); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AOPConstructorJoinpoint.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000002551011301242575033153 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.integration; import java.lang.annotation.Annotation; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; import org.jboss.aop.Advisor; import org.jboss.aop.AspectManager; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.ConstructorInvocation; import org.jboss.aop.microcontainer.annotations.DisabledType; import org.jboss.aop.microcontainer.beans.AspectManagerFactory; import org.jboss.aop.proxy.container.AOPProxyFactory; import org.jboss.aop.proxy.container.AOPProxyFactoryParameters; import org.jboss.aop.proxy.container.ContainerCache; import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory; import org.jboss.joinpoint.plugins.BasicConstructorJoinPoint; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.CommonLevelsUtil; import org.jboss.metadata.spi.scope.ScopeLevel; import org.jboss.metadata.spi.signature.DeclaredMethodSignature; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ConstructorInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; /** * An AOPConstructorJoinpoint. * * @TODO This is not correct if the target is already advised * there is no need for the proxy advisor. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 96564 $ */ public class AOPConstructorJoinpoint extends BasicConstructorJoinPoint { private static final List levels; private AOPProxyFactory proxyFactory = new GeneratedAOPProxyFactory(); private MetaData metaData; static { // get all sub INSTANCE levels levels = new ArrayList(CommonLevelsUtil.getSubLevels(CommonLevels.INSTANCE)); // remove class joinpoint, we're only interested in instance/joinpoint_override levels.remove(CommonLevels.JOINPOINT); } /** * Create a new AOPConstructorJoinpoint. * * @param constructorInfo the constructor info * @param metaData the metaData */ public AOPConstructorJoinpoint(ConstructorInfo constructorInfo, Object metaData) { super(constructorInfo); if (metaData == null) throw new IllegalArgumentException("Null metaData"); if (metaData instanceof MetaData == false) throw new IllegalArgumentException(metaData + " is not metadata"); this.metaData = MetaData.class.cast(metaData); } /** * Should we bypass AOP. * * @param metaData the metadata instance * @return true if we should bypass aop, false otherwise */ protected boolean bypassAOP(MetaData metaData) { return DisableAOPHelper.isAOPDisabled(metaData, DisabledType.POINTCUTS); } @SuppressWarnings("deprecation") public Object dispatch() throws Throwable { if (bypassAOP(metaData)) { return super.dispatch(); } Class clazz = constructorInfo.getDeclaringClass().getType(); AspectManager manager = AspectManagerFactory.getAspectManager(metaData); boolean hasInstanceMetaData = rootHasSubInstanceMetaData(metaData); ContainerCache cache = ContainerCache.initialise(manager, clazz, metaData, hasInstanceMetaData); AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); Object target = createTarget(cache, params); params.setProxiedClass(target.getClass()); params.setMetaData(metaData); params.setTarget(target); params.setContainerCache(cache); params.setMetaDataHasInstanceLevelData(hasInstanceMetaData); return proxyFactory.createAdvisedProxy(params); } /** * Check for metadata at INSTANCE level and below. * * @param metaData the metadata * @return true if there is some metadata that needs to be considered */ private boolean rootHasSubInstanceMetaData(MetaData metaData) { if (metaData == null) { return false; } if (checkForMetaDataAtSubInstanceLevel(metaData)) { return true; } //Check for method annotations return rootHasMethodWithSubInstanceMetaData(metaData); } /** * Check for metadata at INSTANCE level and below for methods. * * @param metaData the metadata * @return true if there is some metadata that needs to be considered */ private boolean rootHasMethodWithSubInstanceMetaData(MetaData metaData) { //Check for method annotations ClassInfo info = constructorInfo.getDeclaringClass(); while (info != null) { MethodInfo[] methods = info.getDeclaredMethods(); if (methods != null) { for (MethodInfo mi : methods) { if (methodHasSubInstanceMetaData(metaData, mi)) { return true; } } } info = info.getSuperclass(); } return false; } /** * Check for metadata at INSTANCE level and below for methods. * * @param metaData the metadata * @param mi the method to check * @return true if there is some metadata that needs to be considered */ private boolean methodHasSubInstanceMetaData(MetaData metaData, MethodInfo mi) { DeclaredMethodSignature sig = new DeclaredMethodSignature(mi); MetaData methodMD = metaData.getComponentMetaData(sig); if (checkForMetaDataAtSubInstanceLevel(methodMD)) { return true; } return false; } /** * Check for metadata at INSTANCE level and below. * * @param metaData the metadata * @return true if there is some metadata that needs to be considered */ private boolean checkForMetaDataAtSubInstanceLevel(MetaData metaData) { if (metaData != null) { for (ScopeLevel level : levels) { if (hasMetaDataAtLevel(metaData, level)) return true; } } return false; } /** * Check for metadata at level param. * * @param metaData the metadata * @param level the scope level * @return true if there is some metadata that needs to be considered */ protected boolean hasMetaDataAtLevel(MetaData metaData, ScopeLevel level) { MetaData levelMetaData = metaData.getScopeMetaData(level); if (levelMetaData != null && levelMetaData.isEmpty() == false) { Object[] allMetaData = levelMetaData.getMetaData(); Annotation[] annotations = levelMetaData.getAnnotations(); // all meta data is not null, since level metadata is not empty int allSize = allMetaData.length; int annotationsSize = annotations != null ? annotations.length : 0; // do we have something else than annotations if (allSize > annotationsSize) { return true; } else if (annotationsSize > 0) { return true; } } return false; } /** * Create the target. * * @param cache the cache * @param params the parameters * @return target instance * @throws Throwable for any error */ private Object createTarget(ContainerCache cache, AOPProxyFactoryParameters params) throws Throwable { Advisor advisor = cache.getAdvisor(); if (advisor != null) { org.jboss.aop.ConstructorInfo aopinfo = findAopConstructorInfo(advisor); Interceptor[] interceptors = (aopinfo != null) ? aopinfo.getInterceptors() : null; if (interceptors != null) { ConstructorInvocation inv = new ConstructorInvocation(aopinfo, aopinfo.getInterceptors()); inv.setArguments(getArguments()); return inv.invokeNext(); } if (getConstructorInfo().getParameterTypes().length > 0) { Constructor constructor = null; if (aopinfo == null) { //Fall back to using the class; Class clazz = advisor.getClazz(); Constructor[] ctors = clazz.getConstructors(); for (Constructor ctor : ctors) { if (matchConstructor(ctor)) { constructor = ctor; break; } } if (constructor == null) throw new IllegalStateException("Could not find constructor"); } else { constructor = aopinfo.getConstructor(); } params.setCtor(constructor.getParameterTypes(), getArguments()); } } return super.dispatch(); } /** * Find constructor info. * * @param advisor the advisor * @return matched constructor or null if no match */ private org.jboss.aop.ConstructorInfo findAopConstructorInfo(Advisor advisor) { org.jboss.aop.ConstructorInfo[] infos = advisor.getConstructorInfos(); for (int i = 0 ; i < infos.length ; i++) { if (matchConstructor(infos[i].getConstructor())) { return infos[i]; } } return null; } /** * Match constructor. * * @param ctor the constructor * @return true if we have a match */ private boolean matchConstructor(Constructor ctor) { TypeInfo[] params = constructorInfo.getParameterTypes(); Class[] ctorParams = ctor.getParameterTypes(); if (params.length == ctorParams.length) { boolean match = true; for (int p = 0 ; p < params.length ; p++) { if (!params[p].getName().equals(ctorParams[p].getName())) { match = false; break; } } if (match) { return true; } } return false; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/DisableAOPHelper.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000444211205232155033150 0ustar twernertwerner/* * 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.aop.microcontainer.integration; import org.jboss.aop.microcontainer.annotations.DisableAOP; import org.jboss.aop.microcontainer.annotations.DisabledType; import org.jboss.metadata.spi.MetaData; /** * Diable AOP helper. * * @author Ales Justin */ public final class DisableAOPHelper { /** * Is AOP disabled for this metadata instance. * * @param metaData the metadata instance * @return true if AOP is disabled, false otherwise * @deprecated use the method with a constraint */ @Deprecated public static boolean isAOPDisabled(MetaData metaData) { return isAOPDisabled(metaData, DisabledType.ALL); } /** * Is AOP disabled for this metadata instance. * * @param metaData the metadata instance * @param constraint the constraint * @return true if AOP is disabled, false otherwise */ public static boolean isAOPDisabled(MetaData metaData, DisabledType constraint) { if (metaData != null) { DisableAOP aop = metaData.getAnnotation(DisableAOP.class); if (aop != null) return DisabledType.isDisabled(aop.value(), constraint); } return false; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AnnotationDependencyBuilderListItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000252710577523320033162 0ustar twernertwerner/* * 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.microcontainer.integration; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ class AnnotationDependencyBuilderListItem extends AspectDependencyBuilderListItem { AnnotationDependencyBuilderListItem(String name) { super(name); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AspectDependencyBuilderListItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000665210764757674033210 0ustar twernertwerner/* * 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.microcontainer.integration; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.spi.dependency.DependencyBuilderListItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ class AspectDependencyBuilderListItem implements DependencyBuilderListItem { protected static Logger log = Logger.getLogger(AspectDependencyBuilderListItem.class); /** * The name of our dependency */ protected String dependencyName; AspectDependencyBuilderListItem(String name) { this.dependencyName = name; } public void addDependency(KernelControllerContext context) { BeanMetaData metaData = context.getBeanMetaData(); DependencyItem dependencyItem = new AbstractDependencyItem(metaData.getName(), dependencyName, ControllerState.INSTANTIATED, ControllerState.INSTALLED); DependencyInfo depends = context.getDependencyInfo(); depends.addIDependOn(dependencyItem); } public void removeDependency(KernelControllerContext context) { DependencyInfo depends = context.getDependencyInfo(); Set items = depends.getIDependOn(null); if (items.size() > 0) { for (DependencyItem item : items) { try { Object iDependOn = item.getIDependOn(); if (iDependOn != null && iDependOn.equals(dependencyName)) { depends.removeIDependOn(item); } } catch (RuntimeException e) { log.warn("Problem uninstalling dependency " + dependencyName + " for " + context, e); } } } } public boolean equals(Object o) { if (o instanceof AspectDependencyBuilderListItem) { return dependencyName.equals(((AspectDependencyBuilderListItem)o).dependencyName); } return false; } public int hashCode() { return dependencyName.hashCode(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AOPJoinpointFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000000433111042323200033134 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.integration; import org.jboss.joinpoint.plugins.BasicJoinpointFactory; import org.jboss.joinpoint.spi.ConstructorJoinpoint; import org.jboss.joinpoint.spi.JoinpointException; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ConstructorInfo; /** * The existence of this class is the signal to the kernel that we want to use the aop-mc integration. * When deployed in jboss the AOPConstructorJoinpoint will be deployed as part of the AspectDeployer, * so we use "normal" constructor joinpoints until that has been deployed * * @author Kabir Khan * @author Adrian Brock * @version $Revision: 76224 $ */ public class AOPJoinpointFactory extends BasicJoinpointFactory { /** * Create a new AOPJoinpointFactory. * * @param classInfo */ public AOPJoinpointFactory(ClassInfo classInfo) { super(classInfo); } public ConstructorJoinpoint getConstructorJoinpoint(ConstructorInfo constructorInfo, Object metaData) throws JoinpointException { if (metaData == null) return super.getConstructorJoinpoint(constructorInfo); return new AOPConstructorJoinpoint(constructorInfo, metaData); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/integration/AOPDependencyBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/in0000644000175000017500000003600711262401357033157 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.integration; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Map.Entry; import org.jboss.aop.Advisor; import org.jboss.aop.AspectManager; import org.jboss.aop.ReflectiveAspectBinder; import org.jboss.aop.advice.AspectDefinition; import org.jboss.aop.microcontainer.beans.AspectManagerFactory; import org.jboss.aop.microcontainer.beans.ManagedAspectDefinition; import org.jboss.aop.microcontainer.lifecycle.LifecycleCallbackDefinition; import org.jboss.aop.microcontainer.annotations.DisabledType; import org.jboss.aop.proxy.container.ContainerCache; import org.jboss.aop.util.Advisable; import org.jboss.aop.util.ClassInfoMethodHashing; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.api.annotations.Dependency; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.DependencyBuilderListItem; import org.jboss.kernel.spi.dependency.helpers.AbstractDependencyBuilder; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.signature.MethodSignature; import org.jboss.reflect.plugins.AnnotationValueFactory; import org.jboss.reflect.plugins.introspection.IntrospectionAnnotationHelper; import org.jboss.reflect.spi.AnnotationInfo; import org.jboss.reflect.spi.AnnotationValue; import org.jboss.reflect.spi.ArrayInfo; import org.jboss.reflect.spi.ArrayValue; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.StringValue; import org.jboss.reflect.spi.TypeInfo; import org.jboss.reflect.spi.Value; /** * Finds all managed aspects that apply * to the bean and includes their dependencies as dependencies of the bean * * @author Kabir Khan * @author Adrian Brock * @author Ales Justin * @version $Revision: 94372 $ */ public class AOPDependencyBuilder extends AbstractDependencyBuilder { private static final String DEPENDENCY_CLASS_NAME = Dependency.class.getName(); private static final String DEPENDENCY_NAME_ATTRIBUTE = "name"; private static final IntrospectionAnnotationHelper helper = new IntrospectionAnnotationHelper(); /** * Should we bypass AOP. * * @param beanInfo the bean info * @param metaData the metadata instance * @param disabledType The type we want to check if is disabled * @return true if we should bypass aop, false otherwise */ protected boolean bypassAOP(BeanInfo beanInfo, MetaData metaData, DisabledType disabledType) { return DisableAOPHelper.isAOPDisabled(metaData, disabledType); } @SuppressWarnings({"unchecked", "deprecation"}) @Override public List getDependencies(BeanInfo beanInfo, MetaData metaData) { if (bypassAOP(beanInfo, metaData, DisabledType.ALL)) { return super.getDependencies(beanInfo, metaData); } AspectManager manager = AspectManagerFactory.getAspectManager(metaData); try { ClassInfo classInfo = beanInfo.getClassInfo(); String className = classInfo.getName(); if (className != null) { ClassLoader loader = classInfo.getType().getClassLoader(); if (loader == null) { loader = Thread.currentThread().getContextClassLoader(); } Class clazz = loader.loadClass(className); Advisor advisor; synchronized (ContainerCache.mapLock) { ContainerCache cache = ContainerCache.initialise(manager, clazz, metaData, true); advisor = cache.getAdvisor(); } ReflectiveAspectBinder binder = new ReflectiveAspectBinder(clazz, advisor); ArrayList depends = new ArrayList(); if (bypassAOP(beanInfo, metaData, DisabledType.POINTCUTS) == false) { Set aspects = binder.getAspects(); if (aspects != null && aspects.size() > 0) { Iterator it = aspects.iterator(); while (it.hasNext()) { AspectDefinition def = (AspectDefinition) it.next(); if (def instanceof ManagedAspectDefinition) { String name = ((ManagedAspectDefinition)def).getDependentAspectName(); if (name != null) { depends.add(new AspectDependencyBuilderListItem(name)); } } } } } if (bypassAOP(beanInfo, metaData, DisabledType.LIFECYCLE) == false) { Map> lifecycleCallbacks = binder.getLifecycleCallbacks(); if (lifecycleCallbacks != null && lifecycleCallbacks.size() > 0) { for (Entry> states : lifecycleCallbacks.entrySet()) { for (LifecycleCallbackDefinition callback : states.getValue()) { depends.add(new LifecycleAspectDependencyBuilderListItem( callback.getBean(), (ControllerState)states.getKey(), callback.getInstallMethod(), callback.getUninstallMethod())); } } } } HashSet annotationDependencies = getAnnotationDependencies(classInfo, metaData); for (String dependency : annotationDependencies) { depends.add(new AnnotationDependencyBuilderListItem(dependency)); } return depends; } return null; } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } private HashSet getAnnotationDependencies(ClassInfo classInfo, MetaData metaData) { try { HashSet dependencies = new LinkedHashSet(); getClassAnnotationDependencies(classInfo, metaData, dependencies); getMethodAnnotationDependencies(classInfo, metaData, dependencies); return dependencies; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } } private void getClassAnnotationDependencies(ClassInfo classInfo, MetaData metaData, HashSet dependencies) throws Exception { HashMap> realMap = new LinkedHashMap>(); getRealClassAnnotationDependencies(classInfo, realMap); HashMap> metaMap = new LinkedHashMap>(); getMetaDataClassAnnotationDependencies(metaData, metaMap); addAllDependenciesToSet(dependencies, realMap, metaMap); } private void getRealClassAnnotationDependencies(ClassInfo classInfo, HashMap> dependencies) throws Exception { AnnotationValue[] annotations = classInfo.getAnnotations(); for (int i = 0 ; i < annotations.length ; i++) { getDependenciesForAnnotation(annotations[i].getType().getName(), annotations[i], dependencies); } } private void getMetaDataClassAnnotationDependencies(MetaData metaData, HashMap> dependencies) throws Exception { if (metaData != null) { for (Object annotation : metaData.getAnnotations()) { getDependenciesForMetaDataAnnotation(annotation, dependencies); } } } @SuppressWarnings("unchecked") private void getMethodAnnotationDependencies(ClassInfo classInfo, MetaData metaData, HashSet dependencies) throws Exception { Map methodMap = ClassInfoMethodHashing.getMethodMap(classInfo); if (methodMap != null) { for (Iterator it = methodMap.values().iterator() ; it.hasNext() ; ) { MethodInfo method = (MethodInfo)it.next(); if (Advisable.isAdvisableMethod(method.getModifiers(), method.getName())) { HashMap> classMap = new LinkedHashMap>(); getRealMethodAnnotationDependencies(method, classMap); HashMap> overrideMap = new LinkedHashMap>(); getMetaDataMethodAnnotationDependencies(method, metaData, overrideMap); addAllDependenciesToSet(dependencies, classMap, overrideMap); } } } } private void getRealMethodAnnotationDependencies(MethodInfo methodInfo, HashMap> dependencies) throws Exception { AnnotationValue[] annotations = methodInfo.getAnnotations(); if (annotations != null) { for (int i = 0 ; i < annotations.length ; i++) { getDependenciesForAnnotation(annotations[i].getType().getName(), annotations[i], dependencies); } } } private void getMetaDataMethodAnnotationDependencies(MethodInfo method, MetaData metaData, HashMap> dependencies) throws Exception { if (metaData != null) { MetaData methodMetaData = metaData.getComponentMetaData(new MethodSignature(method)); if (methodMetaData != null) { for (Object annotation : methodMetaData.getAnnotations()) { getDependenciesForMetaDataAnnotation(annotation, dependencies); } } } } private void getDependenciesForMetaDataAnnotation(Object annotation, HashMap> dependencies) throws Exception { AnnotationInfo info; Class clazz = annotation.getClass().getInterfaces()[0]; try { info = (AnnotationInfo)helper.getTypeInfo(clazz); } catch (RuntimeException e) { // AutoGenerated throw new RuntimeException("Error creating annotation for " + clazz.getName(), e); } AnnotationValue value = AnnotationValueFactory.createAnnotationValue(helper, helper, info, annotation); getDependenciesForAnnotation(info.getName(), value, dependencies); } private void getDependenciesForAnnotation(String topLevelAnnotationName, AnnotationValue annotation, HashMap> dependencies) { if (annotation != null) { addAnnotationAttributeDependencies(topLevelAnnotationName, annotation, dependencies); AnnotationValue[] annotationAnnotations = annotation.getAnnotationType().getAnnotations(); for (int i = 0 ; i < annotationAnnotations.length ; i++) { if (annotationAnnotations[i].getAnnotationType().getName().equals(DEPENDENCY_CLASS_NAME)) { StringValue value = (StringValue)annotationAnnotations[i].getValue(DEPENDENCY_NAME_ATTRIBUTE); StringValue dependency = (StringValue)annotation.getValue(value.getValue()); addDependency(topLevelAnnotationName, dependency, dependencies); } } } } private void addAnnotationAttributeDependencies(String topLevelAnnotationName, AnnotationValue annotation, HashMap> dependencies) { MethodInfo[] attributes = annotation.getAnnotationType().getDeclaredMethods(); if (attributes != null) { for (int i = 0 ; i < attributes.length ; i++) { Value value = annotation.getValue(attributes[i].getName()); if (value instanceof AnnotationValue) { getDependenciesForAnnotation(topLevelAnnotationName, (AnnotationValue)value, dependencies); } else if (value instanceof ArrayValue) { ArrayValue arrVal = (ArrayValue)value; TypeInfo type = ((ArrayInfo)arrVal.getType()).getComponentType(); if (type instanceof AnnotationInfo) { Value[] values = arrVal.getValues(); for (int j = 0 ; j < values.length ; j++) { getDependenciesForAnnotation(topLevelAnnotationName, (AnnotationValue)values[j], dependencies); } } } } } } private void addDependency(String topLevelAnnotationName, StringValue dependency, HashMap> dependencies) { ArrayList list = dependencies.get(topLevelAnnotationName); if (list == null) { list = new ArrayList(); dependencies.put(topLevelAnnotationName, list); } list.add(dependency.getValue()); } private void addAllDependenciesToSet(HashSet dependencies, HashMap> classMap, HashMap> overrideMap) { HashMap> dependencyMap = mergeClassAndOverrideMaps(classMap, overrideMap); if (dependencyMap.size() > 0) { for (ArrayList deps : dependencyMap.values()) { dependencies.addAll(deps); } } } private HashMap> mergeClassAndOverrideMaps(HashMap> classMap, HashMap> overrideMap) { if (classMap.size() == 0 && overrideMap.size() == 0) { return classMap; } if (classMap.size() > 0 && overrideMap.size() == 0) { return classMap; } if (classMap.size() == 0 && overrideMap.size() > 0) { return overrideMap; } for (Entry> entry : overrideMap.entrySet()) { classMap.put(entry.getKey(), entry.getValue()); } return classMap; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/an0000755000175000017500000000000011620312211033123 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/annotations/DisableAOP.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/an0000644000175000017500000000331611205232155033137 0ustar twernertwerner/* * 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.microcontainer.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Disable AOP check per class or instance. * * @author Kabir Khan * @author Ales Justin * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD}) public @interface DisableAOP { /** * The disabled types. * * @return the disabled types */ DisabledType[] value() default {DisabledType.ALL}; } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/annotations/DisabledType.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/an0000644000175000017500000000543111216157032033141 0ustar twernertwerner/* * 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.aop.microcontainer.annotations; import java.util.Arrays; import java.util.EnumSet; /** * Fine grained disable type. * e.g. LIFECYCLE only disable aop lifecycle callbacks * * @author Ales Justin */ public enum DisabledType { ALL, LIFECYCLE, POINTCUTS; /** * Is the type disabled for this constraint. * * @param constraint the constraint * @return true if disabled for this constraint */ public boolean isDisabled(DisabledType constraint) { return this == ALL || this == constraint; } /** * Is the type enabled for this constraint. * * @param constraint the constraint * @return true if enabled for this constraint */ public boolean isEnabled(DisabledType constraint) { return isDisabled(constraint) == false; } /** * Do values mark disabled usage. * * @param values the disabled values * @param constraint the constraint * @return true if disabled for this constraint, false otherwise */ public static boolean isDisabled(DisabledType[] values, DisabledType constraint) { if (values == null || values.length == 0) return false; EnumSet set = EnumSet.copyOf(Arrays.asList(values)); return set.contains(ALL) || set.contains(constraint); } /** * Do values mark enabled usage. * * @param values the disabled values * @param constraint the constraint * @return true if enabled for this constraint, false otherwise */ public static boolean isEnabled(DisabledType[] values, DisabledType constraint) { return isDisabled(values, constraint) == false; } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/lazy/libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/la0000755000175000017500000000000011620312207033126 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/lazy/JBossAOPLazyInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/src/main/java/org/jboss/aop/microcontainer/la0000644000175000017500000000572311201770651033145 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.aop.microcontainer.lazy; import java.util.Set; import org.jboss.aop.proxy.container.AOPProxyFactoryParameters; import org.jboss.aop.proxy.container.GeneratedAOPProxyFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.plugins.lazy.AbstractLazyInitializer; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; /** * JBossAOP lazy initializer. * * @author Ales Justin */ public class JBossAOPLazyInitializer extends AbstractLazyInitializer { @SuppressWarnings("deprecation") public Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { return initializeProxy(kernel, bean, exposeClass, interfaces, null); } public Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces, MetaData metaData) throws Throwable { KernelControllerContext context = getKernelControllerContext(kernel, bean); BeanMetaData bmd = context.getBeanMetaData(); KernelConfigurator configurator = kernel.getConfigurator(); ClassLoader cl = Configurator.getClassLoader(bmd); // TODO - add lazy handler AOPProxyFactoryParameters params = new AOPProxyFactoryParameters(); params.setMetaData(metaData); if (exposeClass) { Class beanClass = getBeanClass(context, configurator, cl); params.setProxiedClass(beanClass); } if (interfaces != null && interfaces.isEmpty() == false) { params.setInterfaces(getClasses(configurator, interfaces, cl)); } GeneratedAOPProxyFactory factory = new GeneratedAOPProxyFactory(); return factory.createAdvisedProxy(params); } } libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/running_tests_readme.txt0000644000175000017500000000067610770522647027464 0ustar twernertwernerSince the tests are not run automatically, here is how to run them since i keep forgetting: mvn surefire-report:report -Ptests-no-weave mvn surefire-report:report -Ptests-no-weave-secure mvn surefire-report:report -Pant-tests-weave mvn surefire-report:report -Pant-tests-weave-secure To run one test mvn surefire-report:report -Pant-one-test-weave -Dtest=org.jboss.test.microcontainer.test.DeployersInterceptedAspectManagerJMXTestCase libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/.settings/0000755000175000017500000000000011620312211024364 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/.settings/org.eclipse.jdt.core.prefs0000644000175000017500000000032010674774740031374 0ustar twernertwerner#Fri Sep 21 17:48:46 BST 2007 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 libjboss-microcontainer-java-2.0.10.GA.orig/aop-mc-int/.project0000644000175000017500000000106711301257231024127 0ustar twernertwerner jboss-aop-mc-int JBoss Microcontainer jboss-dependency jboss-kernel org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature libjboss-microcontainer-java-2.0.10.GA.orig/kernel/0000755000175000017500000000000011620312176021774 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/.classpath0000644000175000017500000000114111301257231023750 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/pom.xml0000644000175000017500000000632511375173343023327 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 jboss-kernel jar JBoss Microcontainer Kernel http://www.jboss.com/products/jbossmc JBoss Microcontainer Kernel org.apache.maven.plugins maven-jar-plugin test-jar org.apache.maven.plugins maven-surefire-plugin org.apache.maven.plugins maven-assembly-plugin src/assembly/spi.xml src/assembly/plugins.xml src/assembly/annotations.xml org.jboss.test jboss-test ${version.org.jboss.test} compile junit junit ${version.junit} compile org.jboss.microcontainer jboss-dependency org.jboss.man jboss-managed true javassist javassist true org.jboss jbossxb org.jboss.test jboss-test true junit junit true org.jboss.logging jboss-logging-log4j test libjboss-microcontainer-java-2.0.10.GA.orig/kernel/.cvsignore0000644000175000017500000000002110132515234023762 0ustar twernertwerneroutput build.log libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/0000755000175000017500000000000011620312176022563 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/0000755000175000017500000000000011620312155023537 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/0000755000175000017500000000000011620312161025546 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/0000755000175000017500000000000011620312155026340 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/0000755000175000017500000000000011620312155027460 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/0000755000175000017500000000000011620312161030434 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/0000755000175000017500000000000011620312161031565 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/test/0000755000175000017500000000000011620312161032544 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/test/JUnitTestCase#testTwo.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/test/JUni0000644000175000017500000000025011067201147033337 0ustar twernertwerner ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/test/JUnitTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/junit/test/JUni0000644000175000017500000000024510370671045033347 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/0000755000175000017500000000000011620312160031713 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000755000175000017500000000000011620312155033456 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000755000175000017500000000000011620312155033456 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/IgnoredFactoryLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000134610656541211033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerStaticTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031211001344032033444 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000077311137570512033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000311210364425143033463 0ustar twernertwerner String1 String1 String1 String1 String1 String1 ././@LongLink0000000000000000000000000000030000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerUsageTestCase_testDependencyInjectionOfBeanWithMismatchedPoolSizes.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000271610772625532033503 0ustar twernertwerner 3 4 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ScopingShutdownTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000617510632247541033501 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment4") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 fromBoot @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") fromApp ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/IgnoredAnnotatedLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035610622203652033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AnnotatedClassesScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000355010567273335033502 0ustar twernertwerner deployment1 deployment2 fromBoot fromApp ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000617510567273335033510 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment4") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 fromBoot @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") fromApp ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AnnotationUsageTestCase_Bad.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030011054741610033454 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/FineGrainedActionTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034210543762251033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanMetaDataFactoryTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000060410412230077033460 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AnonymousBeansXMLTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000474610777165400033506 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000062411137570512033470 0ustar twernertwerner jboss.jca:service=DataSourceBinding,name=DefaultDS ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000064411047541325033472 0ustar twernertwerner jboss.remoting:service=JMXConnectorServer,protocol=rmi ${jboss.bind.address} 1090 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000305511050031647033464 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.beans.metadata.api.annotations.Aliases({"simple"}) main @org.jboss.beans.metadata.api.annotations.Aliases({"simple"}) @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000247711173121305033470 0ustar twernertwerner @org.jboss.test.kernel.deployment.support.SuperDemand(demand="Partition", whenRequired="Configured", dependentState="Start") ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000070511137570512033470 0ustar twernertwerner InjecteeFactory jboss.remoting:service=JMXConnectorServer,protocol=rmi ${jboss.bind.address} 1090 ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/InCallbackInstantiatedTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000040410754576725033504 0ustar twernertwerner Bean ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/PropertyUsageTestCase_Empty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000057611054741610033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.support.TestAnnotation1 ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/NullifyTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000066711113340313033463 0ustar twernertwerner 1 2 ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MutableMetaDataTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000066411047072163033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.support.TestAnnotation1 10@org.jboss.test.kernel.deployment.support.TestAnnotation1 ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AnnotatedLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034710520207361033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000007510705114066033466 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, getClassLoader././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanFactoryContextualInjectionTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000105211147522315033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/MixedLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034310622203652033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanMetaDataWithClassloaderTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000611311173121305033457 0ustar twernertwerner InnerBean1 InnerBean2 InnerBean61 InnerBean71 InnerBean62 InnerBean72 ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanMetaDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000506310567273335033503 0ustar twernertwerner InnerBean1 InnerBean2 InnerBean61 InnerBean71 InnerBean62 InnerBean72 ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerUsageTestCase_testDependencyInjectionOfBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000247010772625532033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037711137570512033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/PooledBeanFactoryTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000323510770265756033506 0ustar twernertwerner prop1DefaultValue ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000105510364477625033503 0ustar twernertwerner ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/WildcardClassLoaderTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000040210367363670033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/InnerBeanScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000611110567273335033476 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") fromBoot @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment4") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") fromApp ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ContextualScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000606410567273335033505 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment4") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 fromBoot @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") fromApp ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ScopingAliasTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000504411032155765033474 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.beans.metadata.api.annotations.Aliases(value={"simple"}) @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.beans.metadata.api.annotations.Aliases(value={"simple"}) @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") deployment3 @org.jboss.beans.metadata.api.annotations.Aliases(value={"simple"}) main ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000227410334220147033465 0ustar twernertwerner org.jboss.test.kernel.deployment.test.DeploymentClassLoaderTestCase ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/InCallbackInstantiatedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000052110754576725033504 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000172411137570512033472 0ustar twernertwerner Partition Configured Start ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/IllegalScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000160210567273335033476 0ustar twernertwerner @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerSetDemandTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000066411002060117033456 0ustar twernertwerner one,two,three two ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000150310777413547033502 0ustar twernertwerner @org.jboss.metadata.plugins.scope.InstanceScope("cf1") @org.jboss.metadata.plugins.scope.InstanceScope("cf2") ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/IgnoredLifecycleTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000055510622203652033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/BeanContainerInjectionTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000160011216411765033465 0ustar twernertwerner java:env/comp ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/ScopingAliasAPITestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000437411032645132033471 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") deployment3 main ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/AnnotatedDeploymentScopingTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000470610567273335033506 0ustar twernertwerner @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.ApplicationScope("testApp") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment3") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment4") @org.jboss.metadata.plugins.scope.DeploymentScope("deployment1") deployment1 @org.jboss.metadata.plugins.scope.DeploymentScope("deployment2") deployment2 fromBoot fromApp ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/test/FromContextUnsupportedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000207010764277253033500 0ustar twernertwerner a1 a2 a3 ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000755000175000017500000000000011620312155033456 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000755000175000017500000000000011620312160033452 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000047510555426701033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016610367657542033506 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026010367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ClassLoaderBadNoValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017110367661070033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032210367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithInject.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024210763552240033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030610367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036410367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DemandWithTransformer.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023710711377006033470 0ustar twernertwerner Demand ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithMultipleBeans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042210367435077033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030510367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithBindings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017410562437612033474 0ustar twernertwerner binddnib ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000063610457474130033476 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithUninstallCallbacks.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035510612500024033455 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000045710555426701033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030510367672621033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034510457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithKeyClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026010367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DependencyBadNoValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016710367665665033514 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithUninstalls.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034310407475257033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithDefault.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037410650627025033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithCandidate.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020010630031724033450 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026210367664371033501 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithSupply.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022310367657542033500 0ustar twernertwerner Supply1 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024110612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/FactoryWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030710367664371033501 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036510650627025033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryBadNoClassOrFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022010367657542033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031110367653121033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithAccessMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020110767571152033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025010367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024410604740716033471 0ustar twernertwerner X${alias.test.name}X ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Constructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017310367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Alias.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021410604740716033466 0ustar twernertwerner SimpleAlias ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000043110741157263033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022310612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithClassLoader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023510367661070033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallBadNoMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016710367667116033505 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithJavaBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030710764504111033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallBadMethodProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010612500024033446 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithSupplies.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027510367653121033474 0ustar twernertwerner Supply1 Supply2 Supply3 ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithInstallCallbacks.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034710612500024033456 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024110612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationSimple.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034510457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026010367672621033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanBadNoClassOrFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020210367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032310367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithAccessMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017210767571152033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031010367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Parameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023710367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034010367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032210367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030410367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023510367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorBadFactoryNoFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025110367662655033502 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032110367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037610367653121033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023410367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000046110555426701033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000070510457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanBadNoClassOrFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020310367653121033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithNoName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017210562437612033472 0ustar twernertwerner binddinb ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithExtends.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000015510562407702033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032110367653121033464 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/List.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023510367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036610367653121033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030710367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithElementClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027210367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027410367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026410367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithAutowire.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020110631001731033445 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SupplyBadNoValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016610367665665033513 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000045510555426701033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025010612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020110374064414033460 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032610367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithDemand.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022310367657542033500 0ustar twernertwerner Demand1 ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallBadMethodProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010612500024033446 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016010367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionWithSearch.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030011147522315033456 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithMixed.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000111010412224517033453 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithLifecycle.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035310630031724033461 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithUninstallCallbacks.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033710612500024033455 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023110374064414033463 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Array.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023610367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Demand.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020410367653121033464 0ustar twernertwerner Demand ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026210367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithConstructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017310367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030410367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithStop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016410367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034210650627025033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithInstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021110367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032310367653121033466 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Collection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024310367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ClassLoaderWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000040310555426701033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/FactoryBadNoBeanOrWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024510367664371033502 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithMultipleBeanMetaDataFactorys.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000076210412224517033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027710457474130033477 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000041510457474130033471 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020710374064414033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027310562437612033474 0ustar twernertwerner @org.jboss.test.Someannotaion ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030510367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Value.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025110367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithDemands.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031310367657542033500 0ustar twernertwerner Demand1 Demand2 Demand3 ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030310367672621033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036410367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/RelatedWithName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022511043375327033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DemandWithTargetState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023111147522315033461 0ustar twernertwerner Demand ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithDemand.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020510367653121033465 0ustar twernertwerner Demand1 ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Set.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023410367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorBadFactoryClassNoFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710367662655033505 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/RelatedWithEnableds.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000050011043375327033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037110612500024033453 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithQualifier.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024210562437612033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000015510367642015033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000040510367667116033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ClassLoaderWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027110475520525033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithAbstract.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000014710631001731033456 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanBadNoClassOrConstructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000012410367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000014510562407702033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithConstructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021110367657542033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042010367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042310555426701033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithType.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010763032124033456 0ustar twernertwerner 42 ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025510367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithIgnored.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021210622203652033455 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithDependency.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021010367653121033461 0ustar twernertwerner Depends1 ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithCreate.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020410367657542033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/FactoryWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000046110555426701033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016410367642015033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryBadNoBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032510650627025033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyBadNoName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017010367665072033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000064510457474130033476 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027310367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithInstallCallbacks.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033110612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027110367667116033501 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithBeanFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026710367435077033505 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026010367435077033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020210374064414033461 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithPlainValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026410367653121033472 0ustar twernertwerner PlainValue ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020610367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000055310457474130033474 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031210367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithProperties.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032710367657542033505 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionBadNoBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024310367672621033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024210367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000044310741157263033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036410367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PolicyWithScope.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017710562437612033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000065510612500024033460 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710367657542033504 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationWithAttribute.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042110457474130033466 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttribute(attribute=java.lang.Long.class) ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithInstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710407475257033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InjectionWithFromContext.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031210647213427033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032210367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036210367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025010612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/RelatedWithEnabled.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025411043375327033472 0ustar twernertwerner aop ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithClassLoader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021710367661070033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Supply.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020410367653121033464 0ustar twernertwerner Supply ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithErrorHandlingMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000017510772743225033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026510367653121033473 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036410367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DemandBadNoValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016610367665665033513 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ClassLoaderWithInject.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024210367642015033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042510741157263033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023610367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037110612500024033453 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithProperties.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031110367653121033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000065510612500024033460 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016710367657542033507 0ustar twernertwerner ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Scope.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020610562437612033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithInstallCallback.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023710612500024033454 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032210367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023510367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036310457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710612500024033453 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithStart.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016510367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithCreate.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016610367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithCardinality.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024210612500024033450 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030410367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithFactoryClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023710367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithRelated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021211044026555033461 0ustar twernertwerner ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Deployment.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000013210367435077033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithValueClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026410367653121033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000076210741157263033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryBadNoClassOrConstructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000013310367657542033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030610367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DemandWithWhenRequired.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710367653121033471 0ustar twernertwerner Demand ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030710367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithDemands.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027510367653121033474 0ustar twernertwerner Demand1 Demand2 Demand3 ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032410367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032110367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithWhenRequired.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024510757136565033504 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033210475520525033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithInstallCallback.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022110612500024033445 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035410457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000042710741157263033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000040010367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023410367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023510367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithInstalls.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032710407475257033501 0ustar twernertwerner ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Policy.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000012210562407702033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000061510635671667033507 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes(clazz=java.lang.Integer.class, integer=100, str="Annotations are nice") ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026110367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031010367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026610367653121033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034310475520525033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033710367653121033473 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationBadNoContent.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010457474130033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035610367653121033474 0ustar twernertwerner KeyValue ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/NamedAliasWithReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024310630031724033457 0ustar twernertwerner X${alias.test.name}X ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Map.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023410367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithUninstallCallback.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024110612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithClassLoader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024510367661400033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016210367435077033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackUninstallWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022710612500024033453 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026110367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027510475520525033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationBadNoContent2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027210457474130033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ScopeWithLevel.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023310562437612033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030510367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032510367653121033470 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000105010555426701033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithWhenRequired.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037010650627025033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024310367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026210367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000035010650627025033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithPlainValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021410562440134033460 0ustar twernertwerner binddinb ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryBadNoClassOrFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022110367657542033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027710367653121033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030310367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithNoReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024510604740716033472 0ustar twernertwerner X${alias.test.name}X ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/NamedAlias.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023210630031724033455 0ustar twernertwerner SimpleAlias ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036710555426701033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithBeanFactoryJavaBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032410764504111033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000062710457474130033476 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithParent.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000015110631001731033451 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031610367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025310367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithWildcard.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000046310555426701033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BindingWithComplexValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027410764475600033500 0ustar twernertwerner 42 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithDestroy.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016710367653121033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithElementClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027010367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithMode.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030610630031724033457 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithLazy.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010763552240033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022210367667116033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010604740716033465 0ustar twernertwerner 12345 ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/FactoryWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030510367664371033477 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033010367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithAnnotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000061510457474130033473 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithAlias.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000051010630031724033454 0ustar twernertwerner FirstAlias SecondAlias ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithStart.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020310367657542033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/LifecycleWithAnnotation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000033310457474130033470 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithFactoryClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020510770473134033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030610367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000047710650627025033477 0ustar twernertwerner foo.bar.key mydefault ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithCardinality.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024110612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithDependency.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022610367657542033503 0ustar twernertwerner Depends1 ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020010374064414033457 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithDependencies.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032410367657542033502 0ustar twernertwerner Depends1 Depends2 Depends3 ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithDependencies.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030610367653121033467 0ustar twernertwerner Depends1 Depends2 Depends3 ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Dependency.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021210367653121033463 0ustar twernertwerner Dependency ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MultipleAlias.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027310604740716033473 0ustar twernertwerner alias1 alias2 alias3 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ValueFactoryBadNoMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032010650627025033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ArrayWithThis.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031010367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027610367653121033475 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023110367667116033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CollectionWithElementClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027710367653121033476 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithUninstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021510367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/MapWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000036210367653121033471 0ustar twernertwerner ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithSupply.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020510367653121033465 0ustar twernertwerner Supply1 ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Lifecycle.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000016610367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031410367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021110367653121033462 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithElementClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027110367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/Property.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021410367653121033465 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/FactoryWithBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026210367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithBeanMetaDataFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000037210412224517033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/CallbackInstallWithMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022310612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithPlainValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010367653121033464 0ustar twernertwerner PlainValue ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/InstallWithMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020710367653121033467 0ustar twernertwerner ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SetWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030310367653121033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026610367653121033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026710367653121033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithUninstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000023310407475257033475 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithUninstalls.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000032510367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithRelateds.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030211044026555033461 0ustar twernertwerner md ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/NamedAliasWithNoReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026310630031724033461 0ustar twernertwerner X${alias.test.name}X ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithInstalls.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031110367653121033463 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/SupplyWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010711377006033462 0ustar twernertwerner 123 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithPreInstantiate.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000027410642732022033465 0ustar twernertwerner PlainValue ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ConstructorWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000020010374064414033457 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026510367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/NamedAliasWithClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025610630031724033463 0ustar twernertwerner 12345 ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ParameterWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000026010367653121033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/PropertyWithValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000025210367653121033467 0ustar twernertwerner Value ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/DeploymentWithMultipleBeanFactorys.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000044710367435077033505 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationWithAttributes.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000047210457474130033474 0ustar twernertwerner @org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes(clazz=java.lang.Integer.class, integer=100, str="Annotations are nice") ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithUninstallCallback.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000022310612500024033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AnnotationBadNoLeadingAt.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000034410457474130033472 0ustar twernertwerner org.jboss.test.kernel.deployment.xml.support.Annotation1 ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanWithName.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000015710367653121033473 0ustar twernertwerner ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ListWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000030710367653121033470 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/ClassLoaderWithNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000021510367642015033466 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/AliasWithBeanFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000024010604740716033465 0ustar twernertwerner SimpleAliasWithBF ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployment/xml/test/BeanFactoryWithSupplies.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/deployme0000644000175000017500000000031310367657542033500 0ustar twernertwerner Supply1 Supply2 Supply3 ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000755000175000017500000000000011620312160033414 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000755000175000017500000000000011620312160033414 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_NewProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000053710540110763033430 0ustar twernertwerner Hello @org.jboss.test.kernel.metadata.support.TestAnnotationC ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_NoOverrideProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000037610540110763033431 0ustar twernertwerner Hello ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_NoOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000031410540110763033421 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_New.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000044310540110763033424 0ustar twernertwerner @org.jboss.test.kernel.metadata.support.TestAnnotationC ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_OverrideProperty.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000056710540110763033433 0ustar twernertwerner Hello @org.jboss.test.kernel.metadata.support.TestAnnotationA("Overridden") ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase_Override.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/metadata0000644000175000017500000000047310540110763033427 0ustar twernertwerner @org.jboss.test.kernel.metadata.support.TestAnnotationA("Overridden") ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000755000175000017500000000000011620312160033470 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000755000175000017500000000000011620312160033470 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Destroy.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000070410746224743033514 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Factory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000103610746224743033513 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Create.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000070310746224743033513 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Install.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000124610746224743033516 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Constructor.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000075510746224743033522 0ustar twernertwerner hello ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_UnCallBackSingle.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000040310746224743033510 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_bad.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000023010470327354033502 0ustar twernertwerner ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Callback.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000063610746224743033520 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_InCallBackCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000040710746224743033514 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Uninstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000125510746224743033516 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/InstallErrorTestCase_BeanNoInstall.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000027511173121305033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Configure.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000072010746224743033512 0ustar twernertwerner hello ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/InstallErrorTestCase_BeanWithSupply.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000123311173121305033473 0ustar twernertwerner TestSupply ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/InstallErrorTestCase_Bean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000117110746224743033513 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Stop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000070110746224743033511 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase_good.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000023010470327354033502 0ustar twernertwerner ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_InCallBackSingle.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000040310746224743033510 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/FieldAccessControlTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000043410770642062033507 0ustar twernertwerner private ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/FieldAccessControlTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000043710770642062033512 0ustar twernertwerner private ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_Start.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000070210746224743033512 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase_UnCallBackCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000040710746224743033514 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/AccessControlTestCase_NotAutomatic.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000060210334175001033472 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/InstallErrorTestCase_Repositories.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000046110746224743033514 0ustar twernertwerner ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/controll0000644000175000017500000000074511137570512033512 0ustar twernertwerner ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000755000175000017500000000000011620312160033416 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000755000175000017500000000000011620312161033417 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000045510711377006033436 0ustar twernertwerner ^[a-zA-Z0-9._%+-]+@acme\.((org)|(com))$ ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/InstallDependencyXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000065210366730626033444 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000036211032416742033431 0ustar twernertwerner alias ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000041610711377006033433 0ustar twernertwerner 5 ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000036211032416742033431 0ustar twernertwerner alias ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/GenericBeanFactoryCallbackDependencyXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000063710771262000033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000037410711377006033436 0ustar twernertwerner aj@acme.org ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/PlainAliasXMLTestCase_Alias.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000023210656042363033432 0ustar twernertwerner MyAlias ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000036311032416742033432 0ustar twernertwerner alias ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/InstallSelfDependencyXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000256011173121305033425 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/FromContextXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000345510764277253033454 0ustar twernertwerner a1 a2 a3 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/InstallSelfDependencyXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000043010366730626033436 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase5.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000040710711377006033433 0ustar twernertwerner i supply fragment word ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/GenericBeanFactoryInstallDependencyXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000031510407477122033433 0ustar twernertwerner ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/GenericBeanFactoryCallbackDependencyXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000030410771262000033420 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000042010711377006033426 0ustar twernertwerner (1,10] ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/PlainAliasXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000041010656042363033430 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase4.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000051010711377006033426 0ustar twernertwerner fragment ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/ConstructorClassLoaderTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000007510645470014033433 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, getClassLoader././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/InstallDependencyXMLTestCase2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000405411173121305033425 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/GenericBeanFactoryInstallDependencyXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000071010407477122033432 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/InstallDependencyXMLTestCase0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000030510366730626033437 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/dependen0000644000175000017500000000036311032416742033432 0ustar twernertwerner alias ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotati0000755000175000017500000000000011620312160033451 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotations/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotati0000755000175000017500000000000011620312160033451 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotations/test/FactoryMethodBadTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/annotati0000644000175000017500000000035510661317020033462 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/lazy/0000755000175000017500000000000011620312155032676 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/lazy/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/lazy/tes0000755000175000017500000000000011620312155033412 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/lazy/test/LazyMetaDataTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/lazy/tes0000644000175000017500000000141511216157032033417 0ustar twernertwerner org.jboss.test.kernel.lazy.support.IRare org.jboss.test.kernel.lazy.support.IRare libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/0000755000175000017500000000000011620312160033167 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000755000175000017500000000000011620312160033353 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/AdditionCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000133610613653046033374 0ustar twernertwerner ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/CollectionCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000133310613653046033371 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/CandidateContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000124410630031724033362 0ustar twernertwerner ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/AdditionAnnotationCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000120110613653046033363 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/CollectionAnnotationCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000120310613653046033365 0ustar twernertwerner ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/WiredTestTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000102410701763217033366 0ustar twernertwerner SomeString ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/MultipleContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000116210612500024033353 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/BadCardinalityCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000140310613354013033357 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/ConstructorContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000372310565031075033374 0ustar twernertwerner test2 1 test2 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/CardinalityCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000140410613653046033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/LifecycleContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000217210471055540033370 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/CardinalityAnnotationCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000120410613653046033366 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/PropertyContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000346211034370463033373 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/GenericsContextualInjection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000172410653175141033374 0ustar twernertwerner SomeString ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/test/InjectionValueCallbackTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/org/jboss/test/kernel/inject/t0000644000175000017500000000102510612500024033351 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/0000755000175000017500000000000011620312161027323 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/0000755000175000017500000000000011620312161030112 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/0000755000175000017500000000000011620312161031232 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/0000755000175000017500000000000011620312161032211 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312161033412 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000376610650627025033442 0ustar twernertwerner foo.bar.key QWERT xyz.key QWERT foo.bar.key qaz xyz.key xyz no.such.key ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112010240175736033422 0ustar twernertwerner 12 ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testBeanFactoryFromStaticFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000051710655604201033425 0ustar twernertwerner 123 ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testArrayWithValueTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121110240155035033411 0ustar twernertwerner string1 string2 string2 string1 1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000026210374104076033425 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testUnmodifiableCollectionPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000123410642732022033421 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testElement.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071210557650756033443 0ustar twernertwerner ]]> ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomCollectionExplicit.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000123710240004221033407 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomCollectionPreInstantiated2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000133410770461341033427 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000027010374104076033424 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testArrayUnmodifiable.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114110642732022033416 0ustar twernertwerner string2 string2 string1 ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testListNotAList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210454703552033424 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testBeanFactoryFromFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067010655604201033425 0ustar twernertwerner 123 ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testUnmodifiableListPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121210642732022033415 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomMapFromSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000115010240155035033413 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomMapPreInstantiated2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000131210770461341033423 0ustar twernertwerner string1 string2 string2string1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomListPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000152510642732022033424 0ustar twernertwerner string1 string2 string2 string1 element ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomSetPreInstantiated2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000130710770461341033427 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCollectionNotACollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000113610454703552033431 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForCustomValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000037711374542121033432 0ustar twernertwerner Custom ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithCollection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000111710240175736033430 0ustar twernertwerner 1 2 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000032310374104076033423 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testProgressionFromOtherBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000156210542550337033433 0ustar twernertwerner 123.456 987.6543 314159 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testPropertyWithPropertyValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067610556136167033446 0ustar twernertwerner ${test.property.value} ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/ValueFactoryAnnotationTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000007510730037304033422 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, getClassLoader././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomSetFromSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210240155035033412 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testPropertyWithIgnoreReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000161310556136167033436 0ustar twernertwerner ${test.property.value} ${test.property.value} ${test.property.value} ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testBeanFactoryFromBean.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000040410655604201033420 0ustar twernertwerner 123 ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testStaticInstantiateFromFactoryWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107010271562775033435 0ustar twernertwerner Static Factory Value ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomSetPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000151710642732022033425 0ustar twernertwerner string1 string2 string2 string1 element ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/ValueFactoryTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000007510730037304033422 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, getClassLoader././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testConstructorDoesNotExist.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000070310235521450033420 0ustar twernertwerner Constructor Value ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromObject.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000037710374104076033434 0ustar twernertwerner ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testArrayIsInterface.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000116210240155035033416 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCollectionIsInterface.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000117610240004221033411 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleInstantiateFromFactoryWithParameters.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000076410367363670033445 0ustar twernertwerner Factory Value ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateFromNull.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067210240201745033423 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleCollectionFromObjects.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000206410367363670033440 0ustar twernertwerner object1 object2 object2 object1 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testArrayNotAArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112410454703552033426 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleSetFromObjects.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000203710367363670033440 0ustar twernertwerner object1 object2 object2 object1 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleSetFromStrings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000111410240155035033413 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleArrayFromStrings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210240155035033412 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testStaticInstantiateFromFactoryWithIntegerParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000104510235532775033434 0ustar twernertwerner 7 ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithArray.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114010240175736033424 0ustar twernertwerner 1 2 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testMapWithKeyTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000136110240155035033417 0ustar twernertwerner string1string2 string2string1 1integer ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomMapExplicit.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000123110240155035033413 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueNoTrim.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000064410675747414033446 0ustar twernertwerner 10 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueOfForControllerState.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000041311374542121033421 0ustar twernertwerner Configured ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testBeanFactoryDefinedFactoryClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000040710770473134033432 0ustar twernertwerner ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCollectionInjectOnObject.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000122610304155716033426 0ustar twernertwerner string1 string2 string2 string1 1 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSetNotASet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112010454703552033422 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateViaInterfaceWithTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000074210240167462033430 0ustar twernertwerner 12 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleMapFromStrings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114210240155035033414 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomArrayFromSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000113010240155035033411 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testMapNotAMap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114610454703552033432 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testUnmodifiableSetPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000120710642732022033421 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCollectionWithValueTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000123610240004221033406 0ustar twernertwerner string1 string2 string2 string1 1 ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testConfigure.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000272210653605316033433 0ustar twernertwerner StringValue 12 true a 123 1234 12345 3.14 3.14e12 Mon Jan 01 00:00:00 CET 2001 12e4 123456 12 true a 123 1234 12345 3.14 3.14e12 12345 StringValue Z ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleMapFromObjects.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000260510367363670033441 0ustar twernertwerner object1 object2 object2 object1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testMapWithValueTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000136110240155035033417 0ustar twernertwerner string1string2 string2string1 integer1 ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithProperties.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000116310240200741033412 0ustar twernertwerner 12 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleArrayFromObjects.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000204510367363670033437 0ustar twernertwerner object1 object2 object2 object1 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSetIsInterface.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114210240155035033414 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testBeanFactoryWithNonExistingClass.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000035710655604201033427 0ustar twernertwerner 123 ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomListPreInstantiated2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000131210770461341033423 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomSetExplicit.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000120310240155035033412 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066510240167462033434 0ustar twernertwerner 7 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testAnnotationPropertyReplace.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000134110562324633033426 0ustar twernertwerner @org.jboss.test.kernel.config.support.SimpleAnnotation(name = "test.${test.property.value}.Name") @org.jboss.test.kernel.config.support.SimpleAnnotation(name = "test.${test.property.value}.Name") ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleCollectionFromStrings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114110240004221033401 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testStaticInstantiateFromFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000072510235532775033440 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromJavabean2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000037710553632666033446 0ustar twernertwerner ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testArrayPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000127210500224555033423 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/ValueFactoryXMLTestCase.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000007510730037304033422 0ustar twernertwernertest.Permission.1=java.lang.RuntimePermission, getClassLoader././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleInstantiateFromFactoryWithIntegerParameter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000075110367363670033441 0ustar twernertwerner 4 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateFromBeanMetaData.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000070710271562775033443 0ustar twernertwerner Constructor Value ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueTrim.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000064310675747414033445 0ustar twernertwerner 10 ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testMapIsInterface.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000117010240155035033415 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomMapPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000161710642732022033426 0ustar twernertwerner string1 string2 string2string1 justKeyjustValue ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomCollectionPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000157110642732022033425 0ustar twernertwerner string1 string2 string2 string1 element ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleListFromStrings.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000111710240007100033403 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomListExplicit.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000120710240007100033403 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testListIsInterface.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114610240007100033405 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testUnmodifiableMapPreInstantiated.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000123310642732022033420 0ustar twernertwerner string1string2 string2string1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromValue.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000033210374104076033423 0ustar twernertwerner AString ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testListWithValueTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121410240007100033401 0ustar twernertwerner string1 string2 string2 string1 1 ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSetWithValueTypeOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121110240155035033411 0ustar twernertwerner string1 string2 string2 string1 1 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomListFromSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112510240007100033402 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomCollectionFromSignature.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000114710240004221033407 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testValueInstantiateFromSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000026110374104076033424 0ustar twernertwerner ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithSet.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000103310240175736033425 0ustar twernertwerner 1 ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testCustomArrayExplicit.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000115610240155035033421 0ustar twernertwerner string1 string2 string2 string1 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleListFromObjects.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000204210367363670033434 0ustar twernertwerner object1 object2 object2 object1 ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleInstantiateFromFactory.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065510367152641033436 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testSimpleInstantiateFromBeanMetaData.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000051110235514665033427 0ustar twernertwerner ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/config/test/testParameterInstantiateWithList.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107510240175736033433 0ustar twernertwerner 1 2 ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312163033414 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110240743224033422 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyWrongOrder3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061010240743224033416 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061410364473115033430 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067611066446716033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110247366176033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyWrongOrder4.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000141010247126414033420 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000075110240743224033424 0ustar twernertwerner factory ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000062510364457166033442 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000062510364457166033442 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000070710656353464033443 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061410364473115033430 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000075110240743224033424 0ustar twernertwerner factory ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107210334002015033407 0ustar twernertwerner ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyCorrectOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364467430033442 0ustar twernertwerner ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderReinstall2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121410334002015033405 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackCorrectOrderCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067210656541211033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107210334002015033407 0ustar twernertwerner ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061410364473115033430 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyCorrectOrder3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyOnDemandSecond0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000064610364464416033441 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063011066446716033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000070710656353464033443 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710245710221033420 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackWrongOrderCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067210656541211033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010245710221033416 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyReinstall2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000057610247126414033434 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyOnDemandFirst0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000064610364464416033441 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrderCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071510656541211033427 0ustar twernertwerner ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710364467430033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyOnDemandFirst1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000074410364464416033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000026000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210364457166033433 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710245710221033420 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071710334002015033414 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073210656353464033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderWrongOrder3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000104510334002015033407 0ustar twernertwerner org.jboss.test.kernel.dependency.test.ConstructorClassLoaderTestCase ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderWrongOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121410334002015033405 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210364457166033433 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061010240743224033416 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071710334002015033414 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyOnDemandFirst1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110247366176033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107410376314522033430 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testNestedInject0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000104510727346727033442 0ustar twernertwerner 5 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110240743224033422 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000057610247126414033434 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testKernelControllerContextAware0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000055010327246577033440 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyReinstall4.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000141010247366176033433 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000062510364457166033442 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110240743224033422 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000061010240743224033416 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073210656353464033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510364473115033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067611066446716033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000064610364464416033441 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackCorrectOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710245710221033420 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackReinstallCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067210656541211033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010247366176033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyCorrectOrder4.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000141010247366176033433 0ustar twernertwerner ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackReinstallCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071510656541211033427 0ustar twernertwerner ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackCorrectOrderCollection0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071510656541211033427 0ustar twernertwerner ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710364467430033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000026200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510364473115033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testNestedInject1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000100010727346727033431 0ustar twernertwerner 5 String1234 ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyOnDemandSecond1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073110247366176033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107410376314522033430 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyOnDemandSecond0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010247366176033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364467430033442 0ustar twernertwerner ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyWrongOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testNestedSet0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000077610727346727033454 0ustar twernertwerner 5 String12 ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000075110240743224033424 0ustar twernertwerner factory ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710240743224033424 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCallbackWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000070710656353464033443 0ustar twernertwerner ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000067611066446716033447 0ustar twernertwerner ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyReinstall3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000071710334002015033414 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107210334002015033407 0ustar twernertwerner ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPlainLifecycleDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510364473115033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000057610247126414033434 0ustar twernertwerner Name1 ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testDemandDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010240743224033422 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String2 WhatIWant ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderCorrectOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000121410334002015033405 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyOnDemandSecond1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000074410364464416033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010245710221033416 0ustar twernertwerner ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063011066446716033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderReinstall3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000104510334002015033407 0ustar twernertwerner org.jboss.test.kernel.dependency.test.ConstructorClassLoaderTestCase ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryDemandDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364450402033431 0ustar twernertwerner String1 WhatIWant ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPropertyDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000065010245710221033416 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackReinstall2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010667033716033433 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyWrongOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000066610364467430033442 0ustar twernertwerner ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryOnDemandDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000074410364464416033440 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testPlainLifecycleDependencyReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247126414033426 0ustar twernertwerner ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackWrongOrder2.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010656353464033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000107410376314522033430 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOptionalCorrectOrder1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063011066446716033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryPropertyDependencyWrongOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000060710364467430033435 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testGenericBeanFactoryConstructorDependencyReinstall1.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000112210364457166033433 0ustar twernertwerner String2 ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testConstructorClassLoaderCorrectOrder3.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000104510334002015033407 0ustar twernertwerner org.jboss.test.kernel.dependency.test.ConstructorClassLoaderTestCase ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testComplicatedLifecycleDependencyCorrectOrder0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000052510247366176033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testCardinalityCallbackReinstall0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000073210656353464033441 0ustar twernertwerner ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/dependency/test/testOnDemandDependencyOnDemandFirst0.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063010247366176033436 0ustar twernertwerner String1 ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/testFactoryMethod.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000033110661317020033414 0ustar twernertwerner ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000755000175000017500000000000011620312162033413 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testLifecycleOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000057410667033716033442 0ustar twernertwerner ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testCallbackOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000062510661317020033422 0ustar twernertwerner ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testConstructorOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000046610661317020033425 0ustar twernertwerner FromXML ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testExternalOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000105610661317020033421 0ustar twernertwerner ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testPropertyOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000042010661317020033413 0ustar twernertwerner FromXML ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testSetsOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000063511173121305033421 0ustar twernertwerner deployer deployer somesupply ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testInstallationOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000047210661317020033422 0ustar twernertwerner ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel/annotations/test/override/testFactoryOverride.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/resources/xml-test/org/jboss/test/kernel0000644000175000017500000000053310661317020033420 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/0000755000175000017500000000000011620312135024456 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/0000755000175000017500000000000011620312135025245 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/0000755000175000017500000000000011620312135026365 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/0000755000175000017500000000000011620312155027346 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/KernelAllTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/KernelAllTestSuite.j0000644000175000017500000000321410562336167033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.jboss.test.junit.test.JUnitTestSuite; import org.jboss.test.kernel.KernelTestSuite; /** * All Test Suite. * * @author Adrian Brock * @version $Revision: 60371 $ */ public class KernelAllTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("All Tests"); suite.addTest(JUnitTestSuite.suite()); suite.addTest(KernelTestSuite.suite()); return suite; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/0000755000175000017500000000000011620312155030477 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/test/0000755000175000017500000000000011620312155031456 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/test/JUnitTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/test/JUnitTest0000644000175000017500000000431711067201147033302 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.junit.test; import junit.framework.Test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * A JUnitTestCase. * * @author Adrian Brock * @version $Revision: 78898 $ */ public class JUnitTestCase extends MicrocontainerTest { /** * Bootstrap the test * * @return the test */ public static Test suite() { return suite(JUnitTestCase.class); } /** * Get the test delegate with security enabled * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); delegate.enableSecurity = true; return delegate; } /** * Create a new JUnitTestCase. * * @param name the test name */ public JUnitTestCase(String name) { super(name); } public void testOne() throws Exception { System.out.println(getBean("TheBean")); } public void testTwo() throws Exception { System.out.println(getBean("MethodBean")); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/test/JUnitTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/junit/test/JUnitTest0000644000175000017500000000301110331006762033267 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.junit.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * JUnit Test Suite. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class JUnitTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("JUnit Tests"); suite.addTest(JUnitTestCase.suite()); return suite; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/0000755000175000017500000000000011620312152030623 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/0000755000175000017500000000000011620312143033003 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000755000175000017500000000000011620312140033331 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnnotatedLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000663210651430575033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.support.AnnotatedLifecycleBean; /** * Test lifecycle annotations. * * @author Ales Justin */ public class AnnotatedLifecycleTestCase extends AbstractManualDeploymentTest { private static final String BEAN_NAME = "LifecycleBean"; public AnnotatedLifecycleTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(AnnotatedLifecycleTestCase.class); } public void testAnnotatedLifecycle() throws Throwable { AnnotatedLifecycleBean target; KernelControllerContext context = getControllerContext(BEAN_NAME, ControllerState.NOT_INSTALLED); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertTrue(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.START); assertEquals(context.getState(), ControllerState.START); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertTrue(target.isCreate()); assertTrue(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertTrue(target.isCreate()); assertFalse(target.isStart()); assertTrue(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CONFIGURED); assertEquals(context.getState(), ControllerState.CONFIGURED); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertTrue(target.isStop()); assertTrue(target.isDestroy()); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/PropertyUsageTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000367311054742116033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; /** * PropertyUsageTestCase. * * @author Ales Justin */ public class PropertyUsageTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(PropertyUsageTestCase.class); } public PropertyUsageTestCase(String name) throws Throwable { super(name); } public void testEmptyProperty() throws Exception { KernelDeployment deployment = deploy("PropertyUsageTestCase_Empty.xml"); try { System.out.println("deployment = " + deployment); /* validate(); EmptyPropTester tester = assertBean("prop_tester", EmptyPropTester.class); assertEquals("", tester.getString1()); assertEquals("", tester.getString2()); */ } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnnotatedClassesScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000560010657020413033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.ObjectWithBeanAware; import org.jboss.test.kernel.deployment.support.SimpleBean; /** * Scoping tests. * With scope annotation at class level. * * @author Ales Justin */ public class AnnotatedClassesScopingTestCase extends ScopingDeploymentTest { public AnnotatedClassesScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(AnnotatedClassesScopingTestCase.class); } // ---- tests public void testAnnotatedDeploymentScoping() throws Throwable { ObjectWithBeanAware appScopeObject = (ObjectWithBeanAware) getBean("appScopeObject"); assertNotNull(appScopeObject); ObjectWithBeanAware deploy1 = (ObjectWithBeanAware) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); ObjectWithBeanAware deploy2 = (ObjectWithBeanAware) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); ObjectWithBeanAware deploy3 = (ObjectWithBeanAware) getBean("deploy3"); assertNotNull(deploy3); SimpleBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); ObjectWithBeanAware deploy4 = (ObjectWithBeanAware) getBean("deploy4"); assertNotNull(deploy4); SimpleBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/TransitiveBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000373011137570512033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.dependency.spi.ControllerState; /** * TransitiveBeansTestCase * * @author Ales Justin */ public class TransitiveBeansTestCase extends MicrocontainerTest { public TransitiveBeansTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(TransitiveBeansTestCase.class); } public void testTransitiveShutdown() throws Throwable { KernelControllerContext tm = getControllerContext("RealTM"); undeploy(tm); // we're not in error, from possible unconfigure exception KernelControllerContext firstBean = getControllerContext("FirstBean", ControllerState.INSTANTIATED); assertNotNull(firstBean); } }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnnotatedDeploymentScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000563110657020413033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping tests. * With scope annotation at deployment level. * * @author Ales Justin */ public class AnnotatedDeploymentScopingTestCase extends ScopingDeploymentTest { public AnnotatedDeploymentScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(AnnotatedDeploymentScopingTestCase.class); } // ---- tests public void testAnnotatedDeploymentScoping() throws Throwable { SimpleObjectWithBean appScopeObject = (SimpleObjectWithBean) getBean("appScopeObject"); assertNotNull(appScopeObject); SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); SimpleObjectWithBean deploy3 = (SimpleObjectWithBean) getBean("deploy3"); assertNotNull(deploy3); SimpleBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); SimpleObjectWithBean deploy4 = (SimpleObjectWithBean) getBean("deploy4"); assertNotNull(deploy4); SimpleBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/InCallbackInstantiatedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000447510756342051033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.List; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.deployment.support.InCallbackInstantiated; import org.jboss.test.kernel.deployment.support.InCallbackInstantiatedRepository; /** * Deployment ClassLoader Test Case. * * @author Adrian Brock * @version $Revision: 40742 $ */ public class InCallbackInstantiatedTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(InCallbackInstantiatedTestCase.class); } public InCallbackInstantiatedTestCase(String name) throws Throwable { super(name); } public void testWildcardClassLoader() throws Throwable { InCallbackInstantiatedRepository repository = assertInstanceOf(getBean("Repository"), InCallbackInstantiatedRepository.class); KernelDeployment deployment = deploy("InCallbackInstantiatedTestCase_NotAutomatic.xml"); try { validate(); List registered = repository.registered; assertEquals(1, registered.size()); InCallbackInstantiated bean = registered.get(0); assertEquals("Bean", bean.getConfigured()); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingAliasTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000446111032645132033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping alias tests. * * @author Kabir Khan */ public class ScopingAliasTestCase extends ScopingDeploymentTest { public ScopingAliasTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingAliasTestCase.class); } public void testAliasInMainController() throws Throwable { checkBean("main", "main"); } public void testAliasInOwnScope() throws Throwable { checkBean("deploy1", "deployment1"); } public void testAliasInParentScope() throws Throwable { checkBean("deploy2", "main"); } public void testAliasInOwnScope2() throws Throwable { checkBean("deploy3", "deployment3"); } private void checkBean(String bean, String ctor) { SimpleObjectWithBean deploy = (SimpleObjectWithBean) getBean(bean); assertNotNull(deploy); SimpleBean simple = deploy.getSimpleBean(); assertNotNull(simple); assertEquals(ctor, simple.getConstructorString()); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanMetaDataFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000365010412230077033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.test.kernel.deployment.support.SimpleBean; import junit.framework.Test; /** * BeanMetaDataFactoryTestCase. * * @author Adrian Brock * @version $Revision: 42841 $ */ public class BeanMetaDataFactoryTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(BeanMetaDataFactoryTestCase.class); } public BeanMetaDataFactoryTestCase(String name) throws Throwable { super(name); } public void testBeanMetaDataFactory() throws Throwable { SimpleBean bean1 = (SimpleBean) getBean("Name1"); SimpleBean bean2 = (SimpleBean) getBean("Name2"); SimpleBean bean3 = (SimpleBean) getBean("Name3"); SimpleBean bean = bean1.getBean(); assertNotNull(bean); assertTrue(bean2 == bean); bean = bean3.getBean(); assertNotNull(bean); assertTrue(bean1 == bean); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/FromContextUnsupportedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001031710764277253033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.MutableMetaData; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.reflect.spi.MethodInfo; import org.jboss.test.kernel.deployment.support.NameAwareBean; /** * @author Ales Justin */ public class FromContextUnsupportedTestCase extends AbstractDeploymentTest { public FromContextUnsupportedTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(FromContextUnsupportedTestCase.class); } public void testUnsupportedInjection() throws Throwable { NameAwareBean alias = (NameAwareBean)getBean("aliases"); assertNotNull(alias); Set aliases = alias.getAliases(); assertNotNull(aliases); assertFalse(aliases.isEmpty()); assertTrue(aliases.contains("a1")); assertTrue(aliases.contains("a2")); assertTrue(aliases.contains("a3")); try { aliases.add("failedAlias"); } catch(Throwable t) { assertUnsupported(t); } NameAwareBean metadata = (NameAwareBean)getBean("metadata"); assertNotNull(metadata); MetaData md = metadata.getMetadata(); assertNotNull(md); assertFalse(md instanceof MutableMetaData); NameAwareBean beaninfo = (NameAwareBean)getBean("beaninfo"); assertNotNull(beaninfo); BeanInfo info = beaninfo.getBeaninfo(); assertNotNull(info); try { info.setMethods(new HashSet()); } catch(Throwable t) { assertUnsupported(t); } NameAwareBean scopekey = (NameAwareBean)getBean("scopekey"); assertNotNull(scopekey); ScopeKey key = scopekey.getScopeKey(); assertNotNull(key); assertInstanceOf(key, ScopeKey.class); KernelControllerContext context = getControllerContext("scopekey"); assertEquals(key, context.getScopeInfo().getScope()); NameAwareBean ctx = (NameAwareBean)getBean("context"); assertNotNull(ctx); ControllerContext realCtx = ctx.getContext(); assertNotNull(realCtx); try { realCtx.setMode(ControllerMode.DISABLED); } catch(Throwable t) { assertUnsupported(t); } DependencyInfo dependencyInfo = realCtx.getDependencyInfo(); assertNotNull(dependencyInfo); try { dependencyInfo.addIDependOn(new AbstractDependencyItem()); } catch(Throwable t) { assertUnsupported(t); } } protected void assertUnsupported(Throwable t) { assertInstanceOf(t, UnsupportedOperationException.class); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerStaticTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000531711001344032033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.StaticHolder; import org.jboss.test.kernel.deployment.support.StaticInjector; /** * @author Ales Justin */ public class BeanContainerStaticTestCase extends AbstractDeploymentTest { public BeanContainerStaticTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanContainerStaticTestCase.class); } public void testStaticInjection() throws Throwable { StaticInjector injector = assertBean("StaticInjector", StaticInjector.class); Class clazz = StaticHolder.class; String string = "foobar"; Integer number = 123; SecurityManager sm = suspendSecurity(); try { injector.injectToNonPublicMethod(clazz, "privMain", string, Object.class); assertSame(string, StaticHolder.getPrivField()); injector.injectToNonPublicMethod(clazz, "protMain", string, Object.class); assertSame(string, StaticHolder.getProtField()); injector.injectToMethod(clazz, "pubMain", string, Object.class); assertSame(string, StaticHolder.pubField); injector.injectToField(clazz, "privField", number); assertSame(number, StaticHolder.getPrivField()); injector.injectToField(clazz, "protField", number); assertSame(number, StaticHolder.getProtField()); injector.injectToField(clazz, "pubField", number); assertSame(number, StaticHolder.pubField); } finally { resumeSecurity(sm); } } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GetInstanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000313411137570512033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * GetInstanceTestCase * * @author Ales Justin */ public class GetInstanceTestCase extends MicrocontainerTest { public GetInstanceTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(GetInstanceTestCase.class); } public void testGetInstance() throws Throwable { assertBean("GetInstance", Object.class); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDeploymentTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000374410756342051033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.test.AbstractTestDelegate; /** * Scoping Deployment Test Case. * * @author Ales Justin */ public abstract class ScopingDeploymentTest extends AbstractDeploymentTest { public ScopingDeploymentTest(String name) throws Throwable { super(name); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new ScopingTestDelegate(clazz); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); //enableTrace("org.jboss.kernel.plugins.deployment"); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanMetaDataWithClassloaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000425010657020413033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * @author Ales Justin */ public class BeanMetaDataWithClassloaderTestCase extends AbstractBeanMetaDataTest { public BeanMetaDataWithClassloaderTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanMetaDataWithClassloaderTestCase.class); } // ---- tests public void testBeanAsValueMetaData() throws Throwable { ClassLoader cl = (ClassLoader) getBean("cl"); assertNotNull(cl); doInnerBeanTests(); ClassLoader cl2 = (ClassLoader) getBean("cl2"); assertNotNull(cl2); SimpleObjectWithBean sowb5 = (SimpleObjectWithBean) getBean("SimpleObject5"); assertNotNull(sowb5); SimpleBean simple5 = (SimpleBean) getBean("simple5"); assertNotNull(simple5); assertNotNull(sowb5.getSimpleBean()); assertEquals(sowb5.getSimpleBean(), simple5); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/IgnoredFactoryLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000445010656541211033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.test.kernel.deployment.support.SimpleLifecycleBean; /** * Test ignore lifecycle. * * @author Ales Justin */ public class IgnoredFactoryLifecycleTestCase extends AbstractDeploymentTest { public IgnoredFactoryLifecycleTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(IgnoredFactoryLifecycleTestCase.class); } public void testIgnoredLifecycle() throws Throwable { checkLifecycleBean("LifecycleBean1", false, false); checkLifecycleBean("LifecycleBean2", false, true); checkLifecycleBean("LifecycleBean3", true, false); checkLifecycleBean("LifecycleBean4", true, true); } protected void checkLifecycleBean(String name, boolean create, boolean start) throws Throwable { BeanFactory factory = (BeanFactory)getBean(name); assertNotNull(factory); SimpleLifecycleBean lifecycle = (SimpleLifecycleBean)factory.createBean(); assertNotNull(lifecycle); assertEquals(create, lifecycle.isCreate()); assertEquals(start, lifecycle.isStart()); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/IllegalScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000454410657020413033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping tests. * Diff scopes. * * @author Ales Justin */ public class IllegalScopingTestCase extends ScopingDeploymentTest { public IllegalScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(IllegalScopingTestCase.class); } // ---- tests public void testIllegalScoping() throws Throwable { ClassLoader cl = (ClassLoader) getBean("cl"); assertNotNull(cl); Throwable expected = null; try { getBean("deploy1"); } catch(Throwable t) { expected = t; } assertNotNull(expected); SimpleObjectWithBean deploy = (SimpleObjectWithBean) getBean("deploy1", ControllerState.INSTANTIATED); assertNotNull(deploy); SimpleBean simple1 = deploy.getSimpleBean(); assertNull(simple1); SimpleBean simple = (SimpleBean)getBean("simple"); assertNotNull(simple); assertEquals("deployment2", simple.getConstructorString()); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AliasInjectTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000347411137570512033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * AliasInjectTestCase * * @author Ales Justin */ public class AliasInjectTestCase extends MicrocontainerTest { private Object injectee; public AliasInjectTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(AliasInjectTestCase.class); } public void testDepends() throws Throwable { assertNotNull(injectee); } @Inject(bean = "InjecteeFactory", property = "serviceName") public void setInjectee(Object injectee) { this.injectee = injectee; } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockEjb3DependsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000317011137570512033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; /** * MockEjb3DependsTestCase: JBMICROCONT-365 * * @author Ales Justin */ public class MockEjb3DependsTestCase extends AbstractDeploymentTest { public MockEjb3DependsTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(MockEjb3DependsTestCase.class); } public void testDepends() throws Throwable { assertBean("EJB", SimpleBean.class); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerUsageTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001712311014246073033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.lang.reflect.Method; import java.net.URL; import java.util.Collections; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.deployment.support.container.Bean1Type; import org.jboss.test.kernel.deployment.support.container.Bean2Type; import org.jboss.test.kernel.deployment.support.container.BeanContainer; import org.jboss.test.kernel.deployment.support.container.BeanPool; /** * Bean Container Test Case. * * @author Scott Stark * @version $Revision: 73488 $ */ public class BeanContainerUsageTestCase extends AbstractKernelTest { private Kernel kernel; private BasicXMLDeployer deployer; public static Test suite() { return suite(BeanContainerUsageTestCase.class); } public BeanContainerUsageTestCase(String name) { super(name); } @SuppressWarnings("unchecked") public void testDependencyInjectionOfBean() throws Throwable { bootstrap(); // ???? BeanContainer container1 = (BeanContainer) getBean("BeanContainer1Type"); getBean("BeanContainer1Type"); BeanPool pool1 = (BeanPool) getBean("Bean1TypePool"); BeanContainer container2 = (BeanContainer) getBean("BeanContainer2Type"); Bean2Type bean21 = container2.getBean(); getLog().debug("bean21: "+bean21); Bean1Type bean11 = bean21.getBean1(); assertEquals(0, pool1.size()); getLog().debug("bean11: "+bean11); assertNotNull(bean11); // Create another Bean2Type instance Bean2Type bean22 = container2.getBean(); getLog().debug("bean22: "+bean22); assertTrue(bean22 != bean21); // The injected bean should not be the same as injected into bean21 Bean1Type bean12 = bean22.getBean1(); getLog().debug("bean12: "+bean12); assertNotNull(bean12); assertTrue(bean12 != bean11); // Create another bean 2 type, should fail Bean2Type bean23 = container2.getBean(); getLog().debug("bean23: "+bean23); Bean1Type bean13Injected = bean23.getBean1(); getLog().debug("bean13Injected: "+bean13Injected); assertNotNull(bean13Injected); deployer.shutdown(); } @SuppressWarnings("unchecked") public void testDependencyInjectionOfBeanWithMismatchedPoolSizes() throws Throwable { bootstrap(); BeanContainer container2 = (BeanContainer) getBean("BeanContainer2Type"); try { fail("Should not have been able to create a Bean2Type: " + container2.getBean()); } catch(IllegalStateException e) { getLog().info("Saw expected IllegalStateException"); } deployer.shutdown(); } /** * There is no xml version of ? * @return ??? */ protected KernelDeployment getDeploymentForDependencyInjectionOfBean() { return null; } /** * Either deploy a test specific xml descriptor, or obtain a test * specific KernelDeployment by looking for a method * "getDeploymentFor"+ getName().substring(4); */ protected Kernel bootstrap() throws Throwable { kernel = super.bootstrap(); deployer = new BasicXMLDeployer(kernel, ControllerMode.AUTOMATIC); String testName = "getDeploymentFor"+ getName().substring(4); KernelDeployment deployment = null; try { Method getDeployment = getClass().getDeclaredMethod(testName); deployment = (KernelDeployment) getDeployment.invoke(this); } catch(NoSuchMethodException e) { getLog().debug("Ignoring: "+e); } if(deployment == null) { String xmlName = getClass().getName() + "_" + super.getName(); xmlName = xmlName.replace('.', '/') + ".xml"; URL url = getClass().getClassLoader().getResource(xmlName); if (url != null) deployer.deploy(url); else getLog().debug("No test specific deployment " + xmlName); } else { deployer.deploy(deployment); } deployer.validate(); return kernel; } protected void shutdown() { deployer.shutdown(); } protected void assertNoBeansExist() { KernelController controller = kernel.getController(); ControllerStateModel states = controller.getStates(); int beanCount = 0; for(ControllerState s : states) { Set ctxs = controller.getContextsByState(s); beanCount += ctxs.size(); } assertEquals(0, beanCount); } protected void assertBeansExist(Set names) { HashSet unexpectedBeanNames = new HashSet(); KernelController controller = kernel.getController(); ControllerStateModel states = controller.getStates(); for(ControllerState s : states) { Set ctxs = controller.getContextsByState(s); for(ControllerContext ctx : ctxs) { String name = ctx.getName().toString(); if(names.contains(name) == false) unexpectedBeanNames.add(name); } } assertEquals(Collections.emptySet(), unexpectedBeanNames); } protected Object getBean(final Object name) { KernelControllerContext context = getControllerContext(name, ControllerState.INSTALLED); return context.getTarget(); } protected KernelControllerContext getControllerContext(final Object name, final ControllerState state) { KernelController controller = kernel.getController(); KernelControllerContext context = (KernelControllerContext) controller.getContext(name, state); if (context == null) { getLog().error("Bean not found " + name + " at state " + state); ControllerStateModel states = controller.getStates(); for(ControllerState s : states) { getLog().info(s+": "+controller.getContextsByState(s)); } throw new IllegalStateException("Bean not found " + name + " at state " + state); } return context; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanMetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000304010657020413033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; /** * @author Ales Justin */ public class BeanMetaDataTestCase extends AbstractBeanMetaDataTest { public BeanMetaDataTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanMetaDataTestCase.class); } // ---- tests public void testBeanAsValueMetaData() throws Throwable { doInnerBeanTests(); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000603110703132622033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.kernel.spi.deployment.KernelDeployment; import static org.jboss.test.classloading.vfs.ClassLoaderUtil.getClassLoader; /** * Deployment ClassLoader Test Case. * * @author Adrian Brock * @version $Revision: 66005 $ */ public class DeploymentClassLoaderTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(DeploymentClassLoaderTestCase.class); } public DeploymentClassLoaderTestCase(String name) throws Throwable { super(name); } public void testDeploymentClassLoader() throws Throwable { KernelDeployment deployment = deploy("DeploymentClassLoaderTestCase_NotAutomatic.xml"); try { validate(); ClassLoader deploymentCL = (ClassLoader) getBean("DeploymentClassLoader"); ClassLoader beanCL = (ClassLoader) getBean("BeanClassLoader"); Object bean = getBean("DeploymentConfiguredClassLoader"); assertEquals(deploymentCL, getClassLoader(bean.getClass())); bean = getBean("BeanConfiguredClassLoader"); assertEquals(beanCL, getClassLoader(bean.getClass())); bean = getBean("NotConfiguredClassLoader"); assertEquals(getClassLoader(getClass()), getClassLoader(bean.getClass())); BeanFactory factory = (BeanFactory) getBean("FactoryDeploymentConfiguredClassLoader"); bean = factory.createBean(); assertEquals(deploymentCL, getClassLoader(bean.getClass())); factory = (BeanFactory) getBean("FactoryBeanConfiguredClassLoader"); bean = factory.createBean(); assertEquals(beanCL, getClassLoader(bean.getClass())); factory = (BeanFactory) getBean("FactoryNotConfiguredClassLoader"); bean = factory.createBean(); assertEquals(getClassLoader(getClass()), getClassLoader(bean.getClass())); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000570210657020413033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping tests. * Test includes same named beans. * * @author Ales Justin */ public class ScopingTestCase extends ScopingDeploymentTest { public ScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingTestCase.class); } // ---- tests // FIXME - correct 'simple' undeploy public void testSimpleScoping() throws Throwable { ClassLoader cl = (ClassLoader) getBean("cl"); assertNotNull(cl); SimpleObjectWithBean appScopeObject = (SimpleObjectWithBean) getBean("appScopeObject"); assertNotNull(appScopeObject); SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); SimpleObjectWithBean deploy3 = (SimpleObjectWithBean) getBean("deploy3"); assertNotNull(deploy3); SimpleBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); SimpleObjectWithBean deploy4 = (SimpleObjectWithBean) getBean("deploy4"); assertNotNull(deploy4); SimpleBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandInstallTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000322111137570512033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SomeCacheTreeManager; /** * SuperDemandAnnotationTestCase * * @author Ales Justin */ public class SuperDemandInstallTestCase extends AbstractDeploymentTest { public SuperDemandInstallTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(SuperDemandInstallTestCase.class); } public void testDependency() throws Throwable { assertBean("Manager", SomeCacheTreeManager.class); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000440211047541325033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * ScopingOverrideTestCase * * @author Kabir Khan */ public class ScopingOverrideTestCase extends ScopingDeploymentTest { public ScopingOverrideTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingOverrideTestCase.class); } public void testScopingOverride() throws Throwable { //This gets injected from the scoped controller SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); //This gets injected from the main controller SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("main", simple2.getConstructorString()); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/InnerBeanScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000610310657020413033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Inner bean scoping tests. * Test includes same named beans. * * @author Ales Justin */ public class InnerBeanScopingTestCase extends ScopingDeploymentTest { public InnerBeanScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(InnerBeanScopingTestCase.class); } // ---- tests public void testSimpleScoping() throws Throwable { SimpleObjectWithBean appScopeObject = (SimpleObjectWithBean) getBean("appScopeObject"); assertNotNull(appScopeObject); SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); SimpleObjectWithBean deploy3 = (SimpleObjectWithBean) getBean("deploy3"); assertNotNull(deploy3); SimpleBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); SimpleBean fromBoot = (SimpleBean)getBean("simpleFromBoot"); assertEquals(simple3, fromBoot); SimpleObjectWithBean deploy4 = (SimpleObjectWithBean) getBean("deploy4"); assertNotNull(deploy4); SimpleBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); SimpleBean fromApp = (SimpleBean)getBean("simpleFromApp"); assertEquals(simple4, fromApp); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanFactoryContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000351411147522315033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.test.kernel.deployment.support.FirstBean2; /** * BeanFactoryContextualInjectionTestCase. * * @author Ales Justin */ public class BeanFactoryContextualInjectionTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(BeanFactoryContextualInjectionTestCase.class); } public BeanFactoryContextualInjectionTestCase(String name) throws Throwable { super(name); } public void testContextualInjection() throws Throwable { BeanFactory bf = assertBean("FirstBean", BeanFactory.class); FirstBean2 bean = (FirstBean2)bf.createBean(); assertNotNull(bean.getC()); assertNotNull(bean.getTm()); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000645110756342051033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; /** * Scoping Deployment Test Delegate. * * @author Ales Justin */ public class ScopingTestDelegate extends MicrocontainerTestDelegate { public ScopingTestDelegate(Class clazz) throws Exception { super(clazz); } protected KernelControllerContext getControllerContext(final Object name, final ControllerState state) { Controller controller; KernelControllerContext context; try { controller = new TestController((AbstractController)kernel.getController()); context = (KernelControllerContext)controller.getContext(name, state); } catch (Exception e) { throw new Error(e); } if (context == null) handleNotFoundContext(controller, name, state); return context; } private class TestController extends AbstractController { private AbstractController delegate; public boolean isShutdown() { return delegate.isShutdown(); } public TestController(AbstractController controller) throws Exception { this.delegate = controller; } public ControllerContext getContext(Object name, ControllerState state) { return findContext(delegate, name, state); } private ControllerContext findContext(AbstractController controller, Object name, ControllerState state) { ControllerContext context = controller.getContext(name, state); if (context != null) { return context; } else { for (AbstractController childController : controller.getControllers()) { ControllerContext ctx = findContext(childController, name, state); if (ctx != null) return ctx; } } return null; } } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MockServiceBindingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000447711047564521033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.MockServiceBinding; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.AbstractTestDelegate; /** * MockServiceBindingTestCase * * @author Ales Justin */ public class MockServiceBindingTestCase extends AbstractDeploymentTest { public MockServiceBindingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(MockServiceBindingTestCase.class); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { System.setProperty("jboss.bind.address", "SomeJBossBindAddress"); AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); delegate.enableSecurity = true; return delegate; } public void testConfiguration() throws Throwable { MockServiceBinding binding = (MockServiceBinding)getBean("ServiceBinding"); assertNotNull(binding); assertEquals("jboss.remoting:service=JMXConnectorServer,protocol=rmi", binding.getServiceName()); assertEquals("SomeJBossBindAddress", binding.getHostName()); assertEquals(1090, binding.getPort()); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AbstractOnDemandDeploymentTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000407310756342051033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; import org.jboss.test.AbstractTestDelegate; import org.jboss.dependency.spi.ControllerMode; /** * Abstract Deployment Test Case. * * @author Ales Justin */ public class AbstractOnDemandDeploymentTest extends MicrocontainerTest { public AbstractOnDemandDeploymentTest(String name) { super(name); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { MicrocontainerTestDelegate delegate = (MicrocontainerTestDelegate) MicrocontainerTest.getDelegate(clazz); delegate.setDefaultMode(ControllerMode.ON_DEMAND); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); //enableTrace("org.jboss.kernel.plugins.deployment"); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AbstractBeanMetaDataTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000674210741157263033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.List; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * @author Ales Justin */ public abstract class AbstractBeanMetaDataTest extends AbstractDeploymentTest { protected AbstractBeanMetaDataTest(String name) throws Throwable { super(name); } // ---- tests public void doInnerBeanTests() throws Throwable { SimpleObjectWithBean sowb1 = (SimpleObjectWithBean) getBean("SimpleObject1"); assertNotNull(sowb1); SimpleObjectWithBean simple1 = (SimpleObjectWithBean) getBean("simple1"); assertNotNull(simple1); assertEquals(sowb1, simple1); SimpleObjectWithBean sowb2 = (SimpleObjectWithBean) getBean("SimpleObject2"); assertNotNull(sowb2); SimpleBean simple2 = (SimpleBean) getBean("simple2"); assertNotNull(simple2); assertNotNull(sowb2.getSimpleBean()); assertEquals(sowb2.getSimpleBean(), simple2); SimpleObjectWithBean sowb3 = (SimpleObjectWithBean) getBean("SimpleObject3"); assertNotNull(sowb3); SimpleBean simple3 = (SimpleBean) getBean("simple3"); assertNotNull(simple3); assertNotNull(sowb3.getSimpleBean()); assertEquals(sowb3.getSimpleBean(), simple3); SimpleObjectWithBean sowb4 = (SimpleObjectWithBean) getBean("SimpleObject4"); assertNotNull(sowb4); List beans = sowb4.getBeans(); assertFalse(beans.isEmpty()); assertEquals(2, beans.size()); SimpleObjectWithBean sowb6 = (SimpleObjectWithBean) getBean("SimpleObject6"); assertNotNull(sowb6); List beans6 = sowb6.getBeans(); assertFalse(beans6.isEmpty()); assertEquals(2, beans6.size()); SimpleBean inner61 = beans6.get(0); assertNotNull(inner61); assertSame(inner61, getBean("inner61")); SimpleBean inner71 = inner61.getBean(); assertNotNull(inner71); assertEquals("InnerBean71", inner71.getString()); assertSame(inner71, getBean("inner71")); SimpleBean inner62 = beans6.get(1); assertNotNull(inner62); assertSame(inner61, getBean("inner61")); SimpleBean inner72 = inner62.getBean(); assertNotNull(inner72); assertEquals("InnerBean72", inner72.getString()); assertSame(inner72, getBean("inner72")); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingShutdownTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000733010756342051033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping shutdown tests. * Test includes same named beans. * * @author Ales Justin */ public class ScopingShutdownTestCase extends ScopingDeploymentTest { public ScopingShutdownTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingShutdownTestCase.class); } /** * Default setup with security manager enabled. * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new ScopingShutdownTestDelegate(clazz); delegate.enableSecurity = true; return delegate; } // ---- tests public void testScopingShutdown() throws Throwable { ClassLoader cl = (ClassLoader) getBean("cl"); assertNotNull(cl); SimpleObjectWithBean appScopeObject = (SimpleObjectWithBean) getBean("appScopeObject"); assertNotNull(appScopeObject); SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); SimpleObjectWithBean deploy3 = (SimpleObjectWithBean) getBean("deploy3"); assertNotNull(deploy3); SimpleBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); SimpleObjectWithBean deploy4 = (SimpleObjectWithBean) getBean("deploy4"); assertNotNull(deploy4); SimpleBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); shutdown(); assertNull(getControllerContext("deploy4")); assertNull(getControllerContext("deploy3")); assertNull(getControllerContext("deploy2")); assertNull(getControllerContext("deploy1")); assertNull(getControllerContext("appScopeObject")); assertNull(getControllerContext("cl")); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingAliasAPITestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000715311032650140033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.plugins.ScopedAliasControllerContext; import org.jboss.dependency.spi.Controller; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.test.AbstractTestDelegate; /** * Scoping alias API tests. * * @author Ales Justin */ public class ScopingAliasAPITestCase extends ScopingAliasTestCase { public ScopingAliasAPITestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingAliasAPITestCase.class); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new ScopingTestAPIDelegate(clazz); delegate.enableSecurity = true; return delegate; } protected void afterSetUp() throws Exception { try { Controller controller = ((ScopingTestAPIDelegate)getDelegate()).getController(); ScopeKey sk1 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment1"), new Scope(CommonLevels.APPLICATION, "testApp")}); ScopedAliasControllerContext.addAlias("simple", "simple1", sk1, controller); ScopeKey sk3 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment3"), new Scope(CommonLevels.APPLICATION, "testApp")}); ScopedAliasControllerContext.addAlias("simple", "simple3", sk3, controller); controller.addAlias("simple", "simple-main"); } catch (Throwable t) { throw new Exception(t); } super.afterSetUp(); } @Override protected void tearDown() throws Exception { Controller controller = ((ScopingTestAPIDelegate)getDelegate()).getController(); controller.removeAlias("simple"); ScopeKey sk1 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment1"), new Scope(CommonLevels.APPLICATION, "testApp")}); ScopedAliasControllerContext.removeAlias("simple", sk1, controller); ScopeKey sk3 = new ScopeKey(new Scope[]{new Scope(CommonLevels.DEPLOYMENT, "deployment3"), new Scope(CommonLevels.APPLICATION, "testApp")}); ScopedAliasControllerContext.removeAlias("simple", sk3, controller); super.tearDown(); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000003140511137570512033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.Collections; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.deployment.support.AliasesImpl; import org.jboss.test.kernel.deployment.support.ApplicationScopeImpl; import org.jboss.test.kernel.deployment.support.SimpleBeanImpl; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Scoping dependency tests. * * @author Kabir Khan * @author Ales Justin * @version $Revision: 1.1 $ */ public class ScopingDependencyTestCase extends ScopingDeploymentTest { private final static String PARENT_CLASS = SimpleBeanImpl.class.getName(); private final static String CHILD_CLASS = SimpleObjectWithBean.class.getName(); private final static String PARENT = "Parent"; private final static String CHILD = "Child"; private final static String SCOPED_PARENT = "Scoped_Parent"; private final static String APP_SCOPE_1 = "scoped1"; private final static String APP_SCOPE_2 = "scoped2"; public ScopingDependencyTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopingDependencyTestCase.class); } public void testScopedChildDependencyOnParent() throws Throwable { KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null); deploy(childDeployment); try { assertNoSuchContext(CHILD); KernelDeployment parentDeployment = createParentDeployment(); deploy(parentDeployment); try { ControllerContext parent = getControllerContext(PARENT); ControllerContext child = getControllerContext(CHILD); assertNotSame(parent.getController(), child.getController()); } finally { undeploy(parentDeployment); } assertNoSuchContext(PARENT); assertNoSuchContext(CHILD); } finally { undeploy(childDeployment); } } public void testScopedChildWithDependencyOnAliasInScopedControllerWithSameNameAsParent() throws Throwable { KernelDeployment childDeployment = createChildDeployment(CHILD, PARENT, APP_SCOPE_1, null); deploy(childDeployment); try { assertNoSuchContext(CHILD); KernelDeployment parentInChildScopeDeployment = createDeployment(SCOPED_PARENT, PARENT_CLASS, null, APP_SCOPE_1, PARENT); deploy(parentInChildScopeDeployment); try { ControllerContext scopedParent = getControllerContext(SCOPED_PARENT); ControllerContext child = getControllerContext(CHILD); assertSame(scopedParent.getController(), child.getController()); KernelDeployment parentDeployment = createParentDeployment(); deploy(parentDeployment); try { ControllerContext parent = getControllerContext(PARENT); assertNotSame(parent.getController(), child.getController()); } finally { undeploy(parentDeployment); } scopedParent = getControllerContext(SCOPED_PARENT); child = getControllerContext(CHILD); } finally { undeploy(parentInChildScopeDeployment); } assertNoSuchContext(CHILD); } finally { undeploy(childDeployment); } } public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParent() throws Throwable { KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD, null, APP_SCOPE_2, null); deploy(childDeploymentNoDependencies); try { List contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts(); assertEquals(1, contextsNoDependencies.size()); KernelControllerContext childNoDependencies = contextsNoDependencies.get(0); assertEquals(ControllerState.INSTALLED, childNoDependencies.getState()); KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 1, CHILD, PARENT, APP_SCOPE_1, null); deploy(childDeploymentWithDependencies); try { List contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts(); assertEquals(1, contextsWithDependencies.size()); KernelControllerContext childWithDependencies = contextsWithDependencies.get(0); assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState())); assertNotSame(childNoDependencies.getController(), childWithDependencies.getController()); KernelDeployment parentDeployment = createParentDeployment(); deploy(parentDeployment); try { ControllerContext parent = getControllerContext(PARENT); ControllerContext child = getControllerContext(CHILD); assertNotSame(parent.getController(), child.getController()); assertNotSame(parent.getController(), childNoDependencies.getController()); assertNotSame(parent.getController(), childWithDependencies.getController()); assertEquals(ControllerState.INSTALLED, childNoDependencies.getState()); } finally { undeploy(parentDeployment); } assertNoSuchContext(PARENT); assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState())); // unwinded due to the same name assertFalse(ControllerState.INSTALLED.equals(childNoDependencies.getState())); } finally { undeploy(childDeploymentWithDependencies); } } finally { undeploy(childDeploymentNoDependencies); } } public void testScopedChildWithNoDependencyAndGlobalChildWithDependencyOnParentViaAliases() throws Throwable { KernelDeployment childDeploymentNoDependencies = createChildDeployment(CHILD + 1, null, APP_SCOPE_2, CHILD); deploy(childDeploymentNoDependencies); try { List contextsNoDependencies = childDeploymentNoDependencies.getInstalledContexts(); assertEquals(1, contextsNoDependencies.size()); KernelControllerContext childNoDependencies = contextsNoDependencies.get(0); assertEquals(ControllerState.INSTALLED, childNoDependencies.getState()); KernelDeployment childDeploymentWithDependencies = createChildDeployment(CHILD + 2, CHILD + 2, PARENT, APP_SCOPE_1, CHILD); deploy(childDeploymentWithDependencies); try { List contextsWithDependencies = childDeploymentWithDependencies.getInstalledContexts(); assertEquals(1, contextsWithDependencies.size()); KernelControllerContext childWithDependencies = contextsWithDependencies.get(0); assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState())); assertNotSame(childNoDependencies.getController(), childWithDependencies.getController()); KernelDeployment parentDeployment = createParentDeployment(); deploy(parentDeployment); try { ControllerContext parent = getControllerContext(PARENT); ControllerContext child = getControllerContext(CHILD); assertNotSame(parent.getController(), child.getController()); assertNotSame(parent.getController(), childNoDependencies.getController()); assertNotSame(parent.getController(), childWithDependencies.getController()); assertEquals(ControllerState.INSTALLED, childNoDependencies.getState()); } finally { undeploy(parentDeployment); } assertNoSuchContext(PARENT); assertFalse(ControllerState.INSTALLED.equals(childWithDependencies.getState())); assertEquals(ControllerState.INSTALLED, childNoDependencies.getState()); } finally { undeploy(childDeploymentWithDependencies); } } finally { undeploy(childDeploymentNoDependencies); } } public void testTwoScopedChildrenOneWithDependencyOnParent() throws Throwable { runTestTwoScopedChildrenWithDependencyOnParent(false); } public void testTwoScopedChildrenOneWithDependencyOnParentReverseOrder() throws Throwable { runTestTwoScopedChildrenWithDependencyOnParent(true); } private void runTestTwoScopedChildrenWithDependencyOnParent(boolean withDependencyFirst) throws Throwable { //TODO this will not work until Abstract } private KernelDeployment createParentDeployment() throws Throwable { return createDeployment(PARENT, PARENT_CLASS, null, null, null); } private KernelDeployment createChildDeployment(String beanName, String dependency, String scope, String alias) { return createChildDeployment(beanName, beanName, dependency, scope, alias); } private KernelDeployment createChildDeployment(String deploymentName, String beanName, String dependency, String scope, String alias) { return createDeployment(deploymentName, beanName, CHILD_CLASS, dependency, scope, alias); } private KernelDeployment createDeployment(String beanName, String clazz, String dependency, String scope, String alias) { return createDeployment(beanName, beanName, clazz, dependency, scope, alias); } @SuppressWarnings({"deprecation"}) private KernelDeployment createDeployment(String deploymentName, String beanName, String clazz, String dependency, String scope, String alias) { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(beanName, clazz); if (dependency != null) { ValueMetaData inject = builder.createInject(dependency); builder.addPropertyMetaData("simpleBean", inject); } if (scope != null) { builder.addAnnotation(new ApplicationScopeImpl(scope)); } if (alias != null) { builder.addAnnotation(new AliasesImpl(alias)); } AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setName(deploymentName); List beans = Collections.singletonList(builder.getBeanMetaDataFactory()); deployment.setBeanFactories(beans); return deployment; } /** * assertNoControllerContext() never fails for scoped beans whether installed or not, so use this instead */ private void assertNoSuchContext(String name) { try { getControllerContext(name); fail(name + " should not be found"); } catch (IllegalStateException e) { } } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000452210777676345033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.annotations.AnnotationToBeanMetaDataFactory; import org.jboss.kernel.spi.annotations.BeanMetaDataAnnotationAdapter; import org.jboss.test.kernel.deployment.support.container.TestSessionBean; /** * @author Ales Justin */ public class BeanContainerInjectionTestCase extends AbstractDeploymentTest { public BeanContainerInjectionTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanContainerInjectionTestCase.class); } public void testContainerInjection() throws Throwable { BeanMetaDataAnnotationAdapter adapter = assertBean("BMDAdapter", BeanMetaDataAnnotationAdapter.class); BeanMetaData bmd = AnnotationToBeanMetaDataFactory.createBeanMetaData(TestSessionBean.class, BeanAccessMode.ALL, adapter); bmd.setName("test"); SecurityManager sm = suspendSecurity(); try { deploy(bmd); } finally { resumeSecurity(sm); } TestSessionBean tsb = assertBean("test", TestSessionBean.class); tsb.validate(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AbstractManualDeploymentTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000403310756342051033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.dependency.spi.ControllerMode; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; /** * Abstract Deployment Test Case. * * @author Adrian Brock * @version $Revision: 40428 $ */ public class AbstractManualDeploymentTest extends MicrocontainerTest { public AbstractManualDeploymentTest(String name) { super(name); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { MicrocontainerTestDelegate delegate = (MicrocontainerTestDelegate) MicrocontainerTest.getDelegate(clazz); delegate.setDefaultMode(ControllerMode.MANUAL); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); //enableTrace("org.jboss.kernel.plugins.deployment"); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnonymousBeansTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001611610777663234033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleBeanImpl; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBeans; /** * Test anonymous beans. * * @author Ales Justin */ public class AnonymousBeansTestCase extends AbstractDeploymentTest { public AnonymousBeansTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(AnonymousBeansTestCase.class); } // ---- tests protected void doSetupBeans() throws Throwable { AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setName("somename"); List beans = new ArrayList(); deployment.setBeanFactories(beans); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("const_value", SimpleObjectWithBeans.class.getName()); builder.setConstructorValue(new AbstractBeanMetaData(null, SimpleObjectWithBeans.class.getName())); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("const_param", SimpleObjectWithBeans.class.getName()); builder.addConstructorParameter(SimpleBean.class.getName(), new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("prop", SimpleObjectWithBeans.class.getName()); builder.addPropertyMetaData("simpleBean", new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("list", SimpleObjectWithBeans.class.getName()); AbstractListMetaData list = new AbstractListMetaData(); list.add(new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); builder.addPropertyMetaData("list", list); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("set", SimpleObjectWithBeans.class.getName()); AbstractSetMetaData set = new AbstractSetMetaData(); set.add(new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); builder.addPropertyMetaData("set", set); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("map", SimpleObjectWithBeans.class.getName()); AbstractMapMetaData map = new AbstractMapMetaData(); map.put(new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName()), new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); builder.addPropertyMetaData("map", map); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); builder = BeanMetaDataBuilder.createBuilder("nested", SimpleObjectWithBeans.class.getName()); BeanMetaDataBuilder nested = BeanMetaDataBuilder.createBuilder(null, SimpleObjectWithBeans.class.getName()); nested.addConstructorParameter(SimpleBean.class.getName(), new AbstractBeanMetaData(null, SimpleBeanImpl.class.getName())); builder.addPropertyMetaData("nested", nested.getBeanMetaData()); beans.add((BeanMetaDataFactory)builder.getBeanMetaData()); deploy(deployment); } public void testAnonymous() throws Throwable { doSetupBeans(); SimpleObjectWithBeans const_value = assertBean("const_value", SimpleObjectWithBeans.class); SimpleObjectWithBeans const_value_1 = assertBean("const_value#1", SimpleObjectWithBeans.class); assertSame(const_value, const_value_1); SimpleObjectWithBeans const_param = assertBean("const_param", SimpleObjectWithBeans.class); SimpleBean const_param_1 = assertBean("const_param#1", SimpleBean.class); assertSame(const_param.getSimpleBean(), const_param_1); SimpleObjectWithBeans prop = assertBean("prop", SimpleObjectWithBeans.class); SimpleBean prop_bean = assertBean("prop$simpleBean#1", SimpleBean.class); assertSame(prop.getSimpleBean(), prop_bean); SimpleObjectWithBeans list = assertBean("list", SimpleObjectWithBeans.class); SimpleBean list_bean = assertBean("list#1", SimpleBean.class); assertNotNull(list.getList()); assertFalse(list.getList().isEmpty()); assertSame(list.getList().get(0), list_bean); SimpleObjectWithBeans set = assertBean("set", SimpleObjectWithBeans.class); SimpleBean set_bean = assertBean("set#1", SimpleBean.class); assertNotNull(set.getSet()); assertFalse(set.getSet().isEmpty()); assertSame(set.getSet().iterator().next(), set_bean); SimpleObjectWithBeans map = assertBean("map", SimpleObjectWithBeans.class); SimpleBean map_bean_1 = assertBean("map#1", SimpleBean.class); SimpleBean map_bean_2 = assertBean("map#2", SimpleBean.class); assertNotNull(map.getMap()); assertFalse(map.getMap().isEmpty()); assertSame(map.getMap().keySet().iterator().next(), map_bean_1); assertSame(map.getMap().values().iterator().next(), map_bean_2); SimpleObjectWithBeans nested = assertBean("nested", SimpleObjectWithBeans.class); SimpleObjectWithBeans nested_nested = assertBean("nested$nested#2", SimpleObjectWithBeans.class); SimpleBean nested_1 = assertBean("nested#1", SimpleBean.class); assertSame(nested.getNested(), nested_nested); assertSame(nested_nested.getSimpleBean(), nested_1); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnnotationRedeployTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001421111051024060033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import junit.framework.Test; 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.builder.BeanMetaDataBuilder; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.test.kernel.annotations.support.TestBean; import org.jboss.test.kernel.deployment.support.TestAnnotation1; /** * AnnotationRedeployTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class AnnotationRedeployTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(AnnotationRedeployTestCase.class); } public AnnotationRedeployTestCase(String name) throws Throwable { super(name); } public void testAnnotationRedeploy() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test", TestBean.class.getName()); builder.addAnnotation("@" + TestAnnotation1.class.getName()); ClassLoader cl = new TestClassLoader(getClass().getClassLoader()); builder.setClassLoader(cl); BeanMetaData beanMetaData = builder.getBeanMetaData(); MetaData metaData = null; TestClassLoader2 tcl = new TestClassLoader2(getClass().getClassLoader()); ClassLoader old = setContextClassLoader(tcl); try { KernelControllerContext context = deploy(beanMetaData); try { validate(); metaData = context.getScopeInfo().getMetaData(); assertNotNull(metaData); Object annotation = metaData.getMetaData(TestAnnotation1.class.getName()); assertNotNull(annotation); assertEquals(cl, annotation.getClass().getClassLoader()); } finally { undeploy(context); } assertNull(metaData.getMetaData(TestAnnotation1.class.getName())); cl = new TestClassLoader(getClass().getClassLoader()); beanMetaData.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData(cl))); context = deploy(beanMetaData); try { validate(); metaData = context.getScopeInfo().getMetaData(); assertNotNull(metaData); Object annotation = metaData.getMetaData(TestAnnotation1.class.getName()); assertNotNull(annotation); assertEquals(cl, annotation.getClass().getClassLoader()); } finally { undeploy(context); } } finally { setContextClassLoader(old); } } protected ClassLoader setContextClassLoader(ClassLoader tcl) { SecurityManager sm = suspendSecurity(); try { Thread thread = Thread.currentThread(); ClassLoader result = thread.getContextClassLoader(); thread.setContextClassLoader(tcl); return result; } finally { resumeSecurity(sm); } } private class TestClassLoader extends ClassLoader { public TestClassLoader(ClassLoader parent) { super(parent); } protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { if (TestAnnotation1.class.getName().equals(name)) { String resourceName = "/" + name.replace('.', '/') + ".class"; URL url = AnnotationRedeployTestCase.this.getResource(resourceName); InputStream is = null; byte[] bytes = null; try { is = url.openStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] tmp = new byte[1024]; int read = 0; while ( (read = is.read(tmp)) >= 0 ) baos.write(tmp, 0, read); bytes = baos.toByteArray(); } catch (IOException e) { throw new RuntimeException("Unable to load class byte code " + name, e); } finally { try { if (is != null) is.close(); } catch (IOException e) { // pointless } } return defineClass(name, bytes, 0, bytes.length); } return super.loadClass(name, resolve); } } private class TestClassLoader2 extends ClassLoader { public TestClassLoader2(ClassLoader parent) { super(parent); } protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { if (TestAnnotation1.class.getName().equals(name)) throw new ClassNotFoundException("Masked: " + name); return super.loadClass(name, resolve); } } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000552711002141272033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.List; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.container.BaseContext; import org.jboss.test.kernel.deployment.support.container.InstanceInterceptor; import org.jboss.test.kernel.deployment.support.container.ScopedContainer; /** * Test controller scopes. * * @author Ales Justin */ public class BeanContainerScopingTestCase extends ScopingDeploymentTest { public BeanContainerScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanContainerScopingTestCase.class); } public void testControllerScopes() throws Throwable { ScopedContainer sc1 = assertBean("CF1", ScopedContainer.class); List beans1 = sc1.createBeans("cf_base_1"); assertNotNull(beans1); assertEquals(2, beans1.size()); BaseContext bc1 = assertBean("cf_base_1$BeanContext", BaseContext.class); InstanceInterceptor ii1 = assertBean("cf_base_1$InstanceInterceptor", InstanceInterceptor.class); assertNotNull(bc1.getInterceptors()); assertEquals(1, bc1.getInterceptors().size()); assertSame(ii1, bc1.getInterceptors().get(0)); ScopedContainer sc2 = assertBean("CF2", ScopedContainer.class); List beans2 = sc2.createBeans("cf_base_2"); assertNotNull(beans2); assertEquals(2, beans2.size()); BaseContext bc2 = assertBean("cf_base_2$BeanContext", BaseContext.class); InstanceInterceptor ii2 = assertBean("cf_base_2$InstanceInterceptor", InstanceInterceptor.class); assertNotNull(bc2.getInterceptors()); assertEquals(1, bc2.getInterceptors().size()); assertSame(ii2, bc2.getInterceptors().get(0)); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingShutdownTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000351610756342051033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Scoping shutdown Deployment Test Delegate. * Doesn't throw exception on not found bean. * * @author Ales Justin */ public class ScopingShutdownTestDelegate extends ScopingTestDelegate { public ScopingShutdownTestDelegate(Class clazz) throws Exception { super(clazz); } protected KernelControllerContext handleNotFoundContext(Controller controller, Object name, ControllerState state) { if (controller.isShutdown() == false) return super.handleNotFoundContext(controller, name, state); else return null; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnonymousBeansXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000301210777165400033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; /** * Test anonymous beans. * * @author Ales Justin */ public class AnonymousBeansXMLTestCase extends AnonymousBeansTestCase { public AnonymousBeansXMLTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(AnonymousBeansXMLTestCase.class); } protected void doSetupBeans() { // do nothing } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerSetDemandTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000323011002060117033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.StaticHolder; /** * @author Ales Justin */ public class BeanContainerSetDemandTestCase extends AbstractDeploymentTest { public BeanContainerSetDemandTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(BeanContainerSetDemandTestCase.class); } public void testSetDemands() throws Throwable { StaticHolder bean = assertBean("demander", StaticHolder.class); assertNotNull(bean); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/SuperDemandAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000323211137570512033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.SomeCacheTreeManager; /** * SuperDemandAnnotationTestCase * * @author Ales Justin */ public class SuperDemandAnnotationTestCase extends AbstractDeploymentTest { public SuperDemandAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(SuperDemandAnnotationTestCase.class); } public void testDependency() throws Throwable { assertBean("Manager", SomeCacheTreeManager.class); } }././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/GenericBeanFactoryLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000435210604153706033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.test.kernel.deployment.support.SimpleBeanWithLifecycle; /** * GenericBeanFactory lifecycle Test Case. * * @author Adrian Brock * @version $Revision: 61978 $ */ public class GenericBeanFactoryLifecycleTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(GenericBeanFactoryLifecycleTestCase.class); } public GenericBeanFactoryLifecycleTestCase(String name) throws Throwable { super(name); } public void testGenericBeanFactoryLifecycle() throws Throwable { BeanFactory factory = (BeanFactory) getBean("Name1"); SimpleBeanWithLifecycle bean = (SimpleBeanWithLifecycle) factory.createBean(); assertTrue(bean.createInvoked); assertTrue(bean.startInvoked); assertFalse(bean.notCreateInvoked); assertFalse(bean.notStartInvoked); factory = (BeanFactory) getBean("Name2"); bean = (SimpleBeanWithLifecycle) factory.createBean(); assertFalse(bean.createInvoked); assertFalse(bean.startInvoked); assertTrue(bean.notCreateInvoked); assertTrue(bean.notStartInvoked); } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/NullifyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001346611113340313033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.Map; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.plugins.dependency.AbstractKernelController; import org.jboss.kernel.plugins.dependency.ConfigureAction; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.BaseTestCase; import org.jboss.test.kernel.deployment.support.NullifyTestBean1; /** * NullifyTestCase * * @author Ales Justin */ public class NullifyTestCase extends BaseTestCase { private KernelController controller; private ThrowableConfigureAction describe = new ThrowableConfigureAction(); public NullifyTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(NullifyTestCase.class); } public void testNullifying() throws Throwable { KernelController controller = getController(); describe.error = false; AbstractBeanMetaData abmd = new AbstractBeanMetaData("Bean1", NullifyTestBean1.class.getName()); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(abmd); AbstractPropertyMetaData property = new AbstractPropertyMetaData("something", builder.createMap(null, String.class.getName(), String.class.getName())); property.setPropertyType(Map.class.getName()); abmd.addProperty(property); KernelControllerContext context = controller.install(builder.getBeanMetaData()); controller.change(context, ControllerState.INSTANTIATED); assertEquals(ControllerState.INSTANTIATED, context.getState()); assertFalse(describe.error); } // ----------------------- private class ThrowableConfigureAction extends ConfigureAction { public boolean error; @Override protected void setAttributes(KernelControllerContext context, Object target, BeanInfo info, BeanMetaData metaData, boolean nullify) throws Throwable { try { super.setAttributes(context, target, info, metaData, nullify); } catch (Throwable t) { error = true; throw t; } } } protected void setUp() throws Exception { super.setUp(); controller = createController(); } protected void tearDown() throws Exception { if (controller != null) controller.shutdown(); controller = null; super.tearDown(); } protected KernelController createController() throws Exception { // bootstrap KernelConfig config = createKernelConfig(); BasicBootstrap bootstrap = config != null ? new BasicBootstrap(config) : new BasicBootstrap(); bootstrap.run(); Kernel kernel = bootstrap.getKernel(); return kernel.getController(); } protected KernelConfig createKernelConfig() { return new TestKernelConfig(); } protected KernelController getController() { return controller; } private class TestKernelConfig extends PropertyKernelConfig { public TestKernelConfig() { super(null); } public KernelController createKernelController() throws Throwable { return new TestController(); } } private class TestController extends AbstractKernelController { public TestController() throws Exception { } protected void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { if (ControllerState.CONFIGURED.equals(toState) && (context instanceof KernelControllerContext)) describe.install(context); else super.install(context, fromState, toState); } protected void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { if (ControllerState.CONFIGURED.equals(fromState) && (context instanceof KernelControllerContext)) describe.uninstall(context); else super.uninstall(context, fromState, toState); } } }././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/IgnoredAnnotatedLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000667010651430575033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.support.AnnotatedLifecycleBean; /** * Test ignore lifecycle annotations. * * @author Ales Justin */ public class IgnoredAnnotatedLifecycleTestCase extends AbstractManualDeploymentTest { private static final String BEAN_NAME = "LifecycleBean"; public IgnoredAnnotatedLifecycleTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(IgnoredAnnotatedLifecycleTestCase.class); } public void testAnnotatedLifecycle() throws Throwable { AnnotatedLifecycleBean target; KernelControllerContext context = getControllerContext(BEAN_NAME, ControllerState.NOT_INSTALLED); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.START); assertEquals(context.getState(), ControllerState.START); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CONFIGURED); assertEquals(context.getState(), ControllerState.CONFIGURED); target = (AnnotatedLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AnnotationUsageTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000331611054741610033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; /** * AnnotationUsageTestCase. * * @author Ales Justin */ public class AnnotationUsageTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(AnnotationUsageTestCase.class); } public AnnotationUsageTestCase(String name) throws Throwable { super(name); } public void testBadAnnotationXml() throws Exception { try { deploy("AnnotationUsageTestCase_Bad.xml"); } catch (Throwable t) { while (t.getCause() != null) t = t.getCause(); assertInstanceOf(t, IllegalArgumentException.class); } } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MixedLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000661710651430575033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.support.SimpleLifecycleBean; /** * Test mixed lifecycle with annotation override. * * @author Ales Justin */ public class MixedLifecycleTestCase extends AbstractManualDeploymentTest { private static final String BEAN_NAME = "LifecycleBean"; public MixedLifecycleTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(MixedLifecycleTestCase.class); } public void testAnnotatedLifecycle() throws Throwable { SimpleLifecycleBean target; KernelControllerContext context = getControllerContext(BEAN_NAME, ControllerState.NOT_INSTALLED); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.START); assertEquals(context.getState(), ControllerState.START); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertTrue(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertTrue(target.isStart()); assertTrue(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CONFIGURED); assertEquals(context.getState(), ControllerState.CONFIGURED); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertTrue(target.isStart()); assertTrue(target.isStop()); assertTrue(target.isDestroy()); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/WildcardClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000440110367363670033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.deployment.support.WildcardClassLoader; /** * Deployment ClassLoader Test Case. * * @author Adrian Brock * @version $Revision: 40742 $ */ public class WildcardClassLoaderTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(WildcardClassLoaderTestCase.class); } public WildcardClassLoaderTestCase(String name) throws Throwable { super(name); } public void testWildcardClassLoader() throws Throwable { KernelDeployment deployment = deploy("WildcardClassLoaderTestCase_NotAutomatic.xml"); try { validate(); ClassLoaderMetaData metadata = deployment.getClassLoader(); assertNotNull(metadata); ValueMetaData value = metadata.getClassLoader(); assertNotNull(value); Object cl = value.getUnderlyingValue(); assertNotNull(cl); assertTrue(cl instanceof WildcardClassLoader); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ScopingTestAPIDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000271011032645132033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.dependency.spi.Controller; /** * Scoping Deployment API Test Delegate. * * @author Ales Justin */ public class ScopingTestAPIDelegate extends ScopingTestDelegate { public ScopingTestAPIDelegate(Class clazz) throws Exception { super(clazz); } Controller getController() { return kernel.getController(); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/BeanContainerUsageMDTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000004110111002141272033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.deployment.support.container.BaseContext; import org.jboss.test.kernel.deployment.support.container.Bean1Type; import org.jboss.test.kernel.deployment.support.container.BeanContainer; import org.jboss.test.kernel.deployment.support.container.BeanContextFactory; import org.jboss.test.kernel.deployment.support.container.InstanceInterceptor; import org.jboss.test.kernel.deployment.support.container.plugin.GenericComponentFactory; import org.jboss.test.kernel.deployment.support.container.spi.ComponentFactory; import org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance; import org.jboss.test.kernel.deployment.support.container.spi.ComponentVisitor; /** * Programatic version of the BeanContainerUsageTestCase tests * * @author Scott.Stark@jboss.org * @version $Revision: 72449 $ */ public class BeanContainerUsageMDTestCase extends BeanContainerUsageTestCase { public static Test suite() { return suite(BeanContainerUsageMDTestCase.class); } public BeanContainerUsageMDTestCase(String name) { super(name); } /** * Test of the ComponentFactory usecase * * @see GenericComponentFactory * @see ComponentFactory * @throws Throwable */ @SuppressWarnings("unchecked") public void testComponentBeanFactory() throws Throwable { bootstrap(); // Lookup the ComponentFactory implementation ComponentFactory>> factory = (ComponentFactory>>) getBean("ComponentBeanFactory"); getLog().info("ComponentBeanFactory bean: "+factory); // Create a component instance ComponentInstance>> contextInstance = factory.createComponents("ComponentBeanFactory"); // Validate the component bean names List beanNames = contextInstance.getComponentNames(); getLog().info("createComponents(ComponentBeanFactory): "+beanNames); HashSet expectedBeanNames = new HashSet(); expectedBeanNames.add("ComponentBeanFactory@ContextFactory#1"); expectedBeanNames.add("ComponentBeanFactory@BeanInstance#1"); expectedBeanNames.add("ComponentBeanFactory@Interceptor:0#1"); assertEquals(expectedBeanNames, new HashSet(beanNames)); long compID = contextInstance.getComponentID(); assertEquals(1, compID); BaseContext> context = contextInstance.getContext(); assertNotNull(context); String contextName = contextInstance.getContextName(); assertEquals("ComponentBeanFactory@ContextFactory#1", contextName); Object contextBean = getBean("ComponentBeanFactory@ContextFactory#1"); assertTrue(contextBean == context); Bean1Type bean1 = (Bean1Type) getBean("ComponentBeanFactory@BeanInstance#1"); assertTrue(bean1 == context.getInstance()); Object interceptor = getBean("ComponentBeanFactory@Interceptor:0#1"); assertNotNull(interceptor); List expectedInterceptors = new ArrayList(); expectedInterceptors.add(interceptor); List interceptors = context.getInterceptors(); assertEquals(interceptors, expectedInterceptors); factory.destroyComponents(contextInstance); expectedBeanNames.clear(); expectedBeanNames.add("ComponentBeanFactory"); // Only the ComponentBeanFactory should exist assertBeansExist(expectedBeanNames); contextInstance = null; // Create a second component instance ComponentInstance>> contextInstance2 = factory.createComponents("ComponentBeanFactory"); // Validate the component bean names List beanNames2 = contextInstance2.getComponentNames(); getLog().info("createComponents(ComponentBeanFactory): "+beanNames2); expectedBeanNames = new HashSet(); expectedBeanNames.add("ComponentBeanFactory@ContextFactory#2"); expectedBeanNames.add("ComponentBeanFactory@BeanInstance#2"); expectedBeanNames.add("ComponentBeanFactory@Interceptor:0#2"); assertEquals(expectedBeanNames, new HashSet(beanNames2)); compID = contextInstance2.getComponentID(); assertEquals(2, compID); BaseContext> context2 = contextInstance2.getContext(); assertNotNull(context2); String contextName2 = contextInstance2.getContextName(); assertEquals("ComponentBeanFactory@ContextFactory#2", contextName2); Object contextBean2 = getBean("ComponentBeanFactory@ContextFactory#2"); assertTrue(contextBean2 == context2); Bean1Type bean2 = (Bean1Type) getBean("ComponentBeanFactory@BeanInstance#2"); assertTrue(bean2 == context2.getInstance()); assertTrue(bean2 != bean1); Object interceptor2 = getBean("ComponentBeanFactory@Interceptor:0#2"); assertNotNull(interceptor2); List expectedInterceptors2 = new ArrayList(); expectedInterceptors2.add(interceptor2); List interceptors2 = context2.getInterceptors(); assertEquals(interceptors2, expectedInterceptors2); factory.destroyComponents(contextInstance2); expectedBeanNames.clear(); expectedBeanNames.add("ComponentBeanFactory"); // Only the ComponentBeanFactory should exist assertBeansExist(expectedBeanNames); shutdown(); } /* */ protected KernelDeployment getDeploymentForDependencyInjectionOfBean() { AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setName("DependencyInjectionOfBean"); ArrayList beanFactories = new ArrayList(); // Bean1TypeFactory GenericBeanFactoryMetaData Bean1TypeFactory = new GenericBeanFactoryMetaData("Bean1TypeFactory", "org.jboss.test.kernel.deployment.support.container.Bean1Type"); beanFactories.add(Bean1TypeFactory); // Bean1TypePool AbstractBeanMetaData Bean1TypePool = new AbstractBeanMetaData("Bean1TypePool", "org.jboss.test.kernel.deployment.support.container.BeanPool"); Set Bean1TypePool_propertys = new HashSet(); Bean1TypePool_propertys.add(new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Bean1TypeFactory"))); Bean1TypePool.setProperties(Bean1TypePool_propertys); beanFactories.add(Bean1TypePool); // BeanContainer1Type AbstractBeanMetaData BeanContainer1Type = new AbstractBeanMetaData("BeanContainer1Type", "org.jboss.test.kernel.deployment.support.container.BeanContainer"); Set BeanContainer1Type_propertys = new HashSet(); BeanContainer1Type_propertys.add(new AbstractPropertyMetaData("pool", new AbstractDependencyValueMetaData("Bean1TypePool"))); BeanContainer1Type.setProperties(BeanContainer1Type_propertys); beanFactories.add(BeanContainer1Type); // Bean2TypeFactory GenericBeanFactoryMetaData Bean2TypeFactory = new GenericBeanFactoryMetaData("Bean2TypeFactory", "org.jboss.test.kernel.deployment.support.container.Bean2Type"); Set Bean2TypeFactory_propertys = new HashSet(); AbstractValueFactoryMetaData bean1CreateMethod = new AbstractValueFactoryMetaData("Bean1TypePool", "createBean"); Bean2TypeFactory_propertys.add(new AbstractPropertyMetaData("bean1", bean1CreateMethod)); Bean2TypeFactory.setProperties(Bean2TypeFactory_propertys); beanFactories.add(Bean2TypeFactory); // Bean2TypePool AbstractBeanMetaData Bean2TypePool = new AbstractBeanMetaData("Bean2TypePool", "org.jboss.test.kernel.deployment.support.container.BeanPool"); Set Bean2TypePool_propertys = new HashSet(); Bean2TypePool_propertys.add(new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Bean2TypeFactory"))); Bean2TypePool.setProperties(Bean2TypePool_propertys); beanFactories.add(Bean2TypePool); // BeanContainer2Type AbstractBeanMetaData BeanContainer2Type = new AbstractBeanMetaData("BeanContainer2Type", "org.jboss.test.kernel.deployment.support.container.BeanContainer"); Set BeanContainer2Type_propertys = new HashSet(); BeanContainer2Type_propertys.add(new AbstractPropertyMetaData("pool", new AbstractDependencyValueMetaData("Bean2TypePool"))); BeanContainer2Type.setProperties(BeanContainer2Type_propertys); beanFactories.add(BeanContainer2Type); deployment.setBeanFactories(beanFactories); return deployment; } /* 3 4 */ protected KernelDeployment getDeploymentForDependencyInjectionOfBeanWithMismatchedPoolSizes() { KernelDeployment deployment = getDeploymentForDependencyInjectionOfBean(); // Update the pool ctors List beanFactories = deployment.getBeanFactories(); for(BeanMetaDataFactory bmdf : beanFactories) { if(bmdf instanceof AbstractBeanMetaData) { AbstractBeanMetaData abmd = (AbstractBeanMetaData) bmdf; if(abmd.getName().equals("Bean1TypePool")) { AbstractConstructorMetaData ctor = new AbstractConstructorMetaData(); ArrayList params = new ArrayList(); params.add(new AbstractParameterMetaData(int.class.getName(), "3")); ctor.setParameters(params); abmd.setConstructor(ctor); } else if(abmd.getName().equals("Bean2TypePool")) { AbstractConstructorMetaData ctor = new AbstractConstructorMetaData(); ArrayList params = new ArrayList(); params.add(new AbstractParameterMetaData(int.class.getName(), "4")); ctor.setParameters(params); abmd.setConstructor(ctor); } } } return deployment; } /** * MetaData version of testComponentBeanFactory * * @return the kernel deployment */ @SuppressWarnings("unchecked") protected KernelDeployment getDeploymentForComponentBeanFactory() { AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setName("ComponentBeanFactory"); ArrayList beanFactories = new ArrayList(); // Bean context factory for Bean1Type BeanContainer container = new BeanContainer(); BeanContextFactory contextFactory = new BeanContextFactory(); contextFactory.setBeanClass(Bean1Type.class.getName()); contextFactory.setContainer(container); String[] interceptorNames = {InstanceInterceptor.class.getName()}; contextFactory.setInterceptorNames(Arrays.asList(interceptorNames)); /* BeanMetaDataFactory contextFactoryMD = installBeanInstance("ComponentBeanFactory", contextFactory); beanFactories.add(contextFactoryMD); */ ComponentVisitor visitor = null; GenericComponentFactory componentFactory = new GenericComponentFactory(contextFactory, visitor); BeanMetaDataFactory componentFactoryMD = installBeanInstance("ComponentBeanFactory", componentFactory); beanFactories.add(componentFactoryMD); deployment.setBeanFactories(beanFactories); return deployment; } protected BeanMetaDataFactory installBeanInstance(String name, Object bean) { AbstractBeanMetaData beanMD = new AbstractBeanMetaData(name, bean.getClass().getName()); beanMD.setConstructor(new AlreadyInstantiated(bean)); return beanMD; } public static class AlreadyInstantiated extends AbstractConstructorMetaData { private static final long serialVersionUID = 1L; private Object bean; public class Factory { public Object create() { return bean; } } public AlreadyInstantiated(Object bean) { this.bean = bean; this.setFactory(new AbstractValueMetaData(new Factory())); this.setFactoryClass(Factory.class.getName()); this.setFactoryMethod("create"); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/IgnoredLifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000657710656541211033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.support.SimpleLifecycleBean; /** * Test ignore lifecycle. * * @author Ales Justin */ public class IgnoredLifecycleTestCase extends AbstractManualDeploymentTest { private static final String BEAN_NAME = "LifecycleBean"; public IgnoredLifecycleTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(IgnoredLifecycleTestCase.class); } public void testIgnoredLifecycle() throws Throwable { SimpleLifecycleBean target; KernelControllerContext context = getControllerContext(BEAN_NAME, ControllerState.NOT_INSTALLED); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.START); assertEquals(context.getState(), ControllerState.START); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CREATE); assertEquals(context.getState(), ControllerState.CREATE); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); change(context, ControllerState.CONFIGURED); assertEquals(context.getState(), ControllerState.CONFIGURED); target = (SimpleLifecycleBean) context.getTarget(); assertNotNull(target); assertFalse(target.isCreate()); assertFalse(target.isStart()); assertFalse(target.isStop()); assertFalse(target.isDestroy()); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/MutableMetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001172711047072163033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.annotation.factory.AnnotationCreator; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.signature.MethodSignature; import org.jboss.metadata.spi.signature.Signature; import org.jboss.test.kernel.deployment.support.TestAnnotation1; import org.jboss.test.kernel.deployment.support.TestAnnotation2; import org.jboss.test.kernel.deployment.support.TestAnnotation3; /** * MutableMetaDataTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class MutableMetaDataTestCase extends AbstractDeploymentTest { public static Test suite() { return suite(MutableMetaDataTestCase.class); } public MutableMetaDataTestCase(String name) throws Throwable { super(name); } public void testMutableMetaData() throws Throwable { MutableMetaDataRepository repository = getMetaDataRepository().getMetaDataRepository(); ScopeKey instanceScope = new ScopeKey(CommonLevels.INSTANCE, "TestBean"); MemoryMetaDataLoader loader = new MemoryMetaDataLoader(instanceScope); TestAnnotation2 annotation = (TestAnnotation2) AnnotationCreator.createAnnotation("@org.jboss.test.kernel.deployment.support.TestAnnotation2", TestAnnotation2.class); loader.addAnnotation(annotation); repository.addMetaDataRetrieval(loader); ScopeKey setStringScope = new ScopeKey(CommonLevels.JOINPOINT, "setString"); MemoryMetaDataLoader stringProperty = new MemoryMetaDataLoader(setStringScope); stringProperty.addAnnotation(annotation); Signature signature = new MethodSignature("setString", String.class); loader.addComponentMetaDataRetrieval(signature, stringProperty); KernelDeployment deployment = deploy("MutableMetaDataTestCase_NotAutomatic.xml"); try { validate(); ControllerContext ctx = getControllerContext("TestBean"); MetaData metaData = ctx.getScopeInfo().getMetaData(); assertNotNull(metaData); assertNotNull("TestAnnotation1 from xml", metaData.getAnnotation(TestAnnotation1.class)); assertNotNull("TestAnnotation2 preconfigured", metaData.getAnnotation(TestAnnotation2.class)); assertNotNull("TestAnnotation3 from class", metaData.getAnnotation(TestAnnotation3.class)); MetaData setStringMetaData = metaData.getComponentMetaData(signature); assertNotNull("TestAnnotation1 from xml", setStringMetaData.getAnnotation(TestAnnotation1.class)); assertNotNull("TestAnnotation2 preconfigured", setStringMetaData.getAnnotation(TestAnnotation2.class)); assertNotNull("TestAnnotation3 from class", setStringMetaData.getAnnotation(TestAnnotation3.class)); } finally { undeploy(deployment); } // Check the preconfigured stuff still exists MetaData metaData = repository.getMetaData(instanceScope); assertNotNull(metaData); assertNull("TestAnnotation1 from xml", metaData.getAnnotation(TestAnnotation1.class)); assertNotNull("TestAnnotation2 preconfigured", metaData.getAnnotation(TestAnnotation2.class)); assertNull("TestAnnotation3 from class", metaData.getAnnotation(TestAnnotation3.class)); MetaData setStringMetaData = metaData.getComponentMetaData(signature); assertNull("TestAnnotation1 from xml", setStringMetaData.getAnnotation(TestAnnotation1.class)); assertNotNull("TestAnnotation2 preconfigured", setStringMetaData.getAnnotation(TestAnnotation2.class)); assertNull("TestAnnotation3 from class", setStringMetaData.getAnnotation(TestAnnotation3.class)); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/FineGrainedActionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001001310543762251033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.support.FineGrainedBean; /** * @author Ales Justin */ public class FineGrainedActionTestCase extends AbstractDeploymentTest { private static final String BEAN_NAME = "FineGrainedBean"; public FineGrainedActionTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(FineGrainedActionTestCase.class); } public void testFineGrainedActions() throws Throwable { KernelControllerContext context = getControllerContext(FineGrainedActionTestCase.BEAN_NAME, ControllerState.NOT_INSTALLED); FineGrainedBean target; change(context, ControllerState.DESCRIBED); target = (FineGrainedBean) context.getTarget(); assertNull(target); change(context, ControllerState.INSTANTIATED); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("INSTANTIATED", target.getStateString()); change(context, ControllerState.CONFIGURED); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("CONFIGURED", target.getStateString()); change(context, ControllerState.CREATE); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("CREATE", target.getStateString()); change(context, ControllerState.START); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("START", target.getStateString()); change(context, ControllerState.INSTALLED); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("INSTALLED", target.getStateString()); change(context, ControllerState.START); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("START", target.getStateString()); change(context, ControllerState.CREATE); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("CREATE", target.getStateString()); change(context, ControllerState.CONFIGURED); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("CONFIGURED", target.getStateString()); change(context, ControllerState.INSTANTIATED); target = (FineGrainedBean) context.getTarget(); assertNotNull(target); assertEquals("INSTANTIATED", target.getStateString()); change(context, ControllerState.DESCRIBED); target = (FineGrainedBean) context.getTarget(); assertNull(target); change(context, ControllerState.NOT_INSTALLED); target = (FineGrainedBean) context.getTarget(); assertNull(target); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/ContextualScopingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000632710657020413033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import org.jboss.test.kernel.deployment.support.FromAppBean; import org.jboss.test.kernel.deployment.support.FromBootBean; import org.jboss.test.kernel.deployment.support.ObjectWithFromAppBean; import org.jboss.test.kernel.deployment.support.ObjectWithFromBootBean; import org.jboss.test.kernel.deployment.support.SimpleBean; import org.jboss.test.kernel.deployment.support.SimpleObjectWithBean; /** * Contextual scoping tests. * Test includes same named beans. * * @author Ales Justin */ public class ContextualScopingTestCase extends ScopingDeploymentTest { public ContextualScopingTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ContextualScopingTestCase.class); } // ---- tests public void testSimpleScoping() throws Throwable { ClassLoader cl = (ClassLoader) getBean("cl"); assertNotNull(cl); SimpleObjectWithBean appScopeObject = (SimpleObjectWithBean) getBean("appScopeObject"); assertNotNull(appScopeObject); SimpleObjectWithBean deploy1 = (SimpleObjectWithBean) getBean("deploy1"); assertNotNull(deploy1); SimpleBean simple1 = deploy1.getSimpleBean(); assertNotNull(simple1); assertEquals("deployment1", simple1.getConstructorString()); SimpleObjectWithBean deploy2 = (SimpleObjectWithBean) getBean("deploy2"); assertNotNull(deploy2); SimpleBean simple2 = deploy2.getSimpleBean(); assertNotNull(simple2); assertEquals("deployment2", simple2.getConstructorString()); ObjectWithFromBootBean deploy3 = (ObjectWithFromBootBean)getBean("deploy3"); assertNotNull(deploy3); FromBootBean simple3 = deploy3.getSimpleBean(); assertNotNull(simple3); assertEquals("fromBoot", simple3.getConstructorString()); ObjectWithFromAppBean deploy4 = (ObjectWithFromAppBean)getBean("deploy4"); assertNotNull(deploy4); FromAppBean simple4 = deploy4.getSimpleBean(); assertNotNull(simple4); assertEquals("fromApp", simple4.getConstructorString()); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/DeploymentTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000001016711147522315033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Deployment Test Suite. * * @author Adrian Brock * @version $Revision: 84514 $ */ public class DeploymentTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Deployment Tests"); suite.addTest(BeanMetaDataTestCase.suite()); suite.addTest(BeanMetaDataWithClassloaderTestCase.suite()); suite.addTest(DeploymentClassLoaderTestCase.suite()); suite.addTest(GenericBeanFactoryLifecycleTestCase.suite()); suite.addTest(WildcardClassLoaderTestCase.suite()); suite.addTest(BeanMetaDataFactoryTestCase.suite()); suite.addTest(AnnotatedLifecycleTestCase.suite()); suite.addTest(IgnoredAnnotatedLifecycleTestCase.suite()); suite.addTest(IgnoredLifecycleTestCase.suite()); suite.addTest(IgnoredFactoryLifecycleTestCase.suite()); suite.addTest(MixedLifecycleTestCase.suite()); suite.addTest(FineGrainedActionTestCase.suite()); suite.addTest(ScopingTestCase.suite()); suite.addTest(AnnotatedDeploymentScopingTestCase.suite()); suite.addTest(IllegalScopingTestCase.suite()); suite.addTest(AnnotatedClassesScopingTestCase.suite()); suite.addTest(ContextualScopingTestCase.suite()); suite.addTest(InnerBeanScopingTestCase.suite()); suite.addTest(ScopingShutdownTestCase.suite()); suite.addTest(FromContextUnsupportedTestCase.suite()); suite.addTest(InCallbackInstantiatedTestCase.suite()); suite.addTest(AnonymousBeansTestCase.suite()); suite.addTest(AnonymousBeansXMLTestCase.suite()); suite.addTest(MutableMetaDataTestCase.suite()); suite.addTest(AnnotationRedeployTestCase.suite()); suite.addTest(MockServiceBindingTestCase.suite()); suite.addTest(MockEjb3DependsTestCase.suite()); suite.addTest(AnnotationUsageTestCase.suite()); suite.addTest(PropertyUsageTestCase.suite()); suite.addTest(AliasInjectTestCase.suite()); suite.addTest(GetInstanceTestCase.suite()); suite.addTest(NullifyTestCase.suite()); suite.addTest(TransitiveBeansTestCase.suite()); suite.addTest(BeanFactoryContextualInjectionTestCase.suite()); // bean container tests suite.addTest(BeanContainerUsageTestCase.suite()); suite.addTest(BeanContainerUsageMDTestCase.suite()); suite.addTest(BeanContainerScopingTestCase.suite()); suite.addTest(BeanContainerInjectionTestCase.suite()); suite.addTest(BeanContainerStaticTestCase.suite()); suite.addTest(BeanContainerSetDemandTestCase.suite()); // scoping alias tests suite.addTest(ScopingAliasTestCase.suite()); suite.addTest(ScopingAliasAPITestCase.suite()); suite.addTest(ScopingOverrideTestCase.suite()); suite.addTest(ScopingDependencyTestCase.suite()); // super-demand suite.addTest(SuperDemandAnnotationTestCase.suite()); suite.addTest(SuperDemandInstallTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/test/AbstractDeploymentTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/te0000644000175000017500000000377510756342051033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * Abstract Deployment Test Case. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class AbstractDeploymentTest extends MicrocontainerTest { public AbstractDeploymentTest(String name) throws Throwable { super(name); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); //enableTrace("org.jboss.kernel.plugins.deployment"); } }././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000755000175000017500000000000011620312142033347 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000755000175000017500000000000011620312142033347 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/MapJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001463610756342051033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * MapJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class MapJaxbTestCase extends AbstractMCTest { protected AbstractMapMetaData getMap() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractMapMetaData); return (AbstractMapMetaData) value; } public void testMap() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithClass() throws Exception { AbstractMapMetaData map = getMap(); assertEquals("MapClass", map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithKeyClass() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertEquals("KeyClass", map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithValueClass() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertEquals("ValueClass", map.getValueType()); } public void testMapWithValue() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertValue("Key", getKey(map)); assertValue("Value", getValue(map)); } public void testMapWithInjection() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertInjection(getKey(map)); assertInjection(getValue(map)); } public void testMapWithCollection() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertCollection(getKey(map)); assertCollection(getValue(map)); } public void testMapWithList() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertList(getKey(map)); assertList(getValue(map)); } public void testMapWithSet() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertSet(getKey(map)); assertSet(getValue(map)); } public void testMapWithArray() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertArray(getKey(map)); assertArray(getValue(map)); } public void testMapWithMap() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertMap(getKey(map)); assertMap(getValue(map)); } public void testMapWithNull() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertNullValue(getKey(map)); assertNullValue(getValue(map)); } public void testMapWithThis() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertThis(getKey(map)); assertThis(getValue(map)); } public void testMapWithWildcard() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertWildcard(getKey(map)); assertWildcard(getValue(map)); } public void testMapWithBean() throws Exception { AbstractMapMetaData map = getMap(); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertBean(getKey(map)); assertBean(getValue(map)); } protected ValueMetaData getKey(AbstractMapMetaData map) { assertEquals(1, map.size()); return (ValueMetaData) map.keySet().iterator().next(); } protected ValueMetaData getValue(AbstractMapMetaData map) { assertEquals(1, map.size()); return (ValueMetaData) map.values().iterator().next(); } public static Test suite() { return MapJaxbTestCase.suite(MapJaxbTestCase.class); } public MapJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DemandTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000627511147522315033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.dependency.spi.ControllerState; /** * Demand TestCase. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 84514 $ */ public class DemandTestCase extends AbstractXMLTest { protected AbstractDemandMetaData getDemand(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set demands = bean.getDemands(); assertNotNull(demands); assertEquals(1, demands.size()); AbstractDemandMetaData demand = (AbstractDemandMetaData) demands.iterator().next(); assertNotNull(demand); return demand; } public void testDemand() throws Exception { AbstractDemandMetaData demand = getDemand("Demand.xml"); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.DESCRIBED, demand.getWhenRequired()); } public void testDemandWithWhenRequired() throws Exception { AbstractDemandMetaData demand = getDemand("DemandWithWhenRequired.xml"); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.CONFIGURED, demand.getWhenRequired()); } public void testDemandWithTargetState() throws Exception { AbstractDemandMetaData demand = getDemand("DemandWithTargetState.xml"); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.CREATE, demand.getTargetState()); } public void testDemandWithTransformer() throws Exception { AbstractDemandMetaData demand = getDemand("DemandWithTransformer.xml"); assertEquals("Demand", demand.getDemand()); assertEquals("default", demand.getTransformer()); } public static Test suite() { return suite(DemandTestCase.class); } public DemandTestCase(String name) { super(name); } protected DemandTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/LifecycleCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000260210776707200033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * LifecycleCloneTestCase. * * @author Ales Justin */ public class LifecycleCloneTestCase extends LifecycleTestCase { public static Test suite() { return suite(LifecycleCloneTestCase.class); } public LifecycleCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ClassLoaderCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000261410776707200033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ClassLoaderCloneTestCase. * * @author Ales Justin */ public class ClassLoaderCloneTestCase extends ClassLoaderTestCase { public static Test suite() { return suite(ClassLoaderCloneTestCase.class); } public ClassLoaderCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/FactoryCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000257010776707200033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * FactoryCloneTestCase. * * @author Ales Justin */ public class FactoryCloneTestCase extends FactoryTestCase { public static Test suite() { return suite(FactoryCloneTestCase.class); } public FactoryCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CallbackCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000264610776707200033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * CallbackCloneTestCase. * * @author Ales Justin */ public class CallbackCloneTestCase extends CallbackTestCase { public CallbackCloneTestCase(String name) { super(name, true); } public static Test suite() { return suite(CallbackCloneTestCase.class); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SupplyCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000256310776707200033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * SupplyCloneTestCase. * * @author Ales Justin */ public class SupplyCloneTestCase extends SupplyTestCase { public static Test suite() { return suite(SupplyCloneTestCase.class); } public SupplyCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InstallCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000256310776707200033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * InstallCloneTestCase. * * @author Ales Justin */ public class InstallCloneTestCase extends InstallTestCase { public static Test suite() { return suite(InstallTestCase.class); } public InstallCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000560410776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ValueTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ValueTestCase extends AbstractXMLTest { protected StringValueMetaData getValue(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof StringValueMetaData); return (StringValueMetaData) value; } public void testValue() throws Exception { StringValueMetaData value = getValue("Value.xml"); assertNull(value.getType()); assertNull(value.getUnderlyingValue()); } public void testValueWithClass() throws Exception { StringValueMetaData value = getValue("ValueWithClass.xml"); assertEquals("ValueClass", value.getType()); assertNull(value.getUnderlyingValue()); } public void testValueWithValue() throws Exception { StringValueMetaData value = getValue("ValueWithValue.xml"); assertNull(value.getType()); assertEquals("Value", value.getUnderlyingValue()); } public static Test suite() { return suite(ValueTestCase.class); } public ValueTestCase(String name) { super(name); } protected ValueTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BeanFactoryJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000006424610770473134033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.ControllerMode; /** * BeanFactoryJaxbTestCase * * @author Adrian Brock * @version $Revision: 62474 $ */ public class BeanFactoryJaxbTestCase extends AbstractMCTest { public void testBeanFactoryWithName() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertEquals("Name1", factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithClass() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals(Object.class.getName(), factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithFactoryClass() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertEquals("MyFactory", factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithMode() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertEquals(ControllerMode.MANUAL, factory.getMode()); assertNull(factory.getAccessMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithAccessMode() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertEquals(BeanAccessMode.FIELDS, factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithClassLoader() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNotNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithConstructor() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNotNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); factory.getBeans(); } public void testBeanFactoryWithProperty() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNotNull(factory.getProperties()); HashSet expected = new HashSet(); expected.add("Property1"); assertProperties(expected, factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithProperties() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNotNull(factory.getProperties()); HashSet expected = new HashSet(); expected.add("Property1"); expected.add("Property2"); expected.add("Property3"); assertProperties(expected, factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithCreate() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNotNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithStart() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNotNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDependency() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Depends1"); assertDepends(expected, factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDependencies() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Depends1"); expected.add("Depends2"); expected.add("Depends3"); assertDepends(expected, factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDemand() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); HashSet expected = new HashSet(); expected.add("Demand1"); assertDemands(expected, factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDemands() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); HashSet expected = new HashSet(); expected.add("Demand1"); expected.add("Demand2"); expected.add("Demand3"); assertDemands(expected, factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithSupply() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); assertSupplies(expected, factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithSupplies() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); expected.add("Supply2"); expected.add("Supply3"); assertSupplies(expected, factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstall() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); List expected = new ArrayList(); expected.add("Install1"); assertInstalls(expected, factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstalls() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); List expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertInstalls(expected, factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstall() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); List expected = new ArrayList(); expected.add("Uninstall1"); assertInstalls(expected, factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstalls() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); List expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertInstalls(expected, factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstallCallback() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); List expected = new ArrayList(); expected.add("Install1"); assertCallbacks(expected, factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstallCallbacks() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); List expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertCallbacks(expected, factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstallCallback() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); List expected = new ArrayList(); expected.add("Uninstall1"); assertCallbacks(expected, factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstallCallbacks() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory(); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDepends()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); List expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertCallbacks(expected, factory.getUninstallCallbacks()); } public static Test suite() { return BeanFactoryJaxbTestCase.suite(BeanFactoryJaxbTestCase.class); } public BeanFactoryJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ArrayJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001340110756342051033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ArrayJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class ArrayJaxbTestCase extends AbstractMCTest { protected AbstractArrayMetaData getCollection() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractArrayMetaData); return (AbstractArrayMetaData) value; } public void testArray() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testArrayWithClass() throws Exception { AbstractArrayMetaData collection = getCollection(); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testArrayWithElementClass() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testArrayWithValue() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testArrayWithInjection() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testArrayWithCollection() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testArrayWithList() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testArrayWithSet() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testArrayWithArray() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testArrayWithMap() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testArrayWithNull() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testArrayWithThis() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testArrayWithWildcard() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testArrayWithBean() throws Exception { AbstractArrayMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractArrayMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return ArrayJaxbTestCase.suite(ArrayJaxbTestCase.class); } public ArrayJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/LifecycleJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001067610737774537033417 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * LifecycleJaxbTestCase. * * @author Adrian Brock * @version $Revision: 63037 $ */ public class LifecycleJaxbTestCase extends AbstractMCTest { protected LifecycleMetaData getLifecycle() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); LifecycleMetaData lifecycle = bean.getCreate(); assertNotNull(lifecycle); return lifecycle; } public void testLifecycle() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithMethod() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertEquals("Method", lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithIgnored() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertTrue(lifecycle.isIgnored()); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithAnnotation() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertNull(lifecycle.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithAnnotations() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertNull(lifecycle.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithParameter() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, lifecycle.getParameters()); } public void testLifecycleWithParameters() throws Exception { LifecycleMetaData lifecycle = getLifecycle(); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, lifecycle.getParameters()); } public static Test suite() { return LifecycleJaxbTestCase.suite(LifecycleJaxbTestCase.class); } public LifecycleJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/FactoryJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000720411002477016033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; /** * FactoryJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40798 $ */ public class FactoryJaxbTestCase extends AbstractMCTest { protected AbstractValueMetaData getFactory() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); ValueMetaData factory = constructor.getFactory(); assertNotNull(factory); assertTrue(factory instanceof AbstractValueMetaData); return (AbstractValueMetaData) factory; } protected AbstractDependencyValueMetaData getFactoryDependency() throws Exception { return (AbstractDependencyValueMetaData) getFactory(); } public void testFactoryWithBean() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency(); assertEquals("Bean1", dependency.getValue()); assertNull(dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testFactoryWithProperty() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency(); assertEquals("Dummy", dependency.getValue()); assertEquals("Property1", dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testFactoryWithState() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency(); assertEquals("Dummy", dependency.getValue()); assertNull(dependency.getProperty()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testFactoryWithWildcard() throws Exception { assertWildcard(getFactory()); } /* TODO public void testFactoryBadNoBeanOrWildcard() throws Exception { try { unmarshalBean("FactoryBadNoBeanOrWildcard.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return FactoryJaxbTestCase.suite(FactoryJaxbTestCase.class); } public FactoryJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InjectionCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000257510776707200033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * InjectionTestCase. * * @author Ales Justin */ public class InjectionCloneTestCase extends InjectionTestCase { public static Test suite() { return suite(InjectionCloneTestCase.class); } public InjectionCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BindingJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000670710763032124033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.policy.BindingMetaData; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; /** * @author Ales Justin */ public class BindingJaxbTestCase extends AbstractPolicyTest { public BindingJaxbTestCase(String name) { super(name); } public static Test suite() { return suite(BindingJaxbTestCase.class); } public void testBindingWithNoName() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); // assertEquals("", binding.getName()); // todo assertNotNull(binding.getValue()); assertNull(binding.getType()); } public void testBindingWithPlainValue() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertNull(binding.getType()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); } public void testBindingWithType() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); assertEquals(Integer.class.getName(), binding.getType()); } public void testBindingWithComplexValue() throws Throwable { // FIXME /* PolicyMetaData policy = unmarshalPolicy(); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); */ } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ConstructorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002467710776707200033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; /** * ConstructorTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ConstructorTestCase extends AbstractXMLTest { protected ConstructorMetaData getConstructor(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); return constructor; } public void testConstructor() throws Exception { ConstructorMetaData constructor = getConstructor("Constructor.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithBean() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithBean.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertBean(constructor.getValue()); } public void testConstructorWithLazy() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithLazy.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertLazy(constructor.getValue()); } public void testConstructorWithFactoryClass() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithFactoryClass.xml"); assertEquals("FactoryClass", constructor.getFactoryClass()); assertEquals("Dummy", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithFactoryMethod() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithFactoryMethod.xml"); assertEquals("Dummy", constructor.getFactoryClass()); assertEquals("FactoryMethod", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithAnnotation() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithAnnotation.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithAnnotations() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithAnnotations.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithFactory() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithFactory.xml"); assertNull(constructor.getFactoryClass()); assertEquals("Dummy", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNotNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithParameter() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithParameter.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithParameters() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithParameters.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithValue() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithValue.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertValue("Value", constructor.getValue()); } public void testConstructorWithInject() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithInject.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertInjection(constructor.getValue()); } public void testConstructorWithCollection() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithCollection.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertCollection(constructor.getValue()); } public void testConstructorWithList() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithList.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertList(constructor.getValue()); } public void testConstructorWithSet() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithSet.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertSet(constructor.getValue()); } public void testConstructorWithArray() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithArray.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertArray(constructor.getValue()); } public void testConstructorWithMap() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithMap.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertMap(constructor.getValue()); } public void testConstructorWithWildcard() throws Exception { ConstructorMetaData constructor = getConstructor("ConstructorWithWildcard.xml"); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertWildcard(constructor.getValue()); } public static Test suite() { return suite(ConstructorTestCase.class); } public ConstructorTestCase(String name) { super(name); } protected ConstructorTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ConstructorJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002523310763552240033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * ConstructorJaxbTestCase. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class ConstructorJaxbTestCase extends AbstractMCTest { protected ConstructorMetaData getConstructor() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); return constructor; } public void testConstructor() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithBean() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertBean(constructor.getValue()); } public void testConstructorWithLazy() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertLazy(constructor.getValue()); } public void testConstructorWithFactoryClass() throws Exception { ConstructorMetaData constructor = getConstructor(); assertEquals("FactoryClass", constructor.getFactoryClass()); assertEquals("Dummy", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithFactoryMethod() throws Exception { ConstructorMetaData constructor = getConstructor(); assertEquals("Dummy", constructor.getFactoryClass()); assertEquals("FactoryMethod", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithAnnotation() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithAnnotations() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithFactory() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertEquals("Dummy", constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNotNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithParameter() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithParameters() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, constructor.getParameters()); assertNull(constructor.getValue()); } public void testConstructorWithValue() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertValue("Value", constructor.getValue()); } public void testConstructorWithInject() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertInjection(constructor.getValue()); } public void testConstructorWithCollection() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertCollection(constructor.getValue()); } public void testConstructorWithList() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertList(constructor.getValue()); } public void testConstructorWithSet() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertSet(constructor.getValue()); } public void testConstructorWithArray() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertArray(constructor.getValue()); } public void testConstructorWithMap() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertMap(constructor.getValue()); } public void testConstructorWithWildcard() throws Exception { ConstructorMetaData constructor = getConstructor(); assertNull(constructor.getFactoryClass()); assertNull(constructor.getFactoryMethod()); assertNull(constructor.getAnnotations()); assertNull(constructor.getFactory()); assertNull(constructor.getParameters()); assertWildcard(constructor.getValue()); } /* TODO public void testConstructorBadFactoryClassNoFactoryMethod() throws Exception { try { unmarshalBean("ConstructorBadFactoryClassNoFactoryMethod.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ /* TODO public void testConstructorBadFactoryNoFactoryMethod() throws Exception { try { unmarshalBean("ConstructorBadFactoryNoFactoryMethod.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return ConstructorJaxbTestCase.suite(ConstructorJaxbTestCase.class); } public ConstructorJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AbstractMCTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002464410764372266033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.net.URL; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LazyMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.xb.binding.JBossXBException; /** * AbstractMCTest. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class AbstractMCTest extends AbstractBuilderTest { public AbstractMCTest(String name) { super(name); } protected AbstractKernelDeployment unmarshalDeployment() throws Exception { return unmarshalObject(AbstractKernelDeployment.class); } protected AbstractBeanMetaData unmarshalBean() throws Exception { return unmarshalObject(AbstractBeanMetaData.class); } protected GenericBeanFactoryMetaData unmarshalBeanFactory() throws Exception { return unmarshalObject(GenericBeanFactoryMetaData.class); } protected void assertAnnotations(Set expected, Set annotations) { assertNotNull(annotations); assertEquals(expected.size(), annotations.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = annotations.iterator(); i.hasNext();) { AnnotationMetaData annotation = i.next(); if (clonedExpected.remove(annotation.getAnnotationInstance().annotationType().getName()) == false) fail("Did not expect " + annotation + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + annotations); } protected void assertProperties(Set expected, Set properties) { assertNotNull(properties); assertEquals(expected.size(), properties.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = properties.iterator(); i.hasNext();) { PropertyMetaData property = i.next(); if (clonedExpected.remove(property.getName()) == false) fail("Did not expect " + property + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + properties); } protected void assertDepends(Set expected, Set depends) { assertNotNull(depends); assertEquals(expected.size(), depends.size()); HashSet clonedExpected = new HashSet(expected); for (DependencyMetaData depend : depends) { if (clonedExpected.remove(depend.getDependency()) == false) fail("Did not expect " + depend + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + depends); } protected void assertDemands(Set expected, Set demands) { assertNotNull(demands); assertEquals(expected.size(), demands.size()); HashSet clonedExpected = new HashSet(expected); for (DemandMetaData demand : demands) { if (clonedExpected.remove(demand.getDemand()) == false) fail("Did not expect " + demand + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + demands); } protected void assertSupplies(Set expected, Set supplies) { assertNotNull(supplies); assertEquals(expected.size(), supplies.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = supplies.iterator(); i.hasNext();) { SupplyMetaData supply = i.next(); if (clonedExpected.remove(supply.getSupply()) == false) fail("Did not expect " + supply + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + supplies); } protected void assertInstalls(List expected, List installs) { assertNotNull(installs); assertEquals(expected.size(), installs.size()); for (int i = 0; i < expected.size(); ++i) { InstallMetaData install = installs.get(i); String method = expected.get(i); assertEquals(method, install.getMethodName()); } } protected void assertCallbacks(List expected, List callbacks) { assertNotNull(callbacks); assertEquals(expected.size(), callbacks.size()); for (int i = 0; i < expected.size(); ++i) { CallbackMetaData callback = callbacks.get(i); String method = expected.get(i); assertEquals(method, callback.getMethodName()); } } protected void assertParameters(List expected, List parameters) { assertNotNull(parameters); assertEquals(expected.size(), parameters.size()); for (int i = 0; i < expected.size(); ++i) { ParameterMetaData parameter = parameters.get(i); String method = expected.get(i); assertEquals(method, parameter.getType()); } } protected void assertPlainValue(String expected, ValueMetaData valueMetaData) { assertValue(expected, valueMetaData); } protected void assertValue(String expected, ValueMetaData valueMetaData) { assertNotNull(valueMetaData); assertTrue(valueMetaData instanceof StringValueMetaData); Object value = valueMetaData.getUnderlyingValue(); assertEquals(expected, value); } protected void assertInjection(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractDependencyValueMetaData); } protected void assertNullValue(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractValueMetaData); assertNull(value.getUnderlyingValue()); } protected void assertWildcard(ValueMetaData value) { assertNotNull(value); assertEquals(AbstractValueMetaData.class, value.getClass()); Object wildcard = value.getUnderlyingValue(); assertNotNull(wildcard); } protected void assertCollection(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractCollectionMetaData); } protected void assertList(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractListMetaData); } protected void assertSet(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractSetMetaData); } protected void assertArray(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractArrayMetaData); } protected void assertMap(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractMapMetaData); } protected void assertThis(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof ThisValueMetaData); } protected void assertBean(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof BeanMetaData); } protected void assertLazy(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof LazyMetaData); } protected void checkJBossXBException(Class expected, Throwable throwable) { checkThrowable(JBossXBException.class, throwable); JBossXBException e = (JBossXBException) throwable; checkThrowable(expected, e.getCause()); } /** * Find the xml * * @param name the name * @return the url of the xml */ protected String findXML(String name) { name = getName().substring(4) + ".xml"; URL url = getClass().getResource(name); if (url == null) fail(name + " not found"); return url.toString(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/MapTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001537710776707200033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * MapTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class MapTestCase extends AbstractXMLTest { protected AbstractMapMetaData getMap(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractMapMetaData); return (AbstractMapMetaData) value; } public void testMap() throws Exception { AbstractMapMetaData map = getMap("Map.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithClass() throws Exception { AbstractMapMetaData map = getMap("MapWithClass.xml"); assertEquals("MapClass", map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithKeyClass() throws Exception { AbstractMapMetaData map = getMap("MapWithKeyClass.xml"); assertNull(map.getType()); assertEquals("KeyClass", map.getKeyType()); assertNull(map.getValueType()); } public void testMapWithValueClass() throws Exception { AbstractMapMetaData map = getMap("MapWithValueClass.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertEquals("ValueClass", map.getValueType()); } public void testMapWithValue() throws Exception { AbstractMapMetaData map = getMap("MapWithValue.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertValue("Key", getKey(map)); assertValue("Value", getValue(map)); } public void testMapWithInjection() throws Exception { AbstractMapMetaData map = getMap("MapWithInjection.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertInjection(getKey(map)); assertInjection(getValue(map)); } public void testMapWithCollection() throws Exception { AbstractMapMetaData map = getMap("MapWithCollection.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertCollection(getKey(map)); assertCollection(getValue(map)); } public void testMapWithList() throws Exception { AbstractMapMetaData map = getMap("MapWithList.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertList(getKey(map)); assertList(getValue(map)); } public void testMapWithSet() throws Exception { AbstractMapMetaData map = getMap("MapWithSet.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertSet(getKey(map)); assertSet(getValue(map)); } public void testMapWithArray() throws Exception { AbstractMapMetaData map = getMap("MapWithArray.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertArray(getKey(map)); assertArray(getValue(map)); } public void testMapWithMap() throws Exception { AbstractMapMetaData map = getMap("MapWithMap.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertMap(getKey(map)); assertMap(getValue(map)); } public void testMapWithNull() throws Exception { AbstractMapMetaData map = getMap("MapWithNull.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertNullValue(getKey(map)); assertNullValue(getValue(map)); } public void testMapWithThis() throws Exception { AbstractMapMetaData map = getMap("MapWithThis.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertThis(getKey(map)); assertThis(getValue(map)); } public void testMapWithWildcard() throws Exception { AbstractMapMetaData map = getMap("MapWithWildcard.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertWildcard(getKey(map)); assertWildcard(getValue(map)); } public void testMapWithBean() throws Exception { AbstractMapMetaData map = getMap("MapWithBean.xml"); assertNull(map.getType()); assertNull(map.getKeyType()); assertNull(map.getValueType()); assertBean(getKey(map)); assertBean(getValue(map)); } protected ValueMetaData getKey(AbstractMapMetaData map) { assertEquals(1, map.size()); return (ValueMetaData) map.keySet().iterator().next(); } protected ValueMetaData getValue(AbstractMapMetaData map) { assertEquals(1, map.size()); return (ValueMetaData) map.values().iterator().next(); } public static Test suite() { return suite(MapTestCase.class); } public MapTestCase(String name) { super(name); } protected MapTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ListTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001406410776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ListTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ListTestCase extends AbstractXMLTest { protected AbstractListMetaData getCollection(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractListMetaData); return (AbstractListMetaData) value; } public void testList() throws Exception { AbstractListMetaData collection = getCollection("List.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testListWithClass() throws Exception { AbstractListMetaData collection = getCollection("ListWithClass.xml"); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testListWithElementClass() throws Exception { AbstractListMetaData collection = getCollection("ListWithElementClass.xml"); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testListWithValue() throws Exception { AbstractListMetaData collection = getCollection("ListWithValue.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testListWithInjection() throws Exception { AbstractListMetaData collection = getCollection("ListWithInjection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testListWithCollection() throws Exception { AbstractListMetaData collection = getCollection("ListWithCollection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testListWithList() throws Exception { AbstractListMetaData collection = getCollection("ListWithList.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testListWithSet() throws Exception { AbstractListMetaData collection = getCollection("ListWithSet.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testListWithArray() throws Exception { AbstractListMetaData collection = getCollection("ListWithArray.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testListWithMap() throws Exception { AbstractListMetaData collection = getCollection("ListWithMap.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testListWithNull() throws Exception { AbstractListMetaData collection = getCollection("ListWithNull.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testListWithThis() throws Exception { AbstractListMetaData collection = getCollection("ListWithThis.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testListWithWildcard() throws Exception { AbstractListMetaData collection = getCollection("ListWithWildcard.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testListWithBean() throws Exception { AbstractListMetaData collection = getCollection("ListWithBean.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractListMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return suite(ListTestCase.class); } public ListTestCase(String name) { super(name); } protected ListTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ConstructorCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000261410776707200033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ConstructorCloneTestCase. * * @author Ales Justin */ public class ConstructorCloneTestCase extends ConstructorTestCase { public static Test suite() { return suite(ConstructorCloneTestCase.class); } public ConstructorCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DeploymentTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000003245410764016205033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.TreeSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory1; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory2; /** * DeploymentTestCase. * * @author Adrian Brock * @version $Revision: 70494 $ */ public class DeploymentTestCase extends AbstractXMLTest { public void testDeployment() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("Deployment.xml"); assertNull(deployment.getName()); assertNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithName() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithName.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithClassLoader() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithClassLoader.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNotNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithBean() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithBean.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeans() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMultipleBeans.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(3, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); } public void testDeploymentWithBeanFactory() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithBeanFactory.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeanFactorys() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMultipleBeanFactorys.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(3, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeanMetaDataFactorys() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMultipleBeanMetaDataFactorys.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beanFactories = deployment.getBeanFactories(); assertNotNull(beanFactories); assertEquals(3, beanFactories.size()); BeanMetaDataFactory factory = beanFactories.get(0); assertEquals(TestBeanMetaDataFactory.class.getName(), factory.getClass().getName()); factory = beanFactories.get(1); assertEquals(TestBeanMetaDataFactory1.class.getName(), factory.getClass().getName()); factory = beanFactories.get(2); assertEquals(TestBeanMetaDataFactory2.class.getName(), factory.getClass().getName()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(6, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getBean()); bean = beans.get(3); assertNotNull(bean); assertEquals("Bean4", bean.getBean()); bean = beans.get(4); assertNotNull(bean); assertEquals("Bean5", bean.getBean()); bean = beans.get(5); assertNotNull(bean); assertEquals("Bean6", bean.getBean()); } public void testDeploymentWithBeanMetaDataFactory() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithBeanMetaDataFactory.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beanFactories = deployment.getBeanFactories(); assertNotNull(beanFactories); assertEquals(1, beanFactories.size()); BeanMetaDataFactory factory = beanFactories.get(0); assertEquals(TestBeanMetaDataFactory.class.getName(), factory.getClass().getName()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(2, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); } public void testDeploymentWithMixed() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMixed.xml"); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(8, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(3); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); bean = beans.get(4); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(5); assertNotNull(bean); assertEquals("Bean4", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(6); assertNotNull(bean); assertEquals("Bean3", bean.getBean()); bean = beans.get(7); assertNotNull(bean); assertEquals("Bean4", bean.getBean()); } public void testDeploymentWithLifecycle() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithLifecycle.xml"); LifecycleMetaData create = deployment.getCreate(); assertNotNull(create); LifecycleMetaData start = deployment.getStart(); assertNotNull(start); LifecycleMetaData stop = deployment.getStop(); assertNotNull(stop); LifecycleMetaData destroy = deployment.getDestroy(); assertNotNull(destroy); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.iterator().next(); assertEquals(create, bean.getCreate()); assertEquals(start, bean.getStart()); assertEquals(stop, bean.getStop()); assertEquals(destroy, bean.getDestroy()); } public void testDeploymentWithMode() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithMode.xml"); ControllerMode mode = deployment.getMode(); assertNotNull(mode); assertEquals(ControllerMode.ON_DEMAND, mode); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.iterator().next(); assertEquals(mode, bean.getMode()); } public void testDeploymentWithAlias() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithAlias.xml"); Set aliases = deployment.getAliases(); assertNotNull(aliases); assertEquals(2, aliases.size()); Set stringAlias = new TreeSet(); for(NamedAliasMetaData namd : aliases) { assertNotNull(namd); Object ann = namd.getAliasValue(); assertNotNull(ann); stringAlias.add(ann.toString()); } Iterator iter = stringAlias.iterator(); String first = iter.next(); assertEquals("FirstAlias", first); String second = iter.next(); assertEquals("SecondAlias", second); } public void testDeploymentWithAnnotations() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment("DeploymentWithAnnotations.xml"); Set annotations = deployment.getAnnotations(); assertNotNull(annotations); assertEquals(2, annotations.size()); List annotationList = new ArrayList(annotations); Annotation ann = annotationList.get(0).getAnnotationInstance(); assertNotNull(ann); assertEquals(Annotation1.class.getName(), ann.annotationType().getName()); ann = annotationList.get(1).getAnnotationInstance(); assertNotNull(ann); assertEquals(AnnotationWithAttributes.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof AnnotationWithAttributes); AnnotationWithAttributes ann1 = (AnnotationWithAttributes)ann; assertNotNull(ann1.clazz()); assertEquals(Integer.class, ann1.clazz()); assertNotNull(ann1.integer()); assertEquals(100, ann1.integer()); assertNotNull(ann1.str()); assertEquals("Annotations are nice", ann1.str()); } public static Test suite() { return suite(DeploymentTestCase.class); } public DeploymentTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ScopeJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000451310763032124033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; import org.jboss.beans.metadata.spi.policy.ScopeMetaData; /** * @author Ales Justin */ public class ScopeJaxbTestCase extends AbstractPolicyTest { public ScopeJaxbTestCase(String name) { super(name); } public static Test suite() { return suite(ScopeJaxbTestCase.class); } public void testScope() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); ScopeMetaData scope = policy.getScope(); assertNull(scope.getLevel()); assertNull(scope.getQualifier()); } public void testScopeWithLevel() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); ScopeMetaData scope = policy.getScope(); assertNotNull(scope.getLevel()); assertEquals("DefaultLevel", scope.getLevel()); assertNull(scope.getQualifier()); } public void testScopeWithQualifier() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); ScopeMetaData scope = policy.getScope(); assertNull(scope.getLevel()); assertNotNull(scope.getQualifier()); assertEquals("SimpleQualifier", scope.getQualifier()); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SetCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000254410776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * SetCloneTestCase. * * @author Ales Justin */ public class SetCloneTestCase extends SetTestCase { public static Test suite() { return suite(SetCloneTestCase.class); } public SetCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AnnotationJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001156410756342051033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.lang.annotation.Annotation; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttribute; import org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes; /** * AnnotationJaxbTestCase. * * @author Adrian Brock * @version $Revision: 55527 $ */ public class AnnotationJaxbTestCase extends AbstractMCTest { protected AbstractAnnotationMetaData getAnnotation() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); Set annotations = constructor.getAnnotations(); assertEquals(1, annotations.size()); AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) annotations.iterator().next(); assertNotNull(annotation); return annotation; } public void testAnnotationSimple() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation(); Annotation ann = annotation.getAnnotationInstance(); assertEquals(Annotation1.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof Annotation1); } public void testAnnotationWithAttribute() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation(); Annotation ann = annotation.getAnnotationInstance(); assertEquals(AnnotationWithAttribute.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof AnnotationWithAttribute); AnnotationWithAttribute ann1 = (AnnotationWithAttribute)ann; assertNotNull(ann1.attribute()); assertEquals(Long.class, ann1.attribute()); } public void testAnnotationWithAttributes() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation(); Annotation ann = annotation.getAnnotationInstance(); assertEquals(AnnotationWithAttributes.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof AnnotationWithAttributes); AnnotationWithAttributes ann1 = (AnnotationWithAttributes)ann; assertNotNull(ann1.clazz()); assertEquals(Integer.class, ann1.clazz()); assertNotNull(ann1.integer()); assertEquals(100, ann1.integer()); assertNotNull(ann1.str()); assertEquals("Annotations are nice", ann1.str()); } /* TODO public void testAnnotationBadNoContent() throws Exception { try { unmarshalBean("AnnotationBadNoContent.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ /* TODO public void testAnnotationBadNoContent2() throws Exception { try { unmarshalBean("AnnotationBadNoContent2.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ /* TODO public void testAnnotationBadNoLeadingAt() throws Exception { try { unmarshalBean("AnnotationBadNoLeadingAt.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return AnnotationJaxbTestCase.suite(AnnotationJaxbTestCase.class); } public AnnotationJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ParameterJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001445610756342051033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * ParameterJaxbTestCase. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class ParameterJaxbTestCase extends AbstractMCTest { protected ParameterMetaData getParameter() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); List parameters = constructor.getParameters(); assertNotNull(parameters); assertEquals(1, parameters.size()); ParameterMetaData parameter = parameters.get(0); assertNotNull(parameter); return parameter; } public void testParameter() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithBean() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getAnnotations()); assertBean(parameter.getValue()); } public void testParameterWithClass() throws Exception { ParameterMetaData parameter = getParameter(); assertEquals("ParameterClass", parameter.getType()); assertNull(parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithAnnotation() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithAnnotations() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithPlainValue() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertPlainValue("PlainValue", parameter.getValue()); } public void testParameterWithValue() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertValue("Value", parameter.getValue()); } public void testParameterWithInjection() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertInjection(parameter.getValue()); } public void testParameterWithCollection() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertCollection(parameter.getValue()); } public void testParameterWithList() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertList(parameter.getValue()); } public void testParameterWithSet() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertSet(parameter.getValue()); } public void testParameterWithArray() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertArray(parameter.getValue()); } public void testParameterWithMap() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertMap(parameter.getValue()); } public void testParameterWithThis() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertThis(parameter.getValue()); } public void testParameterWithWildcard() throws Exception { ParameterMetaData parameter = getParameter(); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertWildcard(parameter.getValue()); } public static Test suite() { return ParameterJaxbTestCase.suite(ParameterJaxbTestCase.class); } public ParameterJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CollectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001455710776707200033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * CollectionTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class CollectionTestCase extends AbstractXMLTest { protected AbstractCollectionMetaData getCollection(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractCollectionMetaData); return (AbstractCollectionMetaData) value; } public void testCollection() throws Exception { AbstractCollectionMetaData collection = getCollection("Collection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testCollectionWithClass() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithClass.xml"); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testCollectionWithElementClass() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithElementClass.xml"); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testCollectionWithValue() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithValue.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testCollectionWithInjection() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithInjection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testCollectionWithCollection() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithCollection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testCollectionWithList() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithList.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testCollectionWithSet() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithSet.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testCollectionWithArray() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithArray.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testCollectionWithMap() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithMap.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testCollectionWithNull() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithNull.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testCollectionWithThis() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithThis.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testCollectionWithWildcard() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithWildcard.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testCollectionWithBean() throws Exception { AbstractCollectionMetaData collection = getCollection("CollectionWithBean.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractCollectionMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return suite(CollectionTestCase.class); } public CollectionTestCase(String name) { super(name); } protected CollectionTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001006510776707200033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.lang.annotation.Annotation; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttribute; import org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes; /** * AnnotationTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class AnnotationTestCase extends AbstractXMLTest { protected AbstractAnnotationMetaData getAnnotation(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); Set annotations = constructor.getAnnotations(); assertEquals(1, annotations.size()); AbstractAnnotationMetaData annotation = (AbstractAnnotationMetaData) annotations.iterator().next(); assertNotNull(annotation); return annotation; } public void testSimpleAnnotation() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation("AnnotationSimple.xml"); Annotation ann = annotation.getAnnotationInstance(); assertEquals(Annotation1.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof Annotation1); } public void testAnnotationWithAttribute() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation("AnnotationWithAttribute.xml"); Annotation ann = annotation.getAnnotationInstance(); assertEquals(AnnotationWithAttribute.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof AnnotationWithAttribute); AnnotationWithAttribute ann1 = (AnnotationWithAttribute)ann; assertNotNull(ann1.attribute()); assertEquals(Long.class, ann1.attribute()); } public void testAnnotationWithAttributes() throws Exception { AbstractAnnotationMetaData annotation = getAnnotation("AnnotationWithAttributes.xml"); Annotation ann = annotation.getAnnotationInstance(); assertEquals(AnnotationWithAttributes.class.getName(), ann.annotationType().getName()); assertTrue(ann instanceof AnnotationWithAttributes); AnnotationWithAttributes ann1 = (AnnotationWithAttributes)ann; assertNotNull(ann1.clazz()); assertEquals(Integer.class, ann1.clazz()); assertNotNull(ann1.integer()); assertEquals(100, ann1.integer()); assertNotNull(ann1.str()); assertEquals("Annotations are nice", ann1.str()); } public static Test suite() { return suite(AnnotationTestCase.class); } public AnnotationTestCase(String name) { super(name); } protected AnnotationTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BeanJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000010060211044026555033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * BeanJaxbTestCase. * * @author Adrian Brock * @version $Revision: 62474 $ */ public class BeanJaxbTestCase extends AbstractMCTest { public void testBeanWithName() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertEquals("Name1", bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithClass() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertEquals(ControllerMode.MANUAL, bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithErrorHandlingMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertEquals(ErrorHandlingMode.MANUAL, bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAccessMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertEquals(BeanAccessMode.FIELDS, bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAnnotation() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAnnotations() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithClassLoader() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNotNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithConstructor() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNotNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithProperty() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); assertProperties(expected, bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithProperties() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); expected.add("Property2"); expected.add("Property3"); assertProperties(expected, bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithCreate() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNotNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithStart() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNotNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithStop() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNotNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDestroy() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNotNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDependency() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Depends1"); assertDepends(expected, bean.getDepends()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDependencies() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Depends1"); expected.add("Depends2"); expected.add("Depends3"); assertDepends(expected, bean.getDepends()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDemand() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Demand1"); assertDemands(expected, bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDemands() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Demand1"); expected.add("Demand2"); expected.add("Demand3"); assertDemands(expected, bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithSupply() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); assertSupplies(expected, bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithSupplies() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); expected.add("Supply2"); expected.add("Supply3"); assertSupplies(expected, bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithInstall() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertInstalls(expected, bean.getInstalls()); assertNull(bean.getUninstalls()); } public void testBeanWithInstalls() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertInstalls(expected, bean.getInstalls()); assertNull(bean.getUninstalls()); } public void testBeanWithUninstall() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertInstalls(expected, bean.getUninstalls()); } public void testBeanWithUninstalls() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertInstalls(expected, bean.getUninstalls()); } public void testBeanWithInstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertCallbacks(expected, bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithInstallCallbacks() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertCallbacks(expected, bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithUninstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertCallbacks(expected, bean.getUninstallCallbacks()); } public void testBeanWithUninstallCallbacks() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertCallbacks(expected, bean.getUninstallCallbacks()); } public void testBeanWithRelated() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getAutowireType()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); Set expected = new HashSet(); expected.add(new AbstractRelatedClassMetaData("Dummy")); assertEquals(expected, bean.getRelated()); } public void testBeanWithRelateds() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); assertNull(bean.getAutowireType()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); Set expected = new HashSet(); expected.add(new AbstractRelatedClassMetaData("Dummy")); AbstractRelatedClassMetaData arcmd = new AbstractRelatedClassMetaData("Dummy"); arcmd.setEnabledValue("md"); expected.add(arcmd); assertEquals(expected, bean.getRelated()); } /* TODO public void testBeanBadNoClassOrConstructor() throws Exception { try { unmarshalBean(); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ /* TODO public void testBeanBadNoClassOrFactoryMethod() throws Exception { try { unmarshalBean(); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ /* TODO public void testBeanBadNoClassOrFactory() throws Exception { try { unmarshalBean(); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return BeanJaxbTestCase.suite(BeanJaxbTestCase.class); } public BeanJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SupplyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000473710776707200033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; /** * SupplyTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class SupplyTestCase extends AbstractXMLTest { protected AbstractSupplyMetaData getSupply(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set supplies = bean.getSupplies(); assertNotNull(supplies); assertEquals(1, supplies.size()); AbstractSupplyMetaData supply = (AbstractSupplyMetaData) supplies.iterator().next(); assertNotNull(supply); return supply; } public void testSupply() throws Exception { AbstractSupplyMetaData supply = getSupply("Supply.xml"); assertEquals("Supply", supply.getSupply()); } public void testSupplyWithClass() throws Exception { AbstractSupplyMetaData supply = getSupply("SupplyWithClass.xml"); assertEquals(123, supply.getSupply()); assertEquals("java.lang.Integer", supply.getType()); } public static Test suite() { return suite(SupplyTestCase.class); } public SupplyTestCase(String name) { super(name); } protected SupplyTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CallbackJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002301710737774537033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * CallbackJaxbTestCase. * * @author Ales Justin */ public class CallbackJaxbTestCase extends AbstractMCTest { public CallbackJaxbTestCase(String name) { super(name); } public static Test suite() { return CallbackJaxbTestCase.suite(CallbackJaxbTestCase.class); } protected CallbackMetaData getInstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); List callbacks = bean.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); CallbackMetaData callback = callbacks.get(0); assertNotNull(callback); return callback; } protected CallbackMetaData getUninstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); List callbacks = bean.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); CallbackMetaData callback = callbacks.get(0); assertNotNull(callback); return callback; } public void testCallbackInstallWithProperty() throws Exception { CallbackMetaData install = getInstallCallback(); assertEquals("someProperty", install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackInstallWithMethod() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("someMethod", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackInstallWithState() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackInstallWithAnnotation() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackInstallWithAnnotations() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackInstallWithSignature() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getSignature()); assertEquals("someSignature", install.getSignature()); } public void testCallbackInstallWithCardinality() throws Exception { CallbackMetaData install = getInstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getCardinality()); assertEquals(install.getCardinality(), Cardinality.ONE_TO_MANY); } /* TODO public void testInstallBothMethodProperty() throws Exception { try { unmarshalBean("CallbackInstallBadMethodProperty.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ // --- Uninstall public void testCallbackUninstallWithProperty() throws Exception { CallbackMetaData install = getUninstallCallback(); assertEquals("someProperty", install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackUninstallWithMethod() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("someMethod", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackUninstallWithState() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackUninstallWithAnnotation() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackUninstallWithAnnotations() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testCallbackUninstallWithSignature() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getSignature()); assertEquals("someSignature", install.getSignature()); } public void testCallbackUninstallWithCardinality() throws Exception { CallbackMetaData install = getUninstallCallback(); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getCardinality()); assertEquals(install.getCardinality(), Cardinality.fromString("2..10")); } /* TODO public void testUninstallBothMethodProperty() throws Exception { try { unmarshalBean("CallbackUninstallBadMethodProperty.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/PropertyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001717010776707200033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * PropertyTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class PropertyTestCase extends AbstractXMLTest { protected PropertyMetaData getProperty(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); return property; } public void testProperty() throws Exception { PropertyMetaData property = getProperty("Property.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithBean() throws Exception { PropertyMetaData property = getProperty("PropertyWithBean.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); ValueMetaData value = property.getValue(); assertBean(value); } public void testPropertyWithClass() throws Exception { PropertyMetaData property = getProperty("PropertyWithClass.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); AbstractPropertyMetaData apmd = assertInstanceOf(property, AbstractPropertyMetaData.class); assertEquals("PropertyClass", apmd.getPropertyType()); } public void testPropertyWithAnnotation() throws Exception { PropertyMetaData property = getProperty("PropertyWithAnnotation.xml"); assertNotNull("PropertyName", property.getName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithAnnotations() throws Exception { PropertyMetaData property = getProperty("PropertyWithAnnotations.xml"); assertNotNull("PropertyName", property.getName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithPlainValue() throws Exception { PropertyMetaData property = getProperty("PropertyWithPlainValue.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertPlainValue("PlainValue", property.getValue()); } public void testPropertyWithPreInstantiate() throws Exception { PropertyMetaData property = getProperty("PropertyWithPreInstantiate.xml"); assertFalse("PreInstantiate should be false.", property.isPreInstantiate()); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertPlainValue("PlainValue", property.getValue()); } public void testPropertyWithValue() throws Exception { PropertyMetaData property = getProperty("PropertyWithValue.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertValue("Value", property.getValue()); } public void testPropertyWithInjection() throws Exception { PropertyMetaData property = getProperty("PropertyWithInjection.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertInjection(property.getValue()); } public void testPropertyWithCollection() throws Exception { PropertyMetaData property = getProperty("PropertyWithCollection.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertCollection(property.getValue()); } public void testPropertyWithList() throws Exception { PropertyMetaData property = getProperty("PropertyWithList.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertList(property.getValue()); } public void testPropertyWithSet() throws Exception { PropertyMetaData property = getProperty("PropertyWithSet.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertSet(property.getValue()); } public void testPropertyWithArray() throws Exception { PropertyMetaData property = getProperty("PropertyWithArray.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertArray(property.getValue()); } public void testPropertyWithMap() throws Exception { PropertyMetaData property = getProperty("PropertyWithMap.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertMap(property.getValue()); } public void testPropertyWithThis() throws Exception { PropertyMetaData property = getProperty("PropertyWithThis.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertThis(property.getValue()); } public void testPropertyWithNull() throws Exception { PropertyMetaData property = getProperty("PropertyWithNull.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertNullValue(property.getValue()); } public void testPropertyWithWildcard() throws Exception { PropertyMetaData property = getProperty("PropertyWithWildcard.xml"); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertWildcard(property.getValue()); } public static Test suite() { return suite(PropertyTestCase.class); } public PropertyTestCase(String name) { super(name); } protected PropertyTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/XMLTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000537110756342051033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * XMLTestDelegate. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class XMLTestDelegate extends AbstractTestDelegate { /** The unmarshaller factory */ protected UnmarshallerFactory unmarshallerFactory; /** The resolver */ protected SchemaBindingResolver resolver; /** * Create a new XMLTestDelegate. * * @param clazz the test class */ public XMLTestDelegate(Class clazz) { super(clazz); } public void setUp() throws Exception { super.setUp(); unmarshallerFactory = UnmarshallerFactory.newInstance(); resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); } /** * Unmarshal an object * * @param url the url * @return the object * @throws Exception for any error */ public Object unmarshal(String url) throws Exception { long start = System.currentTimeMillis(); Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller(); log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms"); try { Object result = unmarshaller.unmarshal(url, resolver); log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms"); return result; } catch (Exception e) { log.debug("Error during parsing: " + url, e); throw e; } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ParameterTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001525310776707200033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; /** * ParameterTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ParameterTestCase extends AbstractXMLTest { protected ParameterMetaData getParameter(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); List parameters = constructor.getParameters(); assertNotNull(parameters); assertEquals(1, parameters.size()); ParameterMetaData parameter = parameters.get(0); assertNotNull(parameter); return parameter; } public void testParameter() throws Exception { ParameterMetaData parameter = getParameter("Parameter.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithBean() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithBean.xml"); assertNull(parameter.getAnnotations()); assertBean(parameter.getValue()); } public void testParameterWithClass() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithClass.xml"); assertEquals("ParameterClass", parameter.getType()); assertNull(parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithAnnotation() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithAnnotation.xml"); assertNull(parameter.getType()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithAnnotations() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithAnnotations.xml"); assertNull(parameter.getType()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, parameter.getAnnotations()); assertNull(parameter.getValue()); } public void testParameterWithPlainValue() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithPlainValue.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertPlainValue("PlainValue", parameter.getValue()); } public void testParameterWithValue() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithValue.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertValue("Value", parameter.getValue()); } public void testParameterWithInjection() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithInjection.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertInjection(parameter.getValue()); } public void testParameterWithCollection() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithCollection.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertCollection(parameter.getValue()); } public void testParameterWithList() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithList.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertList(parameter.getValue()); } public void testParameterWithSet() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithSet.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertSet(parameter.getValue()); } public void testParameterWithArray() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithArray.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertArray(parameter.getValue()); } public void testParameterWithMap() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithMap.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertMap(parameter.getValue()); } public void testParameterWithThis() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithThis.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertThis(parameter.getValue()); } public void testParameterWithWildcard() throws Exception { ParameterMetaData parameter = getParameter("ParameterWithWildcard.xml"); assertNull(parameter.getType()); assertNull(parameter.getAnnotations()); assertWildcard(parameter.getValue()); } public static Test suite() { return suite(ParameterTestCase.class); } public ParameterTestCase(String name) { super(name); } protected ParameterTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/MapCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000254410776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * MapCloneTestCase. * * @author Ales Justin */ public class MapCloneTestCase extends MapTestCase { public static Test suite() { return suite(MapCloneTestCase.class); } public MapCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ClassLoaderJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000573410737774537033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; /** * ClassLoaderJaxbTestCase. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class ClassLoaderJaxbTestCase extends AbstractMCTest { protected ClassLoaderMetaData getClassLoader() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); ClassLoaderMetaData classLoader = deployment.getClassLoader(); assertNotNull(classLoader); return classLoader; } public void testClassLoaderWithBean() throws Exception { ClassLoaderMetaData classLoader = getClassLoader(); assertNotNull(classLoader.getClassLoader()); assertTrue(classLoader.getClassLoader() instanceof BeanMetaData); } public void testClassLoaderWithInject() throws Exception { ClassLoaderMetaData classLoader = getClassLoader(); assertInjection(classLoader.getClassLoader()); } public void testClassLoaderWithNull() throws Exception { ClassLoaderMetaData classLoader = getClassLoader(); assertNullValue(classLoader.getClassLoader()); } public void testClassLoaderWithWildcard() throws Exception { ClassLoaderMetaData classLoader = getClassLoader(); assertWildcard(classLoader.getClassLoader()); } /* TODO public void testClassLoaderBadNoValue() throws Exception { try { unmarshalDeployment("ClassLoaderBadNoValue.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return ClassLoaderJaxbTestCase.suite(ClassLoaderJaxbTestCase.class); } public ClassLoaderJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/RelatedClassTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000555411043375327033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; /** * RelatedTestCase. * * @author Ales Justin */ public class RelatedClassTestCase extends AbstractXMLTest { protected RelatedClassMetaData getRelated(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set related = bean.getRelated(); assertNotNull(related); assertEquals(1, related.size()); RelatedClassMetaData rcmd = related.iterator().next(); assertNotNull(rcmd); return rcmd; } public void testRelatedWithName() throws Exception { RelatedClassMetaData related = getRelated("RelatedWithName.xml"); assertEquals("java.lang.Object", related.getClassName()); } public void testRelatedWithEnabled() throws Exception { RelatedClassMetaData related = getRelated("RelatedWithEnabled.xml"); assertEquals("java.lang.Object", related.getClassName()); Set enabled = related.getEnabled(); assertNotNull(enabled); assertEquals(1, enabled.size()); assertEquals("aop", enabled.iterator().next()); } public void testRelatedWithEnableds() throws Exception { RelatedClassMetaData related = getRelated("RelatedWithEnableds.xml"); assertEquals("java.lang.Object", related.getClassName()); Set enabled = related.getEnabled(); assertNotNull(enabled); assertEquals(2, enabled.size()); } public static Test suite() { return suite(RelatedClassTestCase.class); } public RelatedClassTestCase(String name) { super(name); } protected RelatedClassTestCase(String name, boolean useClone) { super(name, useClone); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/LifecycleTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001117510776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * LifecycleTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class LifecycleTestCase extends AbstractXMLTest { protected LifecycleMetaData getLifecycle(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); LifecycleMetaData lifecycle = bean.getCreate(); assertNotNull(lifecycle); return lifecycle; } public void testLifecycle() throws Exception { LifecycleMetaData lifecycle = getLifecycle("Lifecycle.xml"); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithMethod() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithMethod.xml"); assertEquals("Method", lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithIgnored() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithIgnored.xml"); assertTrue(lifecycle.isIgnored()); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithAnnotation() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithAnnotation.xml"); assertNull(lifecycle.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithAnnotations() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithAnnotations.xml"); assertNull(lifecycle.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, lifecycle.getAnnotations()); assertNull(lifecycle.getParameters()); } public void testLifecycleWithParameter() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithParameter.xml"); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, lifecycle.getParameters()); } public void testLifecycleWithParameters() throws Exception { LifecycleMetaData lifecycle = getLifecycle("LifecycleWithParameters.xml"); assertNull(lifecycle.getMethodName()); assertNull(lifecycle.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, lifecycle.getParameters()); } public static Test suite() { return suite(LifecycleTestCase.class); } public LifecycleTestCase(String name) { super(name); } protected LifecycleTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CollectionCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000260710776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * CollectionCloneTestCase. * * @author Ales Justin */ public class CollectionCloneTestCase extends CollectionTestCase { public static Test suite() { return suite(CollectionCloneTestCase.class); } public CollectionCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AbstractBuilderTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001404411301242575033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.net.URL; import java.util.Collection; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; import org.jboss.util.UnreachableStatementException; import org.jboss.xb.binding.sunday.unmarshalling.DefaultHandlers; import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding; import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler; import org.jboss.xb.binding.sunday.unmarshalling.SequenceBinding; import org.jboss.xb.binding.sunday.unmarshalling.TermBinding; /** * AbstractBuilderTest. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class AbstractBuilderTest extends AbstractTestCaseWithSetup { protected String rootName = getRootName(); private static final DebugElementHandler DEBUG_ELEMENT_HANDLER = new DebugElementHandler(); private ParticleHandler elementHandler; private ParticleHandler simpleHandler; public AbstractBuilderTest(String name) { super(name); } /** * Setup the test delegate * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new JBossXBTestDelegate(clazz); } protected JBossXBTestDelegate getJBossXBDelegate() { return (JBossXBTestDelegate) getDelegate(); } @Override protected void setUp() throws Exception { elementHandler = DefaultHandlers.ELEMENT_HANDLER; simpleHandler = DefaultHandlers.SIMPLE_HANDLER; DefaultHandlers.ELEMENT_HANDLER = DEBUG_ELEMENT_HANDLER; DefaultHandlers.SIMPLE_HANDLER = DefaultHandlers.ELEMENT_HANDLER; super.setUp(); configureLogging(); } protected void tearDown() throws Exception { super.tearDown(); DefaultHandlers.ELEMENT_HANDLER = elementHandler; elementHandler = null; DefaultHandlers.SIMPLE_HANDLER = simpleHandler; simpleHandler = null; } protected T unmarshalObject(Class expected) throws Exception { String testXml = findTestXml(); Object o = unmarshal(testXml); assertNotNull(o); getLog().debug("Unmarshalled " + o + " of type " + o.getClass().getName()); try { return expected.cast(o); } catch (ClassCastException e) { fail("Expected " + expected.getName() + " got " + o.getClass().getName()); throw new UnreachableStatementException(); } } /** * Unmarshal some xml * * @param name the name * @param expected the expected type * @return the unmarshalled object * @throws Exception for any error */ protected Object unmarshal(String name, Class expected) throws Exception { Object object = unmarshal(name); if (object == null) fail("No object from " + name); assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass())); return object; } /** * Unmarshal some xml * * @param name the name * @return the unmarshalled object * @throws Exception for any error */ protected Object unmarshal(String name) throws Exception { String url = findXML(name); return getJBossXBDelegate().unmarshal(url); } protected String findTestXml() { String result = rootName + "_" + getName() + ".xml"; if (getResource(result) == null) result = rootName + ".xml"; return result; } /** * Get the package root name * * @return the root name */ protected String getRootName() { String longName = getClass().getName(); int dot = longName.lastIndexOf('.'); if (dot != -1) longName = longName.substring(dot + 1); dot = longName.lastIndexOf("UnitTestCase"); if (dot != -1) longName = longName.substring(0, dot); return longName; } protected TermBinding assertSingleSequence(TermBinding term) { assertNotNull(term); assertTrue(term instanceof SequenceBinding); SequenceBinding sequence = (SequenceBinding) term; Collection particles = sequence.getParticles(); assertTrue(particles.size() == 1); ParticleBinding particle = particles.iterator().next(); term = particle.getTerm(); assertNotNull(term); return term; } /** * Find the xml * * @param name the name * @return the url of the xml */ protected String findXML(String name) { URL url = getResource(name); if (url == null) fail(name + " not found"); return url.toString(); } @Override public void configureLogging() { //enableTrace("org.jboss.xb"); //enableTrace("org.jboss.test.xb"); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AliasTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001025410776707200033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; /** * AliasTestCase. * * @author Ales Justin */ public class AliasTestCase extends AbstractXMLTest { public AliasTestCase(String name) { super(name); } protected AliasTestCase(String name, boolean useClone) { super(name, useClone); } public static Test suite() { return suite(AliasTestCase.class); } protected Object getAlias(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set aliases = bean.getAliasMetaData(); assertNotNull(aliases); assertEquals(1, aliases.size()); AliasMetaData alias = aliases.iterator().next(); assertNotNull(alias); Object theAlias = alias.getAliasValue(); assertNotNull(theAlias); return theAlias; } public void testAlias() throws Exception { Object alias = getAlias("Alias.xml"); assertEquals("SimpleAlias", alias); } public void testAliasWithjavaBean() throws Exception { Object alias = getAlias("AliasWithJavaBean.xml"); assertInstanceOf(alias, ArrayList.class); } public void testMultipleAliases() throws Exception { AbstractBeanMetaData bean = unmarshalBean("MultipleAlias.xml"); Set aliases = bean.getAliasMetaData(); assertNotNull(aliases); int size = aliases.size(); assertTrue(size > 1); for(AliasMetaData alias : aliases) { assertNotNull(alias); assertNotNull(alias.getAliasValue()); } } public void testAliasAndBeanFactory() throws Exception { GenericBeanFactoryMetaData bean = unmarshalBeanFactory("AliasWithBeanFactory.xml"); Set aliases = bean.getAliases(); assertNotNull(aliases); assertFalse(aliases.isEmpty()); assertEquals("SimpleAliasWithBF", aliases.iterator().next().getAliasValue()); } public void testAliasAndBeanFactoryJavaBean() throws Exception { GenericBeanFactoryMetaData bean = unmarshalBeanFactory("AliasWithBeanFactoryJavaBean.xml"); Set aliases = bean.getAliases(); assertNotNull(aliases); assertFalse(aliases.isEmpty()); assertInstanceOf(aliases.iterator().next().getAliasValue(), ArrayList.class); } protected NamedAliasMetaData getNamedAlias(String name) throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(name); Set aliases = deployment.getAliases(); assertNotNull(aliases); assertEquals(1, aliases.size()); NamedAliasMetaData alias = aliases.iterator().next(); assertNotNull(alias); return alias; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/PropertyJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001623710764216421033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * PropertyJaxbTestCase. * * @author Adrian Brock * @version $Revision: 56471 $ */ public class PropertyJaxbTestCase extends AbstractMCTest { protected PropertyMetaData getProperty() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); return property; } public void testProperty() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithBean() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); ValueMetaData value = property.getValue(); assertBean(value); } public void testPropertyWithClass() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); AbstractPropertyMetaData apmd = assertInstanceOf(property, AbstractPropertyMetaData.class); assertEquals("PropertyClass", apmd.getPropertyType()); } public void testPropertyWithAnnotation() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithAnnotations() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, property.getAnnotations()); assertNull(property.getValue()); } public void testPropertyWithPlainValue() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertPlainValue("PlainValue", property.getValue()); } public void testPropertyWithValue() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertValue("Value", property.getValue()); } public void testPropertyWithInjection() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertInjection(property.getValue()); } public void testPropertyWithCollection() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertCollection(property.getValue()); } public void testPropertyWithList() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertList(property.getValue()); } public void testPropertyWithSet() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertSet(property.getValue()); } public void testPropertyWithArray() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertArray(property.getValue()); } public void testPropertyWithMap() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertMap(property.getValue()); } public void testPropertyWithThis() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertThis(property.getValue()); } public void testPropertyWithNull() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertNullValue(property.getValue()); } public void testPropertyWithWildcard() throws Exception { PropertyMetaData property = getProperty(); assertNotNull("PropertyName", property.getName()); assertNull(property.getAnnotations()); assertWildcard(property.getValue()); } /* TODO public void testPropertyBadNoName() throws Exception { try { unmarshalBean("PropertyBadNoName.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return PropertyJaxbTestCase.suite(PropertyJaxbTestCase.class); } public PropertyJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DependencyJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000507210737774537033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; /** * DependencyJaxbTestCase. * * @author Adrian Brock * @version $Revision: 55527 $ */ public class DependencyJaxbTestCase extends AbstractMCTest { protected AbstractDependencyMetaData getDependency() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set dependencies = bean.getDepends(); assertNotNull(dependencies); assertEquals(1, dependencies.size()); AbstractDependencyMetaData dependency = (AbstractDependencyMetaData) dependencies.iterator().next(); assertNotNull(dependency); return dependency; } public void testDependency() throws Exception { AbstractDependencyMetaData dependency = getDependency(); assertEquals("Dependency", dependency.getDependency()); } /* TODO public void testDependencyBadNoValue() throws Exception { try { unmarshalBean("DependencyBadNoValue.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return DependencyJaxbTestCase.suite(DependencyJaxbTestCase.class); } public DependencyJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InstallTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001465610776707200033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.dependency.spi.ControllerState; /** * InstallTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class InstallTestCase extends AbstractXMLTest { protected InstallMetaData getInstall(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); List installs = bean.getInstalls(); assertNotNull(installs); assertEquals(1, installs.size()); InstallMetaData install = installs.get(0); assertNotNull(install); return install; } public void testInstallWithBean() throws Exception { InstallMetaData install = getInstall("InstallWithBean.xml"); assertEquals("Bean", install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithState() throws Exception { InstallMetaData install = getInstall("InstallWithState.xml"); assertNull(install.getBean()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithWhenRequired() throws Exception { InstallMetaData install = getInstall("InstallWithWhenRequired.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.CONFIGURED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithMethod() throws Exception { InstallMetaData install = getInstall("InstallWithMethod.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Method", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotation() throws Exception { InstallMetaData install = getInstall("InstallWithAnnotation.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotations() throws Exception { InstallMetaData install = getInstall("InstallWithAnnotations.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithParameter() throws Exception { InstallMetaData install = getInstall("InstallWithParameter.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, install.getParameters()); } public void testInstallWithParameters() throws Exception { InstallMetaData install = getInstall("InstallWithParameters.xml"); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, install.getParameters()); } public static Test suite() { return suite(InstallTestCase.class); } public InstallTestCase(String name) { super(name); } protected InstallTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SetJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001326510756342051033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * SetJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class SetJaxbTestCase extends AbstractMCTest { protected AbstractSetMetaData getCollection() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractSetMetaData); return (AbstractSetMetaData) value; } public void testSet() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testSetWithClass() throws Exception { AbstractSetMetaData collection = getCollection(); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testSetWithElementClass() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testSetWithValue() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testSetWithInjection() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testSetWithCollection() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testSetWithList() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testSetWithSet() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testSetWithArray() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testSetWithMap() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testSetWithNull() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testSetWithThis() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testSetWithWildcard() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testSetWithBean() throws Exception { AbstractSetMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractSetMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return SetJaxbTestCase.suite(SetJaxbTestCase.class); } public SetJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueFactoryJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001433710756342051033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; /** * Test value factoty. * * @author Ales Justin */ public class ValueFactoryJaxbTestCase extends AbstractMCTest { protected AbstractValueFactoryMetaData getValueFactory(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(value); assertTrue(value instanceof AbstractValueFactoryMetaData); return (AbstractValueFactoryMetaData) value; } public void testValueFactoryWithBean() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithBean.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithParameter() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithParameter.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); List parameters = dependency.getParameters(); assertNotNull(parameters); assertFalse(parameters.isEmpty()); assertTrue(parameters.size() == 1); ParameterMetaData pmd = parameters.get(0); assertNotNull(pmd); ValueMetaData value = pmd.getValue(); assertNotNull(value); assertEquals("foo.bar.key", value.getUnderlyingValue()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithParameters() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithParameters.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); List parameters = dependency.getParameters(); assertNotNull(parameters); assertFalse(parameters.isEmpty()); assertTrue(parameters.size() == 2); ParameterMetaData pmd1 = parameters.get(0); assertNotNull(pmd1); ValueMetaData value1 = pmd1.getValue(); assertNotNull(value1); assertEquals("foo.bar.key", value1.getUnderlyingValue()); ParameterMetaData pmd2 = parameters.get(1); assertNotNull(pmd2); ValueMetaData value2 = pmd2.getValue(); assertNotNull(value2); assertEquals("mydefault", value2.getUnderlyingValue()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithDefault() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithDefault.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals("mydefault", dependency.getDefaultValue()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithState() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithState.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testValueFactoryWithWhenRequired() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithWhenRequired.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals(ControllerState.CREATE, dependency.getWhenRequiredState()); } public void testValueFactoryBadNoBean() throws Exception { try { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryBadNoBean.xml"); assertNull(dependency.getValue()); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } public void testValueFactoryBadNoMethod() throws Exception { try { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryBadNoMethod.xml"); assertNull(dependency.getValue()); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } public static Test suite() { return suite(ValueFactoryTestCase.class); } public ValueFactoryJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000452610776707200033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; /** * DependencyTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class DependencyTestCase extends AbstractXMLTest { protected AbstractDependencyMetaData getDependency(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set dependencies = bean.getDepends(); assertNotNull(dependencies); assertEquals(1, dependencies.size()); AbstractDependencyMetaData dependency = (AbstractDependencyMetaData) dependencies.iterator().next(); assertNotNull(dependency); return dependency; } public void testDependency() throws Exception { AbstractDependencyMetaData dependency = getDependency("Dependency.xml"); assertEquals("Dependency", dependency.getDependency()); } public static Test suite() { return suite(DependencyTestCase.class); } public DependencyTestCase(String name) { super(name); } protected DependencyTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueFactoryCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000267210776707200033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ValueFactoryCloneTestCase. * * @author Ales Justin */ public class ValueFactoryCloneTestCase extends ValueFactoryTestCase { public static Test suite() { return suite(ValueFactoryCloneTestCase.class); } public ValueFactoryCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000540010756342051033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ValueJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class ValueJaxbTestCase extends AbstractMCTest { protected StringValueMetaData getValue() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof StringValueMetaData); return (StringValueMetaData) value; } public void testValue() throws Exception { StringValueMetaData value = getValue(); assertNull(value.getType()); assertNull(value.getUnderlyingValue()); } public void testValueWithClass() throws Exception { StringValueMetaData value = getValue(); assertEquals("ValueClass", value.getType()); assertNull(value.getUnderlyingValue()); } public void testValueWithValue() throws Exception { StringValueMetaData value = getValue(); assertNull(value.getType()); assertEquals("Value", value.getUnderlyingValue()); } public static Test suite() { return ValueJaxbTestCase.suite(ValueJaxbTestCase.class); } public ValueJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BeanTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000010761611044026555033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; /** * BeanTestCase. * * @author Adrian Brock * @version $Revision: 76463 $ */ public class BeanTestCase extends AbstractXMLTest { public void testBeanWithName() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithName.xml"); assertEquals("Name1", bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithClass() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithClass.xml"); assertNull(bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithMode.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertEquals(ControllerMode.MANUAL, bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithErrorHandlingMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithErrorHandlingMode.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertEquals(ErrorHandlingMode.MANUAL, bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAccessMode() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithAccessMode.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertEquals(BeanAccessMode.FIELDS, bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAnnotation() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithAnnotation.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAnnotations() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithAnnotations.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithClassLoader() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithClassLoader.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNotNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithConstructor() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithConstructor.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNotNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithProperty() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithProperty.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); assertProperties(expected, bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithProperties() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithProperties.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); expected.add("Property2"); expected.add("Property3"); assertProperties(expected, bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithCreate() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithCreate.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNotNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithStart() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithStart.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNotNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithStop() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithStop.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNotNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDestroy() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithDestroy.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNotNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDependency() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithDependency.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Depends1"); assertDepends(expected, bean.getDepends()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDependencies() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithDependencies.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Depends1"); expected.add("Depends2"); expected.add("Depends3"); assertDepends(expected, bean.getDepends()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDemand() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithDemand.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Demand1"); assertDemands(expected, bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithDemands() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithDemands.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); HashSet expected = new HashSet(); expected.add("Demand1"); expected.add("Demand2"); expected.add("Demand3"); assertDemands(expected, bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithSupply() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithSupply.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); assertSupplies(expected, bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithSupplies() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithSupplies.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); expected.add("Supply2"); expected.add("Supply3"); assertSupplies(expected, bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithInstall() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithInstall.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertInstalls(expected, bean.getInstalls()); assertNull(bean.getUninstalls()); } public void testBeanWithInstalls() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithInstalls.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertInstalls(expected, bean.getInstalls()); assertNull(bean.getUninstalls()); } public void testBeanWithUninstall() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithUninstall.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertInstalls(expected, bean.getUninstalls()); } public void testBeanWithUninstalls() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithUninstalls.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertInstalls(expected, bean.getUninstalls()); } public void testBeanWithInstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithInstallCallback.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertCallbacks(expected, bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithInstallCallbacks() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithInstallCallbacks.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertCallbacks(expected, bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithUninstallCallback() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithUninstallCallback.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertCallbacks(expected, bean.getUninstallCallbacks()); } public void testBeanWithUninstallCallbacks() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithUninstallCallbacks.xml"); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertCallbacks(expected, bean.getUninstallCallbacks()); } public void testBeanWithCandidate() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithCandidate.xml"); assertFalse(bean.isAutowireCandidate()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithParent() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithParent.xml"); assertEquals("OldDummy", bean.getParent()); assertNull(bean.getName()); assertNull(bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAbstract() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithAbstract.xml"); assertTrue(bean.isAbstract()); assertNull(bean.getName()); assertNull(bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithAutowire() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithAutowire.xml"); assertEquals(AutowireType.CONSTRUCTOR, bean.getAutowireType()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); } public void testBeanWithRelated() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithRelated.xml"); assertNull(bean.getAutowireType()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); Set expected = new HashSet(); expected.add(new AbstractRelatedClassMetaData("Dummy")); assertEquals(expected, bean.getRelated()); } public void testBeanWithRelateds() throws Exception { AbstractBeanMetaData bean = unmarshalBean("BeanWithRelateds.xml"); assertNull(bean.getAutowireType()); assertNull(bean.getName()); assertEquals("Dummy", bean.getBean()); assertNull(bean.getMode()); assertNull(bean.getErrorHandlingMode()); assertNull(bean.getAccessMode()); assertNull(bean.getAnnotations()); assertNull(bean.getClassLoader()); assertNull(bean.getConstructor()); assertNull(bean.getProperties()); assertNull(bean.getCreate()); assertNull(bean.getStart()); assertNull(bean.getStop()); assertNull(bean.getDestroy()); assertNull(bean.getDemands()); assertNull(bean.getSupplies()); assertNull(bean.getInstalls()); assertNull(bean.getUninstalls()); assertNull(bean.getInstallCallbacks()); assertNull(bean.getUninstallCallbacks()); Set expected = new HashSet(); expected.add(new AbstractRelatedClassMetaData("Dummy")); AbstractRelatedClassMetaData arcmd = new AbstractRelatedClassMetaData("Dummy"); arcmd.setEnabledValue("md"); expected.add(arcmd); assertEquals(expected, bean.getRelated()); } public static Test suite() { return suite(BeanTestCase.class); } public BeanTestCase(String name) { super(name); } protected BeanTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ListCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000255110776707200033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ListCloneTestCase. * * @author Ales Justin */ public class ListCloneTestCase extends ListTestCase { public static Test suite() { return suite(ListCloneTestCase.class); } public ListCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ArrayTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001415310776707200033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ArrayTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ArrayTestCase extends AbstractXMLTest { protected AbstractArrayMetaData getCollection(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractArrayMetaData); return (AbstractArrayMetaData) value; } public void testArray() throws Exception { AbstractArrayMetaData collection = getCollection("Array.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testArrayWithClass() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithClass.xml"); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testArrayWithElementClass() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithElementClass.xml"); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testArrayWithValue() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithValue.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testArrayWithInjection() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithInjection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testArrayWithCollection() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithCollection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testArrayWithList() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithList.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testArrayWithSet() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithSet.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testArrayWithArray() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithArray.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testArrayWithMap() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithMap.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testArrayWithNull() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithNull.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testArrayWithThis() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithThis.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testArrayWithWildcard() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithWildcard.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testArrayWithBean() throws Exception { AbstractArrayMetaData collection = getCollection("ArrayWithBean.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractArrayMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return suite(ArrayTestCase.class); } public ArrayTestCase(String name) { super(name); } protected ArrayTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InstallJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001503210757136565033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.deployment.xml.support.Annotation1; import org.jboss.test.kernel.deployment.xml.support.Annotation2; import org.jboss.test.kernel.deployment.xml.support.Annotation3; /** * InstallJaxbTestCase. * * @author Adrian Brock * @version $Revision: 46386 $ */ public class InstallJaxbTestCase extends AbstractMCTest { protected InstallMetaData getInstall() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); List installs = bean.getInstalls(); assertNotNull(installs); assertEquals(1, installs.size()); InstallMetaData install = installs.get(0); assertNotNull(install); return install; } public void testInstallWithBean() throws Exception { InstallMetaData install = getInstall(); assertEquals("Bean", install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithState() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithWhenRequired() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.CONFIGURED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithMethod() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Method", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotation() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotations() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add(Annotation1.class.getName()); expected.add(Annotation2.class.getName()); expected.add(Annotation3.class.getName()); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithParameter() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); assertParameters(expected, install.getParameters()); } public void testInstallWithParameters() throws Exception { InstallMetaData install = getInstall(); assertNull(install.getBean()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals(ControllerState.INSTALLED, install.getState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); ArrayList expected = new ArrayList(); expected.add("Parameter1"); expected.add("Parameter2"); expected.add("Parameter3"); assertParameters(expected, install.getParameters()); } /* TODO public void testInstallBadNoMethod() throws Exception { try { unmarshalBean("InstallBadNoMethod.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return InstallJaxbTestCase.suite(InstallJaxbTestCase.class); } public InstallJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001237210776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerState; /** * ValueFactoryTestCase. * * @author Ales Justin */ public class ValueFactoryTestCase extends AbstractXMLTest { protected AbstractValueFactoryMetaData getValueFactory(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(value); assertTrue(value instanceof AbstractValueFactoryMetaData); return (AbstractValueFactoryMetaData) value; } public void testValueFactoryWithBean() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithBean.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithParameter() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithParameter.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertNull(dependency.getParameters()); assertEquals("foo.bar.key", dependency.getParameter()); } public void testValueFactoryWithParameters() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithParameters.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); List parameters = dependency.getParameters(); assertNotNull(parameters); assertFalse(parameters.isEmpty()); assertTrue(parameters.size() == 2); ParameterMetaData pmd1 = parameters.get(0); assertNotNull(pmd1); ValueMetaData value1 = pmd1.getValue(); assertNotNull(value1); assertEquals("foo.bar.key", value1.getUnderlyingValue()); ParameterMetaData pmd2 = parameters.get(1); assertNotNull(pmd2); ValueMetaData value2 = pmd2.getValue(); assertNotNull(value2); assertEquals("mydefault", value2.getUnderlyingValue()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithDefault() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithDefault.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals("mydefault", dependency.getDefaultValue()); assertNull(dependency.getDependentState()); } public void testValueFactoryWithState() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithState.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testValueFactoryWithWhenRequired() throws Exception { AbstractValueFactoryMetaData dependency = getValueFactory("ValueFactoryWithWhenRequired.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("getValue", dependency.getMethod()); assertEquals(ControllerState.CREATE, dependency.getWhenRequiredState()); } public static Test suite() { return suite(ValueFactoryTestCase.class); } public ValueFactoryTestCase(String name) { super(name); } protected ValueFactoryTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000531410776707200033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; /** * ClassLoaderTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class ClassLoaderTestCase extends AbstractXMLTest { protected ClassLoaderMetaData getClassLoader(String name) throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(name); ClassLoaderMetaData classLoader = deployment.getClassLoader(); assertNotNull(classLoader); return classLoader; } public void testClassLoaderWithBean() throws Exception { ClassLoaderMetaData classLoader = getClassLoader("ClassLoaderWithBean.xml"); assertBean(classLoader.getClassLoader()); } public void testClassLoaderWithInject() throws Exception { ClassLoaderMetaData classLoader = getClassLoader("ClassLoaderWithInject.xml"); assertInjection(classLoader.getClassLoader()); } public void testClassLoaderWithNull() throws Exception { ClassLoaderMetaData classLoader = getClassLoader("ClassLoaderWithNull.xml"); assertNullValue(classLoader.getClassLoader()); } public void testClassLoaderWithWildcard() throws Exception { ClassLoaderMetaData classLoader = getClassLoader("ClassLoaderWithWildcard.xml"); assertWildcard(classLoader.getClassLoader()); } public static Test suite() { return suite(ClassLoaderTestCase.class); } public ClassLoaderTestCase(String name) { super(name); } protected ClassLoaderTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SetTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001400310776707200033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * SetTestCase. * * @author Adrian Brock * @version $Revision: 71794 $ */ public class SetTestCase extends AbstractXMLTest { protected AbstractSetMetaData getCollection(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractSetMetaData); return (AbstractSetMetaData) value; } public void testSet() throws Exception { AbstractSetMetaData collection = getCollection("Set.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testSetWithClass() throws Exception { AbstractSetMetaData collection = getCollection("SetWithClass.xml"); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testSetWithElementClass() throws Exception { AbstractSetMetaData collection = getCollection("SetWithElementClass.xml"); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testSetWithValue() throws Exception { AbstractSetMetaData collection = getCollection("SetWithValue.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testSetWithInjection() throws Exception { AbstractSetMetaData collection = getCollection("SetWithInjection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testSetWithCollection() throws Exception { AbstractSetMetaData collection = getCollection("SetWithCollection.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testSetWithList() throws Exception { AbstractSetMetaData collection = getCollection("SetWithList.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testSetWithSet() throws Exception { AbstractSetMetaData collection = getCollection("SetWithSet.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testSetWithArray() throws Exception { AbstractSetMetaData collection = getCollection("SetWithArray.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testSetWithMap() throws Exception { AbstractSetMetaData collection = getCollection("SetWithMap.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testSetWithNull() throws Exception { AbstractSetMetaData collection = getCollection("SetWithNull.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testSetWithThis() throws Exception { AbstractSetMetaData collection = getCollection("SetWithThis.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testSetWithWildcard() throws Exception { AbstractSetMetaData collection = getCollection("SetWithWildcard.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testSetWithBean() throws Exception { AbstractSetMetaData collection = getCollection("SetWithBean.xml"); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractSetMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return suite(SetTestCase.class); } public SetTestCase(String name) { super(name); } protected SetTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DebugElementHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000441410763534506033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; import org.jboss.xb.binding.sunday.unmarshalling.ParticleBinding; import org.jboss.xb.binding.sunday.unmarshalling.ParticleHandler; import org.xml.sax.Attributes; /** * DebugElementHandler. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class DebugElementHandler implements ParticleHandler { public Object startParticle(Object parent, QName elementName, ParticleBinding particle, Attributes attrs, NamespaceContext nsCtx) { throw new UnsupportedOperationException("Using Default Handler! startParticle: " + elementName + " " + particle); } public void setParent(Object parent, Object o, QName elementName, ParticleBinding particle, ParticleBinding parentParticle) { throw new UnsupportedOperationException("Using Default Handler! setParent: " + elementName + " " + particle); } public Object endParticle(Object o, QName elementName, ParticleBinding particle) { throw new UnsupportedOperationException("Using Default Handler! endParticle: " + elementName + " " + particle); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DemandCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000255710776707200033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * Demand TestCase. * * @author Ales Justin */ public class DemandCloneTestCase extends DemandTestCase { public static Test suite() { return suite(DemandCloneTestCase.class); } public DemandCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CollectionJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001367710756342051033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * CollectionJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class CollectionJaxbTestCase extends AbstractMCTest { protected AbstractCollectionMetaData getCollection() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractCollectionMetaData); return (AbstractCollectionMetaData) value; } public void testCollection() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testCollectionWithClass() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testCollectionWithElementClass() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testCollectionWithValue() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testCollectionWithInjection() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testCollectionWithCollection() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testCollectionWithList() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testCollectionWithSet() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testCollectionWithArray() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testCollectionWithMap() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testCollectionWithNull() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testCollectionWithThis() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testCollectionWithWildcard() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testCollectionWithBean() throws Exception { AbstractCollectionMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractCollectionMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return CollectionJaxbTestCase.suite(CollectionJaxbTestCase.class); } public CollectionJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AbstractPolicyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000400710764372266033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import org.jboss.beans.metadata.plugins.policy.AbstractBindingMetaData; import org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData; import org.jboss.beans.metadata.plugins.policy.AbstractScopeMetaData; /** * @author Ales Justin */ public abstract class AbstractPolicyTest extends AbstractMCTest { protected AbstractPolicyTest(String name) { super(name); } private T unmarshal(Class expected) throws Exception { return unmarshalObject(expected); } protected AbstractPolicyMetaData unmarshalPolicy() throws Exception { return unmarshal(AbstractPolicyMetaData.class); } protected AbstractScopeMetaData unmarshalScope() throws Exception { return unmarshal(AbstractScopeMetaData.class); } protected AbstractBindingMetaData unmarshalBinding() throws Exception { return unmarshal(AbstractBindingMetaData.class); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AnnotationCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000260710776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * AnnotationCloneTestCase. * * @author Ales Justin */ public class AnnotationCloneTestCase extends AnnotationTestCase { public static Test suite() { return suite(AnnotationCloneTestCase.class); } public AnnotationCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BeanCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000254410776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * BeanTestCase. * * @author Ales Justin */ public class BeanCloneTestCase extends BeanTestCase { public static Test suite() { return suite(BeanCloneTestCase.class); } public BeanCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/CallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002311710776707200033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.HashSet; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; /** * CallbackTestCase. * * @author Ales Justin */ public class CallbackTestCase extends AbstractXMLTest { public CallbackTestCase(String name) { super(name); } protected CallbackTestCase(String name, boolean useClone) { super(name, useClone); } public static Test suite() { return suite(CallbackTestCase.class); } protected CallbackMetaData getInstallCallback(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); List callbacks = bean.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); CallbackMetaData callback = callbacks.get(0); assertNotNull(callback); return callback; } protected CallbackMetaData getUninstallCallback(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); List callbacks = bean.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); CallbackMetaData callback = callbacks.get(0); assertNotNull(callback); return callback; } public void testInstallWithProperty() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithProperty.xml"); assertEquals("someProperty", install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithMethod() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithMethod.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("someMethod", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithState() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithState.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotation() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithAnnotation.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithAnnotations() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithAnnotations.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testInstallWithSignature() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithSignature.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getSignature()); assertEquals("someSignature", install.getSignature()); } public void testInstallWithCardinality() throws Exception { CallbackMetaData install = getInstallCallback("CallbackInstallWithCardinality.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getCardinality()); assertEquals(install.getCardinality(), Cardinality.ONE_TO_MANY); } // --- Uninstall public void testUninstallWithProperty() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithProperty.xml"); assertEquals("someProperty", install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testUninstallWithMethod() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithMethod.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("someMethod", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testUninstallWithState() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithState.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.CONFIGURED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNull(install.getParameters()); } public void testUninstallWithAnnotation() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithAnnotation.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testUninstallWithAnnotations() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithAnnotations.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); HashSet expected = new HashSet(); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation1"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation2"); expected.add("org.jboss.test.kernel.deployment.xml.support.Annotation3"); assertAnnotations(expected, install.getAnnotations()); assertNull(install.getParameters()); } public void testUninstallWithSignature() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithSignature.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getSignature()); assertEquals("someSignature", install.getSignature()); } public void testUninstallWithCardinality() throws Exception { CallbackMetaData install = getUninstallCallback("CallbackUninstallWithCardinality.xml"); assertNull(install.getProperty()); assertEquals(ControllerState.INSTALLED, install.getDependentState()); assertEquals("Dummy", install.getMethodName()); assertNull(install.getAnnotations()); assertNotNull(install.getCardinality()); assertEquals(install.getCardinality(), Cardinality.fromString("2..10")); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DeploymentJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000002252410756342051033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory1; import org.jboss.test.kernel.deployment.xml.support.TestBeanMetaDataFactory2; /** * DeploymentJaxbTestCase. * * @author Adrian Brock * @version $Revision: 56476 $ */ public class DeploymentJaxbTestCase extends AbstractMCTest { public void testDeployment() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertNull(deployment.getName()); assertNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithName() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithClassLoader() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNotNull(deployment.getClassLoader()); assertNull(deployment.getBeans()); } public void testDeploymentWithBean() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeans() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(3, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); } public void testDeploymentWithBeanFactory() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeanFactorys() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(3, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); } public void testDeploymentWithMultipleBeanMetaDataFactorys() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beanFactories = deployment.getBeanFactories(); assertNotNull(beanFactories); assertEquals(3, beanFactories.size()); BeanMetaDataFactory factory = beanFactories.get(0); assertEquals(TestBeanMetaDataFactory.class.getName(), factory.getClass().getName()); factory = beanFactories.get(1); assertEquals(TestBeanMetaDataFactory1.class.getName(), factory.getClass().getName()); factory = beanFactories.get(2); assertEquals(TestBeanMetaDataFactory2.class.getName(), factory.getClass().getName()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(6, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean3", bean.getBean()); bean = beans.get(3); assertNotNull(bean); assertEquals("Bean4", bean.getBean()); bean = beans.get(4); assertNotNull(bean); assertEquals("Bean5", bean.getBean()); bean = beans.get(5); assertNotNull(bean); assertEquals("Bean6", bean.getBean()); } public void testDeploymentWithBeanMetaDataFactory() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beanFactories = deployment.getBeanFactories(); assertNotNull(beanFactories); assertEquals(1, beanFactories.size()); BeanMetaDataFactory factory = beanFactories.get(0); assertEquals(TestBeanMetaDataFactory.class.getName(), factory.getClass().getName()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(2, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); } public void testDeploymentWithMixed() throws Exception { AbstractKernelDeployment deployment = unmarshalDeployment(); assertEquals("SimpleDeployment", deployment.getName()); assertNull(deployment.getClassLoader()); List beans = deployment.getBeans(); assertNotNull(beans); assertEquals(8, beans.size()); BeanMetaData bean = beans.get(0); assertNotNull(bean); assertEquals("Bean1", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(1); assertNotNull(bean); assertEquals("Bean2", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(2); assertNotNull(bean); assertEquals("Bean1", bean.getBean()); bean = beans.get(3); assertNotNull(bean); assertEquals("Bean2", bean.getBean()); bean = beans.get(4); assertNotNull(bean); assertEquals("Bean3", bean.getName()); assertEquals(Object.class.getName(), bean.getBean()); bean = beans.get(5); assertNotNull(bean); assertEquals("Bean4", bean.getName()); assertEquals(GenericBeanFactory.class.getName(), bean.getBean()); bean = beans.get(6); assertNotNull(bean); assertEquals("Bean3", bean.getBean()); bean = beans.get(7); assertNotNull(bean); assertEquals("Bean4", bean.getBean()); } public static Test suite() { return DeploymentJaxbTestCase.suite(DeploymentJaxbTestCase.class); } public DeploymentJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ValueCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000255610776707200033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ValueCloneTestCase. * * @author Ales Justin */ public class ValueCloneTestCase extends ValueTestCase { public static Test suite() { return suite(ValueCloneTestCase.class); } public ValueCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/FactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000676011002477016033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; /** * FactoryTestCase. * * @author Adrian Brock * @version $Revision: 72461 $ */ public class FactoryTestCase extends AbstractXMLTest { protected AbstractValueMetaData getFactory(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); ConstructorMetaData constructor = bean.getConstructor(); assertNotNull(constructor); ValueMetaData factory = constructor.getFactory(); assertNotNull(factory); assertTrue(factory instanceof AbstractValueMetaData); return (AbstractValueMetaData) factory; } protected AbstractDependencyValueMetaData getFactoryDependency(String name) throws Exception { return (AbstractDependencyValueMetaData) getFactory(name); } public void testFactoryWithBean() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency("FactoryWithBean.xml"); assertEquals("Bean1", dependency.getValue()); assertNull(dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testFactoryWithProperty() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency("FactoryWithProperty.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("Property1", dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testFactoryWithState() throws Exception { AbstractDependencyValueMetaData dependency = getFactoryDependency("FactoryWithState.xml"); assertEquals("Dummy", dependency.getValue()); assertNull(dependency.getProperty()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testFactoryWithWildcard() throws Exception { assertWildcard(getFactory("FactoryWithWildcard.xml")); } public static Test suite() { return suite(FactoryTestCase.class); } public FactoryTestCase(String name) { super(name); } protected FactoryTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/PolicyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000755210562437612033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; /** * @author Ales Justin */ public class PolicyTestCase extends AbstractXMLTest { public PolicyTestCase(String name) { super(name); } public static Test suite() { return suite(PolicyTestCase.class); } public void testPolicy() throws Throwable { PolicyMetaData policy = unmarshal("Policy.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithName() throws Throwable { PolicyMetaData policy = unmarshal("PolicyWithName.xml", AbstractPolicyMetaData.class); assertEquals("NamedPolicy", policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithExtends() throws Throwable { PolicyMetaData policy = unmarshal("PolicyWithExtends.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertEquals("ExtendablePolicy", policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithScope() throws Throwable { PolicyMetaData policy = unmarshal("PolicyWithScope.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNotNull(policy.getScope()); assertEquals("DefaultLevel", policy.getScope().getLevel()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithAnnotations() throws Throwable { /* PolicyMetaData policy = unmarshal("PolicyWithAnnotations.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNotNull(policy.getAnnotations()); assertTrue(policy.getAnnotations().size() > 0); assertNull(policy.getBindings()); */ } public void testPolicyWithBindings() throws Throwable { PolicyMetaData policy = unmarshal("PolicyWithBindings.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNotNull(policy.getBindings()); assertTrue(policy.getBindings().size() > 0); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/PropertyCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000257510776707200033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * PropertyCloneTestCase. * * @author Ales Justin */ public class PropertyCloneTestCase extends PropertyTestCase { public static Test suite() { return suite(PropertyCloneTestCase.class); } public PropertyCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DependencyCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000260710776707200033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * DependencyCloneTestCase. * * @author Ales Justin */ public class DependencyCloneTestCase extends DependencyTestCase { public static Test suite() { return suite(DependencyCloneTestCase.class); } public DependencyCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/XMLTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001240411043375327033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * XML Test Suite. * * @author Adrian Brock * @version $Revision: 76312 $ */ public class XMLTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("XML Tests"); suite.addTest(DeploymentTestCase.suite()); suite.addTest(BeanTestCase.suite()); suite.addTest(BeanFactoryTestCase.suite()); suite.addTest(ClassLoaderTestCase.suite()); suite.addTest(ConstructorTestCase.suite()); suite.addTest(FactoryTestCase.suite()); suite.addTest(ParameterTestCase.suite()); suite.addTest(PropertyTestCase.suite()); suite.addTest(RelatedClassTestCase.suite()); suite.addTest(LifecycleTestCase.suite()); suite.addTest(DependencyTestCase.suite()); suite.addTest(DemandTestCase.suite()); suite.addTest(SupplyTestCase.suite()); suite.addTest(InstallTestCase.suite()); suite.addTest(ValueTestCase.suite()); suite.addTest(InjectionTestCase.suite()); suite.addTest(CollectionTestCase.suite()); suite.addTest(ListTestCase.suite()); suite.addTest(SetTestCase.suite()); suite.addTest(ArrayTestCase.suite()); suite.addTest(MapTestCase.suite()); suite.addTest(AnnotationTestCase.suite()); suite.addTest(AliasTestCase.suite()); suite.addTest(CallbackTestCase.suite()); suite.addTest(ValueFactoryTestCase.suite()); // policy suite.addTest(ScopeTestCase.suite()); suite.addTest(BindingTestCase.suite()); suite.addTest(PolicyTestCase.suite()); // jaxb suite.addTest(DeploymentJaxbTestCase.suite()); suite.addTest(BeanJaxbTestCase.suite()); suite.addTest(BeanFactoryJaxbTestCase.suite()); suite.addTest(ClassLoaderJaxbTestCase.suite()); suite.addTest(ConstructorJaxbTestCase.suite()); suite.addTest(FactoryJaxbTestCase.suite()); suite.addTest(ParameterJaxbTestCase.suite()); suite.addTest(PropertyJaxbTestCase.suite()); suite.addTest(RelatedClassJaxbTestCase.suite()); suite.addTest(LifecycleJaxbTestCase.suite()); suite.addTest(DependencyJaxbTestCase.suite()); suite.addTest(DemandJaxbTestCase.suite()); suite.addTest(SupplyJaxbTestCase.suite()); suite.addTest(InstallJaxbTestCase.suite()); suite.addTest(ValueJaxbTestCase.suite()); suite.addTest(InjectionJaxbTestCase.suite()); suite.addTest(CollectionJaxbTestCase.suite()); suite.addTest(ListJaxbTestCase.suite()); suite.addTest(SetJaxbTestCase.suite()); suite.addTest(ArrayJaxbTestCase.suite()); suite.addTest(MapJaxbTestCase.suite()); suite.addTest(AnnotationJaxbTestCase.suite()); suite.addTest(CallbackJaxbTestCase.suite()); suite.addTest(ValueFactoryJaxbTestCase.suite()); // clone suite.addTest(BeanCloneTestCase.suite()); suite.addTest(ClassLoaderCloneTestCase.suite()); suite.addTest(ConstructorCloneTestCase.suite()); suite.addTest(FactoryCloneTestCase.suite()); suite.addTest(ParameterCloneTestCase.suite()); suite.addTest(PropertyCloneTestCase.suite()); suite.addTest(RelatedClassCloneTestCase.suite()); suite.addTest(LifecycleCloneTestCase.suite()); suite.addTest(DependencyCloneTestCase.suite()); suite.addTest(DemandCloneTestCase.suite()); suite.addTest(SupplyCloneTestCase.suite()); suite.addTest(InstallCloneTestCase.suite()); suite.addTest(ValueCloneTestCase.suite()); suite.addTest(InjectionCloneTestCase.suite()); suite.addTest(CollectionCloneTestCase.suite()); suite.addTest(ListCloneTestCase.suite()); suite.addTest(SetCloneTestCase.suite()); suite.addTest(ArrayCloneTestCase.suite()); suite.addTest(MapCloneTestCase.suite()); suite.addTest(AnnotationCloneTestCase.suite()); suite.addTest(CallbackCloneTestCase.suite()); suite.addTest(ValueFactoryCloneTestCase.suite()); // policy suite.addTest(ScopeJaxbTestCase.suite()); suite.addTest(BindingJaxbTestCase.suite()); suite.addTest(PolicyJaxbTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/PolicyJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000712510763032124033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; /** * @author Ales Justin */ public class PolicyJaxbTestCase extends AbstractPolicyTest { public PolicyJaxbTestCase(String name) { super(name); } public static Test suite() { return suite(PolicyJaxbTestCase.class); } public void testPolicy() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithName() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertEquals("NamedPolicy", policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithExtends() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertNull(policy.getName()); assertEquals("ExtendablePolicy", policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithScope() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNotNull(policy.getScope()); assertEquals("DefaultLevel", policy.getScope().getLevel()); assertNull(policy.getAnnotations()); assertNull(policy.getBindings()); } public void testPolicyWithAnnotations() throws Throwable { /* PolicyMetaData policy = unmarshal("PolicyWithAnnotations.xml", AbstractPolicyMetaData.class); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNotNull(policy.getAnnotations()); assertTrue(policy.getAnnotations().size() > 0); assertNull(policy.getBindings()); */ } public void testPolicyWithBindings() throws Throwable { PolicyMetaData policy = unmarshalPolicy(); assertNull(policy.getName()); assertNull(policy.getExtends()); assertNull(policy.getScope()); assertNull(policy.getAnnotations()); assertNotNull(policy.getBindings()); assertTrue(policy.getBindings().size() > 0); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/JBossXBTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000740610764372266033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * JBossXBTestDelegate. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 40492 $ */ public class JBossXBTestDelegate extends AbstractTestDelegate { /** The unmarshaller factory */ protected UnmarshallerFactory unmarshallerFactory; /** The resolver */ protected SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); /** * Create a new JBossXBTestDelegate. * * @param clazz the test class */ public JBossXBTestDelegate(Class clazz) { super(clazz); } @Override public void setUp() throws Exception { super.setUp(); unmarshallerFactory = UnmarshallerFactory.newInstance(); } /** * Unmarshal an object * * @param url the url * @return the object * @throws Exception for any error */ public Object unmarshal(String url) throws Exception { long start = System.currentTimeMillis(); Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller(); log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms"); try { Object result = unmarshaller.unmarshal(url, resolver); log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms"); return result; } catch (Exception e) { log.debug("Error during parsing: " + url, e); throw e; } } /** * Unmarshal an object * * @param url the url * @param schema the schema * @return the object * @throws Exception for any error */ public Object unmarshal(String url, SchemaBinding schema) throws Exception { long start = System.currentTimeMillis(); Unmarshaller unmarshaller = unmarshallerFactory.newUnmarshaller(); log.debug("Initialized parsing in " + (System.currentTimeMillis() - start) + "ms"); try { Object result = unmarshaller.unmarshal(url, schema); log.debug("Total parse for " + url + " took " + (System.currentTimeMillis() - start) + "ms"); return result; } catch (Exception e) { log.debug("Error during parsing: " + url, e); throw e; } } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InjectionJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000750711147522315033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.spi.ControllerState; /** * InjectionJaxbTestCase. * * @author Adrian Brock * @version $Revision: 57133 $ */ public class InjectionJaxbTestCase extends AbstractMCTest { protected AbstractDependencyValueMetaData getInjection() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractDependencyValueMetaData); return (AbstractDependencyValueMetaData) value; } public void testInjectionWithBean() throws Exception { AbstractDependencyValueMetaData dependency = getInjection(); assertEquals("Bean1", dependency.getValue()); assertNull(dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testInjectionWithProperty() throws Exception { AbstractDependencyValueMetaData dependency = getInjection(); assertEquals("Dummy", dependency.getValue()); assertEquals("Property1", dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testInjectionWithState() throws Exception { AbstractDependencyValueMetaData dependency = getInjection(); assertEquals("Dummy", dependency.getValue()); assertNull(dependency.getProperty()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testInjectionWithSearch() throws Exception { AbstractDependencyValueMetaData dependency = getInjection(); assertEquals("Dummy", dependency.getValue()); assertEquals(Search.LEAVES, dependency.getSearch()); } /* TODO public void testInjectionBadNoBean() throws Exception { try { AbstractDependencyValueMetaData dependency = getInjection("InjectionBadNoBean.xml"); assertNull(dependency.getValue()); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return InjectionJaxbTestCase.suite(InjectionJaxbTestCase.class); } public InjectionJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BindingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000725410763032124033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData; import org.jboss.beans.metadata.spi.policy.BindingMetaData; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; /** * @author Ales Justin */ public class BindingTestCase extends AbstractXMLTest { public BindingTestCase(String name) { super(name); } public static Test suite() { return suite(BindingTestCase.class); } public void testBindingWithNoName() throws Throwable { PolicyMetaData policy = unmarshal("BindingWithNoName.xml", AbstractPolicyMetaData.class); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); // assertEquals("", binding.getName()); // todo assertNotNull(binding.getValue()); assertNull(binding.getType()); } public void testBindingWithPlainValue() throws Throwable { PolicyMetaData policy = unmarshal("BindingWithPlainValue.xml", AbstractPolicyMetaData.class); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertNull(binding.getType()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); } public void testBindingWithType() throws Throwable { PolicyMetaData policy = unmarshal("BindingWithType.xml", AbstractPolicyMetaData.class); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); assertEquals(Integer.class.getName(), binding.getType()); } public void testBindingWithComplexValue() throws Throwable { PolicyMetaData policy = unmarshal("BindingWithComplexValue.xml", AbstractPolicyMetaData.class); assertFalse(policy.getBindings().isEmpty()); assertEquals(1, policy.getBindings().size()); BindingMetaData binding = policy.getBindings().iterator().next(); assertNotNull(binding.getName()); assertNotNull(binding.getValue()); assertInstanceOf(binding.getValue(), StringValueMetaData.class); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/RelatedClassJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000530211043375327033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import junit.framework.Test; /** * RelatedClassJaxbTestCase. * * @author Ales Justin */ public class RelatedClassJaxbTestCase extends AbstractMCTest { protected RelatedClassMetaData getRelated() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set related = bean.getRelated(); assertNotNull(related); assertEquals(1, related.size()); RelatedClassMetaData rcmd = related.iterator().next(); assertNotNull(rcmd); return rcmd; } public void testRelatedWithName() throws Exception { RelatedClassMetaData related = getRelated(); assertEquals("java.lang.Object", related.getClassName()); } public void testRelatedWithEnabled() throws Exception { RelatedClassMetaData related = getRelated(); assertEquals("java.lang.Object", related.getClassName()); Set enabled = related.getEnabled(); assertNotNull(enabled); assertEquals(1, enabled.size()); assertEquals("aop", enabled.iterator().next()); } public void testRelatedWithEnableds() throws Exception { RelatedClassMetaData related = getRelated(); assertEquals("java.lang.Object", related.getClassName()); Set enabled = related.getEnabled(); assertNotNull(enabled); assertEquals(2, enabled.size()); } public static Test suite() { return suite(RelatedClassJaxbTestCase.class); } public RelatedClassJaxbTestCase(String name) { super(name); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/DemandJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000614311147522315033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.dependency.spi.ControllerState; /** * Demand TestCase. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 40800 $ */ public class DemandJaxbTestCase extends AbstractMCTest { protected AbstractDemandMetaData getDemand() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set demands = bean.getDemands(); assertNotNull(demands); assertEquals(1, demands.size()); AbstractDemandMetaData demand = (AbstractDemandMetaData) demands.iterator().next(); assertNotNull(demand); return demand; } public void testDemand() throws Exception { AbstractDemandMetaData demand = getDemand(); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.DESCRIBED, demand.getWhenRequired()); } public void testDemandWithWhenRequired() throws Exception { AbstractDemandMetaData demand = getDemand(); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.CONFIGURED, demand.getWhenRequired()); } public void testDemandWithTargetState() throws Exception { AbstractDemandMetaData demand = getDemand(); assertEquals("Demand", demand.getDemand()); assertEquals(ControllerState.CREATE, demand.getTargetState()); } /* TODO public void testDemandBadNoValue() throws Exception { try { unmarshalBean("DemandBadNoValue.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return DemandJaxbTestCase.suite(DemandJaxbTestCase.class); } public DemandJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ArrayCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000255610776707200033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ArrayCloneTestCase. * * @author Ales Justin */ public class ArrayCloneTestCase extends ArrayTestCase { public static Test suite() { return suite(ArrayCloneTestCase.class); } public ArrayCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ParameterCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000260210776707200033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * ParameterCloneTestCase. * * @author Ales Justin */ public class ParameterCloneTestCase extends ParameterTestCase { public static Test suite() { return suite(ParameterCloneTestCase.class); } public ParameterCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/InjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001067511147522315033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.spi.ControllerState; /** * InjectionTestCase. * * @author Adrian Brock * @version $Revision: 84514 $ */ public class InjectionTestCase extends AbstractXMLTest { protected AbstractInjectionValueMetaData getInjection(String name) throws Exception { AbstractBeanMetaData bean = unmarshalBean(name); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(value); assertTrue(value instanceof AbstractInjectionValueMetaData); return (AbstractInjectionValueMetaData) value; } public void testInjectionWithBean() throws Exception { AbstractDependencyValueMetaData dependency = getInjection("InjectionWithBean.xml"); assertEquals("Bean1", dependency.getValue()); assertNull(dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testInjectionWithProperty() throws Exception { AbstractDependencyValueMetaData dependency = getInjection("InjectionWithProperty.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals("Property1", dependency.getProperty()); assertNull(dependency.getDependentState()); } public void testInjectionWithState() throws Exception { AbstractDependencyValueMetaData dependency = getInjection("InjectionWithState.xml"); assertEquals("Dummy", dependency.getValue()); assertNull(dependency.getProperty()); assertEquals(ControllerState.CONFIGURED, dependency.getDependentState()); } public void testInjectionBadNoBean() throws Exception { try { AbstractDependencyValueMetaData dependency = getInjection("InjectionBadNoBean.xml"); assertNull(dependency.getValue()); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } public void testInjectionWithFromContext() throws Exception { AbstractInjectionValueMetaData dependency = getInjection("InjectionWithFromContext.xml"); assertEquals("Dummy", dependency.getValue()); assertNull(dependency.getProperty()); assertEquals(FromContext.getInstance("name"), dependency.getFromContext()); } public void testInjectionWithSearch() throws Exception { AbstractInjectionValueMetaData dependency = getInjection("InjectionWithSearch.xml"); assertEquals("Dummy", dependency.getValue()); assertEquals(Search.LEAVES, dependency.getSearch()); } public static Test suite() { return suite(InjectionTestCase.class); } public InjectionTestCase(String name) { super(name); } protected InjectionTestCase(String name, boolean useClone) { super(name, useClone); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/RelatedClassCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000261511043375327033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * PropertyCloneTestCase. * * @author Ales Justin */ public class RelatedClassCloneTestCase extends RelatedClassTestCase { public static Test suite() { return suite(RelatedClassCloneTestCase.class); } public RelatedClassCloneTestCase(String name) { super(name, true); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ListJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000001333010756342051033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ListJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40781 $ */ public class ListJaxbTestCase extends AbstractMCTest { protected AbstractListMetaData getCollection() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set properties = bean.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData property = properties.iterator().next(); assertNotNull(property); ValueMetaData value = property.getValue(); assertNotNull(property); assertTrue(value instanceof AbstractListMetaData); return (AbstractListMetaData) value; } public void testList() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); } public void testListWithClass() throws Exception { AbstractListMetaData collection = getCollection(); assertEquals("CollectionClass", collection.getType()); assertNull(collection.getElementType()); } public void testListWithElementClass() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertEquals("ElementClass", collection.getElementType()); } public void testListWithValue() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertValue("Value", getValue(collection)); } public void testListWithInjection() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertInjection(getValue(collection)); } public void testListWithCollection() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertCollection(getValue(collection)); } public void testListWithList() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertList(getValue(collection)); } public void testListWithSet() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertSet(getValue(collection)); } public void testListWithArray() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertArray(getValue(collection)); } public void testListWithMap() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertMap(getValue(collection)); } public void testListWithNull() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertNullValue(getValue(collection)); } public void testListWithThis() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertThis(getValue(collection)); } public void testListWithWildcard() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertWildcard(getValue(collection)); } public void testListWithBean() throws Exception { AbstractListMetaData collection = getCollection(); assertNull(collection.getType()); assertNull(collection.getElementType()); assertBean(getValue(collection)); } protected ValueMetaData getValue(AbstractListMetaData collection) { assertEquals(1, collection.size()); return (ValueMetaData) collection.iterator().next(); } public static Test suite() { return ListJaxbTestCase.suite(ListJaxbTestCase.class); } public ListJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/ScopeTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000500310562437612033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.policy.AbstractPolicyMetaData; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; import org.jboss.beans.metadata.spi.policy.ScopeMetaData; /** * @author Ales Justin */ public class ScopeTestCase extends AbstractXMLTest { public ScopeTestCase(String name) { super(name); } public static Test suite() { return suite(ScopeTestCase.class); } public void testScope() throws Throwable { PolicyMetaData policy = unmarshal("Scope.xml", AbstractPolicyMetaData.class); ScopeMetaData scope = policy.getScope(); assertNull(scope.getLevel()); assertNull(scope.getQualifier()); } public void testScopeWithLevel() throws Throwable { PolicyMetaData policy = unmarshal("ScopeWithLevel.xml", AbstractPolicyMetaData.class); ScopeMetaData scope = policy.getScope(); assertNotNull(scope.getLevel()); assertEquals("DefaultLevel", scope.getLevel()); assertNull(scope.getQualifier()); } public void testScopeWithQualifier() throws Throwable { PolicyMetaData policy = unmarshal("ScopeWithQualifier.xml", AbstractPolicyMetaData.class); ScopeMetaData scope = policy.getScope(); assertNull(scope.getLevel()); assertNotNull(scope.getQualifier()); assertEquals("SimpleQualifier", scope.getQualifier()); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/BeanFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000006303210771262000033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.ControllerMode; /** * BeanFactoryTestCase. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class BeanFactoryTestCase extends AbstractXMLTest { public void testBeanFactoryWithName() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithName.xml"); assertEquals("Name1", factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithClass() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithClass.xml"); assertNull(factory.getName()); assertEquals(Object.class.getName(), factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithFactoryClass() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithFactoryClass.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertEquals("MyFactory", factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithMode() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithMode.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertEquals(ControllerMode.MANUAL, factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithAccessMode() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithAccessMode.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertEquals(BeanAccessMode.FIELDS, factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithClassLoader() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithClassLoader.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNotNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithConstructor() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithConstructor.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNotNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithProperty() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithProperty.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); assertBeanFactoryProperties(expected, factory); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithProperties() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithProperties.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); HashSet expected = new HashSet(); expected.add("Property1"); expected.add("Property2"); expected.add("Property3"); assertProperties(expected, factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithCreate() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithCreate.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNotNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithStart() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithStart.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNotNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDependency() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithDependency.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Depends1"); assertDepends(expected, factory.getDepends()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDependencies() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithDependencies.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Depends1"); expected.add("Depends2"); expected.add("Depends3"); assertDepends(expected, factory.getDepends()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDemand() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithDemand.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Demand1"); assertDemands(expected, factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithDemands() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithDemands.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); HashSet expected = new HashSet(); expected.add("Demand1"); expected.add("Demand2"); expected.add("Demand3"); assertDemands(expected, factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithSupply() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithSupply.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); assertSupplies(expected, factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithSupplies() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithSupplies.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); HashSet expected = new HashSet(); expected.add("Supply1"); expected.add("Supply2"); expected.add("Supply3"); assertSupplies(expected, factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstall() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithInstall.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertInstalls(expected, factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstalls() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithInstalls.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertInstalls(expected, factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstall() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithUninstall.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertInstalls(expected, factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstalls() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithUninstalls.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getFactoryClass()); assertNull(factory.getAccessMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertInstalls(expected, factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstallCallback() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithInstallCallback.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); assertCallbacks(expected, factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithInstallCallbacks() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithInstallCallbacks.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); ArrayList expected = new ArrayList(); expected.add("Install1"); expected.add("Install2"); expected.add("Install3"); assertCallbacks(expected, factory.getInstallCallbacks()); assertNull(factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstallCallback() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithUninstallCallback.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); assertCallbacks(expected, factory.getUninstallCallbacks()); } public void testBeanFactoryWithUninstallCallbacks() throws Exception { GenericBeanFactoryMetaData factory = unmarshalBeanFactory("BeanFactoryWithUninstallCallbacks.xml"); assertNull(factory.getName()); assertEquals("Dummy", factory.getBean()); assertNull(factory.getMode()); assertNull(factory.getAnnotations()); assertNull(factory.getClassLoader()); assertNull(factory.getConstructor()); assertNull(factory.getConstructor()); assertNull(factory.getProperties()); assertNull(factory.getProperties()); assertNull(factory.getCreate()); assertNull(factory.getStart()); assertNull(factory.getDemands()); assertNull(factory.getSupplies()); assertNull(factory.getInstalls()); assertNull(factory.getUninstalls()); assertNull(factory.getInstallCallbacks()); ArrayList expected = new ArrayList(); expected.add("Uninstall1"); expected.add("Uninstall2"); expected.add("Uninstall3"); assertCallbacks(expected, factory.getUninstallCallbacks()); } public static Test suite() { return suite(BeanFactoryTestCase.class); } public BeanFactoryTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AliasCloneTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000262710776707200033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import junit.framework.Test; /** * AliasCloneTestCase. * * @author Ales Justin */ public class AliasCloneTestCase extends AliasTestCase { public AliasCloneTestCase(String name) { super(name, true); } public static Test suite() { return suite(AliasCloneTestCase.class); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/AbstractXMLTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000003366711301242575033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.io.Serializable; import java.net.URL; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LazyMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; import org.jboss.xb.binding.JBossXBException; /** * AbstractXMLTest. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 96564 $ */ public class AbstractXMLTest extends AbstractTestCaseWithSetup { protected String rootName = getRootName(); protected boolean useClone; /** * Create a new AbstractXMLTest. * * @param name the name of the test */ public AbstractXMLTest(String name) { this(name, false); } /** * Create a new AbstractXMLTest. * * @param name the name of the test * @param useClone use clone when testing */ public AbstractXMLTest(String name, boolean useClone) { super(name); this.useClone = useClone; } /** * Unmarshal a deployent * * @param name the name * @return the unmarshalled object * @throws Exception for any error */ protected AbstractKernelDeployment unmarshalDeployment(String name) throws Exception { return unmarshal(name, AbstractKernelDeployment.class); } /** * Unmarshal a bean * * @param name the name * @return the unmarshalled object * @throws Exception for any error */ protected AbstractBeanMetaData unmarshalBean(String name) throws Exception { return unmarshalBean(name, useClone); } /** * Unmarshal a bean * * @param name the name * @param useClone should we return the clone * @return the unmarshalled object * @throws Exception for any error */ protected AbstractBeanMetaData unmarshalBean(String name, boolean useClone) throws Exception { AbstractBeanMetaData bmd = unmarshal(name, AbstractBeanMetaData.class); if (useClone) return bmd.clone(); return bmd; } /** * Unmarshal a bean factory * * @param name the name * @return the unmarshalled object * @throws Exception for any error */ protected GenericBeanFactoryMetaData unmarshalBeanFactory(String name) throws Exception { return unmarshal(name, GenericBeanFactoryMetaData.class); } /** * Unmarshal some xml * * @param the expected type * @param name the name * @param expected the expected class * @return the unmarshalled object * @throws Exception for any error */ protected T unmarshal(String name, Class expected) throws Exception { String url = findXML(name); Object object = getJBossXBDelegate().unmarshal(url); if (object == null) fail("No object from " + name); // Test that serialize/deserialize works accurately reproduces the object Serializable serializable = assertInstanceOf(object, Serializable.class, false); object = deserialize(serialize(serializable)); assertTrue("Object '" + object + "' cannot be assigned to " + expected.getName(), expected.isAssignableFrom(object.getClass())); return expected.cast(object); } /** * Find the xml * * @param name the name * @return the url of the xml */ protected String findXML(String name) { URL url = getResource(name); if (url == null) fail(name + " not found"); return url.toString(); } protected void assertAnnotations(Set expected, Set annotations) { assertNotNull(annotations); assertEquals(expected.size(), annotations.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = annotations.iterator(); i.hasNext();) { AnnotationMetaData annotation = i.next(); if (clonedExpected.remove(annotation.getAnnotationInstance().annotationType().getName()) == false) fail("Did not expect " + annotation + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + annotations); } protected void assertProperties(Set expected, Set properties) { assertNotNull(properties); assertEquals(expected.size(), properties.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = properties.iterator(); i.hasNext();) { PropertyMetaData property = i.next(); if (clonedExpected.remove(property.getName()) == false) fail("Did not expect " + property + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + properties); } protected void assertBeanFactoryProperties(Set expected, GenericBeanFactoryMetaData factory) { assertNotNull(factory); Set properties = factory.getProperties(); assertEquals(expected.size(), properties.size()); HashSet clonedExpected = new HashSet(expected); for (PropertyMetaData property : properties) { if (clonedExpected.remove(property.getName()) == false) fail("Did not expect " + property + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + properties); } protected void assertDepends(Set expected, Set depends) { assertNotNull(depends); assertEquals(expected.size(), depends.size()); HashSet clonedExpected = new HashSet(expected); for (DependencyMetaData depend : depends) { if (clonedExpected.remove(depend.getDependency()) == false) fail("Did not expect " + depend + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + depends); } protected void assertDemands(Set expected, Set demands) { assertNotNull(demands); assertEquals(expected.size(), demands.size()); HashSet clonedExpected = new HashSet(expected); for (DemandMetaData demand : demands) { if (clonedExpected.remove(demand.getDemand()) == false) fail("Did not expect " + demand + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + demands); } protected void assertSupplies(Set expected, Set supplies) { assertNotNull(supplies); assertEquals(expected.size(), supplies.size()); HashSet clonedExpected = new HashSet(expected); for (Iterator i = supplies.iterator(); i.hasNext();) { SupplyMetaData supply = i.next(); if (clonedExpected.remove(supply.getSupply()) == false) fail("Did not expect " + supply + " expected " + expected); } if (clonedExpected.size() != 0) fail("Expected " + expected + " got " + supplies); } protected void assertInstalls(List expected, List installs) { assertNotNull(installs); assertEquals(expected.size(), installs.size()); for (int i = 0; i < expected.size(); ++i) { InstallMetaData install = installs.get(i); String method = expected.get(i); assertEquals(method, install.getMethodName()); } } protected void assertCallbacks(List expected, List callbacks) { assertNotNull(callbacks); assertEquals(expected.size(), callbacks.size()); for (int i = 0; i < expected.size(); ++i) { CallbackMetaData callback = callbacks.get(i); String method = expected.get(i); assertEquals(method, callback.getMethodName()); } } protected void assertParameters(List expected, List parameters) { assertNotNull(parameters); assertEquals(expected.size(), parameters.size()); for (int i = 0; i < expected.size(); ++i) { ParameterMetaData parameter = parameters.get(i); String method = expected.get(i); assertEquals(method, parameter.getType()); } } protected void assertPlainValue(String expected, ValueMetaData valueMetaData) { assertValue(expected, valueMetaData); } protected void assertValue(String expected, ValueMetaData valueMetaData) { assertNotNull(valueMetaData); assertTrue(valueMetaData instanceof StringValueMetaData); Object value = valueMetaData.getUnderlyingValue(); assertEquals(expected, value); } protected void assertInjection(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractDependencyValueMetaData); } protected void assertNullValue(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractValueMetaData); assertNull(value.getUnderlyingValue()); } protected void assertWildcard(ValueMetaData value) { assertNotNull(value); assertEquals(AbstractValueMetaData.class, value.getClass()); Object wildcard = value.getUnderlyingValue(); assertNotNull(wildcard); } protected void assertCollection(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractCollectionMetaData); } protected void assertList(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractListMetaData); } protected void assertSet(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractSetMetaData); } protected void assertArray(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractArrayMetaData); } protected void assertMap(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof AbstractMapMetaData); } protected void assertThis(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof ThisValueMetaData); } protected void assertBean(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof BeanMetaData); } protected void assertLazy(ValueMetaData value) { assertNotNull(value); assertTrue(value instanceof LazyMetaData); } protected void checkJBossXBException(Class expected, Throwable throwable) { checkThrowable(JBossXBException.class, throwable); JBossXBException e = (JBossXBException) throwable; checkThrowable(expected, e.getCause()); } /** * Setup the test delegate * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new XMLTestDelegate(clazz); } protected XMLTestDelegate getJBossXBDelegate() { return (XMLTestDelegate) getDelegate(); } protected void setUp() throws Exception { super.setUp(); configureLogging(); } /** * Get the package root name * * @return the root name */ protected String getRootName() { String longName = getClass().getName(); int dot = longName.lastIndexOf('.'); if (dot != -1) return longName.substring(dot + 1); return longName; } protected void configureLogging() { //enableTrace("org.jboss.xb"); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/test/SupplyJaxbTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000471610756342051033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; /** * SupplyJaxbTestCase. * * @author Adrian Brock * @version $Revision: 40800 $ */ public class SupplyJaxbTestCase extends AbstractMCTest { protected AbstractSupplyMetaData getSupply() throws Exception { AbstractBeanMetaData bean = unmarshalBean(); Set supplies = bean.getSupplies(); assertNotNull(supplies); assertEquals(1, supplies.size()); AbstractSupplyMetaData supply = (AbstractSupplyMetaData) supplies.iterator().next(); assertNotNull(supply); return supply; } public void testSupply() throws Exception { AbstractSupplyMetaData supply = getSupply(); assertEquals("Supply", supply.getSupply()); } /* TODO public void testSupplyBadNoValue() throws Exception { try { unmarshalBean("SupplyBadNoValue.xml"); fail("Should not be here"); } catch (Exception expected) { checkJBossXBException(IllegalArgumentException.class, expected); } } */ public static Test suite() { return SupplyJaxbTestCase.suite(SupplyJaxbTestCase.class); } public SupplyJaxbTestCase(String name) { super(name); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000755000175000017500000000000011620312143033350 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/TestBeanMetaDataFactory2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000360710555426701033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; import java.util.ArrayList; import java.util.List; import java.io.Serializable; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.JBossObject; /** * TestBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 59941 $ */ public class TestBeanMetaDataFactory2 extends JBossObject implements BeanMetaDataFactory, Serializable { private static final long serialVersionUID = 1L; public List getBeans() { ArrayList result = new ArrayList(); AbstractBeanMetaData bean = new AbstractBeanMetaData("Bean5"); result.add(bean); bean = new AbstractBeanMetaData("Bean6"); result.add(bean); return result; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/SerializableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000246510555426701033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; import java.io.Serializable; /** * Simple serializable class. * * @author Ales Justin */ public class SerializableObject implements Serializable { private static final long serialVersionUID = -1L; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/Annotation2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000224110457474130033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; /** * * @author Kabir Khan * @version $Revision: 46386 $ */ public @interface Annotation2 { } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/TestBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000360610555426701033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; import java.util.ArrayList; import java.util.List; import java.io.Serializable; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.JBossObject; /** * TestBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 59941 $ */ public class TestBeanMetaDataFactory extends JBossObject implements BeanMetaDataFactory, Serializable { private static final long serialVersionUID = 1L; public List getBeans() { ArrayList result = new ArrayList(); AbstractBeanMetaData bean = new AbstractBeanMetaData("Bean1"); result.add(bean); bean = new AbstractBeanMetaData("Bean2"); result.add(bean); return result; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/Annotation3.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000224110457474130033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; /** * * @author Kabir Khan * @version $Revision: 46386 $ */ public @interface Annotation3 { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/TestBeanMetaDataFactory1.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000360710555426701033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; import java.util.ArrayList; import java.util.List; import java.io.Serializable; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.JBossObject; /** * TestBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 59941 $ */ public class TestBeanMetaDataFactory1 extends JBossObject implements BeanMetaDataFactory, Serializable { private static final long serialVersionUID = 1L; public List getBeans() { ArrayList result = new ArrayList(); AbstractBeanMetaData bean = new AbstractBeanMetaData("Bean3"); result.add(bean); bean = new AbstractBeanMetaData("Bean4"); result.add(bean); return result; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/AnnotationWithAttribute.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000230610756342051033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; /** * * @author Kabir Khan * @version $Revision: 69895 $ */ public @interface AnnotationWithAttribute { Class attribute(); } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/Annotation1.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000224110457474130033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; /** * * @author Kabir Khan * @version $Revision: 46386 $ */ public @interface Annotation1 { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xml/support/AnnotationWithAttributes.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/xm0000644000175000017500000000234610756342051033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.xml.support; /** * * @author Kabir Khan * @version $Revision: 69895 $ */ public @interface AnnotationWithAttributes { Class clazz(); int integer(); String str(); } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000755000175000017500000000000011620312144033354 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/MetaDataAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277610764340107033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.metadata.spi.MetaData; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class MetaDataAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.METADATA) public void setMetadata(MetaData metadata) { super.setMetadata(metadata); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/GetInstanceBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000256311137570512033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class GetInstanceBean { private static final GetInstanceBean instance = new GetInstanceBean("X"); private GetInstanceBean(String x) { } public static GetInstanceBean getInstance() { return instance; } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/TestAnnotation2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000245111047035163033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestAnnotation2. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotation2 { } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FromBootBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000364510567273335033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; /** * A simple annotated bean * * @author Ales Justin */ public class FromBootBean implements Serializable { private static final long serialVersionUID = 1L; private String constructorString; private String string; private SimpleBean bean; public FromBootBean() { constructorString = "()"; } public FromBootBean(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ObjectWithBeanAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000235310567273335033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * An interface with simple bean getter * * @author Ales Justin */ public interface ObjectWithBeanAware { SimpleBean getSimpleBean(); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000275111147522315033372 0ustar twernertwerner/* * 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.test.kernel.deployment.support; /** * @author Ales Justin */ public class FirstBean2 { private FirstBean c; private RealTM tm; public FirstBean2(FirstBean c) { this.c = c; } public FirstBean getC() { return c; } public RealTM getTm() { return tm; } public void setTm(RealTM tm) { this.tm = tm; } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ScopeAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277610764340107033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class ScopeAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.SCOPE) public void setScopeKey(ScopeKey scopeKey) { super.setScopeKey(scopeKey); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/TestBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000245611047072163033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * TestBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @TestAnnotation3 public class TestBean { public String getString() { return null; } @TestAnnotation3 public void setString(String string) { } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment2ObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000405310567273335033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * An annotated object with all possible bean as meta data * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment2") public class Deployment2ObjectWithBean implements Serializable, ObjectWithBeanAware { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; public Deployment2ObjectWithBean() { } public Deployment2ObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FineGrainedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000471410770547065033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.kernel.spi.dependency.ConfigureKernelControllerContextAware; import org.jboss.kernel.spi.dependency.CreateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.InstallKernelControllerContextAware; import org.jboss.kernel.spi.dependency.InstantiateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.StartKernelControllerContextAware; /** * @author Ales Justin */ @SuppressWarnings("deprecation") public class FineGrainedBean implements org.jboss.kernel.spi.dependency.DescribeKernelControllerContextAware, InstantiateKernelControllerContextAware, ConfigureKernelControllerContextAware, CreateKernelControllerContextAware, StartKernelControllerContextAware, InstallKernelControllerContextAware { private int index; public static String[] states = { "NOT_INSTALLED (DESCRIBED)", "INSTANTIATED", "CONFIGURED", "CREATE", "START", "INSTALLED", }; public String getStateString() { return states[index]; } public void setKernelControllerContext(KernelControllerContext context) throws Exception { ++index; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { --index; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AliasesImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000325711061743044033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.api.annotations.Aliases; /** * Simple alises impl. * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AliasesImpl implements Aliases { private String value; public AliasesImpl(String value) { this.value = value; } public boolean replace() { return false; } public String[] value() { return new String[] {value}; } public Class annotationType() { return Aliases.class; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FirstBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000322611137570512033371 0ustar twernertwerner/* * 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.test.kernel.deployment.support; /** * @author Ales Justin */ public class FirstBean { private RealTM tm; private boolean flag; public RealTM getTm() { return tm; } public void setTm(RealTM tm) { // tm == null means we're uniconfiguring // the flag should be there from SecondBean's uninstall if (tm == null && flag == false) throw new IllegalArgumentException("Should be marked from SecondBean"); this.tm = tm; } void markSecondUninstall() { flag = true; } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ObjectWithFromAppBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000324510567273335033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; /** * A simple object with a fromapp bean * * @author Ales Justin */ public class ObjectWithFromAppBean implements Serializable { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private FromAppBean simpleBean; public FromAppBean getSimpleBean() { return simpleBean; } public void setSimpleBean(FromAppBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment4ObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000405310567273335033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * An annotated object with all possible bean as meta data * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment3") public class Deployment4ObjectWithBean implements Serializable, ObjectWithBeanAware { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; public Deployment4ObjectWithBean() { } public Deployment4ObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ScopedAnnSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277511042111600033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * Annotated simple bean * * @author Ales Justin */ @Aliases({"alias"}) @DeploymentScope("somedeployment") public class ScopedAnnSimpleBeanImpl extends SimpleBeanImpl { /** The serialVersionUID */ private static final long serialVersionUID = 1L; }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartition.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000276111137570512033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class HAPartition { private boolean started; @SuppressWarnings("unused") private HAPartitionCacheHandler handler; public void start() { started = true; } public boolean isStarted() { return started; } public void setHandler(HAPartitionCacheHandler handler) { handler.setPartition(this); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/StaticHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000332111001344032033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class StaticHolder { private static Object privField; protected static Object protField; public static Object pubField; public static Object getPrivField() { return privField; } public static Object getProtField() { return protField; } @SuppressWarnings("unused") private static void privMain(Object object) { privField = object; } protected static void protMain(Object object) { protField = object; } public static void pubMain(Object object) { pubField = object; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleBeanWithLifecycle.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000322010364477625033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * A simple bean * * @author Adrian Brock * @version $Revision: 40443 $ */ public class SimpleBeanWithLifecycle { public boolean createInvoked = false; public boolean startInvoked = false; public boolean notCreateInvoked = false; public boolean notStartInvoked = false; public void create() { createInvoked = true; } public void start() { startInvoked = true; } public void notCreate() { notCreateInvoked = true; } public void notStart() { notStartInvoked = true; } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ApplicationScopeImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000314311061743044033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.Annotation; import org.jboss.metadata.plugins.scope.ApplicationScope; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ApplicationScopeImpl implements ApplicationScope { String value; public ApplicationScopeImpl(String value) { this.value = value; } public String value() { return value; } public Class annotationType() { return ApplicationScope.class; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/TestAnnotation3.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000245111047035163033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestAnnotation3. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotation3 { } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/StateAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277410764340107033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.dependency.spi.ControllerState; /** * A simple bean with awareness * * @author Ales Justin */ public class StateAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.STATE) public void setState(ControllerState state) { super.setState(state); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/InCallbackInstantiated.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000260710754576725033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * InCallbackInstantiated. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class InCallbackInstantiated { private String configured = null; public String getConfigured() { return configured; } public void setConfigured(String configured) { this.configured = configured; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000443111137570512033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.List; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.kernel.plugins.annotations.ClassAnnotationPlugin; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.ClassInfo; /** * @author Ales Justin */ public class SuperDemandAnnotationPlugin extends ClassAnnotationPlugin { public SuperDemandAnnotationPlugin() { super(SuperDemand.class); } protected List internalApplyAnnotation(ClassInfo info, MetaData retrieval, SuperDemand annotation, KernelControllerContext context) throws Throwable { DependencyInfo di = context.getDependencyInfo(); DependencyItem item = new AbstractDependencyItem(context.getName(), annotation.demand(), new ControllerState(annotation.whenRequired()), new ControllerState(annotation.dependentState())); di.addIDependOn(item); return null; } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/StaticInjector.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000662011001344032033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.reflect.Method; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.joinpoint.plugins.Config; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.FieldInfo; import org.jboss.reflect.spi.MethodInfo; /** * @author Ales Justin */ public class StaticInjector { private KernelConfigurator configurator; @Constructor public StaticInjector(@Inject(bean = KernelConstants.KERNEL_CONFIGURATOR_NAME) KernelConfigurator configurator) { if (configurator == null) throw new IllegalArgumentException("Null configurator"); this.configurator = configurator; } public void injectToMethod(Class clazz, String method, Object value, Class signature) throws Throwable { injectToMethod(clazz, method, value, signature, true); } public void injectToNonPublicMethod(Class clazz, String method, Object value, Class signature) throws Throwable { injectToMethod(clazz, method, value, signature, false); } private void injectToMethod(Class clazz, String method, Object value, Class signature, boolean isPublic) throws Throwable { ClassInfo classInfo = configurator.getClassInfo(clazz); MethodInfo mi = Config.findMethodInfo(classInfo, method, new String[]{signature.getName()}, true, isPublic); if (isPublic == false) { // TODO - move this into Reflection? if (mi instanceof ReflectMethodInfoImpl) { ReflectMethodInfoImpl rmi = (ReflectMethodInfoImpl)mi; Method m = rmi.getMethod(); m.setAccessible(true); } else throw new IllegalArgumentException("Cannot set accessible on method info: " + mi); } mi.invoke(null, new Object[]{value}); } public void injectToField(Class clazz, String name, Object value) throws Throwable { ClassInfo classInfo = configurator.getClassInfo(clazz); FieldInfo fi = Config.findFieldInfo(classInfo, name); fi.set(null, value); } }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/RealTM.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000227211137570512033371 0ustar twernertwerner/* * 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.test.kernel.deployment.support; /** * @author Ales Justin */ public class RealTM { } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/MixedLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000301110674773017033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Create; /** * @author Ales Justin */ public class MixedLifecycleBean extends SimpleLifecycleBean { @Create(ignored = true) public void create() { m_create = true; } public void start() { m_start = true; } public void stop() { m_stop = true; } public void destroy() { m_destroy = true; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemand.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277711137570512033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.lang.annotation.RetentionPolicy; /** * @author Ales Justin */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface SuperDemand { String demand(); String whenRequired() default "Instantiated"; String dependentState() default "Installed"; }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/IgnoredLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000266410622203652033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class IgnoredLifecycleBean extends SimpleLifecycleBean { public void create() { m_create = true; } public void start() { m_start = true; } public void stop() { m_stop = true; } public void destroy() { m_destroy = true; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment3ObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000405310567273335033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * An annotated object with all possible bean as meta data * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment3") public class Deployment3ObjectWithBean implements Serializable, ObjectWithBeanAware { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; public Deployment3ObjectWithBean() { } public Deployment3ObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AccessBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000242410770236632033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class AccessBean { @SuppressWarnings("unused") private String priString; protected String protString; public String pubString; } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/BeanNameAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000267710764340107033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class BeanNameAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.NAME) public void setName(String name) { super.setName(name); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/BeanInfoAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000300010764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class BeanInfoAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.BEANINFO) public void setBeaninfo(BeanInfo beaninfo) { super.setBeaninfo(beaninfo); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/WildcardClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000231010367363670033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * WildcardClassLoader. * * @author Adrian Brock * @version $Revision: 40742 $ */ public class WildcardClassLoader extends ClassLoader { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/TestBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000416310446736533033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.JBossObject; /** * TestBeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class TestBeanMetaDataFactory extends JBossObject implements BeanMetaDataFactory { public List getBeans() { AbstractBeanMetaData bean1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); bean1.addProperty(new AbstractPropertyMetaData("bean", new AbstractDependencyValueMetaData("Name2"))); AbstractBeanMetaData bean2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()); ArrayList result = new ArrayList(); result.add(bean1); result.add(bean2); return result; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000305510622203652033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class SimpleLifecycleBean { protected boolean m_create; protected boolean m_start; protected boolean m_stop; protected boolean m_destroy; public boolean isCreate() { return m_create; } public boolean isStart() { return m_start; } public boolean isStop() { return m_stop; } public boolean isDestroy() { return m_destroy; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AnnotatedLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000343510674773017033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; /** * @author Ales Justin */ public class AnnotatedLifecycleBean extends SimpleLifecycleBean { @Create public void annotatedCreate() { m_create = true; } @Start public void annotatedStart() { m_start = true; } @Stop public void annotatedStop() { m_start = false; m_stop = true; } @Destroy public void annotatedDestroy() { m_create = false; m_destroy = true; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000370310412230077033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; /** * A simple bean * * @author Adrian Brock * @version $Revision: 42841 $ */ public class SimpleBeanImpl implements Serializable, SimpleBean { private static final long serialVersionUID = 3258132440433243443L; private String constructorString; private String string; private SimpleBean bean; public SimpleBeanImpl() { constructorString = "()"; } public SimpleBeanImpl(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/NullClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000263310657020413033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class NullClassLoader extends ClassLoader { public Class findClass(String name) throws ClassNotFoundException { Thread thread = Thread.currentThread(); return thread.getContextClassLoader().loadClass(name); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/FromAppBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000364210567273335033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; /** * A simple annotated bean * * @author Ales Justin */ public class FromAppBean implements Serializable { private static final long serialVersionUID = 1L; private String constructorString; private String string; private SimpleBean bean; public FromAppBean() { constructorString = "()"; } public FromAppBean(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/NullifyTestBean1.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000267211173121305033365 0ustar twernertwerner/* * 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.test.kernel.deployment.support; import java.util.Map; import java.util.Set; /** * @author Ales Justin */ @SuppressWarnings("unchecked") public class NullifyTestBean1 { public void setSomething(Set set) { System.out.println(set); } public void setSomething(Map map) { System.out.println(map); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment2BeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000420310567273335033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * A simple annotated bean * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment2") public class Deployment2BeanImpl implements Serializable, SimpleBean { private static final long serialVersionUID = 1L; private String constructorString; private String string; private SimpleBean bean; public Deployment2BeanImpl() { constructorString = "()"; } public Deployment2BeanImpl(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AnnotatedObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000373410567273335033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; /** * An annotated object with all possible bean as meta data * * @author Ales Justin */ @ApplicationScope("testApp") public class AnnotatedObjectWithBean implements Serializable, ObjectWithBeanAware { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258126972906387766L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; public AnnotatedObjectWithBean() { } public AnnotatedObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SetDemandTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000400611003122212033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.api.dependency.MatcherTransformer; /** * @author Ales Justin */ public class SetDemandTransformer implements MatcherTransformer { public Matcher transform(Object value) { String string = value.toString(); return new SetDemandMatcher(new HashSet(Arrays.asList(string.split(",")))); } public class SetDemandMatcher implements Matcher { private Set set; public SetDemandMatcher(Set set) { if (set == null) throw new IllegalArgumentException("Null set"); this.set = set; } public boolean match(Object other) { return set.contains(other); } public boolean needExactMatch() { return false; } } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ContextAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000301410764340107033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.dependency.spi.ControllerContext; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class ContextAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.CONTEXT) public void setContext(ControllerContext context) { super.setContext(context); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AnnotatedFromAppBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000406010567273335033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; /** * A simple annotated bean * * @author Ales Justin */ @ApplicationScope("testApp") public class AnnotatedFromAppBeanImpl implements Serializable, SimpleBean { private static final long serialVersionUID = 1L; private String constructorString; private String string; private SimpleBean bean; public AnnotatedFromAppBeanImpl() { constructorString = "()"; } public AnnotatedFromAppBeanImpl(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000407510567273335033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import java.util.List; /** * A simple object with all possible bean as meta data * * @author Ales Justin */ public class SimpleObjectWithBean implements Serializable { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258126972906387766L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; private List beans; public SimpleObjectWithBean() { } public SimpleObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public List getBeans() { return beans; } public void setBeans(List beans) { this.beans = beans; } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/InCallbackInstantiatedRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000351410754576725033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.ArrayList; import java.util.List; /** * InCallbackInstantiatedRepository. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class InCallbackInstantiatedRepository { public List registered = new ArrayList(); public void add(InCallbackInstantiated bean) { checkNotConfigured(bean); registered.add(bean); } public void remove(InCallbackInstantiated bean) { checkNotConfigured(bean); registered.remove(bean); } private void checkNotConfigured(InCallbackInstantiated bean) { String configured = bean.getConfigured(); if (configured != null) throw new IllegalStateException("Bean should not be configured " + configured); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/MockServiceBinding.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000317411047541325033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class MockServiceBinding { private String serviceName; private String hostName; private int port; public MockServiceBinding(String serviceName, String hostName, int port) { this.serviceName = serviceName; this.hostName = hostName; this.port = port; } public String getServiceName() { return serviceName; } public String getHostName() { return hostName; } public int getPort() { return port; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AliasesAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000310310764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.annotations.Aliases; /** * A simple bean with awareness * * @author Ales Justin */ @Aliases({"a1", "a2", "a3"}) public class AliasesAwareBean extends NameAwareBean { @Inject(fromContext = FromContext.ALIASES) public void setAliases(Set aliases) { super.setAliases(aliases); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/OtherAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000272410764340107033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean with awareness * * @author Ales Justin */ public class OtherAwareBean extends NameAwareBean { @Inject(bean = "set_name_bean", fromContext = FromContext.NAME) public void setName(String name) { super.setName(name); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/EmptyPropTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000301311054741610033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class EmptyPropTester { private String string1; private String string2; public String getString1() { return string1; } public void setString1(String string1) { this.string1 = string1; } public String getString2() { return string2; } public void setString2(String string2) { this.string2 = string2; } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000251110412230077033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * A SimpleBean. * * @author Adrian Brock * @version $Revision: 42841 $ */ public interface SimpleBean { String getConstructorString(); String getString(); void setString(String string); SimpleBean getBean(); }././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000755000175000017500000000000011620312144033354 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/Bean1Type.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000274710772625532033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.logging.Logger; /** * @author Scott.Stark@jboss.org * @version $Revision: 71333 $ */ public class Bean1Type { private static Logger log = Logger.getLogger(Bean1Type.class); private String prop1; public Bean1Type() { log.debug("Bean1Type.ctor, this="+this); } public String getProp1() { return prop1; } public void setProp1(String prop1) { this.prop1 = prop1; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/plugin/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000755000175000017500000000000011620312144033354 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/plugin/GenericComponentInstance.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000453510777411017033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.plugin; import java.util.List; import org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance; /** * @param the instance type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class GenericComponentInstance implements ComponentInstance { private T instance; private List names; private long compID; public GenericComponentInstance(T instance, List names, long compID) { this.instance = instance; this.names = names; this.compID = compID; } /* (non-Javadoc) * @see org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance#getComponentID() */ public long getComponentID() { return compID; } /* (non-Javadoc) * @see org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance#getComponentNames() */ public List getComponentNames() { return names; } /* (non-Javadoc) * @see org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance#getContext() */ public T getContext() { return instance; } /* (non-Javadoc) * @see org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance#getContextName() */ public String getContextName() { return names.get(0); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/plugin/GenericComponentFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000002131511043375327033373 0ustar twernertwernerpackage org.jboss.test.kernel.deployment.support.container.plugin; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.concurrent.atomic.AtomicLong; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.reflect.spi.TypeInfo; import org.jboss.test.kernel.deployment.support.container.spi.ComponentBeanMetaDataFactory; import org.jboss.test.kernel.deployment.support.container.spi.ComponentFactory; import org.jboss.test.kernel.deployment.support.container.spi.ComponentInstance; import org.jboss.test.kernel.deployment.support.container.spi.ComponentNameBuilder; import org.jboss.test.kernel.deployment.support.container.spi.ComponentVisitor; import org.jboss.util.JBossStringBuilder; public class GenericComponentFactory implements ComponentFactory, ComponentNameBuilder, KernelControllerContextAware { private ComponentBeanMetaDataFactory componentsFactory; private AtomicLong compID = new AtomicLong(0); private KernelControllerContext factoryContext; private ComponentVisitor visitor; public GenericComponentFactory(ComponentBeanMetaDataFactory factory, ComponentVisitor visitor) { this.componentsFactory = factory; this.visitor = visitor; } public void setKernelControllerContext(KernelControllerContext context) throws Exception { factoryContext = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { factoryContext = null; } @SuppressWarnings("unchecked") public ComponentInstance createComponents(String baseName) throws Throwable { ArrayList compNames = new ArrayList(); long nextID = compID.incrementAndGet(); KernelController controller = (KernelController) factoryContext.getController(); List compBeans = componentsFactory.getBeans(baseName, nextID, this, visitor); T t = null; for(BeanMetaData bmd : compBeans) { String beanName = bmd.getName(); KernelControllerContext kcc = controller.install(bmd); if(t == null) t = (T) kcc.getTarget(); compNames.add(beanName); } GenericComponentInstance instance = new GenericComponentInstance(t, compNames, nextID); return instance; } public void destroyComponents(ComponentInstance instance) throws Exception { KernelController controller = (KernelController) factoryContext.getController(); List compBeans = instance.getComponentNames(); for(String beanName : compBeans) { controller.uninstall(beanName); } } /** * Parses a name for the #compID suffix */ public long getComponentID(String name) throws NumberFormatException { int poundSign = name.lastIndexOf('#'); if(poundSign < 0) throw new NumberFormatException(name+" has no #compID suffix"); long id = Long.parseLong(name.substring(poundSign+1)); return id; } public String buildName(String baseName, String compName, long compID) { String beanName = baseName + "@" + compName + "#" + compID; return beanName; } public ComponentBeanMetaDataFactory getFactory() { return componentsFactory; } public void validate() { KernelController controller = (KernelController) factoryContext.getController(); Set notInstalled = controller.getNotInstalled(); if(notInstalled.size() != 0) throw new IllegalStateException(notInstalled.toString()); } static class BeanMetaDataName implements BeanMetaData { BeanMetaData bmd; String name; BeanMetaDataName(String name, BeanMetaData bmd) { this.name = name; this.bmd = bmd; } public Set getRelated() { return bmd.getRelated(); } public Object clone() { return bmd.clone(); } public void describeVisit(MetaDataVisitor vistor) { bmd.describeVisit(vistor); } public BeanAccessMode getAccessMode() { return bmd.getAccessMode(); } public Set getAliases() { return bmd.getAliases(); } public Set getAnnotations() { return bmd.getAnnotations(); } public AutowireType getAutowireType() { return bmd.getAutowireType(); } public String getBean() { return bmd.getBean(); } public Iterator getChildren() { return bmd.getChildren(); } public ClassLoaderMetaData getClassLoader() { return bmd.getClassLoader(); } public ConstructorMetaData getConstructor() { return bmd.getConstructor(); } public LifecycleMetaData getCreate() { return bmd.getCreate(); } public Set getDemands() { return bmd.getDemands(); } public Set getDepends() { return bmd.getDepends(); } public String getDescription() { return bmd.getDescription(); } public LifecycleMetaData getDestroy() { return bmd.getDestroy(); } public ErrorHandlingMode getErrorHandlingMode() { return bmd.getErrorHandlingMode(); } public List getInstallCallbacks() { return bmd.getInstallCallbacks(); } public List getInstalls() { return bmd.getInstalls(); } public ControllerMode getMode() { return bmd.getMode(); } public String getName() { return name; } public String getParent() { return bmd.getParent(); } public Set getProperties() { return bmd.getProperties(); } public LifecycleMetaData getStart() { return bmd.getStart(); } public LifecycleMetaData getStop() { return bmd.getStop(); } public Set getSupplies() { return bmd.getSupplies(); } public Object getUnderlyingValue() { return bmd.getUnderlyingValue(); } public List getUninstallCallbacks() { return bmd.getUninstallCallbacks(); } public List getUninstalls() { return bmd.getUninstalls(); } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { return bmd.getValue(info, cl); } public void initialVisit(MetaDataVisitor vistor) { bmd.initialVisit(vistor); } public boolean isAbstract() { return bmd.isAbstract(); } public boolean isAutowireCandidate() { return bmd.isAutowireCandidate(); } public void setAnnotations(Set annotations) { bmd.setAnnotations(annotations); } public void setClassLoader(ClassLoaderMetaData classLoader) { bmd.setClassLoader(classLoader); } public void setMode(ControllerMode mode) { bmd.setMode(mode); } public void setName(String name) { bmd.setName(name); } public String toShortString() { return bmd.toShortString(); } public void toShortString(JBossStringBuilder arg0) { bmd.toShortString(arg0); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/Bean2Type.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000247510770265756033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @author Scott.Stark@jboss.org * @version $Revision: 71025 $ */ public class Bean2Type { private Bean1Type bean1; public Bean1Type getBean1() { return bean1; } public void setBean1(Bean1Type bean1) { this.bean1 = bean1; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/TestPooledBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000265010770554641033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.kernel.spi.config.KernelConfigurator; /** * @author Scott.Stark@jboss.org * @version $Revision: 71105 $ */ public class TestPooledBeanFactory extends GenericBeanFactory { public TestPooledBeanFactory(KernelConfigurator configurator, int size) { super(configurator); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/EJBAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000366410777676345033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.annotations.FieldAnnotationPlugin; import org.jboss.reflect.spi.FieldInfo; /** * @author Ales Justin */ public class EJBAnnotationPlugin extends FieldAnnotationPlugin { private String prefix = ""; public EJBAnnotationPlugin() { super(EJB.class); } public ValueMetaData createValueMetaData(FieldInfo info, EJB annotation) { String name = prefix + "/"; if (isAttributePresent(annotation.value())) name += annotation.value(); else name += getName(info); return new AbstractDependencyValueMetaData(name); } public void setPrefix(String prefix) { this.prefix = prefix; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000755000175000017500000000000011620312144033354 5ustar twernertwerner././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/ComponentBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000356410777362672033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.spi; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Factory for the BeanMetaData describing component instances. * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface ComponentBeanMetaDataFactory { /** * Create the beans that will be created together as a component. * * @param baseName - base name used to derive unique bean name * @param compID - component id used to derive unique bean name * @param nameBuilder - transformer used to derive unique bean name from baseName/compID * @param visitor - optional visitor that may augment BeanMetaData * @return list of beans describing the component */ public List getBeans(String baseName, long compID, ComponentNameBuilder nameBuilder, ComponentVisitor visitor); } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/ComponentNameBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000350310777362672033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.spi; /** * Abstraction for building/parsing component names * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface ComponentNameBuilder { /** * Create a globally unique mc bean name * @param baseName - base name used to derive unique bean name * @param compName - the component name used to derive unique bean name * @param compID - component id used to derive unique bean name * @return the unique mc bean name */ public String buildName(String baseName, String compName, long compID); /** * Parse a mc bean name for the component id * @param name - the mc bean name * @return the component id * @throws NumberFormatException */ public long getComponentID(String name) throws NumberFormatException; } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/ComponentInstance.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000351310777411017033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.spi; import java.util.List; /** * The component context instance. This is the bean that acts as the container * for the component bean instances. * * @param the context type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface ComponentInstance { /** * Get the name of the bean for the component context instance * @return the context name */ public String getContextName(); /** * Get the component bean names * @return the component names */ public List getComponentNames(); /** * Get the id associated with this component * @return the component id */ public long getComponentID(); /** * Get the component context instance * @return the context */ public T getContext(); } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/ComponentFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000534010777411017033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.spi; /** * A factory for creating a collection of related mc beans based on a * template of BeanMetaData[] from a BeanMetaDataFactory. * * @param the instance type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface ComponentFactory { /** * the factory which defines template BeanMetaData[] for the components * @return the BeanMetaDataFactory defining the component beans */ public ComponentBeanMetaDataFactory getFactory(); /** * Install a collection of mc beans based on the factory metadata. * * @param baseName - the base bean name used in conjuction wth the factory.getBeans() * BeanMetaData instances getName() to build the unique bean name: * baseName + bmd.getName() + "#" + compID; * @return the component context instance information. * @throws Throwable - on failure to install the component beans */ public ComponentInstance createComponents(String baseName) throws Throwable; /** * Extract the unique component id from a component bean name. * @param name - a name previously returned from createComponents. * @return the component id portion of the name * @throws NumberFormatException - if name is not a valild bean component * name with a component id. */ public long getComponentID(String name) throws NumberFormatException; /** * Uninstall the component beans for the given instance * @param instance - the ComponentInstance previously returned from createComponents * @throws Exception - on failure to uninstall the component beans */ public void destroyComponents(ComponentInstance instance) throws Exception; } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/spi/ComponentVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000337110777362672033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container.spi; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; /** * A component bean factory visitor plugin that allows for extension of the * bean metadata produced by the factory. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface ComponentVisitor { /** * Visit callback to allow for augmentation of a components bean metadata. * @param builder - the bean metadata build facade to augment the metadata * @param baseName - the bean base name * @param componentName - the bean component name * @param compID - the bean component id */ void visit(BeanMetaDataBuilder builder, String baseName, String componentName, long compID); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/EJB.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000267510777676345033424 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) public @interface EJB { String value() default ""; } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/ScopedContainer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000620010777413547033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.metadata.plugins.scope.InstanceScope; import org.jboss.metadata.spi.MetaData; /** * @author Ales Justin */ public class ScopedContainer { private Kernel kernel; private MetaData metaData; public ScopedContainer(Kernel kernel) { if (kernel == null) throw new IllegalArgumentException("Null kernel."); this.kernel = kernel; } public void setMetaData(MetaData metaData) { this.metaData = metaData; } protected String createAnnotation(InstanceScope is) { return "@" + InstanceScope.class.getName() + "(\"" + is.value() + "\")"; } public List createBeans(String baseName) throws Throwable { List result = new ArrayList(); KernelController controller = kernel.getController(); InstanceScope is = metaData.getAnnotation(InstanceScope.class); String sflAnn = createAnnotation(is); // bean context BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("BeanContext", BaseContext.class.getName()); builder.addConstructorParameter(BeanContainer.class.getName(), new BeanContainer()); builder.addAlias(baseName + "$" + "BeanContext"); builder.addAnnotation(sflAnn); result.add(controller.install(builder.getBeanMetaData()).getTarget()); // instance interceptor builder = BeanMetaDataBuilder.createBuilder("InstanceInterceptor", InstanceInterceptor.class.getName()); builder.addAlias(baseName + "$" + "InstanceInterceptor"); builder.addAnnotation(sflAnn); builder.addInstallWithThis("addInterceptor", "BeanContext"); builder.addUninstallWithThis("removeInterceptor", "BeanContext"); result.add(controller.install(builder.getBeanMetaData()).getTarget()); return result; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BeanContextFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000002000210777423012033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; import org.jboss.test.kernel.deployment.support.container.spi.ComponentBeanMetaDataFactory; import org.jboss.test.kernel.deployment.support.container.spi.ComponentNameBuilder; import org.jboss.test.kernel.deployment.support.container.spi.ComponentVisitor; /** * @param the type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class BeanContextFactory implements ComponentBeanMetaDataFactory, KernelControllerContextAware { private static final Logger log = Logger.getLogger(BeanContextFactory.class); private String beanClass; private BeanContainer container; private Set beanInjectionMD; private KernelConfigurator configurator; private Map> interceptorInjectionMD = new HashMap>(); private List interceptorNames; public String getBeanClass() { return beanClass; } public void setBeanClass(String beanClass) { this.beanClass = beanClass; } public BeanContainer getContainer() { return container; } public void setContainer(BeanContainer container) { this.container = container; } public Set getBeanInjectionMD() { return beanInjectionMD; } public void setBeanInjectionMD(Set beanInjectionMD) { this.beanInjectionMD = beanInjectionMD; } public Map> getInterceptorInjectionMD() { return interceptorInjectionMD; } public void setInterceptorInjectionMD( Map> interceptorInjectionMD) { this.interceptorInjectionMD = interceptorInjectionMD; } public List getInterceptorNames() { return interceptorNames; } public void setInterceptorNames(List interceptorNames) { this.interceptorNames = interceptorNames; } public void setKernelControllerContext(KernelControllerContext context) throws Exception { if(context != null) { configurator = context.getKernel().getConfigurator(); } } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { configurator = null; } /** * Create the beans that make up the bean component */ public List getBeans(String baseName, long compID, ComponentNameBuilder nameBuilder, ComponentVisitor visitor) { ArrayList beans = new ArrayList(); try { // Create the BeanContext factory String contextName = nameBuilder.buildName(baseName, "ContextFactory", compID); BeanMetaDataBuilder contextBuilder = BeanMetaDataBuilder.createBuilder(contextName, BaseContext.class.getName()); contextBuilder.setAccessMode(BeanAccessMode.ALL); // The BaseContext ctor contextBuilder.addConstructorParameter(BeanContainer.class.getName(), container); // BaseContext properties // BaseContext.instance String beanName = nameBuilder.buildName(baseName, "BeanInstance", compID); ValueMetaData beanInstance = contextBuilder.createInject(beanName); contextBuilder.addPropertyMetaData("instance", beanInstance); // Call the visitor to augment the metadata if(visitor != null) visitor.visit(contextBuilder, baseName, "ContextFactory", compID); BeanMetaData beanContext = contextBuilder.getBeanMetaData(); beans.add(beanContext); // Create the instance bean BeanMetaDataBuilder beanBuilder = BeanMetaDataBuilder.createBuilder(beanName, beanClass); beanBuilder.setAccessMode(BeanAccessMode.ALL); // For every injection target get the associated property if(beanInjectionMD != null) { addDependencyInjection(beanClass, beanInjectionMD, beanBuilder); } beans.add(beanBuilder.getBeanMetaData()); // Create the interceptors int count = interceptorNames != null ? interceptorNames.size() : 0; for(int n = 0; n < count; n ++) { String iCompName = "Interceptor:"+n; String iname = nameBuilder.buildName(baseName, iCompName, compID); String iclass = interceptorNames.get(n); BeanMetaDataBuilder ibuilder = BeanMetaDataBuilder.createBuilder(iname, iclass); ibuilder.addInstallWithThis("addInterceptor", contextName); ibuilder.addUninstallWithThis("removeInterceptor", contextName); // Call the visitor to augment the metadata if(visitor != null) visitor.visit(contextBuilder, baseName, iCompName, compID); Set injectMDs = interceptorInjectionMD.get(iclass); if(injectMDs != null) addDependencyInjection(beanClass, injectMDs, beanBuilder); BeanMetaData interceptor = ibuilder.getBeanMetaData(); beans.add(interceptor); } } catch(Throwable t) { log.error("Failed to create component beans", t); throw new RuntimeException(t); } log.info("getBeans returning: "+beans); return beans; } private void addDependencyInjection(String clazzName, Set injectMDs, BeanMetaDataBuilder beanBuilder) throws Throwable { ClassLoader loader = getClass().getClassLoader(); BeanInfo beanInfo = configurator.getBeanInfo(clazzName, loader); for(TestInjectionMetaData injectMD : injectMDs) { if(injectMD.getInjectionTargets() != null) { for(TestInjectionTargetMetaData targetMD : injectMD.getInjectionTargets()) { ValueMetaData injectValue = beanBuilder.createInject(injectMD.getResolvedJndiName()); String targetName = targetMD.getInjectionTargetName(); PropertyInfo pinfo = beanInfo.getProperty(targetName); if(pinfo != null) { beanBuilder.addPropertyMetaData(targetName, injectValue); } else { log.warn("No property found for injection target:"+targetName+", on bean: "+beanClass); } } } } } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/TestInjectionMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000770510777411017033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.util.Set; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class TestInjectionMetaData { /** The mapped name */ private String mappedName; private String resolvedJndiName; private boolean ignoreDependency; /** The injection targets */ private Set injectionTargets; /** * Create a new ResourceInjectionMetaData. */ public TestInjectionMetaData() { // For serialization } /** * Get the jndiName. * * @return the jndiName. */ public String getJndiName() { return getMappedName(); } /** * Set the jndiName. * * @param jndiName the jndiName. * @throws IllegalArgumentException for a null jndiName */ public void setJndiName(String jndiName) { setMappedName(jndiName); } /** * Get the mappedName. * * @return the mappedName. */ public String getMappedName() { return mappedName; } /** * Set the mappedName. * * @param mappedName the mappedName. * @throws IllegalArgumentException for a null mappedName */ public void setMappedName(String mappedName) { if (mappedName == null) throw new IllegalArgumentException("Null mappedName"); this.mappedName = mappedName; } /** * An unmanaged runtime jndi name for the resource. Used by deployers to * propagate resolved resource location. * * @return the resolved jndi name */ public String getResolvedJndiName() { return resolvedJndiName; } public void setResolvedJndiName(String resolvedJndiName) { this.resolvedJndiName = resolvedJndiName; } /** * Get the injectionTargets. * * @return the injectionTargets. */ public Set getInjectionTargets() { return injectionTargets; } /** * Set the injectionTargets. * * @param injectionTargets the injectionTargets. * @throws IllegalArgumentException for a null injectionTargets */ public void setInjectionTargets(Set injectionTargets) { if (injectionTargets == null) throw new IllegalArgumentException("Null injectionTargets"); this.injectionTargets = injectionTargets; } /** * Get the ignoreDependency. * * @return the ignoreDependency. */ public boolean getIgnoreDependency() { return ignoreDependency; } /** * Set the ignoreDependency. * * @param flag the ignoreDependency. * @throws IllegalArgumentException for a null ignoreDependency */ public void setIgnoreDependency(boolean flag) { this.ignoreDependency = flag; } /** * Get whether the dependency is ignored * * @return true when the dependency is ignored */ public boolean isDependencyIgnored() { return ignoreDependency; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BeanPool.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000605010777411017033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.TimeUnit; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.logging.Logger; /** * * @param the type * @author Scott.Stark@jboss.org * @version $Revision: 71916 $ */ public class BeanPool { private Logger log; /** The pooling policy */ private ArrayBlockingQueue pool; private boolean poolInitialized = false; private BeanFactory factory; public BeanPool() { this(3); } public BeanPool(int capacity) { pool = new ArrayBlockingQueue(capacity); } public BeanFactory getFactory() { return factory; } public void setFactory(BeanFactory factory) { this.factory = factory; } public int size() { return pool.size(); } public int remainingCapacity() { return pool.remainingCapacity(); } @SuppressWarnings("unchecked") public synchronized T createBean() throws Throwable { if(poolInitialized == false) { T bean = (T) factory.createBean(); pool.put(bean); log = Logger.getLogger("BeanPool<"+bean.getClass().getSimpleName()+">"); log.debug("createBean, initializing pool, remainingCapacity: "+pool.remainingCapacity()); int capacity = pool.remainingCapacity(); // Fill the pool for(int n = 0; n < capacity; n ++) { bean = (T) factory.createBean(); pool.put(bean); } poolInitialized = true; } T bean = pool.poll(1, TimeUnit.SECONDS); if(bean == null) throw new IllegalStateException(this+" is emtpy"); log.debug("End createBean, size: "+pool.size()+", bean: "+bean); return bean; } @SuppressWarnings("unchecked") public void destroyBean(T bean) throws Throwable { bean = (T) factory.createBean(); pool.put(bean); } public void releaseBean(T bean) throws Throwable { pool.put(bean); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/TestInjectionTargetMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000742310777030460033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class TestInjectionTargetMetaData { /** The injection target class */ private String injectionTargetClass; /** The injection target name */ private String injectionTargetName; /** * Create a new ResourceInjectionTargetMetaData. */ public TestInjectionTargetMetaData() { } /** * Get the injectionTargetClass. * * @return the injectionTargetClass. */ public String getInjectionTargetClass() { return injectionTargetClass; } /** * Set the injectionTargetClass. * * @param injectionTargetClass the injectionTargetClass. * @throws IllegalArgumentException for a null injectionTargetClass */ //@JBossXmlNsPrefix(prefix="jee") public void setInjectionTargetClass(String injectionTargetClass) { if (injectionTargetClass == null) throw new IllegalArgumentException("Null injectionTargetClass"); this.injectionTargetClass = injectionTargetClass; } /** * Get the injectionTargetName. * * @return the injectionTargetName. */ public String getInjectionTargetName() { return injectionTargetName; } /** * Set the injectionTargetName. * * @param injectionTargetName the injectionTargetName. * @throws IllegalArgumentException for a null injectionTargetName */ //@JBossXmlNsPrefix(prefix="jee") public void setInjectionTargetName(String injectionTargetName) { if (injectionTargetName == null) throw new IllegalArgumentException("Null injectionTargetName"); this.injectionTargetName = injectionTargetName; } @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + ((injectionTargetClass == null) ? 0 : injectionTargetClass.hashCode()); result = PRIME * result + ((injectionTargetName == null) ? 0 : injectionTargetName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final TestInjectionTargetMetaData other = (TestInjectionTargetMetaData) obj; if (injectionTargetClass == null) { if (other.injectionTargetClass != null) return false; } else if (!injectionTargetClass.equals(other.injectionTargetClass)) return false; if (injectionTargetName == null) { if (other.injectionTargetName != null) return false; } else if (!injectionTargetName.equals(other.injectionTargetName)) return false; return true; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BeanUser.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000274610770265756033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @author Scott.Stark@jboss.org * @version $Revision: 71025 $ */ public class BeanUser { private Bean1Type bean1; private Bean2Type bean2; public Bean1Type getBean1() { return bean1; } public void setBean1(Bean1Type bean1) { this.bean1 = bean1; } public Bean2Type getBean2() { return bean2; } public void setBean2(Bean2Type bean2) { this.bean2 = bean2; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BaseContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000465210777423012033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.util.ArrayList; import java.util.List; import org.jboss.logging.Logger; /** * @param the bean type * @param the container type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class BaseContext > implements BeanContext { protected static Logger log = Logger.getLogger(BaseContext.class); protected C container; protected B bean; protected List interceptorInstances = new ArrayList(); public BaseContext(C container) { this.container = container; log.info("ctor, container: "+container); } public C getContainer() { return container; } public B getInstance() { return bean; } public void setInstance(B bean) { this.bean = bean; log.info("setInstance, bean: "+bean); } public List getInterceptors() { return interceptorInstances; } public void initialiseInterceptorInstances() { } public void addInterceptor(Object interceptor) { interceptorInstances.add(interceptor); log.info("addInterceptor, "+interceptor); } public void removeInterceptor(Object interceptor) { interceptorInstances.remove(interceptor); log.info("removeInterceptor, "+interceptor); } public void remove() { // TODO Auto-generated method stub } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/InstanceInterceptor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000405710777274010033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import java.lang.reflect.Method; import org.jboss.logging.Logger; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class InstanceInterceptor { private static Logger log = Logger.getLogger(InstanceInterceptor.class); private BeanPool> pool; public InstanceInterceptor() { log.info("ctor"); } public Object invoke(Object...args) throws Throwable { BeanContext ctx = pool.createBean(); Object bean = ctx.getInstance(); boolean discard = false; Object value = null; try { String name = (String) args[0]; Class[] paramTypes = {}; Method m = bean.getClass().getMethod(name, paramTypes); Object[] empty = {}; value = m.invoke(bean, empty); return value; } catch (Exception ex) { throw ex; } finally { if (discard) pool.destroyBean(ctx); else pool.releaseBean(ctx); } } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/InjectWrapperMethodAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000303011216411765033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.kernel.plugins.annotations.MethodAnnotationPlugin; /** * InjectWrapperMethodAnnotationPlugin * * A {@link MethodAnnotationPlugin} for {@link Inject} annotation * * @author Jaikiran Pai * @version $Revision: $ */ public class InjectWrapperMethodAnnotationPlugin extends MethodAnnotationPlugin { /** * Constructor */ public InjectWrapperMethodAnnotationPlugin() { super(Inject.class); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/TestSessionBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000410311216411765033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.dependency.spi.Controller; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; /** * @author Ales Justin */ public class TestSessionBean { @EJB private OtherSessionBean other; @Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) private Controller controller; // Will be injected by method level @Inject private Controller oneMoreController; public void validate() { if (other == null) throw new RuntimeException("Other is null"); if (controller == null) throw new RuntimeException("Controller is null"); if (oneMoreController == null) throw new RuntimeException("Other controller is null - Method level @Inject did not work"); } @Inject (bean = KernelConstants.KERNEL_CONTROLLER_NAME) public void setOneMoreController(Controller cont) { this.oneMoreController = cont; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/InjectWrapperFieldAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000245210777676345033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; import org.jboss.kernel.plugins.annotations.InjectFieldAnnotationPlugin; /** * @author Ales Justin */ public class InjectWrapperFieldAnnotationPlugin extends InjectFieldAnnotationPlugin { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BeanContainer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000305411301242575033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @param the type * @author Scott.Stark@jboss.org * @version $Revision: 96564 $ */ public class BeanContainer { private BeanPool pool; public BeanPool getPool() { return pool; } public void setPool(BeanPool pool) { this.pool = pool; } public T getBean() throws Throwable { T bean = pool.createBean(); return bean; } public void destroyBean(T bean) throws Throwable { pool.destroyBean(bean); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/BeanContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000254310777411017033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @param the container type * @author Scott.Stark@jboss.org * @version $Revision:$ */ public interface BeanContext> { Object getInstance(); C getContainer(); void initialiseInterceptorInstances(); void remove(); //EJBContext getEJBContext(); } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/container/OtherSessionBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000225010777676345033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support.container; /** * @author Ales Justin */ public class OtherSessionBean { } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment1BeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000420310567273335033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * A simple annotated bean * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment1") public class Deployment1BeanImpl implements Serializable, SimpleBean { private static final long serialVersionUID = 1L; private String constructorString; private String string; private SimpleBean bean; public Deployment1BeanImpl() { constructorString = "()"; } public Deployment1BeanImpl(String string) { constructorString = string; } public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getBean() { return bean; } public void setBean(SimpleBean bean) { this.bean = bean; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SuperDemandCreator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000457711137570512033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; /** * @author Ales Justin */ public class SuperDemandCreator { private Controller controller; @Constructor public SuperDemandCreator(@Inject(bean = KernelConstants.KERNEL_CONTROLLER_NAME) Controller controller) { this.controller = controller; } public void createDependency(String name, String demand, String whenRequired, String dependentState) { ControllerContext context = controller.getContext(name, null); if (context == null) throw new IllegalArgumentException("Cannot find context: " + name); DependencyInfo di = context.getDependencyInfo(); DependencyItem item = new AbstractDependencyItem(context.getName(), demand, new ControllerState(whenRequired), new ControllerState(dependentState)); di.addIDependOn(item); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/ObjectWithFromBootBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000325110567273335033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; /** * A simple object with a fromapp bean * * @author Ales Justin */ public class ObjectWithFromBootBean implements Serializable { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private FromBootBean simpleBean; public FromBootBean getSimpleBean() { return simpleBean; } public void setSimpleBean(FromBootBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SomeCacheTreeManager.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000261111137570512033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class SomeCacheTreeManager { private String clusteredCache; public String getClusteredCache() { return clusteredCache; } public void setClusteredCache(String clusteredCache) { this.clusteredCache = clusteredCache; } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SecondBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000274111137570512033372 0ustar twernertwerner/* * 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.test.kernel.deployment.support; /** * @author Ales Justin */ public class SecondBean { private FirstBean firstBean; public FirstBean getFirstBean() { return firstBean; } public void setFirstBean(FirstBean firstBean) { if (firstBean == null) this.firstBean.markSecondUninstall(); this.firstBean = firstBean; } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/AnnSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000256611042111600033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Aliases; /** * Annotated simple bean * * @author Ales Justin */ @Aliases({"alias"}) public class AnnSimpleBeanImpl extends SimpleBeanImpl { /** The serialVersionUID */ private static final long serialVersionUID = 1L; }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/SimpleObjectWithBeans.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000532510777165400033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import java.util.List; import java.util.Map; import java.util.Set; /** * A simple object with all possible bean as meta data * * @author Ales Justin */ public class SimpleObjectWithBeans implements Serializable { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258126972906387766L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; private SimpleObjectWithBeans nested; private List list; private Set set; private Map map; public SimpleObjectWithBeans() { } public SimpleObjectWithBeans(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleObjectWithBeans getNested() { return nested; } public void setNested(SimpleObjectWithBeans nested) { this.nested = nested; } public List getList() { return list; } public void setList(List list) { this.list = list; } public Set getSet() { return set; } public void setSet(Set set) { this.set = set; } public Map getMap() { return map; } public void setMap(Map map) { this.map = map; } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/TestAnnotation1.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000245111047035163033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestAnnotation1. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotation1 { } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/IgnoredAnnotatedLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000354710741763423033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; /** * @author Ales Justin */ public class IgnoredAnnotatedLifecycleBean extends AnnotatedLifecycleBean { @Create(ignored = true) public void annotatedCreate() { m_create = true; } @Start(ignored = true) public void annotatedStart() { m_start = true; } @Stop(ignored = true) public void annotatedStop() { m_start = false; m_stop = true; } @Destroy(ignored = true) public void annotatedDestroy() { m_create = false; m_destroy = true; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/Deployment1ObjectWithBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000405310567273335033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.io.Serializable; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * An annotated object with all possible bean as meta data * * @author Ales Justin */ @ApplicationScope("testApp") @DeploymentScope("deployment1") public class Deployment1ObjectWithBean implements Serializable, ObjectWithBeanAware { // Constants ----------------------------------------------------- private static final long serialVersionUID = 1L; // Attributes ---------------------------------------------------- private SimpleBean simpleBean; public Deployment1ObjectWithBean() { } public Deployment1ObjectWithBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } public SimpleBean getSimpleBean() { return simpleBean; } public void setSimpleBean(SimpleBean simpleBean) { this.simpleBean = simpleBean; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/HAPartitionCacheHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000277711137570512033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; /** * @author Ales Justin */ public class HAPartitionCacheHandler { private HAPartition partition; public void setPartition(HAPartition partition) { this.partition = partition; } public String getCache() { if (partition == null || partition.isStarted() == false) throw new IllegalArgumentException("HAPartition not started!"); return "some-cache"; } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/support/NameAwareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/su0000644000175000017500000000602510757136565033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.support; import java.util.Set; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * A simple bean with name * * @author Ales Justin */ public class NameAwareBean { private String name; private Set aliases; private MetaData metadata; private BeanInfo beaninfo; private ScopeKey scopeKey; private Object dynamic; private ControllerContext context; private ControllerState state; public String getName() { return name; } public void setName(String name) { this.name = name; } public void applyName(String name) { this.name = name; } public MetaData getMetadata() { return metadata; } public void setMetadata(MetaData metadata) { this.metadata = metadata; } public ScopeKey getScopeKey() { return scopeKey; } public void setScopeKey(ScopeKey scopeKey) { this.scopeKey = scopeKey; } public Object getDynamic() { return dynamic; } public void setDynamic(Object dynamic) { this.dynamic = dynamic; } public Set getAliases() { return aliases; } public void setAliases(Set aliases) { this.aliases = aliases; } public BeanInfo getBeaninfo() { return beaninfo; } public void setBeaninfo(BeanInfo beaninfo) { this.beaninfo = beaninfo; } public ControllerContext getContext() { return context; } public void setContext(ControllerContext context) { this.context = context; } public ControllerState getState() { return state; } public void setState(ControllerState state) { this.state = state; } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/props/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/pr0000755000175000017500000000000011620312143033345 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/props/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/pr0000755000175000017500000000000011620312143033345 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/props/test/PropsTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/pr0000644000175000017500000000303510716050342033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.props.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * @author Ales Justin */ public class PropsTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Props Tests"); suite.addTest(GraphBuilderTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/props/test/GraphBuilderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/pr0000644000175000017500000001001610741206717033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.deployment.props.test; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.deployment.props.PropertiesGraphFactory; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.BaseTestCase; /** * Test graph from properties. * * @author Ales Justin */ public class GraphBuilderTestCase extends BaseTestCase { public GraphBuilderTestCase(String name) { super(name); } public static Test suite() { return suite(GraphBuilderTestCase.class); } public void testGraphFromProperties() throws Exception { Map properties = new HashMap(); properties.put("mybean.(class)", "org.jboss.acme.MyBean"); properties.put("mybean.somenumber", "123L"); properties.put("mybean.somenumber.type", "java.lang.Long"); properties.put("mybean.injectee", "(inject).injectee"); properties.put("injectee.(class)", "org.jboss.acme.MyBean2"); PropertiesGraphFactory propertiesGraph = new PropertiesGraphFactory(properties); KernelDeployment deployment = propertiesGraph.build(); assertNotNull(deployment); List beans = deployment.getBeans(); assertNotNull(beans); assertFalse(beans.isEmpty()); BeanMetaData bean1 = beans.get(0); assertInstanceOf(bean1, AbstractBeanMetaData.class); AbstractBeanMetaData abmd1 = (AbstractBeanMetaData)bean1; assertNotNull(bean1); assertEquals("mybean", bean1.getName()); assertEquals("org.jboss.acme.MyBean", bean1.getBean()); Set propertys = bean1.getProperties(); assertNotNull(propertys); assertFalse(propertys.isEmpty()); assertEquals(2, propertys.size()); PropertyMetaData pmd1 = abmd1.getProperty("somenumber"); assertNotNull(pmd1); ValueMetaData vmd1 = pmd1.getValue(); assertNotNull(vmd1); assertInstanceOf(vmd1, StringValueMetaData.class); assertEquals("123L", vmd1.getUnderlyingValue()); assertEquals("java.lang.Long", ((StringValueMetaData)vmd1).getType()); PropertyMetaData pmd2 = abmd1.getProperty("injectee"); assertNotNull(pmd2); ValueMetaData vmd2 = pmd2.getValue(); assertNotNull(vmd2); assertInstanceOf(vmd2, AbstractDependencyValueMetaData.class); BeanMetaData bean2 = beans.get(1); assertNotNull(bean2); assertEquals("injectee", bean2.getName()); assertEquals("org.jboss.acme.MyBean2", bean2.getBean()); } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/props/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/deployment/pr0000755000175000017500000000000011620312143033345 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/0000755000175000017500000000000011620312146032073 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/0000755000175000017500000000000011620312146033052 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureAttributeFromStringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000001772711000675327033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.math.BigDecimal; import java.math.BigInteger; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleBean.Alphabet; /** * Configuration from string Test Case. * * @author Adrian Brock * @version $Revision: 72183 $ */ public class ConfigureAttributeFromStringTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(ConfigureAttributeFromStringTestCase.class); } public ConfigureAttributeFromStringTestCase(String name) { super(name); } public void testStringAttribute() throws Throwable { Object value = "StringValue"; SimpleBean bean = configureSimpleBean("AString", value); assertEquals(value, bean.getAString()); } public void testByteAttribute() throws Throwable { Object value = new Byte("12"); SimpleBean bean = configureSimpleBean("AByte", value); assertEquals(value, bean.getAByte()); } public void testBooleanAttribute() throws Throwable { Object value = Boolean.TRUE; SimpleBean bean = configureSimpleBean("ABoolean", value); assertEquals(value, bean.getABoolean()); } /* TODO character public void testCharacterAttribute() throws Throwable { Object value = new Character('a'); SimpleBean bean = configureSimpleBean("aCharacter", value); assertEquals(value, bean.getACharacter()); } */ public void testShortAttribute() throws Throwable { Object value = new Short("123"); SimpleBean bean = configureSimpleBean("AShort", value); assertEquals(value, bean.getAShort()); } public void testIntegerAttribute() throws Throwable { Object value = new Integer("1234"); SimpleBean bean = configureSimpleBean("anInt", value); assertEquals(value, bean.getAnInt()); } public void testLongAttribute() throws Throwable { Object value = new Long("12345"); SimpleBean bean = configureSimpleBean("ALong", value); assertEquals(value, bean.getALong()); } public void testFloatAttribute() throws Throwable { Object value = new Float("3.14"); SimpleBean bean = configureSimpleBean("AFloat", value); assertEquals(value, bean.getAFloat()); } public void testDoubleAttribute() throws Throwable { Object value = new Double("3.14e12"); SimpleBean bean = configureSimpleBean("ADouble", value); assertEquals(value, bean.getADouble()); } public void testDateAttribute() throws Throwable { Object value = createDate(2001, 1, 1); SimpleBean bean = configureSimpleBean("ADate", value); assertEquals(value, bean.getADate()); } public void testBigDecimalAttribute() throws Throwable { Object value = new BigDecimal("12e4"); SimpleBean bean = configureSimpleBean("ABigDecimal", value); assertEquals(value, bean.getABigDecimal()); } public void testBigIntegerAttribute() throws Throwable { Object value = new BigInteger("123456"); SimpleBean bean = configureSimpleBean("ABigInteger", value); assertEquals(value, bean.getABigInteger()); } public void testPrimitiveByteAttribute() throws Throwable { Byte value = new Byte("12"); SimpleBean bean = configureSimpleBean("abyte", value); assertEquals(value.byteValue(), bean.getAbyte()); } public void testPrimitiveBooleanAttribute() throws Throwable { Boolean value = Boolean.TRUE; SimpleBean bean = configureSimpleBean("aboolean", value); assertEquals(value.booleanValue(), bean.isAboolean()); } /* TODO character public void testPrimitiveCharacterAttribute() throws Throwable { Character value = new Character('a'); SimpleBean bean = configureSimpleBean("achar", value); assertEquals(value.charValue(), bean.getAchar()); } */ public void testPrimitiveShortAttribute() throws Throwable { Short value = new Short("123"); SimpleBean bean = configureSimpleBean("ashort", value); assertEquals(value.shortValue(), bean.getAshort()); } public void testPrimitiveIntegerAttribute() throws Throwable { Integer value = new Integer("1234"); SimpleBean bean = configureSimpleBean("anint", value); assertEquals(value.intValue(), bean.getAnint()); } public void testPrimitiveLongAttribute() throws Throwable { Long value = new Long("12345"); SimpleBean bean = configureSimpleBean("along", value); assertEquals(value.longValue(), bean.getAlong()); } public void testPrimitiveFloatAttribute() throws Throwable { Float value = new Float("3.14"); SimpleBean bean = configureSimpleBean("afloat", value); assertEquals(value.floatValue(), bean.getAfloat()); } public void testPrimitiveDoubleAttribute() throws Throwable { Double value = new Double("3.14e12"); SimpleBean bean = configureSimpleBean("adouble", value); assertEquals(value.doubleValue(), bean.getAdouble()); } public void testNumber() throws Throwable { Long value = new Long("4"); SimpleBean bean = configureSimpleBean("ANumber", value, "java.lang.Long"); Object number = bean.getANumber(); assertEquals(Long.class, number.getClass()); assertEquals(value, number); } public void testEnum() throws Throwable { Alphabet value = Alphabet.Z; SimpleBean bean = configureSimpleBean("enumProperty", value, Alphabet.class.getName()); Object evalue = bean.getEnumProperty(); assertEquals(Alphabet.class, evalue.getClass()); assertEquals(value, evalue); } protected SimpleBean configureSimpleBean(String name, Object value) throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); BeanInfo info = configurator.getBeanInfo(SimpleBean.class); SimpleBean bean = (SimpleBean) instantiate(configurator, info); AbstractPropertyMetaData metaData = new AbstractPropertyMetaData(name, value.toString()); configure(bean, info, metaData); return bean; } protected SimpleBean configureSimpleBean(String name, Object value, String type) throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); BeanInfo info = configurator.getBeanInfo(SimpleBean.class); SimpleBean bean = (SimpleBean) instantiate(configurator, info); AbstractPropertyMetaData metaData = new AbstractPropertyMetaData(name, value.toString(), type); ((StringValueMetaData) metaData.getValue()).setConfigurator(configurator); configure(bean, info, metaData); return bean; } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ElementAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/E0000644000175000017500000000422010654102420033155 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.MyElementAnnotated; import org.jboss.test.kernel.config.support.MyElement; import org.w3c.dom.Element; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ElementAnnotationTestCase extends ElementTestCase { public ElementAnnotationTestCase(String name) { super(name); } public ElementAnnotationTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ElementAnnotationTestCase.class); } protected Element instantiateElement() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("MyElement", MyElementAnnotated.class.getName()); MyElement holder = (MyElement)instantiate(builder.getBeanMetaData()); return holder.getMyElement(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureFromStringXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000000350410331006762033163 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * Configuration from object Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ConfigureFromStringXMLTestCase extends ConfigureFromStringTestCase { XMLUtil util; public static Test suite() { return suite(ConfigureFromStringXMLTestCase.class); } public ConfigureFromStringXMLTestCase(String name) { super(name, true); } protected SimpleBean configure() throws Throwable { util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void unconfigure(SimpleBean bean) throws Throwable { util.undeploy(); } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/SetAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/S0000644000175000017500000001260710654057147033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.FromObjectsSetSimpleBean; import org.jboss.test.kernel.config.support.FromStringsSetSimpleBean; import org.jboss.test.kernel.config.support.FromCustomSetSimpleBean; import org.jboss.test.kernel.config.support.FromCustomSignatureSetSimpleBean; import org.jboss.test.kernel.config.support.FromPreinstSetSimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import org.jboss.test.kernel.config.support.FromStringsSetUnmodifiableObject; import org.jboss.test.kernel.config.support.TypeOverrideSetSimpleBean; import org.jboss.test.kernel.config.support.OnObjectSetSimpleBean; import org.jboss.test.kernel.config.support.NotASetSimpleBean; import org.jboss.test.kernel.config.support.InterfaceSetSimpleBean; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.dependency.spi.ControllerState; /** * Set Test Case. * * @author Ales Justin */ public class SetAnnotationTestCase extends SetTestCase { public static Test suite() { return suite(SetAnnotationTestCase.class); } public SetAnnotationTestCase(String name) { super(name); } public SimpleBean simpleSetFromObjects() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromObjectsSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleSetFromStrings() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customSetExplicit() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customSetFromSignature() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSignatureSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customSetPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromPreinstSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected UnmodifiableGetterBean unmodifiableSetPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsSetUnmodifiableObject.class.getName()); return (UnmodifiableGetterBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean setWithValueTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", TypeOverrideSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean setInjectOnObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", OnObjectSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } public void testSetNotASet() throws Throwable { setNotASet(); } protected SimpleBean setNotASet() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", NotASetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } public void testSetIsInterface() throws Throwable { setIsInterface(); } protected SimpleBean setIsInterface() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", InterfaceSetSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueFactoryAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000543710654102420033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.AnnotatedLDAPFactory; import org.jboss.test.kernel.config.support.AnnotatedPropHolder; import org.jboss.test.kernel.config.support.LDAPFactory; import org.jboss.test.kernel.config.support.PropHolder; import org.jboss.test.kernel.config.support.TrimTransformer; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ValueFactoryAnnotationTestCase extends ValueFactoryTestCase { public ValueFactoryAnnotationTestCase(String name) { super(name); } public ValueFactoryAnnotationTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ValueFactoryAnnotationTestCase.class); } protected PropHolder instantiateHolder(KernelController controller) throws Throwable { // ldap BeanMetaDataBuilder ldap = BeanMetaDataBuilderFactory.createBuilder("ldap", AnnotatedLDAPFactory.class.getName()); LDAPFactory lf = (LDAPFactory)instantiate(controller, ldap.getBeanMetaData()); assertNotNull(lf); BeanMetaDataBuilder t = BeanMetaDataBuilderFactory.createBuilder("t", TrimTransformer.class.getName()); instantiate(controller, t.getBeanMetaData()); BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("PropHolder", AnnotatedPropHolder.class.getName()); return (PropHolder)instantiate(controller, builder.getBeanMetaData()); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureFromStringAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000000410410655064367033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.kernel.Kernel; import org.jboss.test.kernel.config.support.FromStringSimpleBean; import org.jboss.test.kernel.config.support.SimpleBean; /** * Configuration from object Test Case. * * @author Ales Justin */ public class ConfigureFromStringAnnotationTestCase extends ConfigureFromStringTestCase { public static Test suite() { return suite(ConfigureFromStringAnnotationTestCase.class); } public ConfigureFromStringAnnotationTestCase(String name) { super(name); } protected SimpleBean configure() throws Throwable { Kernel kernel = bootstrap(); configurator = kernel.getConfigurator(); info = configurator.getBeanInfo(FromStringSimpleBean.class); metaData = new AbstractBeanMetaData("SimpleBean", FromStringSimpleBean.class.getName()); return (SimpleBean)instantiate(kernel.getController(), metaData); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ListXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/L0000644000175000017500000000653110642732022033177 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; /** * List Test Case. * * @author Adrian Brock * @version $Revision: 63822 $ */ public class ListXMLTestCase extends ListTestCase { public static Test suite() { return suite(ListXMLTestCase.class); } public ListXMLTestCase(String name) { super(name, true); } public SimpleBean simpleListFromObjects() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleListFromStrings() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customListExplicit() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customListFromSignature() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customListPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected UnmodifiableGetterBean unmodifiableListPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (UnmodifiableGetterBean) util.getBean("SimpleBean"); } protected SimpleBean listWithValueTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean listNotAList() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkListNotAListException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } protected SimpleBean listIsInterface() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkListIsInterfaceException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/GenericFactoryInstantiateTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/G0000644000175000017500000001464310772714443033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.List; import java.util.Set; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.test.kernel.config.support.MyBeanFactory; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleBeanFactory; /** * GenericFactory Instantiation Test Case. * * @author Ales Justin */ public class GenericFactoryInstantiateTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(GenericFactoryInstantiateTestCase.class); } public GenericFactoryInstantiateTestCase(String name) { super(name); } public GenericFactoryInstantiateTestCase(String name, boolean xmltest) { super(name, xmltest); } protected void assertFactory(BeanFactory factory) throws Throwable { assertNotNull(factory); SimpleBean bean1 = (SimpleBean)factory.createBean(); assertNotNull(bean1); assertEquals(123, bean1.getAnint()); SimpleBean bean2 = (SimpleBean)factory.createBean(); assertNotNull(bean2); assertEquals(123, bean2.getAnint()); } public void testBeanFactoryFromBean() throws Throwable { BeanFactory factory = configureFromBean(); assertFactory(factory); } @SuppressWarnings("deprecation") protected BeanFactory configureFromBean() throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData("Factory", SimpleBean.class.getName()); addBeanProperty(factory, new AbstractPropertyMetaData("anint", 123)); return instantiate(factory); } public void testBeanFactoryFromFactory() throws Throwable { BeanFactory factory = configureFromFactory(); assertFactory(factory); } @SuppressWarnings("deprecation") protected BeanFactory configureFromFactory() throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData(); factory.setName("Factory"); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); factory.setConstructor(constructor); constructor.setFactory(new AbstractValueMetaData(new SimpleBeanFactory())); constructor.setFactoryMethod("createSimpleBean"); addBeanProperty(factory, new AbstractPropertyMetaData("anint", 123)); return instantiate(factory); } public void testBeanFactoryFromStaticFactory() throws Throwable { BeanFactory factory = configureFromStaticFactory(); assertFactory(factory); } @SuppressWarnings("deprecation") protected BeanFactory configureFromStaticFactory() throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData(); factory.setName("Factory"); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); factory.setConstructor(constructor); constructor.setFactoryClass(SimpleBeanFactory.class.getName()); constructor.setFactoryMethod("staticCreateSimpleBean"); addBeanProperty(factory, new AbstractPropertyMetaData("anint", 123)); return instantiate(factory); } public void testBeanFactoryWithNonExistingClass() throws Throwable { BeanFactory factory = configureFromIllegalClass(); assertNotNull(factory); try { factory.createBean(); } catch(Exception ex) { assertInstanceOf(ex, ClassNotFoundException.class); } } protected BeanFactory configureFromIllegalClass() throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData("Factory", "org.jboss.test.NoSuchClass"); return instantiate(factory); } public void testBeanFactoryDefinedFactoryClass() throws Throwable { BeanFactory factory = configureFromDefinedFactoryClass(); assertNotNull(factory); assertInstanceOf(factory, MyBeanFactory.class); assertEquals("foobar", factory.createBean()); } protected BeanFactory configureFromDefinedFactoryClass() throws Throwable { GenericBeanFactoryMetaData factory = new GenericBeanFactoryMetaData("Factory", SimpleBean.class.getName()); factory.setFactoryClass(MyBeanFactory.class.getName()); return instantiate(factory); } protected BeanFactory instantiate(GenericBeanFactoryMetaData factory) throws Throwable { List beans = factory.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); return (BeanFactory)instantiate(beans.get(0)); } protected void addBeanProperty(GenericBeanFactoryMetaData factory, PropertyMetaData property) { Set propertys = factory.getProperties(); if (propertys == null) { propertys = new HashSet(); factory.setProperties(propertys); } propertys.add(property); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureFromObjectTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000001423710653617461033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleBean.Alphabet; /** * Configuration from object Test Case. * * @author Adrian Brock * @version $Revision: 64365 $ */ public class ConfigureFromObjectTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(ConfigureFromObjectTestCase.class); } public ConfigureFromObjectTestCase(String name) { super(name); } public ConfigureFromObjectTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testConfigure() throws Throwable { String stringValue = "StringValue"; Byte byteValue = new Byte("12"); Boolean booleanValue = Boolean.TRUE; Character characterValue = 'a'; Short shortValue = new Short("123"); Integer integerValue = new Integer("1234"); Long longValue = new Long("12345"); Float floatValue = new Float("3.14"); Double doubleValue = new Double("3.14e12"); Date dateValue = createDate(2001, 1, 1); BigDecimal bigDecimalValue = new BigDecimal("12e4"); BigInteger bigIntegerValue = new BigInteger("123456"); Alphabet enumValue = Alphabet.Z; HashSet attributes = new HashSet(); attributes.add(new AbstractPropertyMetaData("AString", stringValue)); attributes.add(new AbstractPropertyMetaData("AByte", byteValue)); attributes.add(new AbstractPropertyMetaData("ABoolean", booleanValue)); attributes.add(new AbstractPropertyMetaData("ACharacter", characterValue)); attributes.add(new AbstractPropertyMetaData("AShort", shortValue)); attributes.add(new AbstractPropertyMetaData("anInt", integerValue)); attributes.add(new AbstractPropertyMetaData("ALong", longValue)); attributes.add(new AbstractPropertyMetaData("AFloat", floatValue)); attributes.add(new AbstractPropertyMetaData("ADouble", doubleValue)); attributes.add(new AbstractPropertyMetaData("ADate", dateValue)); attributes.add(new AbstractPropertyMetaData("ABigDecimal", bigDecimalValue)); attributes.add(new AbstractPropertyMetaData("ABigInteger", bigIntegerValue)); attributes.add(new AbstractPropertyMetaData("abyte", byteValue)); attributes.add(new AbstractPropertyMetaData("aboolean", booleanValue)); attributes.add(new AbstractPropertyMetaData("achar", characterValue)); attributes.add(new AbstractPropertyMetaData("ashort", shortValue)); attributes.add(new AbstractPropertyMetaData("anint", integerValue)); attributes.add(new AbstractPropertyMetaData("along", longValue)); attributes.add(new AbstractPropertyMetaData("afloat", floatValue)); attributes.add(new AbstractPropertyMetaData("adouble", doubleValue)); attributes.add(new AbstractPropertyMetaData("ANumber", longValue)); attributes.add(new AbstractPropertyMetaData("overloadedProperty", stringValue)); attributes.add(new AbstractPropertyMetaData("enumProperty", enumValue)); AbstractBeanMetaData metaData = new AbstractBeanMetaData(SimpleBean.class.getName()); metaData.setProperties(attributes); Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); SimpleBean bean = (SimpleBean)instantiateAndConfigure(configurator, metaData); assertEquals(stringValue, bean.getAString()); assertEquals(byteValue, bean.getAByte()); assertEquals(booleanValue, bean.getABoolean()); assertEquals(characterValue, bean.getACharacter()); assertEquals(shortValue, bean.getAShort()); assertEquals(integerValue, bean.getAnInt()); assertEquals(longValue, bean.getALong()); assertEquals(floatValue, bean.getAFloat()); assertEquals(doubleValue, bean.getADouble()); assertEquals(dateValue, bean.getADate()); assertEquals(bigDecimalValue, bean.getABigDecimal()); assertEquals(bigIntegerValue, bean.getABigInteger()); assertEquals(byteValue.byteValue(), bean.getAbyte()); assertEquals(booleanValue.booleanValue(), bean.isAboolean()); assertEquals(characterValue.charValue(), bean.getAchar()); assertEquals(shortValue.shortValue(), bean.getAshort()); assertEquals(integerValue.intValue(), bean.getAnint()); assertEquals(longValue.longValue(), bean.getAlong()); assertEquals(floatValue.floatValue(), bean.getAfloat()); assertEquals(doubleValue.doubleValue(), bean.getAdouble()); Number number = bean.getANumber(); assertEquals(Long.class, number.getClass()); assertEquals(longValue, number); assertEquals(stringValue, bean.getOverloadedProperty()); Alphabet anenum = bean.getEnumProperty(); assertEquals(enumValue, anenum); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/CollectionAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000001325510653716012033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.FromObjectsCollectionSimpleBean; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import org.jboss.test.kernel.config.support.FromStringsCollectionSimpleBean; import org.jboss.test.kernel.config.support.FromCustomCollectionSimpleBean; import org.jboss.test.kernel.config.support.FromCustomSignatureCollectionSimpleBean; import org.jboss.test.kernel.config.support.FromPreinstCollectionSimpleBean; import org.jboss.test.kernel.config.support.FromStringsCollectionUnmodifiableObject; import org.jboss.test.kernel.config.support.TypeOverrideCollectionSimpleBean; import org.jboss.test.kernel.config.support.OnObjectCollectionSimpleBean; import org.jboss.test.kernel.config.support.NotACollectionSimpleBean; import org.jboss.test.kernel.config.support.InterfaceCollectionSimpleBean; import org.jboss.dependency.spi.ControllerState; /** * Collection Test Case. * * @author Ales Justin */ public class CollectionAnnotationTestCase extends CollectionTestCase { public static Test suite() { return suite(CollectionAnnotationTestCase.class); } public CollectionAnnotationTestCase(String name) { super(name); } public SimpleBean simpleCollectionFromObjects() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromObjectsCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleCollectionFromStrings() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customCollectionExplicit() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customCollectionFromSignature() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSignatureCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customCollectionPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromPreinstCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected UnmodifiableGetterBean unmodifiableCollectionPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsCollectionUnmodifiableObject.class.getName()); return (UnmodifiableGetterBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean collectionWithValueTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", TypeOverrideCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean collectionInjectOnObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", OnObjectCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } public void testCollectionNotACollection() throws Throwable { collectionNotACollection(); } protected SimpleBean collectionNotACollection() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", NotACollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } public void testCollectionIsInterface() throws Throwable { collectionIsInterface(); } protected SimpleBean collectionIsInterface() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", InterfaceCollectionSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/MapXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/M0000644000175000017500000000676310642732022033207 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; /** * Map Test Case. * * @author Adrian Brock * @version $Revision: 63822 $ */ public class MapXMLTestCase extends MapTestCase { public static Test suite() { return suite(MapXMLTestCase.class); } public MapXMLTestCase(String name) { super(name, true); } public SimpleBean simpleMapFromObjects() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleMapFromStrings() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customMapExplicit() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customMapFromSignature() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customMapPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected UnmodifiableGetterBean unmodifiableMapPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (UnmodifiableGetterBean) util.getBean("SimpleBean"); } protected SimpleBean mapWithKeyTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean mapWithValueTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean mapNotAMap() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkMapNotAMapException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } protected SimpleBean mapIsInterface() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkMapIsInterfaceException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/InstantiateAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/I0000644000175000017500000001512610653401333033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.ParamArrayConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamCollectionConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamCompConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamIntConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamListConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamMapConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamNullConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamPropertiesConstructorAnnBean; import org.jboss.test.kernel.config.support.ParamSetConstructorAnnBean; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleConstructorAnnBean; /** * Instantiation Annotation Test Case. * * @author Ales Justin */ public class InstantiateAnnotationTestCase extends InstantiateTestCase { public static Test suite() { return suite(InstantiateAnnotationTestCase.class); } public InstantiateAnnotationTestCase(String name) { super(name); } public void testSimpleInstantiateFromBeanInfo() throws Throwable { // No Annotation equivalent } protected SimpleBean simpleInstantiateFromBeanMetaData() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", SimpleConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateFromBeanMetaData() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateFromNull() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamNullConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamIntConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateViaInterfaceWithTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamCompConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithCollection() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamCollectionConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithList() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamListConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithSet() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamSetConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithArray() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamArrayConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithMap() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamMapConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean parameterInstantiateWithProperties() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("simpleBean", ParamPropertiesConstructorAnnBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } public void testValueInstantiateFromValue() throws Throwable { // Not really meaningful for Annotations } public void testValueInstantiateFromCollection() throws Throwable { // Not really meaningful for Annotations } public void testValueInstantiateFromList() throws Throwable { // Not really meaningful for Annotations } public void testValueInstantiateFromSet() throws Throwable { // Not really meaningful for Annotations } public void testValueInstantiateFromArray() throws Throwable { // Not really meaningful for Annotations } public void testValueInstantiateFromObject() throws Throwable { // Not really meaningful for Annotations } public void testConstructorDoesNotExist() throws Throwable { // No Annotation equivalent } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueTrimAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000530510675747414033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.config.support.NoTrimTester; import org.jboss.test.kernel.config.support.TrimTester; import org.jboss.dependency.spi.ControllerState; /** * Value trim annotation test cases. * * @author Ales Justin */ public class ValueTrimAnnotationTestCase extends ValueTrimTestCase { public ValueTrimAnnotationTestCase(String name) { super(name); } public static Test suite() { return suite(ValueTrimAnnotationTestCase.class); } protected Object getTrimmedValue() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); KernelControllerContext context = controller.install(new AbstractBeanMetaData("tester", TrimTester.class.getName())); TrimTester tester = (TrimTester)context.getTarget(); return tester.getValue(); } protected Object getPlainValue() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); KernelControllerContext context = controller.install(new AbstractBeanMetaData("tester", NoTrimTester.class.getName())); assertEquals(ControllerState.ERROR, context.getState()); throw new IllegalStateException(); } protected Class getExceptionClass() { return IllegalStateException.class; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/FactoryAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/F0000644000175000017500000000756210653577053033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.FromFactorySimpleBean; import org.jboss.test.kernel.config.support.FromFactoryWithParamSimpleBean; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.FromStaticFactorySimpleBean; import org.jboss.test.kernel.config.support.FromFactoryWithIntParamSimpleBean; import org.jboss.test.kernel.config.support.FromStaticFactoryWithParamSimpleBean; import org.jboss.test.kernel.config.support.FromStaticFactoryWithIntParamSimpleBean; /** * Factory Test Case. * * @author Ales Justin */ public class FactoryAnnotationTestCase extends FactoryTestCase { public static Test suite() { return suite(FactoryAnnotationTestCase.class); } public FactoryAnnotationTestCase(String name) { super(name, false); } protected SimpleBean simpleInstantiateFromFactory() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromFactorySimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleInstantiateFromFactoryWithParameters() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromFactoryWithParamSimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleInstantiateFromFactoryWithIntegerParameter() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromFactoryWithIntParamSimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean staticInstantiateFromFactory() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStaticFactorySimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean staticInstantiateFromFactoryWithParameters() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStaticFactoryWithParamSimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } protected SimpleBean staticInstantiateFromFactoryWithIntegerParameter() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStaticFactoryWithIntParamSimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/SetXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/S0000644000175000017500000000650710642732022033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; /** * Set Test Case. * * @author Adrian Brock * @version $Revision: 63822 $ */ public class SetXMLTestCase extends SetTestCase { public static Test suite() { return suite(SetXMLTestCase.class); } public SetXMLTestCase(String name) { super(name, true); } public SimpleBean simpleSetFromObjects() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleSetFromStrings() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customSetExplicit() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customSetFromSignature() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customSetPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected UnmodifiableGetterBean unmodifiableSetPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (UnmodifiableGetterBean) util.getBean("SimpleBean"); } protected SimpleBean setWithValueTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean setNotASet() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkSetNotASetException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } protected SimpleBean setIsInterface() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkSetIsInterfaceException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } }././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/MapTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/M0000644000175000017500000004460210756342051033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import org.jboss.beans.metadata.plugins.*; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.CustomMap; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import junit.framework.Test; /** * Map Test Case. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class MapTestCase extends AbstractKernelConfigTest { MyObject object1 = new MyObject("object1"); MyObject object2 = new MyObject("object2"); String string1 = "string1"; String string2 = "string2"; String integer = "integer"; public static Test suite() { return suite(MapTestCase.class); } public MapTestCase(String name) { super(name); } public MapTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleMapFromObjects() throws Throwable { SimpleBean bean = simpleMapFromObjects(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); Map expected = new HashMap(); expected.put(object1, object2); expected.put(object2, object1); assertEquals(expected, result); } public SimpleBean simpleMapFromObjects() throws Throwable { AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractValueMetaData key1 = new AbstractValueMetaData(object1); AbstractValueMetaData value1 = new AbstractValueMetaData(object2); AbstractValueMetaData key2 = new AbstractValueMetaData(object2); AbstractValueMetaData value2 = new AbstractValueMetaData(object1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.put(key1, value1); smd.put(key2, value2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(bmd); } public void testSimpleMapFromStrings() throws Throwable { SimpleBean bean = simpleMapFromStrings(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); } protected SimpleBean simpleMapFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomMapExplicit() throws Throwable { SimpleBean bean = customMapExplicit(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); } protected SimpleBean customMapExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setType(CustomMap.class.getName()); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomMapFromSignature() throws Throwable { SimpleBean bean = customMapFromSignature(); assertNotNull(bean); Map result = bean.getCustomMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); } protected SimpleBean customMapFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("customMap", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomMapPreInstantiated() throws Throwable { SimpleBean bean = customMapPreInstantiated(); assertNotNull(bean); Map result = bean.getPreInstantiatedMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); assertTrue("Not preinstantiated", ((CustomMap) result).getPreInstantiated()); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); Map setter = bean.setterMap; assertNotNull(setter); assertFalse("Empty setterMap", setter.isEmpty()); } protected SimpleBean customMapPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedMap", smd); properties.add(pmd); AbstractMapMetaData lmd = new AbstractMapMetaData(); lmd.setKeyType("java.lang.String"); lmd.setValueType("java.lang.String"); lmd.put(new StringValueMetaData("justKey"), new StringValueMetaData("justValue")); AbstractPropertyMetaData pmd2 = new AbstractPropertyMetaData("setterMap", lmd); properties.add(pmd2); return (SimpleBean) instantiate(controller, bmd); } public void testUnmodifiableMapPreInstantiated() throws Throwable { UnmodifiableGetterBean bean = unmodifiableMapPreInstantiated(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); } protected UnmodifiableGetterBean unmodifiableMapPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", UnmodifiableGetterBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); pmd.setPreInstantiate(false); properties.add(pmd); return (UnmodifiableGetterBean) instantiate(controller, bmd); } public void testMapWithKeyTypeOverride() throws Throwable { SimpleBean bean = mapWithKeyTypeOverride(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); expected.put(1, integer); assertEquals(expected, result); } protected SimpleBean mapWithKeyTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData kmd3 = new StringValueMetaData("1"); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); StringValueMetaData vmd3 = new StringValueMetaData(integer); kmd3.setConfigurator(configurator); kmd3.setType("java.lang.Integer"); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setType(CustomMap.class.getName()); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); smd.put(kmd3, vmd3); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testMapWithValueTypeOverride() throws Throwable { SimpleBean bean = mapWithValueTypeOverride(); assertNotNull(bean); Map result = bean.getMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); expected.put(integer, 1); assertEquals(expected, result); } protected SimpleBean mapWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData kmd3 = new StringValueMetaData(integer); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); StringValueMetaData vmd3 = new StringValueMetaData("1"); vmd3.setConfigurator(configurator); vmd3.setType("java.lang.Integer"); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setType(CustomMap.class.getName()); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); smd.put(kmd3, vmd3); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testMapNotAMap() throws Throwable { try { mapNotAMap(); fail("Expected a failure trying to set a map on a non map attribute"); } catch (Exception expected) { checkMapNotAMapException(expected); } } protected void checkMapNotAMapException(Exception exception) { checkThrowable(ClassCastException.class, exception); } protected SimpleBean mapNotAMap() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("AString", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testMapIsInterface() throws Throwable { try { mapIsInterface(); fail("Expected a failure trying to use an interface for the map type"); } catch (Exception expected) { checkMapIsInterfaceException(expected); } } protected void checkMapIsInterfaceException(Exception exception) { checkThrowable(IllegalArgumentException.class, exception); } protected SimpleBean mapIsInterface() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setType("java.util.Map"); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.setConfigurator(configurator); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("map", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/InstantiateXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/I0000644000175000017500000001250510553632666033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * Instantiation XML Test Case. * * @author Adrian Brock * @version $Revision: 59753 $ */ public class InstantiateXMLTestCase extends InstantiateTestCase { public static Test suite() { return suite(InstantiateXMLTestCase.class); } public InstantiateXMLTestCase(String name) { super(name, true); } public void testSimpleInstantiateFromBeanInfo() throws Throwable { // No XML equivalent } public void testValueInstantiateFromJavabean2() throws Throwable { Object object = valueInstantiateFromJavabean2(); assertNotNull(object); assertTrue(object.getClass() == Object.class); } protected SimpleBean simpleInstantiateFromBeanMetaData() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateFromBeanMetaData() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateFromNull() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateViaInterfaceWithTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithCollection() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithList() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithSet() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithArray() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithMap() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean parameterInstantiateWithProperties() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected Object valueInstantiateFromArray() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromCollection() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromList() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromObject() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromJavabean2() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromSet() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } protected Object valueInstantiateFromValue() throws Throwable { XMLUtil util = bootstrapXML(true); return util.getBean("Value"); } public void testConstructorDoesNotExist() throws Throwable { XMLUtil util = bootstrapXML(false); try { util.validate(); fail("Should not be valid!"); } catch (IllegalStateException expected) { } try { util.getBean("SimpleBean"); } catch (KernelRegistryEntryNotFoundException expected) { } } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/PropertyReplaceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000001246510772665635033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.Collections; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.test.kernel.config.support.SimpleAnnotation; /** * Property replace test cases: ${x} - looking for System property named x. * * @author Ales Justin */ public class PropertyReplaceTestCase extends AbstractKernelConfigTest { private static final String PROP_NAME = "test.property.value"; private static final String BRACKET_PROP_NAME = "${" + PROP_NAME + "}"; private static final String CONST = "PropertyReplaceTestCase"; public PropertyReplaceTestCase(String name) { super(name); } public PropertyReplaceTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(PropertyReplaceTestCase.class); } private List singlePropertyCreator(final boolean replace) { PropertyReplaceTestCase.ObjectCreator oc = new PropertyReplaceTestCase.ObjectCreator() { public Object createObject() throws Throwable { return instantiateReplacePropertyValue(replace); } }; return Collections.singletonList(oc); } public void testPropertyWithPropertyValue() throws Throwable { doTestProperty(true, singlePropertyCreator(true)); } public void testPropertyWithIgnoreReplace() throws Throwable { doTestProperty(false, createCreators()); } public void testAnnotationPropertyReplace() throws Throwable { SecurityManager sm = suspendSecurity(); try { replaceProperty(); SimpleAnnotation replAnn = instantiateAnnotation(true); assertEquals("test." + CONST + ".Name", replAnn.name()); SimpleAnnotation ignAnn = instantiateAnnotation(false); assertEquals("test." + BRACKET_PROP_NAME + ".Name", ignAnn.name()); } finally { resumeSecurity(sm); } } protected SimpleAnnotation instantiateAnnotation(boolean replace) throws Throwable { AbstractAnnotationMetaData annotation = new AbstractAnnotationMetaData(); annotation.setAnnotation("@org.jboss.test.kernel.config.support.SimpleAnnotation(name = \"test." + BRACKET_PROP_NAME + ".Name\")"); annotation.setReplace(replace); return (SimpleAnnotation)annotation.getAnnotationInstance(); } protected List createCreators() { return singlePropertyCreator(false); } private void replaceProperty() { // set property to be replaced System.setProperty(PROP_NAME, CONST); getLog().debug("Set " + PROP_NAME + " to: " + System.getProperty(PROP_NAME)); } private void doTestProperty(boolean replace, List ocs) throws Throwable { SecurityManager sm = suspendSecurity(); try { replaceProperty(); for(PropertyReplaceTestCase.ObjectCreator oc : ocs) { // get property Object value = oc.createObject(); assertNotNull(value); assertEquals(String.class, value.getClass()); String checkValue = replace ? CONST : BRACKET_PROP_NAME; assertEquals(checkValue, value); } } finally { resumeSecurity(sm); } } protected Object instantiateReplacePropertyValue(boolean replace) throws Throwable { PropertyMetaData property = new AbstractPropertyMetaData("key", BRACKET_PROP_NAME, String.class.getName()); StringValueMetaData svmd = assertInstanceOf(property.getValue(), StringValueMetaData.class, false); svmd.setReplace(replace); svmd.setConfigurator(bootstrap().getConfigurator()); return svmd.getValue(null, Thread.currentThread().getContextClassLoader()); } protected interface ObjectCreator { Object createObject() throws Throwable; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ListTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/L0000644000175000017500000004054310756342051033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import org.jboss.beans.metadata.plugins.*; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.CustomList; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import junit.framework.Test; /** * List Test Case. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class ListTestCase extends AbstractKernelConfigTest { MyObject object1 = new MyObject("object1"); MyObject object2 = new MyObject("object2"); String string1 = "string1"; String string2 = "string2"; public static Test suite() { return suite(ListTestCase.class); } public ListTestCase(String name) { super(name); } public ListTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleListFromObjects() throws Throwable { SimpleBean bean = simpleListFromObjects(); assertNotNull(bean); List result = bean.getList(); assertNotNull("Should be a list", result); ArrayList expected = new ArrayList(); expected.add(object1); expected.add(object2); expected.add(object2); expected.add(object1); assertEquals(expected, result); } public SimpleBean simpleListFromObjects() throws Throwable { AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractValueMetaData vmd1 = new AbstractValueMetaData(object1); AbstractValueMetaData vmd2 = new AbstractValueMetaData(object2); AbstractValueMetaData vmd3 = new AbstractValueMetaData(object1); AbstractListMetaData smd = new AbstractListMetaData(); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("list", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(bmd); } public void testSimpleListFromStrings() throws Throwable { SimpleBean bean = simpleListFromStrings(); assertNotNull(bean); List result = bean.getList(); assertNotNull("Should be a list", result); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean simpleListFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("list", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomListExplicit() throws Throwable { SimpleBean bean = customListExplicit(); assertNotNull(bean); List result = bean.getList(); assertNotNull("Should be a list", result); assertTrue("Not a CustomList: " + result.getClass(), result instanceof CustomList); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customListExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setType(CustomList.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("list", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomListFromSignature() throws Throwable { SimpleBean bean = customListFromSignature(); assertNotNull(bean); List result = bean.getCustomList(); assertNotNull("Should be a list", result); assertTrue("Not a CustomList: " + result.getClass(), result instanceof CustomList); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customListFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("customList", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomListPreInstantiated() throws Throwable { SimpleBean bean = customListPreInstantiated(); assertNotNull(bean); List result = bean.getPreInstantiatedList(); assertNotNull("Should be a list", result); assertTrue("Not a CustomList: " + result.getClass(), result instanceof CustomList); assertTrue("Not preinstantiated", ((CustomList) result).getPreInstantiated()); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); List setter = bean.setterList; assertNotNull(setter); assertFalse("Empty setterList", setter.isEmpty()); } protected SimpleBean customListPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd1 = new AbstractPropertyMetaData("preInstantiatedList", smd); properties.add(pmd1); AbstractListMetaData lmd = new AbstractListMetaData(); lmd.setElementType("java.lang.String"); lmd.add(new StringValueMetaData("element")); AbstractPropertyMetaData pmd2 = new AbstractPropertyMetaData("setterList", lmd); properties.add(pmd2); return (SimpleBean) instantiate(controller, bmd); } public void testUnmodifiableListPreInstantiated() throws Throwable { UnmodifiableGetterBean bean = unmodifiableListPreInstantiated(); assertNotNull(bean); List result = bean.getList(); assertNotNull("Should be a list", result); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected UnmodifiableGetterBean unmodifiableListPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", UnmodifiableGetterBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd1 = new AbstractPropertyMetaData("list", smd); pmd1.setPreInstantiate(false); properties.add(pmd1); return (UnmodifiableGetterBean) instantiate(controller, bmd); } public void testListWithValueTypeOverride() throws Throwable { SimpleBean bean = listWithValueTypeOverride(); assertNotNull(bean); List result = bean.getList(); assertNotNull("Should be a list", result); assertTrue("Not a CustomList: " + result.getClass(), result instanceof CustomList); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); expected.add(new Integer(1)); assertEquals(expected, result); } protected SimpleBean listWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); StringValueMetaData vmd4 = new StringValueMetaData("1"); vmd4.setConfigurator(configurator); vmd4.setType("java.lang.Integer"); AbstractListMetaData smd = new AbstractListMetaData(); smd.setType(CustomList.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates smd.add(vmd4); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("list", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testListNotAList() throws Throwable { try { listNotAList(); fail("Expected a failure trying to set a list on a non list attribute"); } catch (Exception expected) { checkListNotAListException(expected); } } protected void checkListNotAListException(Exception exception) { checkThrowable(ClassCastException.class, exception); } protected SimpleBean listNotAList() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("AString", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testListIsInterface() throws Throwable { try { listIsInterface(); fail("Expected a failure trying to use an interface for the list type"); } catch (Exception expected) { checkListIsInterfaceException(expected); } } protected void checkListIsInterfaceException(Exception exception) { checkThrowable(IllegalArgumentException.class, exception); } protected SimpleBean listIsInterface() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setType("java.util.List"); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("list", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/PreInstantiatedFieldsXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000000446510770461341033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimplerBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * Preinstantiated fields xml test cases. * * @author Ales Justin */ public class PreInstantiatedFieldsXMLTestCase extends PreInstantiatedFieldsTestCase { public PreInstantiatedFieldsXMLTestCase(String name) { super(name, true); } public static Test suite() { return suite(PreInstantiatedFieldsXMLTestCase.class); } protected SimplerBean customCollectionPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimplerBean) util.getBean("SimpleBean"); } protected SimplerBean customListPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimplerBean) util.getBean("SimpleBean"); } protected SimplerBean customMapPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimplerBean) util.getBean("SimpleBean"); } protected SimplerBean customSetPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimplerBean) util.getBean("SimpleBean"); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureFromStringTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000002050711000675327033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleBean.Alphabet; /** * Configuration from object Test Case. * * @author Adrian Brock * @version $Revision: 72183 $ */ public class ConfigureFromStringTestCase extends AbstractKernelConfigTest { KernelConfigurator configurator; BeanInfo info; AbstractBeanMetaData metaData; String stringValue = "StringValue"; Byte byteValue = new Byte("12"); Boolean booleanValue = Boolean.TRUE; // TODO character // Character characterValue = new Character('a'); Short shortValue = new Short("123"); Integer integerValue = new Integer("1234"); Long longValue = new Long("12345"); Float floatValue = new Float("3.14"); Double doubleValue = new Double("3.14e12"); Date dateValue = createDate("Mon Jan 01 00:00:00 CET 2001"); BigDecimal bigDecimalValue = new BigDecimal("12e4"); BigInteger bigIntegerValue = new BigInteger("123456"); Alphabet enumValue = Alphabet.Z; public static Test suite() { return suite(ConfigureFromStringTestCase.class); } public ConfigureFromStringTestCase(String name) { super(name); } public ConfigureFromStringTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testConfigure() throws Throwable { SimpleBean bean = configure(); assertEquals(stringValue, bean.getAString()); assertEquals(byteValue, bean.getAByte()); assertEquals(booleanValue, bean.getABoolean()); // TODO character // assertEquals(characterValue, bean.getACharacter()); assertEquals(shortValue, bean.getAShort()); assertEquals(integerValue, bean.getAnInt()); assertEquals(longValue, bean.getALong()); assertEquals(floatValue, bean.getAFloat()); assertEquals(doubleValue, bean.getADouble()); assertEquals(dateValue, bean.getADate()); assertEquals(bigDecimalValue, bean.getABigDecimal()); assertEquals(bigIntegerValue, bean.getABigInteger()); assertEquals(byteValue.byteValue(), bean.getAbyte()); assertEquals(booleanValue.booleanValue(), bean.isAboolean()); // TODO character // assertEquals(characterValue.charValue(), bean.getAchar()); assertEquals(shortValue.shortValue(), bean.getAshort()); assertEquals(integerValue.intValue(), bean.getAnint()); assertEquals(longValue.longValue(), bean.getAlong()); assertEquals(floatValue.floatValue(), bean.getAfloat()); assertEquals(doubleValue.doubleValue(), bean.getAdouble()); Number number = bean.getANumber(); assertEquals(Long.class, number.getClass()); assertEquals(longValue, number); assertEquals(stringValue, bean.getOverloadedProperty()); assertEquals(enumValue, bean.getEnumProperty()); unconfigure(bean); assertEquals(null, bean.getAString()); assertEquals(null, bean.getAByte()); assertEquals(null, bean.getABoolean()); // TODO character // assertEquals(null, bean.getACharacter()); assertEquals(null, bean.getAShort()); assertEquals(null, bean.getAnInt()); assertEquals(null, bean.getALong()); assertEquals(null, bean.getAFloat()); assertEquals(null, bean.getADouble()); assertEquals(null, bean.getADate()); assertEquals(null, bean.getABigDecimal()); assertEquals(null, bean.getABigInteger()); assertEquals(byteValue.byteValue(), bean.getAbyte()); assertEquals(booleanValue.booleanValue(), bean.isAboolean()); // TODO character // assertEquals(characterValue.charValue(), bean.getAchar()); assertEquals(shortValue.shortValue(), bean.getAshort()); assertEquals(integerValue.intValue(), bean.getAnint()); assertEquals(longValue.longValue(), bean.getAlong()); assertEquals(floatValue.floatValue(), bean.getAfloat()); assertEquals(doubleValue.doubleValue(), bean.getAdouble()); assertEquals(null, bean.getANumber()); assertEquals(null, bean.getOverloadedProperty()); assertEquals(null, bean.getEnumProperty()); } protected SimpleBean configure() throws Throwable { Kernel kernel = bootstrap(); configurator = kernel.getConfigurator(); info = configurator.getBeanInfo(SimpleBean.class); SimpleBean bean = (SimpleBean) instantiate(configurator, info); metaData = new AbstractBeanMetaData(); HashSet attributes = new HashSet(); attributes.add(new AbstractPropertyMetaData("AString", stringValue)); attributes.add(new AbstractPropertyMetaData("AByte", byteValue.toString())); attributes.add(new AbstractPropertyMetaData("ABoolean", booleanValue.toString())); // TODO character // attributes.add(new AbstractAttributeMetaData("aCharacter", characterValue.toString())); attributes.add(new AbstractPropertyMetaData("AShort", shortValue.toString())); attributes.add(new AbstractPropertyMetaData("anInt", integerValue.toString())); attributes.add(new AbstractPropertyMetaData("ALong", longValue.toString())); attributes.add(new AbstractPropertyMetaData("AFloat", floatValue.toString())); attributes.add(new AbstractPropertyMetaData("ADouble", doubleValue.toString())); attributes.add(new AbstractPropertyMetaData("ADate", dateValue.toString())); attributes.add(new AbstractPropertyMetaData("ABigDecimal", bigDecimalValue.toString())); attributes.add(new AbstractPropertyMetaData("ABigInteger", bigIntegerValue.toString())); attributes.add(new AbstractPropertyMetaData("abyte", byteValue.toString())); attributes.add(new AbstractPropertyMetaData("aboolean", booleanValue.toString())); // TODO character // attributes.add(new AbstractAttributeMetaData("achar", characterValue.toString())); attributes.add(new AbstractPropertyMetaData("ashort", shortValue.toString())); attributes.add(new AbstractPropertyMetaData("anint", integerValue.toString())); attributes.add(new AbstractPropertyMetaData("along", longValue.toString())); attributes.add(new AbstractPropertyMetaData("afloat", floatValue.toString())); attributes.add(new AbstractPropertyMetaData("adouble", doubleValue.toString())); attributes.add(new AbstractPropertyMetaData("overloadedProperty", stringValue)); AbstractPropertyMetaData number = new AbstractPropertyMetaData("ANumber", longValue.toString(), "java.lang.Long"); ((StringValueMetaData) number.getValue()).setConfigurator(configurator); attributes.add(number); attributes.add(new AbstractPropertyMetaData("enumProperty", enumValue.toString())); metaData.setProperties(attributes); configure(bean, info, metaData); return bean; } protected void unconfigure(SimpleBean bean) throws Throwable { unconfigure(bean, info); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ArrayAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/A0000644000175000017500000001211610657020413033160 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.config.support.FromCustomArraySimpleBean; import org.jboss.test.kernel.config.support.FromCustomSignatureArraySimpleBean; import org.jboss.test.kernel.config.support.FromObjectsArraySimpleBean; import org.jboss.test.kernel.config.support.FromStringsArraySimpleBean; import org.jboss.test.kernel.config.support.InterfaceArraySimpleBean; import org.jboss.test.kernel.config.support.NotAArraySimpleBean; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.TypeOverrideArraySimpleBean; /** * Array Test Case. * * @author Ales Justin */ public class ArrayAnnotationTestCase extends ArrayTestCase { public static Test suite() { return suite(ArrayAnnotationTestCase.class); } public ArrayAnnotationTestCase(String name) { super(name); } public SimpleBean simpleArrayFromObjects() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromObjectsArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleArrayFromStrings() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customArrayExplicit() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customArrayFromSignature() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSignatureArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } /* protected SimpleBean customArrayPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromPreinstArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected UnmodifiableGetterBean unmodifiableArrayPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsArrayUnmodifiableObject.class.getName()); return (UnmodifiableGetterBean) instantiate(builder.getBeanMetaData()); } */ protected SimpleBean arrayWithValueTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", TypeOverrideArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } /* protected SimpleBean arrayInjectOnObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", OnObjectArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } */ public void testArrayNotAArray() throws Throwable { arrayNotAArray(); } protected SimpleBean arrayNotAArray() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", NotAArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } protected SimpleBean arrayIsInterface() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", InterfaceArraySimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/CollectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000004613711301242575033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import org.jboss.beans.metadata.plugins.*; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.CustomCollection; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import junit.framework.Test; /** * Collection Test Case. * * @author Adrian Brock * @version $Revision: 96564 $ */ public class CollectionTestCase extends AbstractKernelConfigTest { MyObject object1 = new MyObject("object1"); MyObject object2 = new MyObject("object2"); String string1 = "string1"; String string2 = "string2"; public static Test suite() { return suite(CollectionTestCase.class); } public CollectionTestCase(String name) { super(name); } public CollectionTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleCollectionFromObjects() throws Throwable { SimpleBean bean = simpleCollectionFromObjects(); assertNotNull(bean); Collection result = bean.getCollection(); assertNotNull("Should be a collection", result); ArrayList expected = new ArrayList(); expected.add(object1); expected.add(object2); expected.add(object2); expected.add(object1); assertEquals(expected, result); } public SimpleBean simpleCollectionFromObjects() throws Throwable { AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractValueMetaData vmd1 = new AbstractValueMetaData(object1); AbstractValueMetaData vmd2 = new AbstractValueMetaData(object2); AbstractValueMetaData vmd3 = new AbstractValueMetaData(object1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(bmd); } public void testSimpleCollectionFromStrings() throws Throwable { SimpleBean bean = simpleCollectionFromStrings(); assertNotNull(bean); Collection result = bean.getCollection(); assertNotNull("Should be a collection", result); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean simpleCollectionFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomCollectionExplicit() throws Throwable { SimpleBean bean = customCollectionExplicit(); assertNotNull(bean); Collection result = bean.getCollection(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customCollectionExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setType(CustomCollection.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomCollectionFromSignature() throws Throwable { SimpleBean bean = customCollectionFromSignature(); assertNotNull(bean); Collection result = bean.getCustomCollection(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customCollectionFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("customCollection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomCollectionPreInstantiated() throws Throwable { SimpleBean bean = customCollectionPreInstantiated(); assertNotNull(bean); Collection result = bean.getPreInstantiatedCollection(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection); assertTrue("Not preinstantiated", ((CustomCollection) result).getPreInstantiated()); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); Collection setter = bean.setterCollection; assertNotNull(setter); assertFalse("Empty setterCollection", setter.isEmpty()); } protected SimpleBean customCollectionPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedCollection", smd); properties.add(pmd); AbstractListMetaData lmd = new AbstractListMetaData(); lmd.setElementType("java.lang.String"); lmd.add(new StringValueMetaData("element")); AbstractPropertyMetaData pmd2 = new AbstractPropertyMetaData("setterCollection", lmd); properties.add(pmd2); return (SimpleBean) instantiate(controller, bmd); } public void testUnmodifiableCollectionPreInstantiated() throws Throwable { UnmodifiableGetterBean bean = unmodifiableCollectionPreInstantiated(); assertNotNull(bean); Collection result = bean.getCollection(); assertNotNull("Should be a collection", result); Collection expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected.size(), result.size()); Iterator i1 = expected.iterator(); Iterator i2 = result.iterator(); while(i1.hasNext() && i2.hasNext()) { assertEquals(i1.next(), i2.next()); } } protected UnmodifiableGetterBean unmodifiableCollectionPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", UnmodifiableGetterBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); pmd.setPreInstantiate(false); properties.add(pmd); return (UnmodifiableGetterBean) instantiate(controller, bmd); } public void testCollectionWithValueTypeOverride() throws Throwable { SimpleBean bean = collectionWithValueTypeOverride(); assertNotNull(bean); Collection result = bean.getCollection(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); expected.add(new Integer(1)); assertEquals(expected, result); } protected SimpleBean collectionWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); StringValueMetaData vmd4 = new StringValueMetaData("1"); vmd4.setConfigurator(configurator); vmd4.setType("java.lang.Integer"); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setType(CustomCollection.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates smd.add(vmd4); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } @SuppressWarnings("unchecked") public void testCollectionInjectOnObject() throws Throwable { SimpleBean bean = collectionInjectOnObject(); assertNotNull(bean); Object result = bean.getAnObject(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof ArrayList); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); expected.add(new Integer(1)); assertEquals(expected, result); } protected SimpleBean collectionInjectOnObject() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); StringValueMetaData vmd4 = new StringValueMetaData("1"); vmd4.setConfigurator(configurator); vmd4.setType("java.lang.Integer"); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setType(CustomCollection.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates smd.add(vmd4); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("anObject", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCollectionNotACollection() throws Throwable { try { collectionNotACollection(); fail("Expected a failure trying to set a collection on a non collection attribute"); } catch (Exception expected) { checkCollectionNotACollectionException(expected); } } protected void checkCollectionNotACollectionException(Exception exception) { checkThrowable(ClassCastException.class, exception); } protected SimpleBean collectionNotACollection() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("AString", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCollectionIsInterface() throws Throwable { try { collectionIsInterface(); fail("Expected a failure trying to use an interface for the collection type"); } catch (Exception expected) { checkCollectionIsInterfaceException(expected); } } protected void checkCollectionIsInterfaceException(Exception exception) { checkThrowable(IllegalArgumentException.class, exception); } protected SimpleBean collectionIsInterface() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setType("java.util.Collection"); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueFactoryXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000363510650627025033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.PropHolder; import org.jboss.test.kernel.config.support.XMLUtil; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ValueFactoryXMLTestCase extends ValueFactoryTestCase { public ValueFactoryXMLTestCase(String name) { super(name); } public ValueFactoryXMLTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ValueFactoryXMLTestCase.class); } protected PropHolder instantiateHolder(KernelController controller) throws Throwable { XMLUtil util = bootstrapXML(true); return (PropHolder) util.getBean("PropHolder"); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ProgressionAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000000375310654102420033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.ProgressionSimpleBean; import org.jboss.test.kernel.config.support.SimpleBean; /** * Progression @annotation Test Case. * * @author Ales Justin */ public class ProgressionAnnotationTestCase extends ProgressionTestCase { public static Test suite() { return suite(ProgressionAnnotationTestCase.class); } public ProgressionAnnotationTestCase(String name) { super(name); } protected SimpleBean instantiateProgressionBeans() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", ProgressionSimpleBean.class.getName()); return (SimpleBean)instantiate(builder.getBeanMetaData()); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ProgressionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000000623110553474371033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; /** * Progression Test Case. * * @author Ales Justin */ public class ProgressionTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(ProgressionTestCase.class); } public ProgressionTestCase(String name) { super(name); } public ProgressionTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testProgressionFromOtherBean() throws Throwable { //Uncomment the line for no progression simple test. //System.setProperty("org.jboss.reflect.plugins.progressionConvertor", NullProgressionConvertor.class.getName()); SimpleBean bean = instantiateProgressionBeans(); assertEquals(123, bean.getAnint()); assertEquals((short)987, bean.getAShort().shortValue()); assertEquals(314159f, bean.getAFloat().floatValue()); } protected SimpleBean instantiateProgressionBeans() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractPropertyMetaData prop1 = new AbstractPropertyMetaData("anint", 123.456); bmd.addProperty(prop1); StringValueMetaData svmd = new StringValueMetaData("987.6543"); svmd.setType("java.lang.Double"); svmd.setConfigurator(configurator); AbstractPropertyMetaData prop2 = new AbstractPropertyMetaData("AShort", svmd); bmd.addProperty(prop2); AbstractPropertyMetaData prop3 = new AbstractPropertyMetaData("AFloat", 314159); bmd.addProperty(prop3); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/InstantiateTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/I0000644000175000017500000005251411301242575033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Properties; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.joinpoint.spi.JoinpointException; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; /** * Instantiation Test Case. * * @author Adrian Brock * @version $Revision: 96564 $ */ public class InstantiateTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(InstantiateTestCase.class); } public InstantiateTestCase(String name) { super(name); } public InstantiateTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleInstantiateFromBeanInfo() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); BeanInfo info = configurator.getBeanInfo(SimpleBean.class); SimpleBean bean = (SimpleBean) instantiate(configurator, info); assertEquals("()", bean.getConstructorUsed()); } public void testSimpleInstantiateFromBeanMetaData() throws Throwable { SimpleBean bean = simpleInstantiateFromBeanMetaData(); assertEquals("()", bean.getConstructorUsed()); } protected SimpleBean simpleInstantiateFromBeanMetaData() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateFromBeanMetaData() throws Throwable { SimpleBean bean = parameterInstantiateFromBeanMetaData(); assertEquals("Constructor Value", bean.getConstructorUsed()); assertEquals("Constructor Value", bean.getAString()); } protected SimpleBean parameterInstantiateFromBeanMetaData() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData("Constructor Value"); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithTypeOverride() throws Throwable { SimpleBean bean = parameterInstantiateWithTypeOverride(); assertEquals("java.lang.Integer:7", bean.getConstructorUsed()); assertEquals(new Integer(7), bean.getAnInt()); } protected SimpleBean parameterInstantiateWithTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.lang.Integer"); StringValueMetaData svmd = new StringValueMetaData("7"); pmd.setValue(svmd); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateFromNull() throws Throwable { SimpleBean bean = parameterInstantiateFromNull(); assertEquals(null, bean.getConstructorUsed()); assertEquals(null, bean.getAString()); } protected SimpleBean parameterInstantiateFromNull() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.lang.String"); pmd.setValue(new AbstractValueMetaData()); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateViaInterfaceWithTypeOverride() throws Throwable { SimpleBean bean = parameterInstantiateViaInterfaceWithTypeOverride(); assertEquals("java.lang.Comparable:java.lang.Integer:12", bean.getConstructorUsed()); assertEquals(12, bean.getAnObject()); } protected SimpleBean parameterInstantiateViaInterfaceWithTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.lang.Comparable"); StringValueMetaData svmd = new StringValueMetaData("12"); svmd.setConfigurator(configurator); svmd.setType("java.lang.Integer"); pmd.setValue(svmd); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithCollection() throws Throwable { SimpleBean bean = parameterInstantiateWithCollection(); assertEquals("java.util.Collection:java.util.ArrayList:[1, 2]", bean.getConstructorUsed()); ArrayList expected = new ArrayList(); expected.add("1"); expected.add("2"); assertEquals(expected, bean.getCollection()); } protected SimpleBean parameterInstantiateWithCollection() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.util.Collection"); AbstractCollectionMetaData collection = new AbstractCollectionMetaData(); collection.setConfigurator(configurator); collection.setElementType("java.lang.String"); collection.add(new StringValueMetaData("1")); collection.add(new StringValueMetaData("2")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithList() throws Throwable { SimpleBean bean = parameterInstantiateWithList(); assertEquals("java.util.List:java.util.ArrayList:[1, 2]", bean.getConstructorUsed()); ArrayList expected = new ArrayList(); expected.add("1"); expected.add("2"); assertEquals(expected, bean.getList()); } protected SimpleBean parameterInstantiateWithList() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.util.List"); AbstractListMetaData collection = new AbstractListMetaData(); collection.setConfigurator(configurator); collection.setElementType("java.lang.String"); collection.add(new StringValueMetaData("1")); collection.add(new StringValueMetaData("2")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithSet() throws Throwable { SimpleBean bean = parameterInstantiateWithSet(); assertEquals("java.util.Set:java.util.HashSet:[1]", bean.getConstructorUsed()); HashSet expected = new HashSet(); expected.add("1"); assertEquals(expected, bean.getSet()); } protected SimpleBean parameterInstantiateWithSet() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.util.Set"); AbstractSetMetaData collection = new AbstractSetMetaData(); collection.setConfigurator(configurator); collection.setElementType("java.lang.String"); collection.add(new StringValueMetaData("1")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithArray() throws Throwable { SimpleBean bean = parameterInstantiateWithArray(); assertEquals("Array:[Ljava.lang.String;:[1, 2]", bean.getConstructorUsed()); String[] expected = new String[] { "1", "2" }; assertEquals(expected, bean.getArray()); } protected SimpleBean parameterInstantiateWithArray() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType(new Object[0].getClass().getName()); AbstractArrayMetaData collection = new AbstractArrayMetaData(); collection.setConfigurator(configurator); collection.setType("[Ljava.lang.String;"); collection.setElementType("java.lang.String"); collection.add(new StringValueMetaData("1")); collection.add(new StringValueMetaData("2")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithMap() throws Throwable { SimpleBean bean = parameterInstantiateWithMap(); assertEquals("java.util.Map:java.util.HashMap:{1=2}", bean.getConstructorUsed()); HashMap expected = new HashMap(); expected.put("1", "2"); assertEquals(expected, bean.getMap()); } protected SimpleBean parameterInstantiateWithMap() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.util.Map"); AbstractMapMetaData collection = new AbstractMapMetaData(); collection.setConfigurator(configurator); collection.setKeyType("java.lang.String"); collection.setValueType("java.lang.String"); collection.put(new StringValueMetaData("1"), new StringValueMetaData("2")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testParameterInstantiateWithProperties() throws Throwable { SimpleBean bean = parameterInstantiateWithProperties(); assertEquals("java.util.Hashtable:java.util.Properties:{1=2}", bean.getConstructorUsed()); Properties expected = new Properties(); expected.put("1", "2"); assertEquals(expected, bean.getMap()); } protected SimpleBean parameterInstantiateWithProperties() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(); pmd.setType("java.util.Hashtable"); AbstractMapMetaData collection = new AbstractMapMetaData(); collection.setConfigurator(configurator); collection.setType("java.util.Properties"); collection.setKeyType("java.lang.String"); collection.setValueType("java.lang.String"); collection.put(new StringValueMetaData("1"), new StringValueMetaData("2")); pmd.setValue(collection); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testValueInstantiateFromValue() throws Throwable { Object object = valueInstantiateFromValue(); assertEquals("AString", object); } protected Object valueInstantiateFromValue() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); StringValueMetaData vmd = new StringValueMetaData("AString"); vmd.setType(String.class.getName()); vmd.setConfigurator(configurator); cmd.setValue(vmd); return instantiate(configurator, bmd); } @SuppressWarnings("unchecked") public void testValueInstantiateFromCollection() throws Throwable { Object object = valueInstantiateFromCollection(); assertNotNull(object); assertTrue(object instanceof Collection); assertEquals(new ArrayList(), object); } protected Object valueInstantiateFromCollection() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); AbstractCollectionMetaData vmd = new AbstractCollectionMetaData(); cmd.setValue(vmd); return instantiate(configurator, bmd); } @SuppressWarnings("unchecked") public void testValueInstantiateFromList() throws Throwable { Object object = valueInstantiateFromList(); assertNotNull(object); assertTrue(object instanceof List); assertEquals(new ArrayList(), object); } protected Object valueInstantiateFromList() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); AbstractListMetaData vmd = new AbstractListMetaData(); cmd.setValue(vmd); return instantiate(configurator, bmd); } @SuppressWarnings("unchecked") public void testValueInstantiateFromSet() throws Throwable { Object object = valueInstantiateFromSet(); assertNotNull(object); assertTrue(object instanceof Set); assertEquals(new HashSet(), object); } protected Object valueInstantiateFromSet() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); AbstractSetMetaData vmd = new AbstractSetMetaData(); cmd.setValue(vmd); return instantiate(configurator, bmd); } public void testValueInstantiateFromArray() throws Throwable { Object object = valueInstantiateFromArray(); assertNotNull(object); assertTrue(object.getClass().isArray()); } protected Object valueInstantiateFromArray() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); AbstractArrayMetaData vmd = new AbstractArrayMetaData(); vmd.setElementType(String.class.getName()); vmd.setConfigurator(configurator); cmd.setValue(vmd); return instantiate(configurator, bmd); } public void testValueInstantiateFromObject() throws Throwable { Object object = valueInstantiateFromObject(); assertNotNull(object); assertTrue(object.getClass() == Object.class); } protected Object valueInstantiateFromObject() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); AbstractValueMetaData vmd = new AbstractValueMetaData(); vmd.setValue(new Object()); cmd.setValue(vmd); return instantiate(configurator, bmd); } public void testConstructorDoesNotExist() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData("doesNotExist", "Constructor Value"); constructorParams.add(pmd); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setParameters(constructorParams); try { instantiate(configurator, bmd); fail("Should not be here"); } catch (JoinpointException expected) { } } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/FactoryXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/F0000644000175000017500000000514010367363670033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * Factory Test Case. * * @author Adrian Brock * @version $Revision: 40742 $ */ public class FactoryXMLTestCase extends FactoryTestCase { public static Test suite() { return suite(FactoryXMLTestCase.class); } public FactoryXMLTestCase(String name) { super(name, true); } protected SimpleBean simpleInstantiateFromFactory() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleInstantiateFromFactoryWithParameters() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleInstantiateFromFactoryWithIntegerParameter() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean staticInstantiateFromFactory() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean staticInstantiateFromFactoryWithParameters() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean staticInstantiateFromFactoryWithIntegerParameter() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/AbstractKernelConfigTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/A0000644000175000017500000001463211001335752033164 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.config.support.XMLUtil; /** * An abstract kernel config test. * * @author Adrian Brock * @version $Revision: 72267 $ */ public class AbstractKernelConfigTest extends AbstractKernelTest { /** Whether we are an xml test */ protected boolean xmltest = false; public AbstractKernelConfigTest(String name) { super(name); } public AbstractKernelConfigTest(String name, boolean xmltest) { super(name); this.xmltest = xmltest; } protected Kernel bootstrap() throws Throwable { if (xmltest) throw new RuntimeException("Not to be invoked from an xml test"); return super.bootstrap(); } protected XMLUtil bootstrapXML(boolean validate) throws Throwable { Kernel kernel = super.bootstrap(); return new XMLUtil(kernel, this, validate); } protected Object instantiate(KernelConfigurator configurator, BeanInfo info) throws Throwable { Joinpoint joinPoint = configurator.getConstructorJoinPoint(info); return joinPoint.dispatch(); } protected Object instantiateAndConfigure(BeanMetaData metaData) throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); return instantiateAndConfigure(configurator, metaData); } protected Object instantiateAndConfigure(KernelConfigurator configurator, BeanMetaData metaData) throws Throwable { Object result = instantiate(configurator, metaData); configure(configurator, result, metaData); return result; } protected Object instantiate(BeanMetaData metaData) throws Throwable { return instantiate(bootstrap().getController(), metaData); } protected Object instantiate(BeanMetaData metaData, ControllerState expectedState) throws Throwable { return instantiate(bootstrap().getController(), metaData, expectedState); } protected Object instantiate(KernelController controller, BeanMetaData metaData) throws Throwable { return instantiate(controller, metaData, null); } protected Object instantiate(KernelController controller, BeanMetaData metaData, ControllerState expectedState) throws Throwable { metaData.setMode(ControllerMode.AUTOMATIC); KernelControllerContext kernelControllerContext = controller.install(metaData); if (expectedState != null) assertEquals(expectedState, kernelControllerContext.getState()); afterInstall(controller, kernelControllerContext); return kernelControllerContext.getTarget(); } protected void afterInstall(KernelController controller, KernelControllerContext context) throws Throwable { } protected Object instantiate(KernelConfigurator configurator, BeanMetaData metaData) throws Throwable { Joinpoint joinPoint = configurator.getConstructorJoinPoint(metaData); return joinPoint.dispatch(); } protected void configure(KernelConfigurator configurator, Object bean, BeanMetaData metaData) throws Throwable { BeanInfo info = configurator.getBeanInfo(metaData); configure(bean, info, metaData); } protected void configure(Object bean, BeanInfo info, BeanMetaData metaData) throws Throwable { if (info == null) throw new IllegalArgumentException("Null bean info"); if (metaData == null) throw new IllegalArgumentException("Null bean meta data"); Set propertys = metaData.getProperties(); if (propertys != null && propertys.isEmpty() == false) { for (PropertyMetaData pmd : propertys) { PropertyInfo pi = info.getProperty(pmd.getName()); ValueMetaData value = pmd.getValue(); pi.set(bean, value.getValue(pi.getType(), Configurator.getClassLoader(metaData))); } } } protected void configure(Object bean, BeanInfo info, PropertyMetaData metaData) throws Throwable { ClassLoader cl = getClass().getClassLoader(); PropertyInfo pi = info.getProperty(metaData.getName()); pi.set(bean, metaData.getValue().getValue(pi.getType(), cl)); } protected void unconfigure(Object bean, BeanInfo info) throws Throwable { Set properties = info.getProperties(); for (PropertyInfo pi : properties) { try { pi.set(bean, null); } catch (Throwable ignored) { } } } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.beans"); //enableTrace("org.jboss.joinpoint.plugins.config"); //enableTrace("org.jboss.kernel.plugins.config"); //if (xmltest) // enableTrace("org.jboss.xb"); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000377011374542121033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.ControllerStateBean; import org.jboss.test.kernel.config.support.CustomValueBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ValueConverterValueOfXMLTestCase extends ValueConverterValueOfTestCase { public ValueConverterValueOfXMLTestCase(String name) { super(name, true); } public static Test suite() { return suite(ValueConverterValueOfXMLTestCase.class); } protected CustomValueBean valueOfForCustomValue() throws Throwable { XMLUtil util = bootstrapXML(true); return (CustomValueBean) util.getBean("CustomValueBean"); } protected ControllerStateBean valueOfForControllerState() throws Throwable { XMLUtil util = bootstrapXML(true); return (ControllerStateBean) util.getBean("ControllerStateBean"); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000001011411374542121033160 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Config Test Suite. * * @author Adrian Brock * @version $Revision: 104939 $ */ public class ConfigTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Config Tests"); suite.addTest(InstantiateTestCase.suite()); suite.addTest(InstantiateXMLTestCase.suite()); suite.addTest(InstantiateAnnotationTestCase.suite()); suite.addTest(GenericFactoryInstantiateTestCase.suite()); suite.addTest(GenericFactoryInstantiateXMLTestCase.suite()); suite.addTest(FactoryTestCase.suite()); suite.addTest(FactoryXMLTestCase.suite()); suite.addTest(FactoryAnnotationTestCase.suite()); suite.addTest(ConfigureAttributeFromObjectTestCase.suite()); suite.addTest(ConfigureAttributeFromStringTestCase.suite()); suite.addTest(ConfigureFromObjectTestCase.suite()); suite.addTest(ConfigureFromStringTestCase.suite()); suite.addTest(ConfigureFromStringXMLTestCase.suite()); suite.addTest(ConfigureFromStringAnnotationTestCase.suite()); suite.addTest(CollectionTestCase.suite()); suite.addTest(CollectionXMLTestCase.suite()); suite.addTest(CollectionAnnotationTestCase.suite()); suite.addTest(SetTestCase.suite()); suite.addTest(SetXMLTestCase.suite()); suite.addTest(SetAnnotationTestCase.suite()); suite.addTest(ListTestCase.suite()); suite.addTest(ListXMLTestCase.suite()); suite.addTest(ListAnnotationTestCase.suite()); suite.addTest(ArrayTestCase.suite()); suite.addTest(ArrayXMLTestCase.suite()); suite.addTest(ArrayAnnotationTestCase.suite()); suite.addTest(MapTestCase.suite()); suite.addTest(MapXMLTestCase.suite()); suite.addTest(MapAnnotationTestCase.suite()); suite.addTest(ProgressionTestCase.suite()); suite.addTest(ProgressionXMLTestCase.suite()); suite.addTest(ProgressionAnnotationTestCase.suite()); suite.addTest(BeanMetaDataBuilderTestCase.suite()); suite.addTest(PropertyReplaceTestCase.suite()); suite.addTest(PropertyReplaceXMLTestCase.suite()); suite.addTest(PropertyReplaceAnnotationTestCase.suite()); suite.addTest(ElementTestCase.suite()); suite.addTest(ElementXMLTestCase.suite()); suite.addTest(ElementAnnotationTestCase.suite()); suite.addTest(ValueFactoryTestCase.suite()); suite.addTest(ValueFactoryXMLTestCase.suite()); suite.addTest(ValueFactoryAnnotationTestCase.suite()); suite.addTest(ValueConverterValueOfTestCase.suite()); suite.addTest(ValueConverterValueOfXMLTestCase.suite()); suite.addTest(ValueTrimTestCase.suite()); suite.addTest(ValueTrimXMLTestCase.suite()); suite.addTest(ValueTrimAnnotationTestCase.suite()); suite.addTest(PreInstantiatedFieldsTestCase.suite()); suite.addTest(PreInstantiatedFieldsXMLTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueConverterValueOfTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000743511374542121033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.ControllerStateBean; import org.jboss.test.kernel.config.support.CustomValueBean; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ValueConverterValueOfTestCase extends AbstractKernelConfigTest { public ValueConverterValueOfTestCase(String name) { super(name); } public ValueConverterValueOfTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ValueConverterValueOfTestCase.class); } public void testValueOfForCustomValue() throws Throwable { CustomValueBean bean = valueOfForCustomValue(); assertNotNull(bean); assertNotNull(bean.getValue()); assertEquals("Custom", bean.getValue().getValue()); } public void testValueOfForControllerState() throws Throwable { ControllerStateBean bean = valueOfForControllerState(); assertNotNull(bean); assertNotNull(bean.getState()); assertEquals(ControllerState.CONFIGURED, bean.getState()); } protected CustomValueBean valueOfForCustomValue() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(CustomValueBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("value", new StringValueMetaData("Custom")); properties.add(pmd); return (CustomValueBean) instantiateAndConfigure(configurator, bmd); } protected ControllerStateBean valueOfForControllerState() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(ControllerStateBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("state", new StringValueMetaData("Configured")); properties.add(pmd); return (ControllerStateBean) instantiateAndConfigure(configurator, bmd); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ListAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/L0000644000175000017500000001266110654057147033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.FromObjectsListSimpleBean; import org.jboss.test.kernel.config.support.FromStringsListSimpleBean; import org.jboss.test.kernel.config.support.FromCustomListSimpleBean; import org.jboss.test.kernel.config.support.FromCustomSignatureListSimpleBean; import org.jboss.test.kernel.config.support.FromPreinstListSimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import org.jboss.test.kernel.config.support.FromStringsListUnmodifiableObject; import org.jboss.test.kernel.config.support.TypeOverrideListSimpleBean; import org.jboss.test.kernel.config.support.OnObjectListSimpleBean; import org.jboss.test.kernel.config.support.NotAListSimpleBean; import org.jboss.test.kernel.config.support.InterfaceListSimpleBean; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.dependency.spi.ControllerState; /** * List Test Case. * * @author Ales Justin */ public class ListAnnotationTestCase extends ListTestCase { public static Test suite() { return suite(ListAnnotationTestCase.class); } public ListAnnotationTestCase(String name) { super(name); } public SimpleBean simpleListFromObjects() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromObjectsListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleListFromStrings() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customListExplicit() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customListFromSignature() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSignatureListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customListPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromPreinstListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected UnmodifiableGetterBean unmodifiableListPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsListUnmodifiableObject.class.getName()); return (UnmodifiableGetterBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean listWithValueTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", TypeOverrideListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean listInjectOnObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", OnObjectListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } public void testListNotAList() throws Throwable { listNotAList(); } protected SimpleBean listNotAList() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", NotAListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } public void testListIsInterface() throws Throwable { listIsInterface(); } protected SimpleBean listIsInterface() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", InterfaceListSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ConfigureAttributeFromObjectTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000001557211000675327033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.math.BigDecimal; import java.math.BigInteger; import junit.framework.Test; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; /** * Configuration from object Test Case. * * @author Adrian Brock * @version $Revision: 72183 $ */ public class ConfigureAttributeFromObjectTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(ConfigureAttributeFromObjectTestCase.class); } public ConfigureAttributeFromObjectTestCase(String name) { super(name); } public void testStringAttribute() throws Throwable { Object value = new String("StringValue"); SimpleBean bean = configureSimpleBean("AString", value); assertEquals(value, bean.getAString()); } public void testByteAttribute() throws Throwable { Object value = new Byte("12"); SimpleBean bean = configureSimpleBean("AByte", value); assertEquals(value, bean.getAByte()); } public void testBooleanAttribute() throws Throwable { Object value = Boolean.TRUE; SimpleBean bean = configureSimpleBean("ABoolean", value); assertEquals(value, bean.getABoolean()); } public void testCharacterAttribute() throws Throwable { Object value = new Character('a'); SimpleBean bean = configureSimpleBean("ACharacter", value); assertEquals(value, bean.getACharacter()); } public void testShortAttribute() throws Throwable { Object value = new Short("123"); SimpleBean bean = configureSimpleBean("AShort", value); assertEquals(value, bean.getAShort()); } public void testIntegerAttribute() throws Throwable { Object value = new Integer("1234"); SimpleBean bean = configureSimpleBean("anInt", value); assertEquals(value, bean.getAnInt()); } public void testLongAttribute() throws Throwable { Object value = new Long("12345"); SimpleBean bean = configureSimpleBean("ALong", value); assertEquals(value, bean.getALong()); } public void testFloatAttribute() throws Throwable { Object value = new Float("3.14"); SimpleBean bean = configureSimpleBean("AFloat", value); assertEquals(value, bean.getAFloat()); } public void testDoubleAttribute() throws Throwable { Object value = new Double("3.14e12"); SimpleBean bean = configureSimpleBean("ADouble", value); assertEquals(value, bean.getADouble()); } public void testDateAttribute() throws Throwable { Object value = createDate(2001, 1, 1); SimpleBean bean = configureSimpleBean("ADate", value); assertEquals(value, bean.getADate()); } public void testBigDecimalAttribute() throws Throwable { Object value = new BigDecimal("12e4"); SimpleBean bean = configureSimpleBean("ABigDecimal", value); assertEquals(value, bean.getABigDecimal()); } public void testBigIntegerAttribute() throws Throwable { Object value = new BigInteger("123456"); SimpleBean bean = configureSimpleBean("ABigInteger", value); assertEquals(value, bean.getABigInteger()); } public void testPrimitiveByteAttribute() throws Throwable { Byte value = new Byte("12"); SimpleBean bean = configureSimpleBean("abyte", value); assertEquals(value.byteValue(), bean.getAbyte()); } public void testPrimitiveBooleanAttribute() throws Throwable { Boolean value = Boolean.TRUE; SimpleBean bean = configureSimpleBean("aboolean", value); assertEquals(value.booleanValue(), bean.isAboolean()); } public void testPrimitiveCharacterAttribute() throws Throwable { Character value = new Character('a'); SimpleBean bean = configureSimpleBean("achar", value); assertEquals(value.charValue(), bean.getAchar()); } public void testPrimitiveShortAttribute() throws Throwable { Short value = new Short("123"); SimpleBean bean = configureSimpleBean("ashort", value); assertEquals(value.shortValue(), bean.getAshort()); } public void testPrimitiveIntegerAttribute() throws Throwable { Integer value = new Integer("1234"); SimpleBean bean = configureSimpleBean("anint", value); assertEquals(value.intValue(), bean.getAnint()); } public void testPrimitiveLongAttribute() throws Throwable { Long value = new Long("12345"); SimpleBean bean = configureSimpleBean("along", value); assertEquals(value.longValue(), bean.getAlong()); } public void testPrimitiveFloatAttribute() throws Throwable { Float value = new Float("3.14"); SimpleBean bean = configureSimpleBean("afloat", value); assertEquals(value.floatValue(), bean.getAfloat()); } public void testPrimitiveDoubleAttribute() throws Throwable { Double value = new Double("3.14e12"); SimpleBean bean = configureSimpleBean("adouble", value); assertEquals(value.doubleValue(), bean.getAdouble()); } public void testNumber() throws Throwable { Long value = new Long("4"); SimpleBean bean = configureSimpleBean("ANumber", value); Object number = bean.getANumber(); assertEquals(Long.class, number.getClass()); assertEquals(value, number); } protected SimpleBean configureSimpleBean(String name, Object value) throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); BeanInfo info = configurator.getBeanInfo(SimpleBean.class); SimpleBean bean = (SimpleBean) instantiate(configurator, info); AbstractPropertyMetaData metaData = new AbstractPropertyMetaData(name, value); configure(bean, info, metaData); return bean; } }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ArrayTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/A0000644000175000017500000003043011301242575033161 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleBean; /** * Array Test Case. * * @author Adrian Brock * @version $Revision: 96564 $ */ public class ArrayTestCase extends AbstractKernelConfigTest { MyObject object1 = new MyObject("object1"); MyObject object2 = new MyObject("object2"); String string1 = "string1"; String string2 = "string2"; public static Test suite() { return suite(ArrayTestCase.class); } public ArrayTestCase(String name) { super(name); } public ArrayTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleArrayFromObjects() throws Throwable { SimpleBean bean = simpleArrayFromObjects(); assertNotNull(bean); Object[] result = bean.getArray(); assertNotNull("Should be a array", result); Object[] expected = new Object[] { object1, object2, object2, object1 }; assertEquals(expected, result); } protected SimpleBean simpleArrayFromObjects() throws Throwable { AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractValueMetaData vmd1 = new AbstractValueMetaData(object1); AbstractValueMetaData vmd2 = new AbstractValueMetaData(object2); AbstractValueMetaData vmd3 = new AbstractValueMetaData(object1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("array", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(bmd); } public void testSimpleArrayFromStrings() throws Throwable { SimpleBean bean = simpleArrayFromStrings(); assertNotNull(bean); Object[] result = bean.getArray(); assertNotNull("Should be a array", result); Object[] expected = new Object[] { string1, string2, string2, string1 }; assertEquals(expected, result); } protected SimpleBean simpleArrayFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("array", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomArrayExplicit() throws Throwable { SimpleBean bean = customArrayExplicit(); assertNotNull(bean); Object[] result = bean.getArray(); assertNotNull("Should be a array", result); assertTrue("Not a String[]: " + result.getClass(), result instanceof String[]); Object[] expected = new Object[] { string1, string2, string2, string1 }; assertEquals(expected, result); } protected SimpleBean customArrayExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setType(new String[0].getClass().getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("array", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomArrayFromSignature() throws Throwable { SimpleBean bean = customArrayFromSignature(); assertNotNull(bean); String[] result = bean.getCustomArray(); assertNotNull("Should be a array", result); Object[] expected = new Object[] { string1, string2, string2, string1 }; assertEquals(expected, result); } protected SimpleBean customArrayFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("customArray", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testArrayWithValueTypeOverride() throws Throwable { SimpleBean bean = arrayWithValueTypeOverride(); assertNotNull(bean); Object[] result = bean.getArray(); assertNotNull("Should be a array", result); Object[] expected = new Object[] { string1, string2, string2, string1, new Integer(1) }; assertEquals(expected, result); } protected SimpleBean arrayWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); StringValueMetaData vmd4 = new StringValueMetaData("1"); vmd4.setConfigurator(configurator); vmd4.setType("java.lang.Integer"); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates smd.add(vmd4); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("array", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testArrayNotAArray() throws Throwable { try { arrayNotAArray(); fail("Expected a failure trying to set a array on a non array attribute"); } catch (Exception expected) { checkArrayNotAArrayException(expected); } } protected void checkArrayNotAArrayException(Exception exception) { checkThrowable(ClassCastException.class, exception); } protected SimpleBean arrayNotAArray() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("AString", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } @SuppressWarnings("unchecked") public void testArrayIsInterface() throws Throwable { SimpleBean bean = arrayIsInterface(); assertNotNull(bean); Object[] result = bean.getArray(); assertNotNull("Should be a array", result); assertTrue("Not a Comparable[]: " + result.getClass(), result instanceof Comparable[]); Object[] expected = new Object[] { string1, string2, string2, string1 }; assertEquals(expected, result); } protected SimpleBean arrayIsInterface() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractArrayMetaData smd = new AbstractArrayMetaData(); smd.setType(new Comparable[0].getClass().getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("array", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000001405110650627025033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.List; import java.util.Map; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.Kernel; import org.jboss.test.kernel.config.support.PropHolder; import org.jboss.test.kernel.config.support.TrimTransformer; import org.jboss.test.kernel.config.support.LDAPFactory; import org.jboss.test.kernel.config.support.Transformer; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ValueFactoryTestCase extends AbstractKernelConfigTest { public ValueFactoryTestCase(String name) { super(name); } public ValueFactoryTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ValueFactoryTestCase.class); } public void testValueFactory() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); PropHolder propHolder = instantiateHolder(controller); assertNotNull(propHolder); assertEquals("QWERT", propHolder.getConstructor()); assertEquals("QWERT", propHolder.getValue()); assertNotNull(propHolder.getList()); for (String prop : propHolder.getList()) assertEquals("QWERT", prop); } protected PropHolder instantiateHolder(KernelController controller) throws Throwable { // ldap BeanMetaDataBuilder ldap = BeanMetaDataBuilderFactory.createBuilder("ldap", LDAPFactory.class.getName()); AbstractMapMetaData map = new AbstractMapMetaData(); map.setKeyType(String.class.getName()); map.setValueType(String.class.getName()); map.put(new StringValueMetaData("foo.bar.key"), new StringValueMetaData("QWERT")); map.put(new StringValueMetaData("xyz.key"), new StringValueMetaData(" QWERT ")); ldap.addConstructorParameter(Map.class.getName(), map); LDAPFactory lf = (LDAPFactory)instantiate(controller, ldap.getBeanMetaData()); assertNotNull(lf); // simple one AbstractValueFactoryMetaData vfmd1 = new AbstractValueFactoryMetaData("ldap", "getValue"); List parameters1 = new ArrayList(); vfmd1.setParameters(parameters1); parameters1.add(new AbstractParameterMetaData(String.class.getName(), "foo.bar.key")); BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("PropHolder", PropHolder.class.getName()); builder.addConstructorParameter(String.class.getName(), vfmd1); builder.addPropertyMetaData("value", vfmd1); AbstractListMetaData listMD = new AbstractListMetaData(); listMD.add(vfmd1); // default from 2nd param AbstractValueFactoryMetaData vfmd2 = new AbstractValueFactoryMetaData("ldap", "getValue"); List parameters2 = new ArrayList(); vfmd2.setParameters(parameters2); parameters2.add(new AbstractParameterMetaData(String.class.getName(), "foo.bar.key")); parameters2.add(new AbstractParameterMetaData(String.class.getName(), "qaz")); listMD.add(vfmd2); // with transformer AbstractValueFactoryMetaData vfmd3 = new AbstractValueFactoryMetaData("ldap", "getValue"); List parameters3 = new ArrayList(); vfmd3.setParameters(parameters3); parameters3.add(new AbstractParameterMetaData(String.class.getName(), "xyz.key")); parameters3.add(new AbstractParameterMetaData(String.class.getName(), "xyz")); // instantiate transformer BeanMetaDataBuilder tranformer = BeanMetaDataBuilderFactory.createBuilder("t", TrimTransformer.class.getName()); assertNotNull(instantiate(controller, tranformer.getBeanMetaData())); parameters3.add(new AbstractParameterMetaData(Transformer.class.getName(), tranformer.getBeanMetaData())); listMD.add(vfmd3); // null, use default AbstractValueFactoryMetaData vfmd4 = new AbstractValueFactoryMetaData("ldap", "getValue", "QWERT"); List parameters4 = new ArrayList(); vfmd4.setParameters(parameters4); parameters4.add(new AbstractParameterMetaData(String.class.getName(), "no.such.key")); listMD.add(vfmd4); builder.addPropertyMetaData("list", listMD); return (PropHolder)instantiate(controller, builder.getBeanMetaData()); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/GenericFactoryInstantiateXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/G0000644000175000017500000000453010770473134033177 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.test.kernel.config.support.XMLUtil; /** * GenericFactory Instantiation Test Case. * * @author Ales Justin */ public class GenericFactoryInstantiateXMLTestCase extends GenericFactoryInstantiateTestCase { public static Test suite() { return suite(GenericFactoryInstantiateXMLTestCase.class); } public GenericFactoryInstantiateXMLTestCase(String name) { super(name, true); } protected BeanFactory configureFromBean() throws Throwable { return configureFactory(); } protected BeanFactory configureFromFactory() throws Throwable { return configureFactory(); } protected BeanFactory configureFromStaticFactory() throws Throwable { return configureFactory(); } protected BeanFactory configureFromIllegalClass() throws Throwable { return configureFactory(); } protected BeanFactory configureFromDefinedFactoryClass() throws Throwable { return configureFactory(); } protected BeanFactory configureFactory() throws Throwable { XMLUtil util = bootstrapXML(true); return (BeanFactory) util.getBean("Factory"); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/PreInstantiatedFieldsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000002403010770461341033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.HashMap; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.CustomCollection; import org.jboss.test.kernel.config.support.SimplerBean; import org.jboss.test.kernel.config.support.CustomList; import org.jboss.test.kernel.config.support.CustomMap; import org.jboss.test.kernel.config.support.CustomSet; import org.jboss.test.AbstractTestDelegate; /** * Preinstantiated fields test cases. * * @author Ales Justin */ public class PreInstantiatedFieldsTestCase extends AbstractKernelConfigTest { String string1 = "string1"; String string2 = "string2"; public PreInstantiatedFieldsTestCase(String name) { super(name); } public PreInstantiatedFieldsTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(PreInstantiatedFieldsTestCase.class); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = false; return delegate; } public void testCustomCollectionPreInstantiated2() throws Throwable { SimplerBean bean = customCollectionPreInstantiated(); assertNotNull(bean); Collection result = bean.getPreInstantiatedCollection(); assertNotNull("Should be a collection", result); assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection); assertTrue("Not preinstantiated", ((CustomCollection) result).getPreInstantiated()); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimplerBean customCollectionPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimplerBean.class.getName()); bmd.setAccessMode(BeanAccessMode.ALL); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractCollectionMetaData smd = new AbstractCollectionMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedCollection", smd); properties.add(pmd); return (SimplerBean) instantiate(controller, bmd); } public void testCustomListPreInstantiated2() throws Throwable { SimplerBean bean = customListPreInstantiated(); assertNotNull(bean); List result = bean.getPreInstantiatedList(); assertNotNull("Should be a list", result); assertTrue("Not a CustomList: " + result.getClass(), result instanceof CustomList); assertTrue("Not preinstantiated", ((CustomList) result).getPreInstantiated()); ArrayList expected = new ArrayList(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimplerBean customListPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimplerBean.class.getName()); bmd.setAccessMode(BeanAccessMode.ALL); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractListMetaData smd = new AbstractListMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd1 = new AbstractPropertyMetaData("preInstantiatedList", smd); properties.add(pmd1); return (SimplerBean) instantiate(controller, bmd); } public void testCustomMapPreInstantiated2() throws Throwable { SimplerBean bean = customMapPreInstantiated(); assertNotNull(bean); Map result = bean.getPreInstantiatedMap(); assertNotNull("Should be a map", result); assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap); assertTrue("Not preinstantiated", ((CustomMap) result).getPreInstantiated()); Map expected = new HashMap(); expected.put(string1, string2); expected.put(string2, string1); assertEquals(expected, result); } protected SimplerBean customMapPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimplerBean.class.getName()); bmd.setAccessMode(BeanAccessMode.ALL); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData kmd1 = new StringValueMetaData(string1); StringValueMetaData kmd2 = new StringValueMetaData(string2); StringValueMetaData vmd1 = new StringValueMetaData(string2); StringValueMetaData vmd2 = new StringValueMetaData(string1); AbstractMapMetaData smd = new AbstractMapMetaData(); smd.setKeyType("java.lang.String"); smd.setValueType("java.lang.String"); smd.put(kmd1, vmd1); smd.put(kmd2, vmd2); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedMap", smd); properties.add(pmd); return (SimplerBean) instantiate(controller, bmd); } public void testCustomSetPreInstantiated2() throws Throwable { SimplerBean bean = customSetPreInstantiated(); assertNotNull(bean); Set result = bean.getPreInstantiatedSet(); assertNotNull("Should be a set", result); assertTrue("Not a CustomSet: " + result.getClass(), result instanceof CustomSet); assertTrue("Not preinstantiated", ((CustomSet) result).getPreInstantiated()); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimplerBean customSetPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimplerBean.class.getName()); bmd.setAccessMode(BeanAccessMode.ALL); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedSet", smd); properties.add(pmd); return (SimplerBean) instantiate(controller, bmd); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/SetTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/S0000644000175000017500000004027210756342051033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.HashSet; import java.util.Set; import org.jboss.beans.metadata.plugins.*; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.config.support.CustomSet; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import junit.framework.Test; /** * Set Test Case. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class SetTestCase extends AbstractKernelConfigTest { MyObject object1 = new MyObject("object1"); MyObject object2 = new MyObject("object2"); String string1 = "string1"; String string2 = "string2"; public static Test suite() { return suite(SetTestCase.class); } public SetTestCase(String name) { super(name); } public SetTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleSetFromObjects() throws Throwable { SimpleBean bean = simpleSetFromObjects(); assertNotNull(bean); Set result = bean.getSet(); assertNotNull("Should be a set", result); HashSet expected = new HashSet(); expected.add(object1); expected.add(object2); expected.add(object2); expected.add(object1); assertEquals(expected, result); } public SimpleBean simpleSetFromObjects() throws Throwable { AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); AbstractValueMetaData vmd1 = new AbstractValueMetaData(object1); AbstractValueMetaData vmd2 = new AbstractValueMetaData(object2); AbstractValueMetaData vmd3 = new AbstractValueMetaData(object1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(bmd); } public void testSimpleSetFromStrings() throws Throwable { SimpleBean bean = simpleSetFromStrings(); assertNotNull(bean); Set result = bean.getSet(); assertNotNull("Should be a set", result); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean simpleSetFromStrings() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomSetExplicit() throws Throwable { SimpleBean bean = customSetExplicit(); assertNotNull(bean); Set result = bean.getSet(); assertNotNull("Should be a set", result); assertTrue("Not a CustomSet: " + result.getClass(), result instanceof CustomSet); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customSetExplicit() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setType(CustomSet.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomSetFromSignature() throws Throwable { SimpleBean bean = customSetFromSignature(); assertNotNull(bean); Set result = bean.getCustomSet(); assertNotNull("Should be a set", result); assertTrue("Not a CustomSet: " + result.getClass(), result instanceof CustomSet); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected SimpleBean customSetFromSignature() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("customSet", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testCustomSetPreInstantiated() throws Throwable { SimpleBean bean = customSetPreInstantiated(); assertNotNull(bean); Set result = bean.getPreInstantiatedSet(); assertNotNull("Should be a set", result); assertTrue("Not a CustomSet: " + result.getClass(), result instanceof CustomSet); assertTrue("Not preinstantiated", ((CustomSet) result).getPreInstantiated()); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); Set setter = bean.setterSet; assertNotNull(setter); assertFalse("Empty setterSet", setter.isEmpty()); } protected SimpleBean customSetPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("preInstantiatedSet", smd); properties.add(pmd); AbstractSetMetaData lmd = new AbstractSetMetaData(); lmd.setElementType("java.lang.String"); lmd.add(new StringValueMetaData("element")); AbstractPropertyMetaData pmd2 = new AbstractPropertyMetaData("setterSet", lmd); properties.add(pmd2); return (SimpleBean) instantiate(controller, bmd); } public void testUnmodifiableSetPreInstantiated() throws Throwable { UnmodifiableGetterBean bean = unmodifiableSetPreInstantiated(); assertNotNull(bean); Set result = bean.getSet(); assertNotNull("Should be a set", result); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); assertEquals(expected, result); } protected UnmodifiableGetterBean unmodifiableSetPreInstantiated() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractBeanMetaData bmd = new AbstractBeanMetaData("test1", UnmodifiableGetterBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); pmd.setPreInstantiate(false); properties.add(pmd); return (UnmodifiableGetterBean) instantiate(controller, bmd); } public void testSetWithValueTypeOverride() throws Throwable { SimpleBean bean = setWithValueTypeOverride(); assertNotNull(bean); Set result = bean.getSet(); assertNotNull("Should be a set", result); assertTrue("Not a CustomSet: " + result.getClass(), result instanceof CustomSet); HashSet expected = new HashSet(); expected.add(string1); expected.add(string2); expected.add(string2); expected.add(string1); expected.add(new Integer(1)); assertEquals(expected, result); } protected SimpleBean setWithValueTypeOverride() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); StringValueMetaData vmd4 = new StringValueMetaData("1"); vmd4.setConfigurator(configurator); vmd4.setType("java.lang.Integer"); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setType(CustomSet.class.getName()); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates smd.add(vmd4); AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testSetNotASet() throws Throwable { try { setNotASet(); fail("Expected a failure trying to set a set on a non set attribute"); } catch (Exception expected) { checkSetNotASetException(expected); } } protected void checkSetNotASetException(Exception exception) { checkThrowable(ClassCastException.class, exception); } protected SimpleBean setNotASet() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("AString", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } public void testSetIsInterface() throws Throwable { try { setIsInterface(); fail("Expected a failure trying to use an interface for the set type"); } catch (Exception expected) { checkSetIsInterfaceException(expected); } } protected void checkSetIsInterfaceException(Exception exception) { checkThrowable(IllegalArgumentException.class, exception); } protected SimpleBean setIsInterface() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); HashSet properties = new HashSet(); bmd.setProperties(properties); StringValueMetaData vmd1 = new StringValueMetaData(string1); StringValueMetaData vmd2 = new StringValueMetaData(string2); StringValueMetaData vmd3 = new StringValueMetaData(string1); AbstractSetMetaData smd = new AbstractSetMetaData(); smd.setType("java.util.Set"); smd.setElementType("java.lang.String"); smd.setConfigurator(configurator); smd.add(vmd1); smd.add(vmd2); smd.add(vmd2); // tests duplicates smd.add(vmd3); // tests duplicates AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("set", smd); properties.add(pmd); return (SimpleBean) instantiateAndConfigure(configurator, bmd); } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueTrimXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000405110675747414033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.config.support.SimpleBean; /** * Value trim xml test cases. * * @author Ales Justin */ public class ValueTrimXMLTestCase extends ValueTrimTestCase { public ValueTrimXMLTestCase(String name) { super(name, true); } public static Test suite() { return suite(ValueTrimXMLTestCase.class); } protected Object getTrimmedValue() throws Throwable { XMLUtil util = bootstrapXML(true); SimpleBean bean = (SimpleBean)util.getBean("SimpleBean"); return bean.getAnInt(); } protected Object getPlainValue() throws Throwable { XMLUtil util = bootstrapXML(true); Object bean = util.getBean("SimpleBean"); util.validate(); return bean; } protected Class getExceptionClass() { return IllegalStateException.class; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/PropertyReplaceAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000000452510654102420033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.config.support.Tester; /** * @author Ales Justin */ public class PropertyReplaceAnnotationTestCase extends PropertyReplaceTestCase { public PropertyReplaceAnnotationTestCase(String name) { super(name); } public static Test suite() { return suite(PropertyReplaceAnnotationTestCase.class); } protected List createCreators() { List result = new ArrayList(); ObjectCreator singleton = new ObjectCreator() { public Object createObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("test", Tester.class.getName()); Tester tester = (Tester)instantiate(builder.getBeanMetaData()); return tester.getValue(); } }; result.add(singleton); return result; } public void testAnnotationPropertyReplace() throws Throwable { // No annotation equivalent. } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/FactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/F0000644000175000017500000002064610653577053033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleBeanFactory; import junit.framework.Test; /** * Factory Test Case. * * @author Adrian Brock * @version $Revision: 64362 $ */ public class FactoryTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(FactoryTestCase.class); } public FactoryTestCase(String name) { super(name); } public FactoryTestCase(String name, boolean xmltest) { super(name, xmltest); } public void testSimpleInstantiateFromFactory() throws Throwable { SimpleBean bean = simpleInstantiateFromFactory(); assertEquals("createSimpleBean()", SimpleBeanFactory.getMethodUsed()); assertEquals("()", bean.getConstructorUsed()); } protected SimpleBean simpleInstantiateFromFactory() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); SimpleBeanFactory factory = new SimpleBeanFactory(); AbstractValueMetaData vmd = new AbstractValueMetaData(factory); cmd.setFactory(vmd); cmd.setFactoryMethod("createSimpleBean"); return (SimpleBean) instantiate(configurator, bmd); } public void testSimpleInstantiateFromFactoryWithParameters() throws Throwable { SimpleBean bean = simpleInstantiateFromFactoryWithParameters(); assertEquals("createSimpleBean(String)", SimpleBeanFactory.getMethodUsed()); assertEquals("Factory Value", bean.getConstructorUsed()); } protected SimpleBean simpleInstantiateFromFactoryWithParameters() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); SimpleBeanFactory factory = new SimpleBeanFactory(); AbstractValueMetaData vmd = new AbstractValueMetaData(factory); cmd.setFactory(vmd); cmd.setFactoryMethod("createSimpleBean"); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData("Factory Value"); constructorParams.add(pmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testSimpleInstantiateFromFactoryWithIntegerParameter() throws Throwable { SimpleBean bean = simpleInstantiateFromFactoryWithIntegerParameter(); assertEquals("createSimpleBean(integer)", SimpleBeanFactory.getMethodUsed()); assertEquals("4", bean.getConstructorUsed()); } protected SimpleBean simpleInstantiateFromFactoryWithIntegerParameter() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); SimpleBeanFactory factory = new SimpleBeanFactory(); AbstractValueMetaData vmd = new AbstractValueMetaData(factory); cmd.setFactory(vmd); cmd.setFactoryMethod("createSimpleBean"); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(4); pmd.setType("java.lang.Integer"); constructorParams.add(pmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testStaticInstantiateFromFactory() throws Throwable { SimpleBean bean = staticInstantiateFromFactory(); assertEquals("staticCreateSimpleBean()", SimpleBeanFactory.getMethodUsed()); assertEquals("()", bean.getConstructorUsed()); } protected SimpleBean staticInstantiateFromFactory() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setFactoryClass(SimpleBeanFactory.class.getName()); cmd.setFactoryMethod("staticCreateSimpleBean"); return (SimpleBean) instantiate(configurator, bmd); } public void testStaticInstantiateFromFactoryWithParameters() throws Throwable { SimpleBean bean = staticInstantiateFromFactoryWithParameters(); assertEquals("staticCreateSimpleBean(String)", SimpleBeanFactory.getMethodUsed()); assertEquals("Static Factory Value", bean.getConstructorUsed()); } protected SimpleBean staticInstantiateFromFactoryWithParameters() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setFactoryClass(SimpleBeanFactory.class.getName()); cmd.setFactoryMethod("staticCreateSimpleBean"); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData("Static Factory Value"); constructorParams.add(pmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } public void testStaticInstantiateFromFactoryWithIntegerParameter() throws Throwable { SimpleBean bean = staticInstantiateFromFactoryWithIntegerParameter(); assertEquals("staticCreateSimpleBean(integer)", SimpleBeanFactory.getMethodUsed()); assertEquals("7", bean.getConstructorUsed()); } protected SimpleBean staticInstantiateFromFactoryWithIntegerParameter() throws Throwable { Kernel kernel = bootstrap(); KernelConfigurator configurator = kernel.getConfigurator(); AbstractBeanMetaData bmd = new AbstractBeanMetaData(SimpleBean.class.getName()); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); bmd.setConstructor(cmd); cmd.setFactoryClass(SimpleBeanFactory.class.getName()); cmd.setFactoryMethod("staticCreateSimpleBean"); ArrayList constructorParams = new ArrayList(); AbstractParameterMetaData pmd = new AbstractParameterMetaData(7); pmd.setType("java.lang.Integer"); constructorParams.add(pmd); cmd.setParameters(constructorParams); return (SimpleBean) instantiate(configurator, bmd); } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ProgressionXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000000332210542550337033204 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; /** * Progression XML Test Case. * * @author Ales Justin */ public class ProgressionXMLTestCase extends ProgressionTestCase { public static Test suite() { return suite(ProgressionXMLTestCase.class); } public ProgressionXMLTestCase(String name) { super(name, true); } protected SimpleBean instantiateProgressionBeans() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ElementXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/E0000644000175000017500000000357310557650756033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.MyElement; import org.jboss.test.kernel.config.support.XMLUtil; import org.w3c.dom.Element; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ElementXMLTestCase extends ElementTestCase { public ElementXMLTestCase(String name) { super(name); } public ElementXMLTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ElementXMLTestCase.class); } protected Element instantiateElement() throws Throwable { XMLUtil util = bootstrapXML(true); MyElement mybean = (MyElement)util.getBean("MyElementBean"); return mybean.getMyElement(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ArrayXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/A0000644000175000017500000000571210476014754033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; import junit.framework.Test; /** * Array Test Case. * * @author Adrian Brock * @version $Revision: 56500 $ */ public class ArrayXMLTestCase extends ArrayTestCase { public static Test suite() { return suite(ArrayXMLTestCase.class); } public ArrayXMLTestCase(String name) { super(name, true); } public SimpleBean simpleArrayFromObjects() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleArrayFromStrings() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customArrayPreinstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customArrayExplicit() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customArrayFromSignature() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean arrayWithValueTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean arrayNotAArray() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkArrayNotAArrayException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } protected SimpleBean arrayIsInterface() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/MapAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/M0000644000175000017500000001337310654057147033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.FromObjectsMapSimpleBean; import org.jboss.test.kernel.config.support.FromStringsMapSimpleBean; import org.jboss.test.kernel.config.support.FromCustomMapSimpleBean; import org.jboss.test.kernel.config.support.FromCustomSignatureMapSimpleBean; import org.jboss.test.kernel.config.support.FromPreinstMapSimpleBean; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; import org.jboss.test.kernel.config.support.FromStringsMapUnmodifiableObject; import org.jboss.test.kernel.config.support.ValueTypeOverrideMapSimpleBean; import org.jboss.test.kernel.config.support.OnObjectMapSimpleBean; import org.jboss.test.kernel.config.support.NotAMapSimpleBean; import org.jboss.test.kernel.config.support.InterfaceMapSimpleBean; import org.jboss.test.kernel.config.support.KeyTypeOverrideMapSimpleBean; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.dependency.spi.ControllerState; /** * Map Test Case. * * @author Ales Justin */ public class MapAnnotationTestCase extends MapTestCase { public static Test suite() { return suite(MapAnnotationTestCase.class); } public MapAnnotationTestCase(String name) { super(name); } public SimpleBean simpleMapFromObjects() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromObjectsMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean simpleMapFromStrings() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customMapExplicit() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customMapFromSignature() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromCustomSignatureMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean customMapPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromPreinstMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected UnmodifiableGetterBean unmodifiableMapPreInstantiated() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", FromStringsMapUnmodifiableObject.class.getName()); return (UnmodifiableGetterBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean mapWithKeyTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", KeyTypeOverrideMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean mapWithValueTypeOverride() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", ValueTypeOverrideMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } protected SimpleBean mapInjectOnObject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", OnObjectMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData()); } public void testMapNotAMap() throws Throwable { mapNotAMap(); } protected SimpleBean mapNotAMap() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", NotAMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } public void testMapIsInterface() throws Throwable { mapIsInterface(); } protected SimpleBean mapIsInterface() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SimpleBean", InterfaceMapSimpleBean.class.getName()); return (SimpleBean) instantiate(builder.getBeanMetaData(), ControllerState.ERROR); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ValueTrimTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/V0000644000175000017500000000570510675747414033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; /** * Value trim test cases. * * @author Ales Justin */ public class ValueTrimTestCase extends AbstractKernelConfigTest { public ValueTrimTestCase(String name) { super(name); } public ValueTrimTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ValueTrimTestCase.class); } protected Object getValue(boolean trim, String value, Class clazz) throws Throwable { Kernel kernel = bootstrap(); StringValueMetaData string = new StringValueMetaData(value); string.setTrim(trim); KernelConfigurator configurator = kernel.getConfigurator(); string.setConfigurator(configurator); return string.getValue(configurator.getClassInfo(clazz), Thread.currentThread().getContextClassLoader()); } protected Object getTrimmedValue() throws Throwable { return getValue(true, " 10 ", Integer.class); } public void testValueTrim() throws Throwable { Object value = getTrimmedValue(); assertNotNull(value); assertInstanceOf(value, Integer.class); assertEquals(10, value); } protected Object getPlainValue() throws Throwable { return getValue(false, " 10 ", Integer.class); } protected Class getExceptionClass() { return NumberFormatException.class; } public void testValueNoTrim() throws Throwable { try { Object value = getPlainValue(); assertNull("Should not be here.", value); } catch (Throwable t) { assertInstanceOf(t, getExceptionClass()); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/ElementTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/E0000644000175000017500000000504610557650756033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.w3c.dom.Element; /** * Test org.w3c.dom.Element usage in MC xml. * * @author Ales Justin */ public class ElementTestCase extends AbstractKernelConfigTest { public ElementTestCase(String name) { super(name); } public ElementTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ElementTestCase.class); } public void testElement() throws Throwable { Element element = instantiateElement(); assertNotNull(element); assertEquals("someelement", element.getTagName()); assertTrue(element.hasAttribute("attrib")); assertEquals("someattribute", element.getAttribute("attrib")); } protected Element instantiateElement() throws Throwable { PropertyMetaData pmd = new AbstractPropertyMetaData( "element", "", Element.class.getName() ); StringValueMetaData svmd = assertInstanceOf(pmd.getValue(), StringValueMetaData.class, false); svmd.setConfigurator(bootstrap().getConfigurator()); return (Element)svmd.getValue(null, Thread.currentThread().getContextClassLoader()); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/PropertyReplaceXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/P0000644000175000017500000001010410562324633033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.config.support.MyObject; import org.jboss.test.kernel.config.support.SimpleAnnotation; import org.jboss.test.kernel.config.support.XMLUtil; /** * @author Ales Justin */ public class PropertyReplaceXMLTestCase extends PropertyReplaceTestCase { public PropertyReplaceXMLTestCase(String name) { super(name); } public PropertyReplaceXMLTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(PropertyReplaceXMLTestCase.class); } protected Object instantiateValue(String type) throws Throwable { XMLUtil util = bootstrapXML(true); MyObject mybean = (MyObject)util.getBean("MyBean" + type); return mybean.getKey(); } protected Object instantiateProperty() throws Throwable { return instantiateValue("Property"); } protected Object instantiateConstructorParameter() throws Throwable { return instantiateValue("Parameter"); } protected Object instantiatePlainValue() throws Throwable { return instantiateValue("PlainValue"); } protected List createCreators() { List result = new ArrayList(); ObjectCreator property = new ObjectCreator() { public Object createObject() throws Throwable { return instantiateProperty(); } }; result.add(property); ObjectCreator parameter = new ObjectCreator() { public Object createObject() throws Throwable { return instantiateConstructorParameter(); } }; result.add(parameter); ObjectCreator plainValue = new ObjectCreator() { public Object createObject() throws Throwable { return instantiatePlainValue(); } }; result.add(plainValue); return result; } protected SimpleAnnotation instantiateAnnotation(boolean replace) throws Throwable { XMLUtil util = bootstrapXML(true); KernelController controller = util.getKernel().getController(); KernelControllerContext context = (KernelControllerContext)controller.getInstalledContext("MyBean" + (replace ? "Replace" : "Ignore")); BeanMetaData beanMetaData = context.getBeanMetaData(); Set annotations = beanMetaData.getAnnotations(); assertNotNull(annotations); assertFalse(annotations.isEmpty()); assertEquals(1, annotations.size()); return (SimpleAnnotation)annotations.iterator().next().getAnnotationInstance(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/BeanMetaDataBuilderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/B0000644000175000017500000013274011224616616033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployer; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.test.kernel.config.support.SimpleAnnotation; import org.jboss.test.kernel.config.support.SimpleAnnotationImpl; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.SimpleCallbackBean; import org.jboss.test.kernel.config.support.SimpleLifecycleBean; import org.jboss.test.kernel.config.support.Transformer; import org.jboss.test.kernel.config.support.TrimTransformer; /** * Builder TestCase. * * @author Ales Justin */ public class BeanMetaDataBuilderTestCase extends AbstractKernelConfigTest { public static Test suite() { return suite(BeanMetaDataBuilderTestCase.class); } public BeanMetaDataBuilderTestCase(String name) throws Throwable { super(name); } public void testConstructor() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("FromBMD", SimpleBean.class.getName()); builder.addConstructorParameter(String.class.getName(), "TestConstructor"); BeanMetaData beanMetaData = builder.getBeanMetaData(); SimpleBean fbmd = (SimpleBean)instantiateAndConfigure(beanMetaData); assertNotNull(fbmd); assertNotNull(fbmd.getConstructorUsed()); assertEquals("TestConstructor", fbmd.getConstructorUsed()); } public void testProperty() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("PropBMD", SimpleBean.class.getName()) .addPropertyMetaData("adouble", 3.1459) .addPropertyMetaData("anint", "123") .addPropertyMetaData("collection", new ArrayList()); BeanMetaData beanMetaData = builder.getBeanMetaData(); SimpleBean pbmd = (SimpleBean)instantiateAndConfigure(beanMetaData); assertNotNull(pbmd); assertEquals(3.1459, pbmd.getAdouble()); assertEquals(123, pbmd.getAnint()); assertNotNull(pbmd.getCollection()); assertTrue(pbmd.getCollection().isEmpty()); } public void testLifecycle() throws Throwable { Kernel kernel = bootstrap(); BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName()) .addCreateParameter(String.class.getName(), "ParamCreate") .setStart("doStart") .addStartParameter(String.class.getName(), "ParamStart") .setStop("doStop") .addStopParameter(String.class.getName(), "ParamStop") .addDestroyParameter(String.class.getName(), "ParamDestroy"); BeanMetaData beanMetaData = builder.getBeanMetaData(); KernelController controller = kernel.getController(); KernelControllerContext context = controller.install(beanMetaData); SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget(); assertNotNull(slb); assertEquals("ParamCreate", slb.getCreate()); assertEquals("ParamStart", slb.getStart()); controller.uninstall("SLB"); assertEquals("ParamStop", slb.getStop()); assertEquals("ParamDestroy", slb.getDestroy()); } public void testInstall() throws Throwable { Kernel kernel = bootstrap(); BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("SLB", SimpleLifecycleBean.class.getName()) .addInstall("installParam", String.class.getName(), "Install") .addUninstall("uninstallParam", String.class.getName(), "Uninstall"); BeanMetaData beanMetaData = builder.getBeanMetaData(); KernelController controller = kernel.getController(); KernelControllerContext context = controller.install(beanMetaData); SimpleLifecycleBean slb = (SimpleLifecycleBean)context.getTarget(); assertNotNull(slb); assertEquals("Install", slb.getInstall()); controller.uninstall("SLB"); assertEquals("Uninstall", slb.getInstall()); } @SuppressWarnings("deprecation") public void testDemandSupply() throws Throwable { BeanMetaDataBuilder demand = BeanMetaDataBuilderFactory.createBuilder("DemandBean", SimpleBean.class.getName()); demand.addDemand("Barrier"); BeanMetaDataFactory demandBean = demand.getBeanMetaDataFactory(); BeanMetaDataBuilder supply = BeanMetaDataBuilderFactory.createBuilder("SupplyBean", SimpleLifecycleBean.class.getName()); supply.addSupply("Barrier"); BeanMetaDataFactory supplyBean = supply.getBeanMetaDataFactory(); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setBeanFactories(Arrays.asList(demandBean, supplyBean)); Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel); deployer.deploy(deployment); try { Object db = controller.getInstalledContext("DemandBean").getTarget(); assertNotNull(db); Object sb = controller.getInstalledContext("SupplyBean").getTarget(); assertNotNull(sb); } finally { deployer.undeploy(deployment); } } @SuppressWarnings("deprecation") public void testDemandWithTargetState() throws Throwable { BeanMetaDataBuilder demand = BeanMetaDataBuilderFactory.createBuilder("DemandBean", SimpleBean.class.getName()); demand.addDemand("SupplyBean", ControllerState.CREATE, ControllerState.START, null); BeanMetaDataFactory demandBean = demand.getBeanMetaDataFactory(); BeanMetaDataBuilder supply = BeanMetaDataBuilderFactory.createBuilder("SupplyBean", SimpleLifecycleBean.class.getName()); BeanMetaDataFactory supplyBean = supply.getBeanMetaDataFactory(); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setBeanFactories(Arrays.asList(demandBean, supplyBean)); Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel); deployer.deploy(deployment); try { Object db = controller.getInstalledContext("DemandBean").getTarget(); assertNotNull(db); Object sb = controller.getInstalledContext("SupplyBean").getTarget(); assertNotNull(sb); } finally { deployer.undeploy(deployment); } } @SuppressWarnings("deprecation") public void testDependency() throws Throwable { BeanMetaDataBuilder dependOn = BeanMetaDataBuilderFactory.createBuilder("DependOnBean", SimpleBean.class.getName()); dependOn.addDependency("DependencyResolver"); BeanMetaDataFactory dependOnBean = dependOn.getBeanMetaDataFactory(); BeanMetaDataBuilder resolver = BeanMetaDataBuilderFactory.createBuilder("DependencyResolver", SimpleLifecycleBean.class.getName()); BeanMetaDataFactory resolverBean = resolver.getBeanMetaDataFactory(); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setBeanFactories(Arrays.asList(dependOnBean, resolverBean)); Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel); deployer.deploy(deployment); try { Object db = controller.getInstalledContext("DependOnBean").getTarget(); assertNotNull(db); Object rb = controller.getInstalledContext("DependencyResolver").getTarget(); assertNotNull(rb); } finally { deployer.undeploy(deployment); } } @SuppressWarnings("deprecation") public void testCollectionProperties() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("CollectionBean", SimpleBean.class.getName()); List array = builder.createArray(); array.add(builder.createValue(new Integer(5))); array.add(builder.createValue(new Integer(10))); builder.addPropertyMetaData("array", array); List list = builder.createList(); list.add(builder.createValue("One")); list.add(builder.createValue("Two")); builder.addPropertyMetaData("list", list); Set set = builder.createSet(); set.add(builder.createValue("En")); set.add(builder.createValue("To")); builder.addPropertyMetaData("set", set); Collection collection = builder.createCollection(); collection.add(builder.createValue("Eins")); collection.add(builder.createValue("Zwei")); builder.addPropertyMetaData("collection", collection); Map map = builder.createMap(); map.put(builder.createValue("One"), builder.createValue("Uno")); map.put(builder.createValue("Two"), builder.createValue("Dos")); builder.addPropertyMetaData("map", map); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory())); Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel); deployer.deploy(deployment); try { Object o = controller.getInstalledContext("CollectionBean").getTarget(); assertNotNull(o); assertInstanceOf(o, SimpleBean.class); SimpleBean bean = (SimpleBean)o; Object[] arr = bean.getArray(); assertEquals(2, arr.length); assertEquals(5, arr[0]); assertEquals(10, arr[1]); List lst = bean.getList(); assertEquals(2, lst.size()); assertEquals("One", lst.get(0)); assertEquals("Two", lst.get(1)); Set st = bean.getSet(); assertEquals(2, lst.size()); assertTrue(st.contains("En")); assertTrue(st.contains("To")); Collection coll = bean.getCollection(); assertEquals(2, lst.size()); assertTrue(coll.contains("Eins")); assertTrue(coll.contains("Zwei")); Map mp = bean.getMap(); assertEquals(2, mp.size()); assertEquals("Uno", mp.get("One")); assertEquals("Dos", mp.get("Two")); } finally { deployer.undeploy(deployment); } } @SuppressWarnings("deprecation") public void testReplacePropertyMetaData() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("ReplaceBean", SimpleBean.class.getName()); builder.addPropertyMetaData("anInt", new Integer(1)); builder.addPropertyMetaData("anInt", new Integer(5)); builder.addPropertyMetaData("AString", "One"); builder.addPropertyMetaData("AString", "Two"); ValueMetaData value = builder.createValue("Three"); builder.addPropertyMetaData("anObject", value); value = builder.createValue("Four"); builder.addPropertyMetaData("anObject", value); List array = builder.createArray(); builder.addPropertyMetaData("array", array); array = builder.createArray(); array.add(builder.createValue(new Integer(5))); array.add(builder.createValue(new Integer(10))); builder.addPropertyMetaData("array", array); Map map = builder.createMap(); builder.addPropertyMetaData("map", map); map = builder.createMap(); map.put(builder.createValue("One"), builder.createValue("Uno")); map.put(builder.createValue("Two"), builder.createValue("Dos")); builder.addPropertyMetaData("map", map); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setBeanFactories(Arrays.asList(builder.getBeanMetaDataFactory())); Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); AbstractKernelDeployer deployer = new AbstractKernelDeployer(kernel); deployer.deploy(deployment); try { Object o = controller.getInstalledContext("ReplaceBean").getTarget(); assertNotNull(o); assertInstanceOf(o, SimpleBean.class); SimpleBean bean = (SimpleBean)o; Integer integer = bean.getAnInt(); assertEquals(new Integer(5), integer); String string = bean.getAString(); assertEquals("Two", string); Object obj = bean.getAnObject(); assertEquals("Four", obj); Object[] arr = bean.getArray(); assertEquals(2, arr.length); assertEquals(5, arr[0]); assertEquals(10, arr[1]); Map mp = bean.getMap(); assertEquals(2, mp.size()); assertEquals("Uno", mp.get("One")); assertEquals("Dos", mp.get("Two")); } finally { deployer.undeploy(deployment); } } public void testCallbacks() throws Throwable { BeanMetaDataBuilder builder; BeanMetaData beanMetaData; List callbacks; CallbackMetaData callback; KernelControllerContext cc; Object target; Transformer transformer; SimpleCallbackBean bean; Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); try { beanMetaData = BeanMetaDataBuilder.createBuilder("t", TrimTransformer.class.getName()).getBeanMetaData(); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); transformer = assertInstanceOf(target, Transformer.class); // ct1 builder = BeanMetaDataBuilder.createBuilder("ct1", SimpleCallbackBean.class.getName()); builder.addPropertyInstallCallback("transformers"); builder.addPropertyUninstallCallback("transformers"); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct2 builder = BeanMetaDataBuilder.createBuilder("ct2", SimpleCallbackBean.class.getName()); builder.addPropertyInstallCallback("transformers", Cardinality.ONE_TO_MANY); builder.addPropertyUninstallCallback("transformers", Cardinality.ONE_TO_MANY); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct3 builder = BeanMetaDataBuilder.createBuilder("ct3", SimpleCallbackBean.class.getName()); builder.addPropertyInstallCallback("transformers", ControllerState.CREATE); builder.addPropertyUninstallCallback("transformers", ControllerState.CREATE); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getMethodName()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct4 builder = BeanMetaDataBuilder.createBuilder("ct4", SimpleCallbackBean.class.getName()); builder.addPropertyInstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE); builder.addPropertyUninstallCallback("transformers", Set.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.START, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertEquals(Set.class.getName(), callback.getSignature()); assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality()); assertNull(callback.getMethodName()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("transformers", callback.getProperty()); assertEquals(ControllerState.START, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertEquals(Set.class.getName(), callback.getSignature()); assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality()); assertNull(callback.getMethodName()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct1 builder = BeanMetaDataBuilder.createBuilder("mct1", SimpleCallbackBean.class.getName()); builder.addMethodInstallCallback("addTransformer"); builder.addMethodUninstallCallback("removeTransformer"); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("addTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("removeTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct2 builder = BeanMetaDataBuilder.createBuilder("mct2", SimpleCallbackBean.class.getName()); builder.addMethodInstallCallback("addTransformer", Cardinality.ONE_TO_MANY); builder.addMethodUninstallCallback("removeTransformer", Cardinality.ONE_TO_MANY); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("addTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("removeTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertNull(callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertEquals(Cardinality.ONE_TO_MANY, callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct3 builder = BeanMetaDataBuilder.createBuilder("mct3", SimpleCallbackBean.class.getName()); builder.addMethodInstallCallback("addTransformer", ControllerState.CREATE); builder.addMethodUninstallCallback("removeTransformer", ControllerState.CREATE); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("addTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("removeTransformer", callback.getMethodName()); assertEquals(ControllerState.INSTALLED, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertNull(callback.getSignature()); assertNull(callback.getProperty()); assertNull(callback.getCardinality()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); // ct4 builder = BeanMetaDataBuilder.createBuilder("mct4", SimpleCallbackBean.class.getName()); builder.addMethodInstallCallback("addTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE); builder.addMethodUninstallCallback("removeTransformer", Transformer.class.getName(), ControllerState.CREATE, ControllerState.START, Cardinality.ZERO_TO_ONE); beanMetaData = builder.getBeanMetaData(); callbacks = beanMetaData.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, InstallCallbackMetaData.class, false); assertEquals("addTransformer", callback.getMethodName()); assertEquals(ControllerState.START, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertEquals(Transformer.class.getName(), callback.getSignature()); assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality()); assertNull(callback.getProperty()); assertNull(callback.getParameters()); callbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertNotNull(callback); assertInstanceOf(callback, UninstallCallbackMetaData.class, false); assertEquals("removeTransformer", callback.getMethodName()); assertEquals(ControllerState.START, callback.getDependentState()); assertEquals(ControllerState.CREATE, callback.getState()); assertEquals(Transformer.class.getName(), callback.getSignature()); assertEquals(Cardinality.ZERO_TO_ONE, callback.getCardinality()); assertNull(callback.getProperty()); assertNull(callback.getParameters()); cc = controller.install(beanMetaData); assertNotNull(cc); assertEquals(ControllerState.INSTALLED, cc.getState()); target = cc.getTarget(); assertNotNull(target); bean = assertInstanceOf(target, SimpleCallbackBean.class); assertNotNull(bean.getTransformers()); assertEquals(1, bean.getTransformers().size()); assertSame(transformer, bean.getTransformers().iterator().next()); } finally { controller.shutdown(); } } public void testAliases() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); try { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName()); builder.addAlias("alias"); controller.install(builder.getBeanMetaData()); assertNotNull(controller.getInstalledContext("alias")); builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName()); Object foobar = "foobar"; builder.setAliases(Collections.singleton(foobar)); controller.install(builder.getBeanMetaData()); assertNotNull(controller.getInstalledContext("foobar")); } finally { controller.shutdown(); } } public void testAnnotations() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); try { BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder("bean", SimpleBean.class.getName()); builder.addAnnotation("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")"); controller.install(builder.getBeanMetaData()); ControllerContext cc = controller.getInstalledContext("bean"); assertNotNull(cc); MetaData metaData = cc.getScopeInfo().getMetaData(); assertNotNull(metaData); assertNotNull(metaData.getAnnotation(SimpleAnnotation.class)); builder = BeanMetaDataBuilderFactory.createBuilder("other", SimpleBean.class.getName()); builder.setAnnotations(Collections.singleton("@" + SimpleAnnotation.class.getName() + "(name=\"foobar\")")); controller.install(builder.getBeanMetaData()); cc = controller.getInstalledContext("other"); assertNotNull(cc); metaData = cc.getScopeInfo().getMetaData(); assertNotNull(metaData); assertNotNull(metaData.getAnnotation(SimpleAnnotation.class)); } finally { controller.shutdown(); } } public void testNewEnums() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(Object.class.getName()); builder.setErrorHandlingMode(ErrorHandlingMode.MANUAL); builder.setAutowireType(AutowireType.CONSTRUCTOR); builder.setAutowireCandidate(false); BeanMetaData bmd = builder.getBeanMetaData(); assertEquals(ErrorHandlingMode.MANUAL, bmd.getErrorHandlingMode()); assertEquals(AutowireType.CONSTRUCTOR, bmd.getAutowireType()); assertFalse(bmd.isAutowireCandidate()); } public void testBeanMetaDataFactory() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("bean", Object.class.getName()); BeanMetaDataFactory f1 = builder.getBeanMetaDataFactory(); assertNotNull(f1); BeanMetaDataFactory f2 = builder.asBeanMetaDataFactory(); assertNotNull(f2); List b1 = f1.getBeans(); assertNotNull(b1); List b2 = f1.getBeans(); assertNotNull(b2); assertEquals(b1, b2); AbstractBeanMetaData abmd = new AbstractBeanMetaData("bean", Object.class.getName()); builder = BeanMetaDataBuilder.createBuilder(abmd); assertSame(abmd, builder.getBeanMetaDataFactory()); BeanMetaDataFactory bmdf = builder.asBeanMetaDataFactory(); assertNotNull(bmdf); List beans = bmdf.getBeans(); assertNotNull(beans); assertFalse(beans.isEmpty()); assertSame(abmd, beans.get(0)); } public void testRelatedClassName() throws Throwable { RelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName()); Set related = new HashSet(); related.add(rcmd); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean"); builder.addRelatedClass(Object.class.getName()); BeanMetaData bmd = builder.getBeanMetaData(); assertEquals(related, bmd.getRelated()); } public void testRelatedClassNameWithEnabled() throws Throwable { AbstractRelatedClassMetaData rcmd = new AbstractRelatedClassMetaData(Object.class.getName()); rcmd.setEnabledValue("aop"); Set related = new HashSet(); related.add(rcmd); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean"); builder.addRelatedClass(Object.class.getName(), "aop"); BeanMetaData bmd = builder.getBeanMetaData(); assertEquals(related, bmd.getRelated()); } public void testMultipleRelatedClassNameWithMultipleEnabled() throws Throwable { AbstractRelatedClassMetaData rcmd1 = new AbstractRelatedClassMetaData(Object.class.getName()); rcmd1.setEnabled(new HashSet(Arrays.asList("aop", "md"))); AbstractRelatedClassMetaData rcmd2 = new AbstractRelatedClassMetaData(String.class.getName()); rcmd2.setEnabled(new HashSet(Arrays.asList("qwert", "foobar"))); Set related = new HashSet(); related.add(rcmd1); related.add(rcmd2); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean"); builder.addRelatedClass(Object.class.getName(), "aop", "md"); builder.addRelatedClass(String.class.getName(), "qwert", "foobar"); BeanMetaData bmd = builder.getBeanMetaData(); assertEquals(related, bmd.getRelated()); } public void testIgnoredLifecycle() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); builder.ignoreCreate(); builder.ignoreStart(); builder.ignoreStop(); builder.ignoreDestroy(); BeanMetaData bmd = builder.getBeanMetaData(); assertIgnoredLifecycle(bmd.getCreate()); assertIgnoredLifecycle(bmd.getStart()); assertIgnoredLifecycle(bmd.getStop()); assertIgnoredLifecycle(bmd.getDestroy()); } protected void assertIgnoredLifecycle(LifecycleMetaData lmd) { assertNotNull(lmd); assertTrue(lmd.isIgnored()); } public void testContextualInjection() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); builder.addPropertyMetaData("ci", builder.createContextualInject()); BeanMetaData bmd = builder.getBeanMetaData(); Set properties = bmd.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData pmd = properties.iterator().next(); ValueMetaData vmd = pmd.getValue(); assertNotNull(vmd); assertNull(vmd.getUnderlyingValue()); } public void testSearch() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); builder.addPropertyMetaData("ci", builder.createContextualInject(null, null, null, null, Search.WIDTH)); BeanMetaData bmd = builder.getBeanMetaData(); Set properties = bmd.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData pmd = properties.iterator().next(); ValueMetaData vmd = pmd.getValue(); assertNotNull(vmd); AbstractDependencyValueMetaData advmd = assertInstanceOf(vmd, AbstractDependencyValueMetaData.class); assertEquals(Search.WIDTH, advmd.getSearch()); } public void testPropertyAnnotations() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); builder.addPropertyMetaData("ci", builder.createContextualInject()); builder.addPropertyAnnotation("ci", new SimpleAnnotationImpl()); BeanMetaData bmd = builder.getBeanMetaData(); Set properties = bmd.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData pmd = properties.iterator().next(); Set annotations = pmd.getAnnotations(); assertNotNull(annotations); assertEquals(1, annotations.size()); } public void testFromContextInject() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); ValueMetaData value = builder.createFromContextInject(FromContext.CONTEXT, "foobar", ControllerState.CREATE, Search.CHILD_ONLY_DEPTH); builder.addPropertyMetaData("someproprerty", value); BeanMetaData bmd = builder.getBeanMetaData(); Set properties = bmd.getProperties(); assertNotNull(properties); assertEquals(1, properties.size()); PropertyMetaData pmd = properties.iterator().next(); ValueMetaData vmd = pmd.getValue(); AbstractInjectionValueMetaData inject = assertInstanceOf(vmd, AbstractInjectionValueMetaData.class); assertEquals(FromContext.CONTEXT, inject.getFromContext()); assertEquals("foobar", inject.getUnderlyingValue()); assertEquals(ControllerState.CREATE, inject.getDependentState()); assertEquals(Search.CHILD_ONLY_DEPTH, inject.getSearch()); } public void testValueFactory() throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("test"); ValueMetaData v1 = builder.createValueFactory("other", "somemethod1", "key"); builder.addPropertyMetaData("v1", v1); ParameterMetaData p1 = builder.createParameter(123); ParameterMetaData p2 = builder.createParameter(builder.createInject("third"), Long.class.getName(), 1); ValueMetaData v2 = builder.createValueFactory("other", "somemethod2", p1, p2); builder.addPropertyMetaData("v2", v2); BeanMetaData bmd = builder.getBeanMetaData(); Set properties = bmd.getProperties(); assertNotNull(properties); assertEquals(2, properties.size()); Iterator iter = properties.iterator(); // 1 PropertyMetaData pmd = iter.next(); ValueMetaData vmd = pmd.getValue(); AbstractValueFactoryMetaData vf = assertInstanceOf(vmd, AbstractValueFactoryMetaData.class, false); assertEquals("other", vf.getValue()); assertTrue(vf.getMethod().startsWith("somemethod")); assertEquals(Integer.parseInt(vf.getMethod().substring("somemethod".length())), vf.getParameters().size()); // 2 pmd = iter.next(); vmd = pmd.getValue(); vf = assertInstanceOf(vmd, AbstractValueFactoryMetaData.class, false); assertEquals("other", vf.getValue()); assertTrue(vf.getMethod().startsWith("somemethod")); assertEquals(Integer.parseInt(vf.getMethod().substring("somemethod".length())), vf.getParameters().size()); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/CollectionXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/test/C0000644000175000017500000000716310642732022033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.test; import junit.framework.Test; import org.jboss.test.kernel.config.support.SimpleBean; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.config.support.UnmodifiableGetterBean; /** * Collection Test Case. * * @author Adrian Brock * @version $Revision: 63822 $ */ public class CollectionXMLTestCase extends CollectionTestCase { public static Test suite() { return suite(CollectionXMLTestCase.class); } public CollectionXMLTestCase(String name) { super(name, true); } public SimpleBean simpleCollectionFromObjects() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean simpleCollectionFromStrings() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customCollectionExplicit() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customCollectionFromSignature() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean customCollectionPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected UnmodifiableGetterBean unmodifiableCollectionPreInstantiated() throws Throwable { XMLUtil util = bootstrapXML(true); return (UnmodifiableGetterBean) util.getBean("SimpleBean"); } protected SimpleBean collectionWithValueTypeOverride() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean collectionInjectOnObject() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected SimpleBean collectionNotACollection() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkCollectionNotACollectionException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } protected SimpleBean collectionIsInterface() throws Throwable { XMLUtil util = bootstrapXML(true); return (SimpleBean) util.getBean("SimpleBean"); } protected void checkCollectionIsInterfaceException(Exception exception) { checkThrowable(IllegalStateException.class, exception); } }././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000755000175000017500000000000011620312147033345 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000356510764340107033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setSet(Set collection) { super.setSet(collection); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromFactoryWithParamSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000566310764340107033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @Factory( factory = @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.SimpleBeanFactory.class)), factoryMethod = "createSimpleBean", parameters = {@Value(string = @StringValue("Factory Value"), type = String.class)} ) public class FromFactoryWithParamSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromFactoryWithParamSimpleBean() { } public FromFactoryWithParamSimpleBean(String string) { super(string); } public FromFactoryWithParamSimpleBean(String string1, String string2) { super(string1, string2); } public FromFactoryWithParamSimpleBean(Integer integer) { super(integer); } public FromFactoryWithParamSimpleBean(Comparable comparable) { super(comparable); } public FromFactoryWithParamSimpleBean(Collection collection) { super(collection); } public FromFactoryWithParamSimpleBean(List list) { super(list); } public FromFactoryWithParamSimpleBean(Set set) { super(set); } public FromFactoryWithParamSimpleBean(Object[] array) { super(array); } public FromFactoryWithParamSimpleBean(Map map) { super(map); } public FromFactoryWithParamSimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/InterfaceArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000360410764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class InterfaceArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = Comparable[].class ) public void setArray(Object[] array) { super.setArray(array); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimplerBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000460710770461341033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.io.Serializable; /** * A simpler bean * * @author Ales Justin */ public class SimplerBean implements Serializable { private static final long serialVersionUID = -2041055615016745994L; /** preInstantiated */ protected CustomCollection preInstantiatedCollection = new CustomCollection(true); /** preInstantiated */ protected CustomSet preInstantiatedSet = new CustomSet(true); /** preInstantiated */ protected CustomList preInstantiatedList = new CustomList(true); /** preInstantiated */ protected CustomMap preInstantiatedMap = new CustomMap(true); public SimplerBean() { } public SimplerBean(String string) { preInstantiatedCollection.add(string); preInstantiatedList.add(string); preInstantiatedSet.add(string); } public SimplerBean(String key, String value) { preInstantiatedMap.put(key, value); } public CustomCollection getPreInstantiatedCollection() { return preInstantiatedCollection; } public CustomSet getPreInstantiatedSet() { return preInstantiatedSet; } public CustomList getPreInstantiatedList() { return preInstantiatedList; } public CustomMap getPreInstantiatedMap() { return preInstantiatedMap; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromPreinstCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000441610764340107033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromPreinstCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = java.lang.String.class ) public void setPreInstantiatedCollection(CustomCollection preInstantiatedCollection) { super.setPreInstantiatedCollection(preInstantiatedCollection); } @CollectionValue( value = { @Value(string = @StringValue("element")) }, elementClass = String.class ) public void setSetterCollection(Collection setterCollection) { super.setSetterCollection(setterCollection); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000274710772714443033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.spi.factory.AbstractBeanFactory; import org.jboss.kernel.spi.config.KernelConfigurator; /** * @author Ales Justin */ public class MyBeanFactory extends AbstractBeanFactory { public MyBeanFactory(KernelConfigurator configurator) { super(configurator); } public Object createBean() throws Throwable { return "foobar"; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSignatureSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000356310764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class FromCustomSignatureSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setCustomSet(CustomSet collection) { super.setCustomSet(collection); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromObjectsMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000442110764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromObjectsMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)), value=@Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)) ), @EntryValue( key=@Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), value=@Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)) ) }, keyClass = Object.class, valueClass = Object.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromPreinstSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000423310764340107033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromPreinstSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setPreInstantiatedSet(CustomSet preInstantiatedSet) { super.setPreInstantiatedSet(preInstantiatedSet); } @SetValue( value = { @Value(string = @StringValue("element")) }, elementClass = String.class ) public void setSetterSet(Set setterSet) { super.setSetterSet(setterSet); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/AnnotatedLDAPFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000423210764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * @author Ales Justin */ public class AnnotatedLDAPFactory extends LDAPFactory { @Constructor public AnnotatedLDAPFactory( @MapValue( keyClass = String.class, valueClass = String.class, value = { @EntryValue( key = @Value(string = @StringValue("foo.bar.key")), value = @Value(string = @StringValue("QWERT")) ), @EntryValue( key = @Value(string = @StringValue("xyz.key")), value = @Value(string = @StringValue(" QWERT ")) ) } ) Map map ) { super(map); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsCollectionUnmodifiableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000374710764340107033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsCollectionUnmodifiableObject extends UnmodifiableGetterBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.ArrayList.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000357410764340107033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setList(List collection) { super.setList(collection); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromPreinstArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000416310764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromPreinstArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setPreInstantiatedArray(Object[] preInstantiatedArray) { super.setPreInstantiatedArray(preInstantiatedArray); } @ArrayValue( value = { @Value(string = @StringValue("element")) }, elementClass = String.class ) public void setSetterArray(Object[] setterArray) { } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamNullConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000311710756342051033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.NullValue; /** * A simple annotated bean * * @author Ales Justin */ public class ParamNullConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamNullConstructorAnnBean() { } @Constructor public ParamNullConstructorAnnBean(@NullValue String string) { super(string); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsMapUnmodifiableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000420410764340107033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsMapUnmodifiableObject extends UnmodifiableGetterBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class, clazz = java.util.HashMap.class ) public void setMap(Map map) { super.setMap(map); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TypeOverrideListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000402510764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class TypeOverrideListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomList.class ) public void setList(List collection) { super.setList(collection); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomList.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000320110540110763033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.ArrayList; /** * A CustomCollection. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class CustomList extends ArrayList { /** The serialVersionUID */ private static final long serialVersionUID = 3762538897183683896L; /** Whether the collection was pre instantited */ private boolean preInstantiated; public CustomList() { } public CustomList(boolean preInstantiated) { this.preInstantiated = preInstantiated; } public boolean getPreInstantiated() { return preInstantiated; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NotAListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000364710764340107033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class NotAListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setAString(String string) { super.setAString(string); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TrimTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000263210675747414033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * @author Ales Justin */ public class TrimTester { private Integer value; public Integer getValue() { return value; } @StringValue(" 10 ") public void setValue(Integer value) { this.value = value; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromObjectsListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000407210764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromObjectsListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)) }, elementClass = Object.class ) public void setList(List collection) { super.setList(collection); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamListConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000372410764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple annotated bean * * @author Ales Justin */ public class ParamListConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamListConstructorAnnBean() { } @Constructor public ParamListConstructorAnnBean( @ListValue( elementClass = String.class, value={ @Value(string = @StringValue("1")), @Value(string = @StringValue("2")) } ) List collection) { super(collection); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/PropHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000333410650627025033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; /** * @author Ales Justin */ public class PropHolder { private String constructor; private String value; private List list; public PropHolder(String constructor) { this.constructor = constructor; } public String getConstructor() { return constructor; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public List getList() { return list; } public void setList(List list) { this.list = list; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000376410764340107033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromCustomCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomCollection.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NotAMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000406110764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.EntryValue; /** * A simple bean * * @author Ales Justin */ public class NotAMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class ) public void setAString(String string) { super.setAString(string); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000362310764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromCustomArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = java.lang.String.class, clazz = String[].class ) public void setArray(Object[] collection) { super.setArray(collection); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/Tester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000267610674773017033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * @author Ales Justin */ public class Tester { private String value; public String getValue() { return value; } @StringValue(value = "${test.property.value}", replace = false) public void setValue(String value) { this.value = value; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromPreinstListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000425210764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromPreinstListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setPreInstantiatedList(CustomList preInstantiatedList) { super.setPreInstantiatedList(preInstantiatedList); } @ListValue( value = { @Value(string = @StringValue("element")) }, elementClass = String.class ) public void setSetterList(List setterList) { super.setSetterList(setterList); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsSetUnmodifiableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000364610764340107033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsSetUnmodifiableObject extends UnmodifiableGetterBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.HashSet.class ) public void setSet(Set set) { super.setSet(set); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromPreinstMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000502210764340107033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromPreinstMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class ) public void setPreInstantiatedMap(CustomMap preInstantiatedMap) { super.setPreInstantiatedMap(preInstantiatedMap); } @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("justKey")), value=@Value(string = @StringValue("justValue")) ) }, keyClass = String.class, valueClass = String.class ) public void setSetterMap(Map setterMap) { super.setSetterMap(setterMap); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyObject1.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000235710653716012033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * A simple bean * * @author Ales Justin */ public class MyObject1 extends MyObject { public MyObject1() { super("object1"); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsListUnmodifiableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000366110764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsListUnmodifiableObject extends UnmodifiableGetterBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.ArrayList.class ) public void setList(List list) { super.setList(list); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamArrayConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000370010764340107033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.ArrayValue; /** * A simple annotated bean * * @author Ales Justin */ public class ParamArrayConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamArrayConstructorAnnBean() { } @Constructor public ParamArrayConstructorAnnBean( @ArrayValue( elementClass = String.class, value={ @Value(string = @StringValue("1")), @Value(string = @StringValue("2")) } ) String[] collection) { super(collection); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamCompConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000320410764340107033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple annotated bean * * @author Ales Justin */ public class ParamCompConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamCompConstructorAnnBean() { } @Constructor public ParamCompConstructorAnnBean(@StringValue(value = "12", type=Integer.class) Comparable comparable) { super(comparable); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NotACollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000367110764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class NotACollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setAString(String string) { super.setAString(string); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NotAArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000365210764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class NotAArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setAString(String string) { super.setAString(string); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/InterfaceMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000415610764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class InterfaceMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class, clazz = java.util.Map.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/OnObjectArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000366010764340107033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class OnObjectArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setAnObject(Object object) { super.setAnObject(object); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromFactorySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000525510764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @Factory( factory = @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.SimpleBeanFactory.class)), factoryMethod = "createSimpleBean" ) public class FromFactorySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromFactorySimpleBean() { } public FromFactorySimpleBean(String string) { super(string); } public FromFactorySimpleBean(String string1, String string2) { super(string1, string2); } public FromFactorySimpleBean(Integer integer) { super(integer); } public FromFactorySimpleBean(Comparable comparable) { super(comparable); } public FromFactorySimpleBean(Collection collection) { super(collection); } public FromFactorySimpleBean(List list) { super(list); } public FromFactorySimpleBean(Set set) { super(set); } public FromFactorySimpleBean(Object[] array) { super(array); } public FromFactorySimpleBean(Map map) { super(map); } public FromFactorySimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/OnObjectCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000401610764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class OnObjectCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomCollection.class ) public void setAnObject(Object object) { super.setAnObject(object); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000422010764340107033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromCustomMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomMap.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamPropertiesConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000431310764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Hashtable; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple annotated bean * * @author Ales Justin */ public class ParamPropertiesConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamPropertiesConstructorAnnBean() { } @Constructor public ParamPropertiesConstructorAnnBean( @MapValue( clazz=java.util.Properties.class, keyClass = String.class, valueClass = String.class, value = { @EntryValue( key = @Value(string = @StringValue("1")), value = @Value(string = @StringValue("2")) ) } ) Hashtable collection) { super(collection); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyElement.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000262110557650756033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.w3c.dom.Element; /** * Element holder bean. * * @author Ales Justin */ public class MyElement { private Element myElement; public Element getMyElement() { return myElement; } public void setMyElement(Element myElement) { this.myElement = myElement; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ValueTypeOverrideMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000453210764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class ValueTypeOverrideMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ), @EntryValue( key=@Value(string = @StringValue("integer")), value=@Value(string = @StringValue(value = "1", type=Integer.class)) ) }, keyClass = String.class, valueClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomMap.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleCallbackBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000332610771175116033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import java.util.HashSet; /** * @author Ales Justin */ public class SimpleCallbackBean { private Set> transformers = new HashSet>(); public Set> getTransformers() { return transformers; } public void setTransformers(Set> transformers) { this.transformers = transformers; } public void addTransformer(Transformer transformer) { transformers.add(transformer); } public void removeTransformer(Transformer transformer) { transformers.remove(transformer); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/KeyTypeOverrideMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000453010764340107033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class KeyTypeOverrideMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ), @EntryValue( key=@Value(string = @StringValue(value = "1", type=Integer.class)), value=@Value(string = @StringValue("integer")) ) }, keyClass = String.class, valueClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomMap.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000265710562362221033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) public @interface SimpleAnnotation { String name(); } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromObjectsSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000406310764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromObjectsSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)) }, elementClass = Object.class ) public void setSet(Set collection) { super.setSet(collection); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000313410756342051033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple annotated bean * * @author Ales Justin */ public class ParamConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamConstructorAnnBean() { } @Constructor public ParamConstructorAnnBean(@StringValue("Constructor Value") String string) { super(string); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamMapConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000417010764340107033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple annotated bean * * @author Ales Justin */ public class ParamMapConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamMapConstructorAnnBean() { } @Constructor public ParamMapConstructorAnnBean( @MapValue( keyClass = String.class, valueClass = String.class, value = { @EntryValue( key = @Value(string = @StringValue("1")), value = @Value(string = @StringValue("2")) ) } ) Map collection) { super(collection); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/OnObjectMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000416510764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.EntryValue; /** * A simple bean * * @author Ales Justin */ public class OnObjectMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomMap.class ) public void setAnObject(Object object) { super.setAnObject(object); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/OnObjectSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000376210764340107033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class OnObjectSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomSet.class ) public void setAnObject(Object object) { super.setAnObject(object); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromObjectsCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000414410764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromObjectsCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)) }, elementClass = Object.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/LDAPFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000377410650627025033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; /** * @author Ales Justin */ public class LDAPFactory { private Map map; public LDAPFactory(Map map) { if (map == null) throw new IllegalArgumentException("Map is null."); this.map = map; } public String getValue(String key) { return getValue(key, null); } public String getValue(String key, String def) { return getValue(key, def, null); } public String getValue(String key, String def, Transformer transformer) { if (transformer == null) transformer = new Transformer() { public String transform(String value) { return value; } }; String value = map.get(key); if (value == null) value = def; return transformer.transform(value); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000251611374542121033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CustomValueBean { CustomValue value; public CustomValue getValue() { return value; } public void setValue(CustomValue value) { this.value = value; } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyObject2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000235710653716012033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * A simple bean * * @author Ales Justin */ public class MyObject2 extends MyObject { public MyObject2() { super("object2"); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000412310764340107033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Map; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class ) public void setMap(Map collection) { super.setMap(collection); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleLifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000410110554206056033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * @author Ales Justin */ public class SimpleLifecycleBean { private String create; private String start; private String stop; private String destroy; private String install; public void create(String param) { create = param; } public void doStart(String param) { start = param; } public void doStop(String param) { stop = param; } public void destroy(String param) { destroy = param; } public String getCreate() { return create; } public String getStart() { return start; } public String getStop() { return stop; } public String getDestroy() { return destroy; } public String getInstall() { return install; } public void installParam(String param) { install = param; } public void uninstallParam(String param) { install = param; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TypeOverrideArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000365610764340107033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class TypeOverrideArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setArray(Object[] array) { super.setArray(array); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NoTrimTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000266210675747414033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * @author Ales Justin */ public class NoTrimTester { private Integer value; public Integer getValue() { return value; } @StringValue(value = " 10 ", trim = false) public void setValue(Integer value) { this.value = value; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/NotASetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000364410764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class NotASetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class ) public void setAString(String string) { super.setAString(string); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomSet.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000316310540110763033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.HashSet; /** * A CustomSet. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class CustomSet extends HashSet { /** The serialVersionUID */ private static final long serialVersionUID = 3762538897183683896L; /** Whether the collection was pre instantited */ private boolean preInstantiated; public CustomSet() { } public CustomSet(boolean preInstantiated) { this.preInstantiated = preInstantiated; } public boolean getPreInstantiated() { return preInstantiated; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromObjectsArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000403410764340107033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromObjectsArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject2.class)), @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.MyObject1.class)) }, elementClass = Object.class ) public void setArray(Object[] array) { super.setArray(array); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/Transformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000232610650627025033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * @param transformer type * @author Ales Justin */ public interface Transformer { T transform(T value); } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000364610764340107033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/UnmodifiableGetterBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000511210756342051033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.io.Serializable; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Collection; /** * An unmodifiable getter bean. * * @author Ales Justin */ @SuppressWarnings("unchecked") public class UnmodifiableGetterBean implements Serializable { /** The serialVersionUID */ private static final long serialVersionUID = 1L; private Collection collection = new CustomCollection(true); private List list = new CustomList(true); private Set set = new CustomSet(true); private Map map = new CustomMap(true); private String[] array = new String[]{"aa", "ab", "ac"}; public Collection getCollection() { return Collections.unmodifiableCollection(collection); } public void setCollection(Collection collection) { this.collection = collection; } public List getList() { return Collections.unmodifiableList(list); } public void setList(List list) { this.list = list; } public Set getSet() { return Collections.unmodifiableSet(set); } public void setSet(Set set) { this.set = set; } public Map getMap() { return Collections.unmodifiableMap(map); } public void setMap(Map map) { this.map = map; } public String[] getArray() { return array; } public void setArray(String[] array) { this.array = array; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStaticFactorySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000514610764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; /** * A simple bean * * @author Ales Justin */ @Factory( factoryClass = org.jboss.test.kernel.config.support.SimpleBeanFactory.class, factoryMethod = "staticCreateSimpleBean" ) public class FromStaticFactorySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromStaticFactorySimpleBean() { } public FromStaticFactorySimpleBean(String string) { super(string); } public FromStaticFactorySimpleBean(String string1, String string2) { super(string1, string2); } public FromStaticFactorySimpleBean(Integer integer) { super(integer); } public FromStaticFactorySimpleBean(Comparable comparable) { super(comparable); } public FromStaticFactorySimpleBean(Collection collection) { super(collection); } public FromStaticFactorySimpleBean(List list) { super(list); } public FromStaticFactorySimpleBean(Set set) { super(set); } public FromStaticFactorySimpleBean(Object[] array) { super(array); } public FromStaticFactorySimpleBean(Map map) { super(map); } public FromStaticFactorySimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TrimTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000241310650627025033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * @author Ales Justin */ public class TrimTransformer implements Transformer { public String transform(String value) { return value.trim(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/InterfaceSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000363210764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class InterfaceSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.Set.class ) public void setSet(Set collection) { super.setSet(collection); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamCollectionConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000377610764340107033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple annotated bean * * @author Ales Justin */ public class ParamCollectionConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamCollectionConstructorAnnBean() { } @Constructor public ParamCollectionConstructorAnnBean( @CollectionValue( elementClass = String.class, value={ @Value(string = @StringValue("1")), @Value(string = @StringValue("2")) } ) Collection collection) { super(collection); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamSetConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000362610764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple annotated bean * * @author Ales Justin */ public class ParamSetConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamSetConstructorAnnBean() { } @Constructor public ParamSetConstructorAnnBean( @SetValue( elementClass = String.class, value={ @Value(string = @StringValue("1")) } ) Set collection) { super(collection); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsArrayUnmodifiableObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000366210764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsArrayUnmodifiableObject extends UnmodifiableGetterBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.ArrayList.class ) public void setList(List list) { super.setList(list); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringsArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000354010764340107033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromStringsArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setArray(Object[] array) { super.setArray(array); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ControllerStateBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000263211374542121033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.dependency.spi.ControllerState; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ControllerStateBean { ControllerState state; public ControllerState getState() { return state; } public void setState(ControllerState state) { this.state = state; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000002760410770461341033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; /** * A simple bean * * @author Adrian Brock * @version $Revision: 71057 $ */ public class SimpleBean extends SimplerBean implements Serializable { public enum Alphabet {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, X, Y, Z} // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258126972906387766L; // Attributes ---------------------------------------------------- /** Constructor used */ private String constructorUsed; /** Object */ private Object anObject; /** A string */ private String aString; /** Byte */ private Byte aByte; /** Boolean */ private Boolean aBoolean; /** Character */ private Character aCharacter; /** Short */ private Short aShort; /** Int */ private Integer anInt; /** Long */ private Long aLong; /** Float */ private Float aFloat; /** Double */ private Double aDouble; /** Date */ private Date aDate; /** BigDecimal */ private BigDecimal aBigDecimal; /** BigDecimal */ private BigInteger aBigInteger; /** byte */ private byte abyte; /** boolean */ private boolean aboolean; /** char */ private char achar; /** short */ private short ashort; /** int */ private int anint; /** long */ private long along; /** float */ private float afloat; /** double */ private double adouble; /** number */ private Number aNumber; /** collection */ private Collection collection; /** set */ private Set set; /** list */ private List list; /** array */ private Object[] array; /** preInstantiated */ private Object[] preInstantiatedArray = new Object[]{"string1", "string2", "string2", "string1"}; /** map */ private Map map; /** Overloaded property */ private String overloadedProperty; private Alphabet enumProperty = Alphabet.A; // public just for testing purpose /** Just a setter for this collection */ public Collection setterCollection; /** Just a setter for this set */ public Set setterSet; /** Just a setter for this list */ public List setterList; /** Just a setter for this map */ public Map setterMap; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public SimpleBean() { constructorUsed = "()"; } public SimpleBean(String string) { super(string); constructorUsed = string; aString = string; preInstantiatedArray = new Object[]{string}; } public SimpleBean(String string1, String string2) { super(string1, string2); } public SimpleBean(Integer integer) { constructorUsed = integer.getClass().getName() + ":" + integer.toString(); anInt = integer; } public SimpleBean(Comparable comparable) { constructorUsed = "java.lang.Comparable:" + comparable.getClass().getName() + ":" + comparable.toString(); anObject = comparable; } public SimpleBean(Collection collection) { constructorUsed = "java.util.Collection:" + collection.getClass().getName() + ":" + collection.toString(); this.collection = collection; } public SimpleBean(List list) { constructorUsed = "java.util.List:" + list.getClass().getName() + ":" + list.toString(); this.list = list; } public SimpleBean(Set set) { constructorUsed = "java.util.Set:" + set.getClass().getName() + ":" + set.toString(); this.set = set; } public SimpleBean(Object[] array) { constructorUsed = "Array:" + array.getClass().getName() + ":" + Arrays.asList(array); this.array = array; } public SimpleBean(Map map) { constructorUsed = "java.util.Map:" + map.getClass().getName() + ":" + map.toString(); this.map = map; } public SimpleBean(Hashtable hashtable) { constructorUsed = "java.util.Hashtable:" + hashtable.getClass().getName() + ":" + hashtable.toString(); this.map = hashtable; } // Public -------------------------------------------------------- public String getConstructorUsed() { return constructorUsed; } public Object getAnObject() { return anObject; } public void setAnObject(Object object) { anObject = object; } public BigDecimal getABigDecimal() { return aBigDecimal; } public void setABigDecimal(BigDecimal bigDecimal) { aBigDecimal = bigDecimal; } public BigInteger getABigInteger() { return aBigInteger; } public void setABigInteger(BigInteger bigInteger) { aBigInteger = bigInteger; } public boolean isAboolean() { return aboolean; } public void setAboolean(boolean aboolean) { this.aboolean = aboolean; } public Boolean getABoolean() { return aBoolean; } public void setABoolean(Boolean boolean1) { aBoolean = boolean1; } public Number getANumber() { return aNumber; } public void setANumber(Number number) { aNumber = number; } public byte getAbyte() { return abyte; } public void setAbyte(byte abyte) { this.abyte = abyte; } public Byte getAByte() { return aByte; } public void setAByte(Byte byte1) { aByte = byte1; } public char getAchar() { return achar; } public void setAchar(char achar) { this.achar = achar; } public Character getACharacter() { return aCharacter; } public void setACharacter(Character character) { aCharacter = character; } public Date getADate() { return aDate; } public void setADate(Date date) { aDate = date; } public double getAdouble() { return adouble; } public void setAdouble(double adouble) { this.adouble = adouble; } public Double getADouble() { return aDouble; } public void setADouble(Double double1) { aDouble = double1; } public float getAfloat() { return afloat; } public void setAfloat(float afloat) { this.afloat = afloat; } public Float getAFloat() { return aFloat; } public void setAFloat(Float float1) { aFloat = float1; } public long getAlong() { return along; } public void setAlong(long along) { this.along = along; } public Long getALong() { return aLong; } public void setALong(Long long1) { aLong = long1; } public int getAnint() { return anint; } public void setAnint(int anint) { this.anint = anint; } public Integer getAnInt() { return anInt; } public void setAnInt(Integer anInt) { this.anInt = anInt; } public short getAshort() { return ashort; } public void setAshort(short ashort) { this.ashort = ashort; } public Short getAShort() { return aShort; } public void setAShort(Short short1) { aShort = short1; } public String getAString() { return aString; } public void setAString(String string) { aString = string; } public Set getSet() { return set; } public void setSet(Set set) { this.set = set; } public CustomSet getCustomSet() { return (CustomSet) set; } public void setCustomSet(CustomSet set) { this.set = set; } public void setPreInstantiatedSet(CustomSet preInstantiatedSet) { this.preInstantiatedSet = preInstantiatedSet; } public Collection getCollection() { return collection; } public void setCollection(Collection collection) { this.collection = collection; } public CustomCollection getCustomCollection() { return (CustomCollection) collection; } public void setCustomCollection(CustomCollection collection) { this.collection = collection; } public void setPreInstantiatedCollection(CustomCollection preInstantiatedCollection) { this.preInstantiatedCollection = preInstantiatedCollection; } public List getList() { return list; } public void setList(List list) { this.list = list; } public CustomList getCustomList() { return (CustomList) list; } public void setCustomList(CustomList list) { this.list = list; } public void setPreInstantiatedList(CustomList preInstantiatedList) { this.preInstantiatedList = preInstantiatedList; } public Object[] getArray() { return array; } public void setArray(Object[] array) { this.array = array; } public Object[] getPreInstantiatedArray() { return preInstantiatedArray; } public void setPreInstantiatedArray(Object[] preInstantiatedArray) { this.preInstantiatedArray = preInstantiatedArray; } public String[] getCustomArray() { return (String[]) array; } public void setCustomArray(String[] array) { this.array = array; } public Map getMap() { return map; } public void setMap(Map map) { this.map = map; } public CustomMap getCustomMap() { return (CustomMap) map; } public void setCustomMap(CustomMap map) { this.map = map; } public void setPreInstantiatedMap(CustomMap preInstantiatedMap) { this.preInstantiatedMap = preInstantiatedMap; } public String getOverloadedProperty() { return overloadedProperty; } public void setOverloadedProperty(Long broken) { throw new RuntimeException("Invoked the wrong setter"); } public void setOverloadedProperty(String overloadedProperty) { this.overloadedProperty = overloadedProperty; } public void setOverloadedProperty(Integer broken) { throw new RuntimeException("Invoked the wrong setter"); } public Alphabet getEnumProperty() { return enumProperty; } public void setEnumProperty(Alphabet enumProperty) { this.enumProperty = enumProperty; } public void setSetterCollection(Collection setterCollection) { this.setterCollection = setterCollection; } public void setSetterSet(Set setterSet) { this.setterSet = setterSet; } public void setSetterList(List setterList) { this.setterList = setterList; } public void setSetterMap(Map setterMap) { this.setterMap = setterMap; } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStaticFactoryWithIntParamSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000567110764340107033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @Factory( factoryClass = org.jboss.test.kernel.config.support.SimpleBeanFactory.class, factoryMethod = "staticCreateSimpleBean", parameters = {@Value(type=Integer.class, string = @StringValue("7"))} ) public class FromStaticFactoryWithIntParamSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromStaticFactoryWithIntParamSimpleBean() { } public FromStaticFactoryWithIntParamSimpleBean(String string) { super(string); } public FromStaticFactoryWithIntParamSimpleBean(String string1, String string2) { super(string1, string2); } public FromStaticFactoryWithIntParamSimpleBean(Integer integer) { super(integer); } public FromStaticFactoryWithIntParamSimpleBean(Comparable comparable) { super(comparable); } public FromStaticFactoryWithIntParamSimpleBean(Collection collection) { super(collection); } public FromStaticFactoryWithIntParamSimpleBean(List list) { super(list); } public FromStaticFactoryWithIntParamSimpleBean(Set set) { super(set); } public FromStaticFactoryWithIntParamSimpleBean(Object[] array) { super(array); } public FromStaticFactoryWithIntParamSimpleBean(Map map) { super(map); } public FromStaticFactoryWithIntParamSimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/InterfaceListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000364210764340107033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class InterfaceListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.List.class ) public void setList(List collection) { super.setList(collection); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000560510331006762033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * A simple bean factory * * @author Adrian Brock * @version $Revision: 37459 $ */ public class SimpleBeanFactory { // Constants ----------------------------------------------------- /** The method used */ private static String methodUsed; // Attributes ---------------------------------------------------- // Static -------------------------------------------------------- public static String getMethodUsed() { return methodUsed; } public static SimpleBean staticCreateSimpleBean() { methodUsed = "staticCreateSimpleBean()"; return new SimpleBean(); } public static SimpleBean staticCreateSimpleBean(String string) { methodUsed = "staticCreateSimpleBean(String)"; return new SimpleBean(string); } public static SimpleBean staticCreateSimpleBean(Integer integer) { methodUsed = "staticCreateSimpleBean(integer)"; return new SimpleBean(integer.toString()); } // Constructors -------------------------------------------------- public SimpleBeanFactory() { } // Public -------------------------------------------------------- public SimpleBean createSimpleBean() { methodUsed = "createSimpleBean()"; return new SimpleBean(); } public SimpleBean createSimpleBean(String string) { methodUsed = "createSimpleBean(String)"; return new SimpleBean(string); } public SimpleBean createSimpleBean(Integer integer) { methodUsed = "createSimpleBean(integer)"; return new SimpleBean(integer.toString()); } // Package protected --------------------------------------------- // Protected ----------------------------------------------------- // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/InterfaceCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000372210764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class InterfaceCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = java.util.Collection.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000301710756342051033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; /** * A simple annotated bean * * @author Ales Justin */ public class SimpleConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @Constructor public SimpleConstructorAnnBean() { super(); } public SimpleConstructorAnnBean(String string) { super(string); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyElementAnnotated.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000267710674773017033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.w3c.dom.Element; import org.jboss.beans.metadata.api.annotations.StringValue; /** * Element holder bean. * * @author Ales Justin */ public class MyElementAnnotated extends MyElement { @StringValue("") public void setMyElement(Element myElement) { super.setMyElement(myElement); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomMap.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000317310540110763033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.HashMap; /** * A CustomMap. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class CustomMap extends HashMap { /** The serialVersionUID */ private static final long serialVersionUID = 3762538897183683896L; /** Whether the collection was pre instantited */ private boolean preInstantiated; public CustomMap() { } public CustomMap(boolean preInstantiated) { this.preInstantiated = preInstantiated; } public boolean getPreInstantiated() { return preInstantiated; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ProgressionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000334310764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class ProgressionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @StringValue(value = "123.456", type=Double.class) public void setAnint(int anint) { super.setAnint(anint); } @StringValue(value = "314159") public void setAFloat(Float float1) { super.setAFloat(float1); } @StringValue(value = "987.6543", type=Float.class) public void setAShort(Short short1) { super.setAShort(short1); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/MyObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000346110367363670033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * MyObject. * * @author Adrian Brock * @version $Revision: 40742 $ */ public class MyObject { private String key; public MyObject() { } public MyObject(String key) { this.key = key; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public boolean equals(Object object) { if (this == object) return true; if (object == null || object instanceof MyObject == false) return false; MyObject other = (MyObject) object; return key.equals(other.key); } public int hashCode() { return key.hashCode(); } public String toString() { return key; } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSignatureArraySimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000356210764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class FromCustomSignatureArraySimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setCustomArray(String[] array) { super.setCustomArray(array); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/AnnotatedPropHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000553110764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Parameter; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.ValueFactory; /** * @author Ales Justin */ public class AnnotatedPropHolder extends PropHolder { @Constructor public AnnotatedPropHolder( @ValueFactory(bean = "ldap", method = "getValue", parameter = "foo.bar.key") String constructor ) { super(constructor); } @ValueFactory(bean = "ldap", method = "getValue", parameter = "foo.bar.key") public void setValue(String value) { super.setValue(value); } @ListValue( elementClass = String.class, value = { @Value(valueFactory = @ValueFactory(bean = "ldap", method = "getValue", parameter = "foo.bar.key")), @Value(valueFactory = @ValueFactory(bean = "ldap", method = "getValue", parameters = {@Parameter(string = @StringValue("foo.bar.key")), @Parameter(string = @StringValue("qaz"))})), @Value(valueFactory = @ValueFactory(bean = "ldap", method = "getValue", parameters = {@Parameter(string = @StringValue("xyz.key")), @Parameter(string = @StringValue("xyz")), @Parameter(inject = @Inject(bean = "t"))})), @Value(valueFactory = @ValueFactory(bean = "ldap", method = "getValue", defaultValue = "QWERT", parameters = {@Parameter(string = @StringValue("no.such.key"))})) } ) public void setList(List list) { super.setList(list); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TypeOverrideCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000410510764340107033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class TypeOverrideCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomCollection.class ) public void setCollection(Collection collection) { super.setCollection(collection); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/SimpleAnnotationImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000261011147522315033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.lang.annotation.Annotation; /** * @author Ales Justin */ public class SimpleAnnotationImpl implements SimpleAnnotation { public String name() { return null; } public Class annotationType() { return SimpleAnnotation.class; } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSignatureListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000357110764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class FromCustomSignatureListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setCustomList(CustomList collection) { super.setCustomList(collection); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromFactoryWithIntParamSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000571310764340107033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @Factory( factory = @Value(javabean = @JavaBeanValue(org.jboss.test.kernel.config.support.SimpleBeanFactory.class)), factoryMethod = "createSimpleBean", parameters = {@Value(type = Integer.class, string = @StringValue("4"))} ) public class FromFactoryWithIntParamSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromFactoryWithIntParamSimpleBean() { } public FromFactoryWithIntParamSimpleBean(String string) { super(string); } public FromFactoryWithIntParamSimpleBean(String string1, String string2) { super(string1, string2); } public FromFactoryWithIntParamSimpleBean(Integer integer) { super(integer); } public FromFactoryWithIntParamSimpleBean(Comparable comparable) { super(comparable); } public FromFactoryWithIntParamSimpleBean(Collection collection) { super(collection); } public FromFactoryWithIntParamSimpleBean(List list) { super(list); } public FromFactoryWithIntParamSimpleBean(Set set) { super(set); } public FromFactoryWithIntParamSimpleBean(Object[] array) { super(array); } public FromFactoryWithIntParamSimpleBean(Map map) { super(map); } public FromFactoryWithIntParamSimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000263611374542121033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class CustomValue { String value; CustomValue(String value) { this.value = value; } public static CustomValue valueOf(String value) { return new CustomValue(value); } public String getValue() { return value; } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/XMLUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000733111014301412033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.net.URL; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.util.Classes; /** * A helper for tests using xml. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class XMLUtil { /** The kernel */ private Kernel kernel; /** The test */ private AbstractKernelTest test; /** The deployer */ private BasicXMLDeployer deployer; /** The deployment */ private KernelDeployment deployment; /** * * Create a new XMLKernel. * * @param kernel the kernel * @param test the test * @param validate whether to validate the deployment * @throws Throwable for any error */ public XMLUtil(Kernel kernel, AbstractKernelTest test, boolean validate) throws Throwable { this.kernel = kernel; this.test = test; deployer = new BasicXMLDeployer(kernel); String packageName = Classes.getPackageName(test.getClass()); packageName = packageName.replace('.', '/'); String name = "/xml-test/" + packageName + '/' + test.getName() + ".xml"; test.getLog().debug("Using " + name); URL url = test.getResource(name); if (url == null) throw new RuntimeException("Resource not found: " + name); test.getLog().debug("url=" + url); deployment = deployer.deploy(url); if (validate) validate(); } /** * Get the kernel * * @return the kernel */ public Kernel getKernel() { return kernel; } /** * Get the deployer * * @return the deployer */ public BasicXMLDeployer getDeployer() { return deployer; } /** * Get the test * * @return the test */ public AbstractKernelTest getTest() { return test; } /** * Get a bean from the registry * * @param name the bean name * @return the bean * @throws Throwable for any error */ public Object getBean(String name) throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelRegistryEntry entry = registry.getEntry(name); return entry.getTarget(); } /** * Validate the deployment * * @throws Throwable for any error */ public void validate() throws Throwable { deployer.validate(); } /** * Undeploy the deployment */ public void undeploy() { deployer.undeploy(deployment); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/TypeOverrideSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000401510764340107033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class TypeOverrideSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomSet.class ) public void setSet(Set collection) { super.setSet(collection); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/ParamIntConstructorAnnBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000312610756342051033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple annotated bean * * @author Ales Justin */ public class ParamIntConstructorAnnBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ParamIntConstructorAnnBean() { } @Constructor public ParamIntConstructorAnnBean(@StringValue("7") Integer string) { super(string); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomCollection.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000323110540110763033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.ArrayList; /** * A CustomCollection. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class CustomCollection extends ArrayList { /** The serialVersionUID */ private static final long serialVersionUID = 3762538897183683896L; /** Whether the collection was pre instantited */ private boolean preInstantiated; public CustomCollection() { } public CustomCollection(boolean preInstantiated) { this.preInstantiated = preInstantiated; } public boolean getPreInstantiated() { return preInstantiated; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStringSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000001035610764340107033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Date; import java.math.BigInteger; import java.math.BigDecimal; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class FromStringSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromStringSimpleBean() { super(); } // Public -------------------------------------------------------- @StringValue("Z") public void setEnumProperty(Alphabet enumProperty) { super.setEnumProperty(enumProperty); } @StringValue("StringValue") public void setOverloadedProperty(String overloadedProperty) { super.setOverloadedProperty(overloadedProperty); } @StringValue("StringValue") public void setAString(String string) { super.setAString(string); } @StringValue("123") public void setAShort(Short short1) { super.setAShort(short1); } @StringValue("123") public void setAshort(short ashort) { super.setAshort(ashort); } @StringValue("1234") public void setAnInt(Integer anInt) { super.setAnInt(anInt); } @StringValue("1234") public void setAnint(int anint) { super.setAnint(anint); } @StringValue("12345") public void setALong(Long long1) { super.setALong(long1); } @StringValue("12345") public void setAlong(long along) { super.setAlong(along); } @StringValue("3.14") public void setAFloat(Float float1) { super.setAFloat(float1); } @StringValue("3.14") public void setAfloat(float afloat) { super.setAfloat(afloat); } @StringValue("3.14e12") public void setADouble(Double double1) { super.setADouble(double1); } @StringValue("3.14e12") public void setAdouble(double adouble) { super.setAdouble(adouble); } @StringValue("Mon Jan 01 00:00:00 CET 2001") public void setADate(Date date) { super.setADate(date); } @StringValue("a") public void setACharacter(Character character) { super.setACharacter(character); } @StringValue("a") public void setAchar(char achar) { super.setAchar(achar); } @StringValue("12") public void setAByte(Byte byte1) { super.setAByte(byte1); } @StringValue("12") public void setAbyte(byte abyte) { super.setAbyte(abyte); } @StringValue(value="12345", type=Long.class) public void setANumber(Number number) { super.setANumber(number); } @StringValue("true") public void setABoolean(Boolean boolean1) { super.setABoolean(boolean1); } @StringValue("true") public void setAboolean(boolean aboolean) { super.setAboolean(aboolean); } @StringValue("123456") public void setABigInteger(BigInteger bigInteger) { super.setABigInteger(bigInteger); } @StringValue("12e4") public void setABigDecimal(BigDecimal bigDecimal) { super.setABigDecimal(bigDecimal); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/OnObjectListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000376610764340107033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class OnObjectListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")), @Value(string = @StringValue(value = "1", type = Integer.class)) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomList.class ) public void setAnObject(Object object) { super.setAnObject(object); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSetSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000367410764340107033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromCustomSetSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @SetValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomSet.class ) public void setSet(Set collection) { super.setSet(collection); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSignatureMapSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000411710764340107033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.EntryValue; /** * A simple bean * * @author Ales Justin */ public class FromCustomSignatureMapSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @MapValue( value = { @EntryValue( key=@Value(string = @StringValue("string1")), value=@Value(string = @StringValue("string2")) ), @EntryValue( key=@Value(string = @StringValue("string2")), value=@Value(string = @StringValue("string1")) ) }, keyClass = String.class, valueClass = String.class ) public void setCustomMap(CustomMap collection) { super.setCustomMap(collection); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromStaticFactoryWithParamSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000564710764340107033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.Collection; import java.util.Hashtable; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @Factory( factoryClass = org.jboss.test.kernel.config.support.SimpleBeanFactory.class, factoryMethod = "staticCreateSimpleBean", parameters = {@Value(type=String.class, string = @StringValue("Static Factory Value"))} ) public class FromStaticFactoryWithParamSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public FromStaticFactoryWithParamSimpleBean() { } public FromStaticFactoryWithParamSimpleBean(String string) { super(string); } public FromStaticFactoryWithParamSimpleBean(String string1, String string2) { super(string1, string2); } public FromStaticFactoryWithParamSimpleBean(Integer integer) { super(integer); } public FromStaticFactoryWithParamSimpleBean(Comparable comparable) { super(comparable); } public FromStaticFactoryWithParamSimpleBean(Collection collection) { super(collection); } public FromStaticFactoryWithParamSimpleBean(List list) { super(list); } public FromStaticFactoryWithParamSimpleBean(Set set) { super(set); } public FromStaticFactoryWithParamSimpleBean(Object[] array) { super(array); } public FromStaticFactoryWithParamSimpleBean(Map map) { super(map); } public FromStaticFactoryWithParamSimpleBean(Hashtable hashtable) { super(hashtable); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomListSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000370410764340107033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ public class FromCustomListSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @ListValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class, clazz = org.jboss.test.kernel.config.support.CustomList.class ) public void setList(List collection) { super.setList(collection); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/support/FromCustomSignatureCollectionSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/config/suppor0000644000175000017500000000363510764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.config.support; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class FromCustomSignatureCollectionSimpleBean extends SimpleBean { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = String.class ) public void setCustomCollection(CustomCollection collection) { super.setCustomCollection(collection); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/0000755000175000017500000000000011620312144032404 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test0000755000175000017500000000000011620312144033304 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test/CachingMetaDataRepositoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test0000644000175000017500000000652111050035372033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.test; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.kernel.metadata.support.TestAnnotationA; import org.jboss.test.kernel.metadata.support.TestAnnotationB; import org.jboss.test.kernel.metadata.support.TestAnnotationC; import org.jboss.test.kernel.metadata.support.TestCachingMetaDataRepository; /** * @author Ales Justin */ public class CachingMetaDataRepositoryTestCase extends AbstractMetaDataTest { public CachingMetaDataRepositoryTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(CachingMetaDataRepositoryTestCase.class); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { System.setProperty(KernelMetaDataRepository.class.getName(), TestCachingMetaDataRepository.class.getName()); System.setProperty("LRUPolicyCaching.min", "2"); System.setProperty("LRUPolicyCaching.max", "10"); return MicrocontainerTest.getDelegate(clazz); } @Override protected void tearDown() throws Exception { System.clearProperty(KernelMetaDataRepository.class.getName()); super.tearDown(); } protected MetaData assertMetaData() { return assertMetaData("Name1"); } public void testTouchCachingMetaDataRepository() throws Exception { TestCachingMetaDataRepository.touched = false; KernelDeployment deployment = deploy("ClassAnnotationTestCase_Override.xml"); try { MetaData metaData = assertMetaData(); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("Overridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); assertTrue(TestCachingMetaDataRepository.touched); } finally { undeploy(deployment); } } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test/AbstractMetaDataTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test0000644000175000017500000000754711050035372033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.test; import java.lang.annotation.Annotation; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.repository.MetaDataRepository; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.dependency.spi.ScopeInfo; /** * MetaData Test Case. * * @author Adrian Brock * @version $Revision: 40428 $ */ public class AbstractMetaDataTest extends MicrocontainerTest { public AbstractMetaDataTest(String name) throws Throwable { super(name); } protected void setUp() throws Exception { super.setUp(); } protected MetaData assertMetaData(String name) { KernelControllerContext context = getControllerContext(name); assertNotNull(context); ScopeInfo scopeInfo = context.getScopeInfo(); assertNotNull(scopeInfo); MetaData metaData = scopeInfo.getMetaData(); assertNotNull(metaData); return metaData; } protected ScopeKey assertRetrievals(String name) { KernelControllerContext context = getControllerContext(name); MetaDataRepository repository = getMetaDataRepository().getMetaDataRepository(); ScopeKey result = context.getScopeInfo().getScope(); assertNotNull(repository.getMetaDataRetrieval(result)); assertNotNull(repository.getMetaDataRetrieval(new ScopeKey(CommonLevels.INSTANCE, name))); return result; } protected void assertNoRetrievals(String name, ScopeKey scope) { MetaDataRepository repository = getMetaDataRepository().getMetaDataRepository(); assertNull(repository.getMetaDataRetrieval(scope)); assertNull(repository.getMetaDataRetrieval(new ScopeKey(CommonLevels.INSTANCE, name))); } protected T assertAnnotation(MetaData metaData, Class annotationClass) { T result = metaData.getAnnotation(annotationClass); assertNotNull(result); return result; } protected void assertNoAnnotation(MetaData metaData, Class annotationClass) { T result = metaData.getAnnotation(annotationClass); assertNull(result); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); //delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test/MetaDataTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test0000644000175000017500000000314011050034561033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * MetaData Test Suite. * * @author Adrian Brock * @version $Revision: 55945 $ */ public class MetaDataTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("MetaData Tests"); suite.addTest(ClassAnnotationTestCase.suite()); suite.addTest(CachingMetaDataRepositoryTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test/ClassAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/test0000644000175000017500000001754111050035372033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.test; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.signature.MethodSignature; import org.jboss.test.kernel.metadata.support.TestAnnotationA; import org.jboss.test.kernel.metadata.support.TestAnnotationB; import org.jboss.test.kernel.metadata.support.TestAnnotationC; /** * ClassAnnotationTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class ClassAnnotationTestCase extends AbstractMetaDataTest { public static Test suite() { return suite(ClassAnnotationTestCase.class); } public ClassAnnotationTestCase(String name) throws Throwable { super(name); } protected MetaData assertMetaData() { return assertMetaData("Name1"); } public void testClassAnnotationNoOverride() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_NoOverride.xml"); try { scope = assertRetrievals("Name1"); MetaData metaData = assertMetaData(); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } public void testClassAnnotationOverride() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_Override.xml"); try { scope = assertRetrievals("Name1"); MetaData metaData = assertMetaData(); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("Overridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } public void testClassAnnotationNew() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_New.xml"); try { scope = assertRetrievals("Name1"); MetaData metaData = assertMetaData(); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } public void testPropertyAnnotationNoOverride() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_NoOverrideProperty.xml"); try { scope = assertRetrievals("Name1"); MetaData classMetaData = assertMetaData(); MetaData metaData = classMetaData.getComponentMetaData(new MethodSignature("getSomething")); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); metaData = classMetaData.getComponentMetaData(new MethodSignature("setSomething", String.class)); a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } public void testPropertyAnnotationOverride() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_OverrideProperty.xml"); try { scope = assertRetrievals("Name1"); MetaData classMetaData = assertMetaData(); MetaData metaData = classMetaData.getComponentMetaData(new MethodSignature("getSomething")); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("Overridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); metaData = classMetaData.getComponentMetaData(new MethodSignature("setSomething", String.class)); a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("Overridden", a.value()); b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertNoAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } public void testPropertyAnnotationNew() throws Throwable { ScopeKey scope = null; KernelDeployment deployment = deploy("ClassAnnotationTestCase_NewProperty.xml"); try { scope = assertRetrievals("Name1"); MetaData classMetaData = assertMetaData(); MetaData metaData = classMetaData.getComponentMetaData(new MethodSignature("getSomething")); TestAnnotationA a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); TestAnnotationB b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertAnnotation(metaData, TestAnnotationC.class); metaData = classMetaData.getComponentMetaData(new MethodSignature("setSomething", String.class)); a = assertAnnotation(metaData, TestAnnotationA.class); assertEquals("NotOverridden", a.value()); b = assertAnnotation(metaData, TestAnnotationB.class); assertEquals("NotOverridden", b.value()); assertAnnotation(metaData, TestAnnotationC.class); } finally { undeploy(deployment); if (scope != null) assertNoRetrievals("Name1", scope); } } }././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000755000175000017500000000000011620312144033314 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/TestAnnotationA.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000644000175000017500000000247010540110763033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestAnnotation. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotationA { String value(); } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/TestCachingMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000644000175000017500000000306111050034561033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.support; import org.jboss.kernel.plugins.metadata.basic.LRUPolicyCachingBasicKernelMetaDataRepository; import org.jboss.metadata.plugins.cache.CachePolicyFactory; /** * @author Ales Justin */ public class TestCachingMetaDataRepository extends LRUPolicyCachingBasicKernelMetaDataRepository { public static boolean touched; protected CachePolicyFactory createCachePolicyFactory() { touched = true; return super.createCachePolicyFactory(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/TestAnnotationC.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000644000175000017500000000244510540110763033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestAnnotation. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotationC { } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/TestAnnotationB.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000644000175000017500000000250010540110763033316 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * TestOverrideAnnotation. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface TestAnnotationB { String value(); } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/support/TestClassAnnotation.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/metadata/supp0000644000175000017500000000305010763262076033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.metadata.support; /** * TestClassAnnotation. * * @author Adrian Brock * @version $Revision: 1.1 $ */ @TestAnnotationA("NotOverridden") @TestAnnotationB("NotOverridden") public class TestClassAnnotation { public TestClassAnnotation() { } @TestAnnotationA("NotOverridden") @TestAnnotationB("NotOverridden") public String getSomething() { return null; } @TestAnnotationA("NotOverridden") @TestAnnotationB("NotOverridden") public void setSomething(String p1) { } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/0000755000175000017500000000000011620312147032477 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test0000755000175000017500000000000011620312147033377 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test/BusTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test0000644000175000017500000001247311216157032033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.test; import java.util.Date; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext; import org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.registry.support.BusBean; /** * Bus Test Case. * * @author Adrian Brock * @author Ales Justin */ @SuppressWarnings("deprecation") public class BusTestCase extends AbstractKernelTest { public static Test suite() { return suite(BusTestCase.class); } public BusTestCase(String name) { super(name); } public void testSetAndGet() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelConfigurator configurator = kernel.getConfigurator(); registry.registerEntry("Bus", makeContext(configurator, "Name1", new BusBean())); KernelBus bus = kernel.getBus(); Object result1 = bus.get("Bus", "value"); assertNull("Result 1", result1); bus.set("Bus", "value", "BusBus"); Object result2 = bus.get("Bus", "value"); assertEquals("BusBus", result2); } public void testInvoke() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelConfigurator configurator = kernel.getConfigurator(); KernelRegistryEntry entry1 = makeContext(configurator, "Name1", "A string"); entry1.setState(ControllerState.INSTALLED); registry.registerEntry("Name1", entry1); KernelRegistryEntry entry2 = makeContext(configurator, "Name2", "B string"); entry2.setState(ControllerState.INSTALLED); registry.registerEntry("Name2", entry2); KernelBus bus = kernel.getBus(); Object result1 = bus.invoke("Name1", "toString", new Object[]{}, new String[]{}); Object result2 = bus.invoke("Name2", "toString", new Object[]{}, new String[]{}); assertEquals("A string", result1); assertEquals("B string", result2); } public void testLifecycle() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Name1", BusBean.class.getName()); builder.addStartParameter(String.class.getName(), "123-Start"); builder.setStop("doStop"); builder.setDestroy("executeDestroy"); builder.addDestroyParameter("int", 123); builder.addDestroyParameter(Date.class.getName(), new Date()); KernelControllerContext context = controller.install(builder.getBeanMetaData()); assertEquals(ControllerState.INSTALLED, context.getState()); KernelBus bus = kernel.getBus(); assertInstanceOf(bus, LifecycleAwareKernelBus.class); bus.invoke("Name1", "executeDestroy", new Object[]{-1, new Date()}, new String[]{int.class.getName(), Date.class.getName()}); assertEquals(ControllerState.CONFIGURED, context.getState()); bus.invoke("Name1", "create", null, null); assertEquals(ControllerState.CREATE, context.getState()); bus.invoke("Name1", "start", new Object[]{"foobar"}, new String[]{String.class.getName()}); assertEquals(ControllerState.START, context.getState()); bus.invoke("Name1", "doStop", null, null); assertEquals(ControllerState.CREATE, context.getState()); } protected static KernelRegistryEntry makeContext(KernelConfigurator configurator, String name, Object target) throws Throwable { return new AbstractKernelControllerContext( configurator.getBeanInfo(target.getClass()), new AbstractBeanMetaData(name, target.getClass().getName()), target ); } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test/RegistryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test0000644000175000017500000001276311014301412033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.test; import junit.framework.Test; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntryAlreadyRegisteredException; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.test.kernel.AbstractKernelTest; /** * Registry Test Case. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class RegistryTestCase extends AbstractKernelTest { public static Test suite() { return suite(RegistryTestCase.class); } public RegistryTestCase(String name) { super(name); } public void testGotRegistry() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); assertNotNull(registry); } public void testRegister() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); KernelRegistryEntry test1 = makeEntry(new Object()); registry.registerEntry("Name1", test1); assertEqualsRegistryTarget(test1, registry.getEntry("Name1")); } public void testDuplicateRegisterError() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); KernelRegistryEntry test1 = makeEntry(new Object()); registry.registerEntry("Name1", test1); KernelRegistryEntry test2 = makeEntry(new Object()); try { registry.registerEntry("Name1", test2); fail("Expected duplicate registration error"); } catch (KernelRegistryEntryAlreadyRegisteredException e) { // expected } assertEqualsRegistryTarget(test1, registry.getEntry("Name1")); } public void testRegisterTwice() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); Object object = new Object(); KernelRegistryEntry test1 = makeEntry(object); registry.registerEntry("Name1", test1); KernelRegistryEntry test2 = makeEntry(object); registry.registerEntry("Name2", test2); assertEqualsRegistryTarget(registry.getEntry("Name1"), registry.getEntry("Name2")); } public void testUnregister() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); try { registry.getEntry("Name1"); fail("Expected not registered error"); } catch (KernelRegistryEntryNotFoundException e) { // expected } try { registry.unregisterEntry("Name1"); fail("Expected not registered error"); } catch (KernelRegistryEntryNotFoundException e) { // expected } KernelRegistryEntry test1 = makeEntry(new Object()); registry.registerEntry("Name1", test1); registry.unregisterEntry("Name1"); try { registry.getEntry("Name1"); fail("Expected not registered error"); } catch (KernelRegistryEntryNotFoundException e) { // expected } try { registry.unregisterEntry("Name1"); fail("Expected not registered error"); } catch (KernelRegistryEntryNotFoundException e) { // expected } registry.registerEntry("Name1", test1); assertEqualsRegistryTarget(test1, registry.getEntry("Name1")); } public void testNull() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); try { registry.getEntry(null); fail("Expected null name error"); } catch (IllegalArgumentException e) { // expected } try { KernelRegistryEntry test1 = makeEntry(new Object()); registry.registerEntry(null, test1); fail("Expected null name error"); } catch (IllegalArgumentException e) { // expected } try { registry.registerEntry("Name1", null); fail("Expected null object error"); } catch (IllegalArgumentException e) { // expected } try { registry.unregisterEntry(null); fail("Expected null name error"); } catch (IllegalArgumentException e) { // expected } } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.kernel.plugins.registry"); } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test/RegistryTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test0000644000175000017500000000320010331006762033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Registry Test Suite. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class RegistryTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Registry Tests"); suite.addTest(RegistryTestCase.suite()); suite.addTest(RegistryFactoryTestCase.suite()); suite.addTest(BusTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test/RegistryFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/test0000644000175000017500000001400011014301412033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.test; import junit.framework.Test; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.registry.support.SimpleRegistryFactory; /** * Registry Factory Test Case. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class RegistryFactoryTestCase extends AbstractKernelTest { public static Test suite() { return suite(RegistryFactoryTestCase.class); } public RegistryFactoryTestCase(String name) { super(name); } @SuppressWarnings("deprecation") public void testAddRegistryFactory() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); SimpleRegistryFactory factory = new SimpleRegistryFactory(); Object testObject = new Object(); factory.entries.put("Name1", testObject); KernelRegistryEntry factoryEntry = makeEntry(factory); registry.registerEntry("Factory", factoryEntry); KernelRegistryEntry result = registry.getEntry("Name1"); assertNotNull(result); Object target = result.getTarget(); assertNotNull(target); assertTrue("Should be the same object", testObject == target); } public void testRemoveRegistryFactory() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); SimpleRegistryFactory factory = new SimpleRegistryFactory(); Object testObject = new Object(); factory.entries.put("Name1", testObject); KernelRegistryEntry factoryEntry = makeEntry(factory); registry.registerEntry("Factory", factoryEntry); registry.unregisterEntry("Factory"); try { registry.getEntry("Name1"); fail("Should not be here"); } catch (KernelRegistryEntryNotFoundException expected) { } } public void testAddRemoveAddRegistryFactory() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); SimpleRegistryFactory factory = new SimpleRegistryFactory(); Object testObject = new Object(); factory.entries.put("Name1", testObject); KernelRegistryEntry factoryEntry = makeEntry(factory); registry.registerEntry("Factory", factoryEntry); registry.unregisterEntry("Factory"); registry.registerEntry("Factory", factoryEntry); KernelRegistryEntry result = registry.getEntry("Name1"); assertNotNull(result); Object target = result.getTarget(); assertNotNull(target); assertTrue("Should be the same object", testObject == target); } public void testDuplicateRegistryFactory() throws Throwable { org.jboss.kernel.spi.registry.KernelRegistry registry = bootstrap().getRegistry(); SimpleRegistryFactory factory1 = new SimpleRegistryFactory(); Object testObject1 = new Object(); factory1.entries.put("Name1", testObject1); KernelRegistryEntry factoryEntry1 = makeEntry(factory1); registry.registerEntry("Factory1", factoryEntry1); SimpleRegistryFactory factory2 = new SimpleRegistryFactory(); Object testObject2 = new Object(); Object testObject3 = new Object(); factory2.entries.put("Name1", testObject2); factory2.entries.put("Name2", testObject3); KernelRegistryEntry factoryEntry2 = makeEntry(factory2); registry.registerEntry("Factory2", factoryEntry2); KernelRegistryEntry result = registry.getEntry("Name1"); assertNotNull(result); Object target = result.getTarget(); assertNotNull(target); assertTrue("Should be the object from the first factory", testObject1 == target); result = registry.getEntry("Name2"); assertNotNull(result); target = result.getTarget(); assertNotNull(target); assertTrue("Should be the object from the second factory", testObject3 == target); registry.unregisterEntry("Factory1"); result = registry.getEntry("Name1"); assertNotNull(result); target = result.getTarget(); assertNotNull(target); assertTrue("Should be the object from the second factory", testObject2 == target); registry.registerEntry("Factory1", factoryEntry1); result = registry.getEntry("Name1"); assertNotNull(result); target = result.getTarget(); assertNotNull(target); assertTrue("Should be the object from the second factory", testObject2 == target); registry.unregisterEntry("Factory1"); registry.unregisterEntry("Factory2"); try { registry.getEntry("Name1"); fail("Should not be here"); } catch (KernelRegistryEntryNotFoundException expected) { } } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.kernel.plugins.registry"); } }././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/supp0000755000175000017500000000000011620312147033407 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/support/BusBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/supp0000644000175000017500000000334711216157032033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.support; import java.util.Date; /** * @author Ales Justin */ public class BusBean { private String value; public String getValue() { return value; } public void setValue(String value) { this.value = value; } public void create() { System.out.println("Created"); } public void start(String msg) { System.out.println("msg = " + msg); } public void doStop() { System.out.println("doStop"); } public void executeDestroy(int exit, Date date) { System.out.println("exit = " + exit); System.out.println("date = " + date); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/support/SimpleRegistryFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/registry/supp0000644000175000017500000000352110446736533033430 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.registry.support; import java.util.HashMap; import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; /** * A simple registry factory * * @author Adrian Brock * @version $Revision: 45764 $ */ public class SimpleRegistryFactory implements KernelRegistryPlugin { /** The entries */ public HashMap entries = new HashMap(); public KernelRegistryEntry getEntry(Object name) { Object object = entries.get(name); if (object == null) return null; else { AbstractKernelRegistryEntry entry = new AbstractKernelRegistryEntry(object); entry.setName(name); return entry; } } }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/0000755000175000017500000000000011620312145033010 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000755000175000017500000000000011620312145033341 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/RedeployAfterErrorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000635310757022266033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; /** * RedeployAfterErrorTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class RedeployAfterErrorTestCase extends AbstractControllerTest { public static Test suite() { return suite(RedeployAfterErrorTestCase.class); } public RedeployAfterErrorTestCase(String name) throws Throwable { super(name); } public void testRedeployAfterError() throws Throwable { KernelDeployment deployment = deploy("RedeployAfterErrorTestCase_bad.xml"); try { ControllerContext context = getControllerContext("Name1", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(ClassNotFoundException.class, context.getError()); } finally { undeploy(deployment); } validate(); deployment = deploy("RedeployAfterErrorTestCase_good.xml"); try { validate(); assertNotNull(getBean("Name1")); } finally { undeploy(deployment); } } public void testChangeUsage() throws Throwable { KernelDeployment deployment = deploy("RedeployAfterErrorTestCase_bad.xml"); try { KernelControllerContext context = getControllerContext("Name1", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(ClassNotFoundException.class, context.getError()); // a hacky fix, but the point is to get the error away :-) AbstractBeanMetaData bmd = (AbstractBeanMetaData)context.getBeanMetaData(); bmd.setBean(Object.class.getName()); // we suspect the error was resolved, let's try to install change(context, ControllerState.INSTALLED); // nope, still in error assertEquals(ControllerState.ERROR, context.getState()); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/AbstractControllerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000367310756342051033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * AccessControl Test Case. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class AbstractControllerTest extends MicrocontainerTest { public AbstractControllerTest(String name) throws Throwable { super(name); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/AccessControlTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000407710334760572033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import java.security.AccessControlException; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.deployment.KernelDeployment; /** * AccessControl Test Case. * * @author Adrian Brock * @version $Revision: 38046 $ */ public class AccessControlTestCase extends AbstractControllerTest { public static Test suite() { return suite(AccessControlTestCase.class); } public AccessControlTestCase(String name) throws Throwable { super(name); } public void testAccessControlContext() throws Throwable { KernelDeployment deployment = deploy("AccessControlTestCase_NotAutomatic.xml"); try { ControllerContext context = getControllerContext("Name1", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(AccessControlException.class, context.getError()); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/FieldAccessControlTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000447310770665555033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import java.security.AccessControlException; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.controller.support.PrivateFieldTestBean; /** * FieldAccessControl Test Case. * * @author Adrian Brock * @version $Revision: 38046 $ */ public class FieldAccessControlTestCase extends AbstractControllerTest { public static Test suite() { return suite(FieldAccessControlTestCase.class); } public FieldAccessControlTestCase(String name) throws Throwable { super(name); } public void testPrivateField() throws Throwable { PrivateFieldTestBean test = assertBean("Allowed", PrivateFieldTestBean.class); assertEquals("private", test.getPrivateStringNotGetter()); KernelDeployment deployment = deploy("FieldAccessControlTestCase_NotAutomatic.xml"); try { ControllerContext context = getControllerContext("NotAllowed", null); assertEquals(ControllerState.ERROR, context.getState()); checkDeepThrowable(AccessControlException.class, context.getError()); } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/InstallWhenRequiredErrorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000001430310757136565033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.controller.support.TestBean; import org.jboss.test.kernel.controller.support.TestBeanRepository; /** * Install when required test case. * * @author Ales Justin */ public class InstallWhenRequiredErrorTestCase extends AbstractControllerTest { public static Test suite() { return suite(InstallWhenRequiredErrorTestCase.class); } public InstallWhenRequiredErrorTestCase(String name) throws Throwable { super(name); } protected ControllerState[] getStates() { return new ControllerState[]{ ControllerState.CONFIGURED, ControllerState.CREATE, ControllerState.START, }; } protected BeanMetaData createBeanMetaData(ControllerState state) { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Bean", TestBean.class.getName()); builder.addInstallWithThis("add", "Repository1", null, state); builder.addInstallWithThis("add", "Repository2", null, state); builder.addUninstallWithThis("remove", "Repository1", null, state); builder.addUninstallWithThis("remove", "Repository2", null, state); return builder.getBeanMetaData(); } public void testErrorInInstallWithSupplies() throws Throwable { ControllerState[] states = getStates(); for (ControllerState state : states) runErrorInInstallWithSupplies(state); } public void runErrorInInstallWithSupplies(ControllerState state) throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { BeanMetaData metaData = createBeanMetaData(state); KernelControllerContext deployment = deploy(metaData); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); try { getControllerContext("TestSupply", null); fail("Should not be here!"); } catch (Throwable throwable) { checkThrowable(IllegalStateException.class, throwable); } } finally { undeploy(deployment); } } finally { undeploy(repository); } } public void testErrorInInstallRedeploy() throws Throwable { ControllerState[] states = getStates(); for (ControllerState state : states) runErrorInInstallRedeploy(state); } public void runErrorInInstallRedeploy(ControllerState state) throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { BeanMetaData metaData = createBeanMetaData(state); KernelControllerContext kcc = deploy(metaData); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); } finally { undeploy(kcc); } KernelDeployment deployment = deploy("InstallErrorTestCase_BeanNoInstall.xml"); try { assertNotNull(getControllerContext("Bean")); } finally { undeploy(deployment); } } finally { undeploy(repository); } } public void testErrorInInstall() throws Throwable { ControllerState[] states = getStates(); for (ControllerState state : states) runErrorInInstall(state); } public void runErrorInInstall(ControllerState state) throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { TestBeanRepository repository1 = (TestBeanRepository)getBean("Repository1"); TestBeanRepository repository2 = (TestBeanRepository)getBean("Repository2"); BeanMetaData metaData = createBeanMetaData(state); KernelControllerContext deployment = deploy(metaData); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); assertEmpty(repository1.getBeans()); assertEmpty(repository2.getBeans()); } finally { undeploy(deployment); } } finally { undeploy(repository); } } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/ContextClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000001664411000653773033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.controller.support.TestClassLoaderBean; /** * ContextClassLoaderTestCase. * * TODO test others, e.g. ControllerContextAware * @author Adrian Brock * @version $Revision: 1.1 $ */ public class ContextClassLoaderTestCase extends AbstractControllerTest { ClassLoader cl = null; public static Test suite() { return suite(ContextClassLoaderTestCase.class); } public ContextClassLoaderTestCase(String name) throws Throwable { super(name); } protected void setUp() throws Exception { super.setUp(); SecurityManager sm = suspendSecurity(); try { cl = Thread.currentThread().getContextClassLoader(); } finally { resumeSecurity(sm); } } protected void tearDown() throws Exception { SecurityManager sm = suspendSecurity(); try { assertEquals(cl, Thread.currentThread().getContextClassLoader()); } finally { resumeSecurity(sm); super.tearDown(); } } public ClassLoader assertClassLoader() throws Exception { ClassLoader classLoader = (ClassLoader) getBean("ClassLoader"); checkClassLoader(classLoader); return classLoader; } public ClassLoader assertClassLoader(ClassLoader cl) throws Exception { ClassLoader classLoader = (ClassLoader) getBean("ClassLoader"); checkClassLoader(cl); return classLoader; } public void checkClassLoader(ClassLoader classLoader) throws Exception { assertEquals(classLoader, TestClassLoaderBean.getAndResetClassLoader()); } public void testFactory() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Factory.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); } } public void testConstructor() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Constructor.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); } } public void testConfigure() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Configure.xml"); ClassLoader cl = null; try { validate(); cl = assertClassLoader(); } finally { undeploy(deployment); } checkClassLoader(cl); } public void testCreate() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Create.xml"); try { assertClassLoader(); } finally { undeploy(deployment); } } public void testStart() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Start.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); } } public void testStop() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Stop.xml"); ClassLoader cl = null; try { cl = assertClassLoader(null); } finally { undeploy(deployment); } checkClassLoader(cl); } public void testDestroy() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Destroy.xml"); ClassLoader cl = null; try { validate(); cl = assertClassLoader(null); } finally { undeploy(deployment); } checkClassLoader(cl); } public void testInstall() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Install.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); } } public void testUninstall() throws Throwable { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Uninstall.xml"); ClassLoader cl = null; try { validate(); cl = assertClassLoader(null); } finally { undeploy(deployment); } checkClassLoader(cl); } public void testIncallbackSingle() throws Throwable { KernelDeployment repository = deploy("ContextClassLoaderTestCase_InCallBackSingle.xml"); KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Callback.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); undeploy(repository); } } public void testIncallbackCollection() throws Throwable { KernelDeployment repository = deploy("ContextClassLoaderTestCase_InCallBackCollection.xml"); KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Callback.xml"); try { validate(); assertClassLoader(); } finally { undeploy(deployment); undeploy(repository); } } public void testUncallbackSingle() throws Throwable { KernelDeployment repository = deploy("ContextClassLoaderTestCase_UnCallBackSingle.xml"); ClassLoader cl = null; try { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Callback.xml"); try { validate(); cl = assertClassLoader(null); } finally { undeploy(deployment); } checkClassLoader(cl); } finally { undeploy(repository); } } public void testUncallbackCollection() throws Throwable { KernelDeployment repository = deploy("ContextClassLoaderTestCase_UnCallBackCollection.xml"); ClassLoader cl = null; try { KernelDeployment deployment = deploy("ContextClassLoaderTestCase_Callback.xml"); try { validate(); cl = assertClassLoader(null); } finally { undeploy(deployment); } checkClassLoader(cl); } finally { undeploy(repository); } } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/NoInstantiateTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000506110366736272033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.controller.support.SimpleBean; /** * No instantiate Test Case. * * @author Adrian Brock * @version $Revision: 40730 $ */ public class NoInstantiateTestCase extends AbstractKernelTest { public static Test suite() { return suite(NoInstantiateTestCase.class); } public NoInstantiateTestCase(String name) throws Throwable { super(name); } public void testNoInstantiate() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); SimpleBean bean = new SimpleBean(); AbstractBeanMetaData metaData = new AbstractBeanMetaData("Name1", bean.getClass().getName()); KernelControllerContext context = controller.install(metaData, bean); assertEquals(ControllerState.INSTALLED, context.getState()); assertEquals(bean, context.getTarget()); controller.uninstall("Name1"); assertEquals(bean, context.getTarget()); context = controller.install(metaData, bean); assertEquals(ControllerState.INSTALLED, context.getState()); assertEquals(bean, context.getTarget()); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/InstallErrorTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000001055010757136565033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.controller.support.TestBeanRepository; /** * InstallErrorTestCase * * TODO test others, e.g. ControllerContextAware * @author Adrian Brock * @version $Revision: 1.1 $ */ public class InstallErrorTestCase extends AbstractControllerTest { public static Test suite() { return suite(InstallErrorTestCase.class); } public InstallErrorTestCase(String name) throws Throwable { super(name); } public void testErrorInInstallWithSupplies() throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { KernelDeployment deployment = deploy("InstallErrorTestCase_BeanWithSupply.xml"); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); try { getControllerContext("TestSupply", null); fail("Should not be here!"); } catch (Throwable throwable) { checkThrowable(IllegalStateException.class, throwable); } } finally { undeploy(deployment); } } finally { undeploy(repository); } } public void testErrorInInstallRedeploy() throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { KernelDeployment deployment = deploy("InstallErrorTestCase_Bean.xml"); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); } finally { undeploy(deployment); } deployment = deploy("InstallErrorTestCase_BeanNoInstall.xml"); try { assertNotNull(getControllerContext("Bean")); } finally { undeploy(deployment); } } finally { undeploy(repository); } } public void testErrorInInstall() throws Throwable { KernelDeployment repository = deploy("InstallErrorTestCase_Repositories.xml"); try { TestBeanRepository repository1 = (TestBeanRepository) getBean("Repository1"); TestBeanRepository repository2 = (TestBeanRepository) getBean("Repository2"); KernelDeployment deployment = deploy("InstallErrorTestCase_Bean.xml"); try { ControllerContext context = getControllerContext("Bean", null); assertEquals(ControllerState.ERROR, context.getState()); checkThrowable(Error.class, context.getError()); assertTrue(repository1.getBeans().isEmpty()); assertTrue(repository2.getBeans().isEmpty()); } finally { undeploy(deployment); } } finally { undeploy(repository); } } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/ControllerTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000370311110551720033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Controller Test Suite. * * @author Adrian Brock * @version $Revision: 81226 $ */ public class ControllerTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Controller Tests"); suite.addTest(AccessControlTestCase.suite()); suite.addTest(NoInstantiateTestCase.suite()); suite.addTest(RedeployAfterErrorTestCase.suite()); suite.addTest(ContextClassLoaderTestCase.suite()); suite.addTest(InstallErrorTestCase.suite()); suite.addTest(InstallWhenRequiredErrorTestCase.suite()); suite.addTest(FieldAccessControlTestCase.suite()); suite.addTest(GenericBeanFactoryAccessControlTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/test/GenericBeanFactoryAccessControlTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/te0000644000175000017500000000577211137570512033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.test; import java.security.AccessControlException; import java.util.Collections; import junit.framework.Test; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.test.kernel.controller.support.PrivilegedBean; /** * AccessControl Test Case. * * @author Adrian Brock * @version $Revision: 38046 $ */ public class GenericBeanFactoryAccessControlTestCase extends AbstractControllerTest { public static Test suite() { return suite(GenericBeanFactoryAccessControlTestCase.class); } public GenericBeanFactoryAccessControlTestCase(String name) throws Throwable { super(name); } public void testPrivilegedBean() throws Throwable { BeanFactory factory = assertBean("Factory", BeanFactory.class); Object object = factory.createBean(); ClassLoader cl = assertBean("ClassLoader", ClassLoader.class); assertEquals(cl, object.getClass().getClassLoader()); } public void testUnPrivilegedBean() throws Throwable { GenericBeanFactoryMetaData gbfmd = new GenericBeanFactoryMetaData(); gbfmd.setName("NonPrivileged"); gbfmd.setBean(PrivilegedBean.class.getName()); AbstractKernelDeployment deployment = new AbstractKernelDeployment(); deployment.setName("test"); deployment.setBeanFactories(Collections.singletonList((BeanMetaDataFactory) gbfmd)); deploy(deployment); try { BeanFactory factory = assertBean("NonPrivileged", BeanFactory.class); try { factory.createBean(); fail("Should not be here!"); } catch (Throwable t) { checkThrowable(AccessControlException.class, t); } } finally { undeploy(deployment); } } }././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000755000175000017500000000000011620312145033360 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/TestBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000255010746224743033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; /** * TestBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestBean { private boolean throwError = false; public boolean isThrowError() { return throwError; } public void setThrowError(boolean throwError) { this.throwError = throwError; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/TestClassLoaderBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000303710746224743033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; import java.util.Set; /** * TestClassLoaderBeanRepository. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestClassLoaderBeanRepository { public void add(TestClassLoaderBean bean) { TestClassLoaderBean.checkClassLoader(); } public void remove(TestClassLoaderBean bean) { TestClassLoaderBean.checkClassLoader(); } public void setBeans(Set beans) { TestClassLoaderBean.checkClassLoader(); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivateFieldTestBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000245111301242575033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; /** * PrivateFieldTestBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class PrivateFieldTestBean { private String privateString; public String getPrivateStringNotGetter() { return privateString; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/TestBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000326210746224743033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; import java.util.HashSet; import java.util.Set; /** * TestBeanRepository. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestBeanRepository { private Set beans = new HashSet(); public Set getBeans() { return beans; } public void setBeans(Set beans) { this.beans = beans; } public void add(TestBean bean) { if (bean.isThrowError() == false) bean.setThrowError(true); else throw new Error(); beans.add(bean); } public void remove(TestBean bean) { beans.remove(bean); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/PrivilegedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000237411137570512033377 0ustar twernertwerner/* * 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.test.kernel.controller.support; /** * PrivilegedBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class PrivilegedBean { public PrivilegedBean() { System.getProperties(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000224210366735454033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; /** * SimpleBean. * * @author Adrian Brock * @version $Revision: 40729 $ */ public class SimpleBean { } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/TestClassLoaderBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000457310746224743033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; import org.jboss.test.AbstractTestCaseWithSetup; /** * TestClassLoaderBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestClassLoaderBean { private static ClassLoader classLoader; private String something = "something"; public static ClassLoader getAndResetClassLoader() { ClassLoader result = classLoader; classLoader = null; return result; } protected static void checkClassLoader() { SecurityManager securityManager = AbstractTestCaseWithSetup.suspendSecurity(); try { classLoader = Thread.currentThread().getContextClassLoader(); } finally { AbstractTestCaseWithSetup.resumeSecurity(securityManager); } } public static TestClassLoaderBean createInstance() { checkClassLoader(); return new TestClassLoaderBean(); } public TestClassLoaderBean() { } public TestClassLoaderBean(String something) { checkClassLoader(); this.something = something; } public String getSomething() { checkClassLoader(); return something; } public void setSomething(String something) { checkClassLoader(); this.something = something; } public void doLifecycle() { checkClassLoader(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/TestClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000243110746224743033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.controller.support; /** * TestClassLoader. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class TestClassLoader extends ClassLoader { public TestClassLoader() { super(TestClassLoader.class.getClassLoader()); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/support/SimpleScopedClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/controller/su0000644000175000017500000000600311137570512033370 0ustar twernertwerner/* * 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.test.kernel.controller.support; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.security.ProtectionDomain; import org.jboss.test.AbstractTestCaseWithSetup; /** * SimpleScopedClassLoader. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class SimpleScopedClassLoader extends ClassLoader { @Override protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { if (name.startsWith("org.jboss.test.kernel")) { SecurityManager sm = AbstractTestCaseWithSetup.suspendSecurity(); try { String resourceName = name.replace('.', '/') + ".class"; URL url = SimpleScopedClassLoader.class.getClassLoader().getResource(resourceName); InputStream is = null; byte[] bytes = null; try { is = url.openStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); byte[] tmp = new byte[1024]; int read = 0; while ( (read = is.read(tmp)) >= 0 ) baos.write(tmp, 0, read); bytes = baos.toByteArray(); } catch (IOException e) { throw new RuntimeException("Unable to load class byte code " + name, e); } finally { try { if (is != null) is.close(); } catch (IOException e) { // pointless } } ProtectionDomain pd = AbstractTestCaseWithSetup.class.getProtectionDomain(); return defineClass(name, bytes, 0, bytes.length, pd); } finally { AbstractTestCaseWithSetup.resumeSecurity(sm); } } return super.loadClass(name, resolve); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/AbstractKernelTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/AbstractKerne0000644000175000017500000000762010772714443033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Locale; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; import org.jboss.util.NestedRuntimeException; /** * An abstract kernel test. * * @author Adrian Brock * @version $Revision: 71345 $ */ public class AbstractKernelTest extends AbstractTestCaseWithSetup { private static DateFormat dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss z yyyy", Locale.US); private Locale locale; public AbstractKernelTest(String name) { super(name); } protected void setUp() throws Exception { // set locales locale = Locale.getDefault(); setLocale(Locale.US); super.setUp(); } protected void setLocale(Locale locale) { SecurityManager sm = suspendSecurity(); try { Locale.setDefault(locale); } finally { resumeSecurity(sm); } } protected void tearDown() throws Exception { super.tearDown(); // reset locale setLocale(locale); locale = null; } protected Kernel bootstrap() throws Throwable { BasicBootstrap bootstrap = new BasicBootstrap(); bootstrap.run(); configureLoggingAfterBootstrap(); return bootstrap.getKernel(); } protected static void assertEqualsRegistryTarget(KernelRegistryEntry e1, KernelRegistryEntry e2) { assertEquals(e1.getTarget(), e2.getTarget()); } protected static KernelRegistryEntry makeEntry(Object o) { return new AbstractKernelRegistryEntry(o); } protected Date createDate(String date) { Locale locale = Locale.getDefault(); try { setLocale(Locale.US); return dateFormat.parse(date); } catch (Exception e) { throw new NestedRuntimeException(e); } finally { setLocale(locale); } } protected Date createDate(int year, int month, int day) { Calendar calender = Calendar.getInstance(); calender.clear(); calender.set(year, month-1, day, 0, 0, 0); return calender.getTime(); } protected void configureLoggingAfterBootstrap() { } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = true; return delegate; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/KernelTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/KernelTestSui0000644000175000017500000000560210716050342033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.jboss.test.kernel.bootstrap.test.BootstrapTestSuite; import org.jboss.test.kernel.config.test.ConfigTestSuite; import org.jboss.test.kernel.controller.test.ControllerTestSuite; import org.jboss.test.kernel.dependency.test.DependencyTestSuite; import org.jboss.test.kernel.deployment.test.DeploymentTestSuite; import org.jboss.test.kernel.deployment.xml.test.XMLTestSuite; import org.jboss.test.kernel.deployment.props.test.PropsTestSuite; import org.jboss.test.kernel.event.test.EventTestSuite; import org.jboss.test.kernel.registry.test.RegistryTestSuite; import org.jboss.test.kernel.inject.test.ContextualInjectionTestSuite; import org.jboss.test.kernel.metadata.test.MetaDataTestSuite; import org.jboss.test.kernel.annotations.test.AnnotationsTestSuite; import org.jboss.test.kernel.lazy.test.LazyTestSuite; /** * Kernel Test Suite. * * @author Adrian Brock * @version $Revision: 66956 $ */ public class KernelTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Kernel Tests"); suite.addTest(BootstrapTestSuite.suite()); suite.addTest(RegistryTestSuite.suite()); suite.addTest(EventTestSuite.suite()); suite.addTest(ConfigTestSuite.suite()); suite.addTest(DependencyTestSuite.suite()); suite.addTest(ControllerTestSuite.suite()); suite.addTest(DeploymentTestSuite.suite()); suite.addTest(ContextualInjectionTestSuite.suite()); suite.addTest(XMLTestSuite.suite()); suite.addTest(MetaDataTestSuite.suite()); suite.addTest(AnnotationsTestSuite.suite()); suite.addTest(LazyTestSuite.suite()); suite.addTest(PropsTestSuite.suite()); return suite; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/xml/0000755000175000017500000000000011620312144031424 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/xml/validateschema/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/xml/validates0000755000175000017500000000000011620312144033321 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/xml/validateschema/ValidateBeansSchemaTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/xml/validates0000644000175000017500000000552710775141751033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source. * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.xml.validateschema; import java.io.InputStream; import junit.framework.Test; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class ValidateBeansSchemaTestCase extends MicrocontainerTest { public static Test suite() { return suite(ValidateBeansSchemaTestCase.class); } public ValidateBeansSchemaTestCase(String name) { super(name); } public void testSchemaIsValid() throws Exception { InputStream aopbeans = Thread.currentThread().getContextClassLoader().getResourceAsStream("schema/bean-deployer_2_0.xsd"); assertNotNull(aopbeans); org.jboss.xb.binding.Util.loadSchema(aopbeans, null, new SchemaBindingResolver() { public String getBaseURI() { return null; } public SchemaBinding resolve(String nsUri, String baseURI, String schemaLocation) { return null; } public org.w3c.dom.ls.LSInput resolveAsLSInput(String nsUri, String baseUri, String schemaLocation) { if (schemaLocation.equals("jboss-beans-common_2_0.xsd")) { schemaLocation = "schema/" + schemaLocation; } InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(schemaLocation); assertNotNull(stream); return new org.jboss.xb.binding.sunday.unmarshalling.LSInputAdaptor(stream, null); } public void setBaseURI(String baseURI) { } }); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/0000755000175000017500000000000011620312154032743 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/classloader/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/cl0000755000175000017500000000000011620312154033262 5ustar twernertwerner././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/classloader/SimpleBeanWithConstructorClassLoaderImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/cl0000644000175000017500000000467710333273212033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.classloader; import java.io.Serializable; /** * A simple bean * * @author Adrian Brock * @version $Revision: 37882 $ */ public class SimpleBeanWithConstructorClassLoaderImpl implements Serializable, SimpleBeanWithConstructorClassLoader { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3905240143387505464L; // Attributes ---------------------------------------------------- private String string; private SimpleBean bean; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public SimpleBeanWithConstructorClassLoaderImpl() { } public SimpleBeanWithConstructorClassLoaderImpl(SimpleBean bean) { this.bean = bean; } // Public -------------------------------------------------------- public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getSimpleBean() { return bean; } // Package protected --------------------------------------------- // Protected ----------------------------------------------------- // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/classloader/SimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/cl0000644000175000017500000000463010333273212033270 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.classloader; import java.io.Serializable; /** * A simple bean * * @author Adrian Brock * @version $Revision: 37882 $ */ public class SimpleBeanImpl implements Serializable, SimpleBean { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258132440433243443L; // Attributes ---------------------------------------------------- private String constructorString; private String string; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public SimpleBeanImpl() { constructorString = "()"; } public SimpleBeanImpl(String string) { constructorString = string; } // Public -------------------------------------------------------- public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } // Package protected --------------------------------------------- // Protected ----------------------------------------------------- // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/classloader/SimpleBeanWithConstructorClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/cl0000644000175000017500000000306510333273212033271 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.classloader; /** * A SimpleBeanWithConstructorDependency. * * @author Adrian Brock * @version $Revision: 37882 $ */ public interface SimpleBeanWithConstructorClassLoader { // Constants ----------------------------------------------------- // Public -------------------------------------------------------- String getString(); void setString(String string); SimpleBean getSimpleBean(); // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/classloader/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/cl0000644000175000017500000000301010333273212033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.classloader; /** * A SimpleBean. * * @author Adrian Brock * @version $Revision: 37882 $ */ public interface SimpleBean { // Constants ----------------------------------------------------- // Public -------------------------------------------------------- String getConstructorString(); String getString(); void setString(String string); // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000755000175000017500000000000011620312154033274 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000002305310764340107033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanRepository; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 70562 $ */ public class InstallDependencyTestCase extends AbstractKernelDependencyTest { public static Test suite() { return suite(InstallDependencyTestCase.class); } public InstallDependencyTestCase(String name) throws Throwable { super(name); } public InstallDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testInstallDependencyCorrectOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanRepository bean1 = (SimpleBeanRepository) context1.getTarget(); assertNotNull(bean1); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyWrongOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.START); ControllerContext context1 = assertInstall(0, "Name1"); SimpleBeanRepository bean1 = (SimpleBeanRepository) context1.getTarget(); assertNotNull(bean1); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyReinstall() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanRepository bean1 = (SimpleBeanRepository) context1.getTarget(); assertNotNull(bean1); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name1"); assertContext("Name2", ControllerState.START); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context1 = assertInstall(0, "Name1"); assertContext("Name2", ControllerState.INSTALLED); bean1 = (SimpleBeanRepository) context1.getTarget(); assertNotNull(bean1); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name2"); assertContext("Name1", ControllerState.INSTALLED); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context2 = assertInstall(1, "Name2"); assertContext("Name1", ControllerState.INSTALLED); bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testWhenRequiredInstalls() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(2, "Name3"); SimpleBeanRepository bean1 = (SimpleBeanRepository) context1.getTarget(); assertNotNull(bean1); Set states = bean1.getStates(); assertNotNull(states); assertEquals(getExpectedInstallSize(), states.size()); assertUninstall(context2.getName().toString()); int uninstallSize = getExpectedUninstallSize(); assertEquals(uninstallSize, states.size()); if (uninstallSize > 0) { ControllerState state = states.iterator().next(); assertEquals(ControllerState.NOT_INSTALLED, state); } } protected int getExpectedInstallSize() { return 6; } protected int getExpectedUninstallSize() { return 1; } protected void setupBeanMetaDatas() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanRepository.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()); ArrayList installs = new ArrayList(); AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setBean("Name1"); install.setMethodName("addSimpleBean"); ArrayList parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(null, new ThisValueMetaData())); install.setParameters(parameters); installs.add(install); metaData2.setInstalls(installs); ArrayList uninstalls = new ArrayList(); AbstractInstallMetaData uninstall = new AbstractInstallMetaData(); uninstall.setBean("Name1"); uninstall.setMethodName("removeSimpleBean"); parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(null, new ThisValueMetaData())); uninstall.setParameters(parameters); uninstalls.add(uninstall); metaData2.setUninstalls(uninstalls); AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanImpl.class.getName()); ArrayList stateInstalls = new ArrayList(); addInstallMetaData(ControllerState.PRE_INSTALL, stateInstalls); addInstallMetaData(ControllerState.DESCRIBED, stateInstalls); addInstallMetaData(ControllerState.INSTANTIATED, stateInstalls); addInstallMetaData(ControllerState.CONFIGURED, stateInstalls); addInstallMetaData(ControllerState.CREATE, stateInstalls); addInstallMetaData(ControllerState.START, stateInstalls); ArrayList stateUninstalls = new ArrayList(); addUninstallMetaData(ControllerState.PRE_INSTALL, stateUninstalls); addUninstallMetaData(ControllerState.DESCRIBED, stateUninstalls); addUninstallMetaData(ControllerState.INSTANTIATED, stateUninstalls); addUninstallMetaData(ControllerState.CONFIGURED, stateUninstalls); addUninstallMetaData(ControllerState.CREATE, stateUninstalls); addUninstallMetaData(ControllerState.START, stateUninstalls); metaData3.setInstalls(stateInstalls); metaData3.setUninstalls(stateUninstalls); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3 }); } protected void addInstallMetaData(ControllerState state, List states) { addInstallMetaData(state, states, "add"); } protected void addUninstallMetaData(ControllerState state, List states) { addInstallMetaData(state, states, "remove"); } protected void addInstallMetaData(ControllerState state, List states, String prefix) { AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setBean("Name1"); install.setMethodName(prefix + "State"); AbstractInjectionValueMetaData injection = new AbstractInjectionValueMetaData(); injection.setFromContext(FromContext.STATE); ParameterMetaData parameter = new AbstractParameterMetaData(injection); install.setParameters(Collections.singletonList(parameter)); install.setState(state); states.add(install); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001440310654125045033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class PlainLifecycleDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(PlainLifecycleDependencyTestCase.class); } public PlainLifecycleDependencyTestCase(String name) throws Throwable { super(name); } public PlainLifecycleDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testPlainLifecycleDependencyCorrectOrder() throws Throwable { plainLifecycleDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(3, bean2.createOrder); assertEquals(2, bean1.startOrder); assertEquals(4, bean2.startOrder); } public void plainLifecycleDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testPlainLifecycleDependencyWrongOrder() throws Throwable { plainLifecycleDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.CONFIGURED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(2, bean2.createOrder); assertEquals(3, bean1.startOrder); assertEquals(4, bean2.startOrder); } public void plainLifecycleDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testPlainLifecycleDependencyReinstall() throws Throwable { plainLifecycleDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); uninstall("Name1"); assertContext("Name2", ControllerState.CONFIGURED); assertEquals(5, bean2.stopOrder); assertEquals(6, bean1.stopOrder); assertEquals(7, bean2.destroyOrder); assertEquals(8, bean1.destroyOrder); context1 = assertInstall(0, "Name1"); bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); assertContext("Name2", ControllerState.INSTALLED); assertEquals(9, bean1.createOrder); assertEquals(10, bean2.createOrder); assertEquals(11, bean1.startOrder); assertEquals(12, bean2.startOrder); uninstall("Name2"); assertContext("Name1", ControllerState.INSTALLED); assertEquals(13, bean2.stopOrder); assertEquals(14, bean2.destroyOrder); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); context2 = assertInstall(1, "Name2"); bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); assertContext("Name1", ControllerState.INSTALLED); assertEquals(15, bean2.createOrder); assertEquals(16, bean2.startOrder); assertEquals(9, bean1.createOrder); assertEquals(11, bean1.startOrder); } public void plainLifecycleDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName()); HashSet depends = new HashSet(); depends.add(new AbstractDependencyMetaData("Name1")); metaData2.setDepends(depends); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } protected void setUp() throws Exception { super.setUp(); SimpleBeanWithLifecycle.resetOrder(); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001026510755316653033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.CustomMatcherTransfomer; /** * Test matcher demand/supply. * * @author Ales Justin */ public class MatcherDemandSupplyTestCase extends AbstractKernelDependencyTest { public MatcherDemandSupplyTestCase(String name) throws Throwable { super(name); } public MatcherDemandSupplyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(MatcherDemandSupplyTestCase.class); } public void testMatching() throws Throwable { setBeanMetaDatas(); ControllerContext regexpDemand = assertInstall(0, "regexpDemander", getState()); assertInstall(1, "regexpSupplier"); assertEquals(ControllerState.INSTALLED, regexpDemand.getState()); ControllerContext limitDemand = assertInstall(2, "intervalDemander", getState()); assertInstall(3, "intervalSupplier"); assertEquals(ControllerState.INSTALLED, limitDemand.getState()); ControllerContext customDemand = assertInstall(4, "customDemander", getState()); assertInstall(5, "customSupplier"); assertEquals(ControllerState.INSTALLED, customDemand.getState()); } protected ControllerState getState() { return ControllerState.PRE_INSTALL; } protected void setBeanMetaDatas() throws Throwable { BeanMetaDataBuilder b0 = BeanMetaDataBuilderFactory.createBuilder("regexpDemander", Object.class.getName()); b0.addDemand("^[a-zA-Z0-9._%+-]+@acme\\.((org)|(com))$", (String) null, "regexp"); BeanMetaDataBuilder b1 = BeanMetaDataBuilderFactory.createBuilder("regexpSupplier", Object.class.getName()); b1.addSupply("aj@acme.org"); BeanMetaDataBuilder b2 = BeanMetaDataBuilderFactory.createBuilder("intervalDemander", Object.class.getName()); b2.addDemand("(1,10]", (String) null, "interval"); BeanMetaDataBuilder b3 = BeanMetaDataBuilderFactory.createBuilder("intervalSupplier", Object.class.getName()); b3.addSupply("5", "java.lang.Integer"); BeanMetaDataBuilder b4 = BeanMetaDataBuilderFactory.createBuilder("customDemander", Object.class.getName()); b4.addDemand("fragment", (String) null, CustomMatcherTransfomer.class.getName()); BeanMetaDataBuilder b5 = BeanMetaDataBuilderFactory.createBuilder("customSupplier", Object.class.getName()); b5.addSupply("i supply fragment word"); setBeanMetaDatas(new BeanMetaData[] { b0.getBeanMetaData(), b1.getBeanMetaData(), b2.getBeanMetaData(), b3.getBeanMetaData(), b4.getBeanMetaData(), b5.getBeanMetaData(), } ); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PropertyFieldDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000420710767766613033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.test.kernel.dependency.support.SimplerBeanImpl; /** * Property Field Dependency Test Case. * * @author Ales Justin */ public class PropertyFieldDependencyTestCase extends PropertyDependencyTestCase { public static Test suite() { return suite(PropertyFieldDependencyTestCase.class); } public PropertyFieldDependencyTestCase(String name) throws Throwable { super(name); } protected AbstractBeanMetaData createName1() { AbstractBeanMetaData metaData = new AbstractBeanMetaData("Name1", SimplerBeanImpl.class.getName()); metaData.setAccessMode(BeanAccessMode.FIELDS); return metaData; } protected AbstractBeanMetaData createName2() { AbstractBeanMetaData metaData = new AbstractBeanMetaData("Name2", SimplerBeanImpl.class.getName()); metaData.setAccessMode(BeanAccessMode.FIELDS); return metaData; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000303010364464416033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * OnDemand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40439 $ */ public class GenericBeanFactoryOnDemandDependencyXMLTestCase extends GenericBeanFactoryOnDemandDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryOnDemandDependencyXMLTestCase.class); } public GenericBeanFactoryOnDemandDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DuplicateAliasXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000301611032416742033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Duplicate alias tests. * * @author Ales Justin */ public class DuplicateAliasXMLTestCase extends DuplicateAliasTestCase { public DuplicateAliasXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(DuplicateAliasXMLTestCase.class); } protected void buildMetaData() throws Throwable { } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000300110331006762033273 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * KernelControllerContextAware Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class KernelControllerContextAwareXMLTestCase extends KernelControllerContextAwareTestCase { public static Test suite() { return suite(KernelControllerContextAwareXMLTestCase.class); } public KernelControllerContextAwareXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OnDemandDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000272010331006762033302 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * OnDemand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class OnDemandDependencyXMLTestCase extends OnDemandDependencyTestCase { public static Test suite() { return suite(OnDemandDependencyXMLTestCase.class); } public OnDemandDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/FromContextXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000305010654624420033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Test FromContext from XML. * * @author Ales Justin */ public class FromContextXMLTestCase extends FromContextTestCase { public FromContextXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(FromContextXMLTestCase.class); } protected void setBeanMetaDatas() throws Throwable { deploy(0); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000652310711377006033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.dependency.support.RegexpDemander; import org.jboss.test.kernel.dependency.support.RegexpSupplier; import org.jboss.test.kernel.dependency.support.IntervalDemander; import org.jboss.test.kernel.dependency.support.IntervalSupplier; import org.jboss.test.kernel.dependency.support.CustomDemander; import org.jboss.test.kernel.dependency.support.CustomSupplier; import org.jboss.dependency.spi.ControllerState; /** * Test matcher demand/supply. * * @author Ales Justin */ public class MatcherDemandSupplyAnnotationTestCase extends MatcherDemandSupplyTestCase { public MatcherDemandSupplyAnnotationTestCase(String name) throws Throwable { super(name, false); } public static Test suite() { return suite(MatcherDemandSupplyAnnotationTestCase.class); } protected ControllerState getState() { return ControllerState.DESCRIBED; } protected void setBeanMetaDatas() throws Throwable { BeanMetaDataBuilder b0 = BeanMetaDataBuilderFactory.createBuilder("regexpDemander", RegexpDemander.class.getName()); BeanMetaDataBuilder b1 = BeanMetaDataBuilderFactory.createBuilder("regexpSupplier", RegexpSupplier.class.getName()); BeanMetaDataBuilder b2 = BeanMetaDataBuilderFactory.createBuilder("intervalDemander", IntervalDemander.class.getName()); BeanMetaDataBuilder b3 = BeanMetaDataBuilderFactory.createBuilder("intervalSupplier", IntervalSupplier.class.getName()); BeanMetaDataBuilder b4 = BeanMetaDataBuilderFactory.createBuilder("customDemander", CustomDemander.class.getName()); BeanMetaDataBuilder b5 = BeanMetaDataBuilderFactory.createBuilder("customSupplier", CustomSupplier.class.getName()); setBeanMetaDatas(new BeanMetaData[] { b0.getBeanMetaData(), b1.getBeanMetaData(), b2.getBeanMetaData(), b3.getBeanMetaData(), b4.getBeanMetaData(), b5.getBeanMetaData(), } ); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PropertyDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000272010331006762033302 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Property Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class PropertyDependencyXMLTestCase extends PropertyDependencyTestCase { public static Test suite() { return suite(PropertyDependencyXMLTestCase.class); } public PropertyDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ConstructorDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000443410654125045033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithConstructorDependencyImpl; import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl; /** * Constructor Dependency Test Case. * * @author Ales Justin */ public class ConstructorDependencyAnnotationTestCase extends ConstructorDependencyTestCase { public static Test suite() { return suite(ConstructorDependencyAnnotationTestCase.class); } public ConstructorDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void buildMetaData() { BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName()); BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", AnnotatedSimpleBeanWithConstructorDependencyImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() }); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000303010364467430033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Property Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40440 $ */ public class GenericBeanFactoryPropertyDependencyXMLTestCase extends GenericBeanFactoryPropertyDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryPropertyDependencyXMLTestCase.class); } public GenericBeanFactoryPropertyDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/AbstractKernelDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001345111032416742033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.net.URL; import java.util.Set; import java.util.HashSet; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.dependency.support.TestUtil; /** * An abstract kernel config test. * * @author Adrian Brock * @version $Revision: 75258 $ */ public class AbstractKernelDependencyTest extends AbstractKernelTest { /** The test utility */ private TestUtil util; /** Whether this is an xml test */ private boolean xmltest; /** The BeanMetaDatas */ private BeanMetaData[] beanMetaDatas; public AbstractKernelDependencyTest(String name) throws Throwable { this(name, false); } public AbstractKernelDependencyTest(String name, boolean xmltest) throws Throwable { super(name); this.xmltest = xmltest; } protected void setUp() throws Exception { super.setUp(); try { Kernel kernel = bootstrap(); this.util = new TestUtil(kernel, this); } catch (Exception e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } protected TestUtil getUtil() { return util; } protected ControllerContext install(int number, String name) throws Throwable { if (xmltest) { deploy(number); return util.getContext(name); } else { return util.install(beanMetaDatas[number]); } } protected void uninstall(String name) throws Throwable { util.uninstall(name); } protected ControllerContext assertInstall(int number, String name) throws Throwable { return assertInstall(number, name, ControllerState.INSTALLED); } protected ControllerContext assertInstall(int number, String name, ControllerState expected) throws Throwable { ControllerContext context = install(number, name); assertNotNull("Missing context with name: " + name, context); assertEquals(expected, context.getState()); return context; } protected ControllerContext assertContext(String name) throws Throwable { return assertContext(name, ControllerState.INSTALLED); } protected ControllerContext assertContext(String name, ControllerState expected) throws Throwable { ControllerContext context = util.getContext(name); assertNotNull("Expected " + name + " state=" + expected.toShortString(), context); assertEquals(expected, context.getState()); return context; } protected void assertUninstall(String name) throws Throwable { uninstall(name); assertNotInstalled(name); ControllerContext context = util.getContext(name); assertNull(context); } protected void assertNotInstalled(String name) throws Throwable { if (util.getInstalledContext(name) != null) fail("Should not be installed"); } protected void setBeanMetaDatas(BeanMetaData[] beanMetaDatas) { if (xmltest) return; this.beanMetaDatas = beanMetaDatas; } protected void addBeanProperty(GenericBeanFactoryMetaData factory, PropertyMetaData property) { Set propertys = factory.getProperties(); if (propertys == null) { propertys = new HashSet(); factory.setProperties(propertys); } propertys.add(property); } protected BeanMetaData getBeanMetaData(GenericBeanFactoryMetaData factory) { List beans = factory.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); return beans.get(0); } protected void deploy(int number) throws Throwable { String name = getClass().getName(); int dot = name.lastIndexOf('.'); if (dot != -1) name = name.substring(dot + 1); name = name + number + ".xml"; getLog().debug("Using " + name); URL url = getResource(name); if (url == null) throw new RuntimeException("Resource not found: " + name); getLog().debug("url=" + url); util.deploy(url); } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.beans"); //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.joinpoint.plugins.config"); //enableTrace("org.jboss.kernel.plugins.config"); //enableTrace("org.jboss.kernel.plugins.dependency"); //if (xmltest) // enableTrace("org.jboss.xb"); } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000505510654125045033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithComplicatedLifecycle; import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle; /** * Lifecycle Dependency Test Case. * * @author Ales Justin */ public class ComplicatedLifecycleDependencyAnnotationTestCase extends ComplicatedLifecycleDependencyTestCase { public static Test suite() { return suite(ComplicatedLifecycleDependencyAnnotationTestCase.class); } public ComplicatedLifecycleDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", AnnotatedSimpleBeanWithComplicatedLifecycle.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3, metaData4, metaData5 }); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000275110331006762033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class PlainLifecycleDependencyXMLTestCase extends PlainLifecycleDependencyTestCase { public static Test suite() { return suite(PlainLifecycleDependencyXMLTestCase.class); } public PlainLifecycleDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000501110757136565033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.dependency.support.SimpleBeanRepository; import org.jboss.test.kernel.dependency.support.ExternalInstallSimpleBeanImpl; import org.jboss.test.kernel.dependency.support.ExternalInstallWithStateSimpleBeanImpl; /** * Install Dependency Test Case. * * @author Ales Justin */ public class InstallDependencyAnnotationTestCase extends InstallDependencyTestCase { public static Test suite() { return suite(InstallDependencyAnnotationTestCase.class); } public InstallDependencyAnnotationTestCase(String name) throws Throwable { super(name); } // we don't expect PreInstall protected int getExpectedInstallSize() { return 5; } protected int getExpectedUninstallSize() { return 0; } protected void setupBeanMetaDatas() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanRepository.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", ExternalInstallSimpleBeanImpl.class.getName()); AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", ExternalInstallWithStateSimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3 }); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/MatcherDemandSupplyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000276110711377006033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Test matcher demand/supply. * * @author Ales Justin */ public class MatcherDemandSupplyXMLTestCase extends MatcherDemandSupplyTestCase { public MatcherDemandSupplyXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(MatcherDemandSupplyXMLTestCase.class); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackCollectionXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000325610656541211033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Callback tests. * * @author Ales Justin */ public class CallbackCollectionXMLTestCase extends CallbackTestCase { public CallbackCollectionXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(CallbackCollectionXMLTestCase.class); } protected String createName(int number) { String name = super.createName(number); if (number != 0) return name; return name.replaceFirst("0.xml", "Collection0.xml"); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000435010654125045033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithDependencyImpl; /** * Plain Dependency Test Case. * * @author Ales Justin */ public class PlainDependencyAnnotationTestCase extends PlainDependencyTestCase { public static Test suite() { return suite(PlainDependencyAnnotationTestCase.class); } public PlainDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void buildMetaData() { BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName()); BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", AnnotatedSimpleBeanWithDependencyImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() }); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OnDemandDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001542211216157032033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependencyImpl; /** * OnDemand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 90317 $ */ public class OnDemandDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(OnDemandDependencyTestCase.class); } public OnDemandDependencyTestCase(String name) throws Throwable { super(name); } public OnDemandDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testOnDemandDependencyOnDemandFirst() throws Throwable { onDemandDependencyOnDemandFirst(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED); ControllerContext context2 = assertInstall(1, "Name2"); assertContext("Name1"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void onDemandDependencyOnDemandFirst() throws Throwable { buildMetaData(); } public void testOnDemandDependencyOnDemandSecond() throws Throwable { onDemandDependencyOnDemandSecond(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void onDemandDependencyOnDemandSecond() throws Throwable { buildMetaData(); } public void testOnDemandDependencyReinstall() throws Throwable { onDemandDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED); ControllerContext context2 = assertInstall(1, "Name2"); assertContext("Name1"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name2"); context1 = assertContext("Name1"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void onDemandDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); metaData1.setMode(ControllerMode.ON_DEMAND); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName()); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1"))); metaData2.setProperties(attributes2); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } }././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001773010771262000033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithConstructorDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithConstructorDependencyImpl; /** * Constructor Dependency Test Case. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryConstructorDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryConstructorDependencyTestCase.class); } public GenericBeanFactoryConstructorDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryConstructorDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryConstructorDependencyCorrectOrder() throws Throwable { constructorDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void constructorDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryConstructorDependencyWrongOrder() throws Throwable { constructorDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void constructorDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryConstructorDependencyReinstall() throws Throwable { constructorDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); assertUninstall("Name2"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(ControllerState.ERROR, context2.getState()); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBeanWithConstructorDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void constructorDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName()); addBeanProperty(metaData1, new AbstractPropertyMetaData("string", "String1")); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName()); addBeanProperty(metaData2, new AbstractPropertyMetaData("string", "String2")); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); ArrayList constructor2 = new ArrayList(); constructor2.add(new AbstractParameterMetaData(GenericBeanFactory.class.getName(), new AbstractDependencyValueMetaData("Name1"))); cmd.setParameters(constructor2); metaData2.setConstructor(cmd); setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), getBeanMetaData(metaData2) }); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryCallbackDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001422710771262000033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.GenericBeanFactoryRepositoryBF; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Callback Dependency Test Case. * * @author Ales Justin */ public class GenericBeanFactoryCallbackDependencyTestCase extends AbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryCallbackDependencyTestCase.class); } public GenericBeanFactoryCallbackDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryCallbackDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testInstallDependencyCorrectOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactoryRepositoryBF bean1 = (GenericBeanFactoryRepositoryBF) context1.getTarget(); assertNotNull(bean1); SimpleBeanImpl bean2 = (SimpleBeanImpl) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyWrongOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context2 = assertInstall(1, "Name2"); ControllerContext context1 = assertInstall(0, "Name1"); GenericBeanFactoryRepositoryBF bean1 = (GenericBeanFactoryRepositoryBF) context1.getTarget(); assertNotNull(bean1); SimpleBeanImpl bean2 = (SimpleBeanImpl) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyReinstall() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactoryRepositoryBF bean1 = (GenericBeanFactoryRepositoryBF) context1.getTarget(); assertNotNull(bean1); SimpleBeanImpl bean2 = (SimpleBeanImpl) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name1"); assertContext("Name2"); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context1 = assertInstall(0, "Name1"); assertContext("Name2", ControllerState.INSTALLED); bean1 = (GenericBeanFactoryRepositoryBF) context1.getTarget(); assertNotNull(bean1); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name2"); assertContext("Name1", ControllerState.INSTALLED); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context2 = assertInstall(1, "Name2"); assertContext("Name1", ControllerState.INSTALLED); bean2 = (SimpleBeanImpl) context2.getTarget(); assertNotNull(bean2); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } protected void setupBeanMetaDatas() throws Throwable { GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName()); metaData1.setFactoryClass(GenericBeanFactoryRepositoryBF.class.getName()); ArrayList installs = new ArrayList(); AbstractCallbackMetaData install = new InstallCallbackMetaData(); install.setMethodName("addGenericBeanFactory"); installs.add(install); metaData1.setInstallCallbacks(installs); ArrayList uninstalls = new ArrayList(); AbstractCallbackMetaData uninstall = new UninstallCallbackMetaData(); uninstall.setMethodName("removeGenericBeanFactory"); uninstalls.add(uninstall); metaData1.setUninstallCallbacks(uninstalls); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), metaData2 }); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000271310366730626033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40727 $ */ public class InstallDependencyXMLTestCase extends InstallDependencyTestCase { public static Test suite() { return suite(InstallDependencyXMLTestCase.class); } public InstallDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000427011032416742033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Set; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * Duplicate alias tests. * * @author Ales Justin */ public class ScopedDuplicateAliasTestCase extends DuplicateAliasTestCase { public ScopedDuplicateAliasTestCase(String name) throws Throwable { super(name); } protected ScopedDuplicateAliasTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(ScopedDuplicateAliasTestCase.class); } protected void addAnnotation(AbstractBeanMetaData bmd) { Set annotations = new HashSet(); annotations.add(new AbstractAnnotationMetaData("@" + DeploymentScope.class.getName() + "(\"somedeployment\")")); bmd.setAnnotations(annotations); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ConstructorDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000273710331006762033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Constructor Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ConstructorDependencyXMLTestCase extends ConstructorDependencyTestCase { public static Test suite() { return suite(ConstructorDependencyXMLTestCase.class); } public ConstructorDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DemandDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000270610331006762033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Demand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class DemandDependencyXMLTestCase extends DemandDependencyTestCase { public static Test suite() { return suite(DemandDependencyXMLTestCase.class); } public DemandDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryCallbackDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000304710771262000033302 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Callback Dependency Test Case. * * @author Ales Justin */ public class GenericBeanFactoryCallbackDependencyXMLTestCase extends GenericBeanFactoryCallbackDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryCallbackDependencyXMLTestCase.class); } public GenericBeanFactoryCallbackDependencyXMLTestCase(String name) throws Throwable { super(name, true); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000510310366730626033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.test.kernel.dependency.support.SimpleBeanWithKernelControllerContextAware; /** * KernelControllerContextAware Test Case. * * @author Adrian Brock * @version $Revision: 40727 $ */ public class KernelControllerContextAwareTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(KernelControllerContextAwareTestCase.class); } public KernelControllerContextAwareTestCase(String name) throws Throwable { super(name); } public KernelControllerContextAwareTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testKernelControllerContextAware() throws Throwable { kernelControllerContextAware(); ControllerContext context1 = assertInstall(0, "Name1"); SimpleBeanWithKernelControllerContextAware bean1 = (SimpleBeanWithKernelControllerContextAware) context1.getTarget(); assertNotNull(bean1); assertEquals(context1, bean1.context); assertUninstall("Name1"); assertNull(bean1.context); } public void kernelControllerContextAware() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithKernelControllerContextAware.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1 }); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallSelfDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000422410757136565033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanInstallSelf; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanInstallsAware; /** * Install Dependency Test Case. * * @author Ales Justin */ public class InstallSelfDependencyAnnotationTestCase extends InstallSelfDependencyTestCase { public static Test suite() { return suite(InstallSelfDependencyAnnotationTestCase.class); } public InstallSelfDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void setupBeanMetaDatas() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", AnnotatedSimpleBeanInstallSelf.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", AnnotatedSimpleBeanInstallsAware.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000304710364457166033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Constructor Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40438 $ */ public class GenericBeanFactoryConstructorDependencyXMLTestCase extends GenericBeanFactoryConstructorDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryConstructorDependencyXMLTestCase.class); } public GenericBeanFactoryConstructorDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000267310656353464033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Callback tests. * * @author Ales Justin */ public class CallbackXMLTestCase extends CallbackTestCase { public CallbackXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(CallbackXMLTestCase.class); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000005622610654125045033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Collections; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanWithComplicatedLifecycle; import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class ComplicatedLifecycleDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(ComplicatedLifecycleDependencyTestCase.class); } public ComplicatedLifecycleDependencyTestCase(String name) throws Throwable { super(name); } public ComplicatedLifecycleDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testComplicatedLifecycleDependencyCorrectOrder() throws Throwable { complicatedLifecycleDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); ControllerContext context3 = assertInstall(2, "Name3"); ControllerContext context4 = assertInstall(3, "Name4"); ControllerContext context5 = assertInstall(4, "Name5"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); SimpleBeanWithLifecycle bean3 = (SimpleBeanWithLifecycle) context3.getTarget(); assertNotNull(bean3); SimpleBeanWithLifecycle bean4 = (SimpleBeanWithLifecycle) context4.getTarget(); assertNotNull(bean4); SimpleBeanWithComplicatedLifecycle bean5 = (SimpleBeanWithComplicatedLifecycle) context5.getTarget(); assertNotNull(bean5); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(9, bean5.createOrder); assertEquals(10, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(-1, bean5.stopOrder); assertEquals(-1, bean5.destroyOrder); } public void complicatedLifecycleDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testComplicatedLifecycleDependencyWrongOrder() throws Throwable { complicatedLifecycleDependencyWrongOrder(); ControllerContext context5 = assertInstall(4, "Name5", ControllerState.CONFIGURED); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context4 = assertInstall(3, "Name4"); assertContext("Name5", ControllerState.CREATE); ControllerContext context2 = assertInstall(1, "Name2"); ControllerContext context3 = assertInstall(2, "Name3"); assertContext("Name5", ControllerState.INSTALLED); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); SimpleBeanWithLifecycle bean3 = (SimpleBeanWithLifecycle) context3.getTarget(); assertNotNull(bean3); SimpleBeanWithLifecycle bean4 = (SimpleBeanWithLifecycle) context4.getTarget(); assertNotNull(bean4); SimpleBeanWithComplicatedLifecycle bean5 = (SimpleBeanWithComplicatedLifecycle) context5.getTarget(); assertNotNull(bean5); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean4.createOrder); assertEquals(4, bean4.startOrder); assertEquals(5, bean5.createOrder); assertEquals(6, bean2.createOrder); assertEquals(7, bean2.startOrder); assertEquals(8, bean3.createOrder); assertEquals(9, bean3.startOrder); assertEquals(10, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(-1, bean5.stopOrder); assertEquals(-1, bean5.destroyOrder); } public void complicatedLifecycleDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testComplicatedLifecycleDependencyReinstall() throws Throwable { complicatedLifecycleDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); ControllerContext context3 = assertInstall(2, "Name3"); ControllerContext context4 = assertInstall(3, "Name4"); ControllerContext context5 = assertInstall(4, "Name5"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); SimpleBeanWithLifecycle bean3 = (SimpleBeanWithLifecycle) context3.getTarget(); assertNotNull(bean3); SimpleBeanWithLifecycle bean4 = (SimpleBeanWithLifecycle) context4.getTarget(); assertNotNull(bean4); SimpleBeanWithComplicatedLifecycle bean5 = (SimpleBeanWithComplicatedLifecycle) context5.getTarget(); assertNotNull(bean5); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(9, bean5.createOrder); assertEquals(10, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(-1, bean5.stopOrder); assertEquals(-1, bean5.destroyOrder); assertUninstall("Name1"); assertContext("Name2"); assertContext("Name3"); assertContext("Name4"); assertContext("Name5", ControllerState.CONFIGURED); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(9, bean5.createOrder); assertEquals(10, bean5.startOrder); assertNull(bean5.createBean); assertNull(bean5.startBean); assertTrue(bean3 == bean5.stopBean); assertTrue(bean4 == bean5.destroyBean); assertEquals(13, bean1.stopOrder); assertEquals(14, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(11, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); context1 = assertInstall(0, "Name1"); bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); assertContext("Name2"); assertContext("Name3"); assertContext("Name4"); assertContext("Name5"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(18, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(11, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); assertUninstall("Name2"); assertContext("Name1"); assertContext("Name3"); assertContext("Name4"); assertContext("Name5", ControllerState.CREATE); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(18, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertNull(bean5.startBean); assertTrue(bean3 == bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(20, bean2.stopOrder); assertEquals(21, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(19, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); context2 = assertInstall(1, "Name2"); bean2 = (SimpleBeanWithLifecycle) context2.getTarget(); assertNotNull(bean2); assertContext("Name1"); assertContext("Name3"); assertContext("Name4"); assertContext("Name5"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(24, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(19, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); assertUninstall("Name3"); assertContext("Name1"); assertContext("Name2"); assertContext("Name4"); assertContext("Name5", ControllerState.CREATE); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(5, bean3.createOrder); assertEquals(6, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(24, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertNull(bean5.startBean); assertTrue(bean3 == bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(26, bean3.stopOrder); assertEquals(27, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(25, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); context3 = assertInstall(2, "Name3"); bean3 = (SimpleBeanWithLifecycle) context3.getTarget(); assertNotNull(bean3); assertContext("Name1"); assertContext("Name2"); assertContext("Name4"); assertContext("Name5"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(28, bean3.createOrder); assertEquals(29, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(30, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(25, bean5.stopOrder); assertEquals(12, bean5.destroyOrder); assertUninstall("Name4"); assertContext("Name1"); assertContext("Name2"); assertContext("Name3"); assertContext("Name5", ControllerState.CONFIGURED); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(28, bean3.createOrder); assertEquals(29, bean3.startOrder); assertEquals(7, bean4.createOrder); assertEquals(8, bean4.startOrder); assertEquals(17, bean5.createOrder); assertEquals(30, bean5.startOrder); assertNull(bean5.createBean); assertNull(bean5.startBean); assertTrue(bean3 == bean5.stopBean); assertTrue(bean4 == bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(33, bean4.stopOrder); assertEquals(34, bean4.destroyOrder); assertEquals(31, bean5.stopOrder); assertEquals(32, bean5.destroyOrder); context4 = assertInstall(3, "Name4"); bean4 = (SimpleBeanWithLifecycle) context4.getTarget(); assertNotNull(bean4); assertContext("Name1"); assertContext("Name2"); assertContext("Name3"); assertContext("Name5"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(28, bean3.createOrder); assertEquals(29, bean3.startOrder); assertEquals(35, bean4.createOrder); assertEquals(36, bean4.startOrder); assertEquals(37, bean5.createOrder); assertEquals(38, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(31, bean5.stopOrder); assertEquals(32, bean5.destroyOrder); assertUninstall("Name5"); assertContext("Name1"); assertContext("Name2"); assertContext("Name3"); assertContext("Name4"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(28, bean3.createOrder); assertEquals(29, bean3.startOrder); assertEquals(35, bean4.createOrder); assertEquals(36, bean4.startOrder); assertEquals(37, bean5.createOrder); assertEquals(38, bean5.startOrder); assertNull(bean5.createBean); assertNull(bean5.startBean); assertTrue(bean3 == bean5.stopBean); assertTrue(bean4 == bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(39, bean5.stopOrder); assertEquals(40, bean5.destroyOrder); context5 = assertInstall(4, "Name5"); bean5 = (SimpleBeanWithComplicatedLifecycle) context5.getTarget(); assertNotNull(bean5); assertContext("Name1"); assertContext("Name2"); assertContext("Name3"); assertContext("Name4"); assertEquals(15, bean1.createOrder); assertEquals(16, bean1.startOrder); assertEquals(22, bean2.createOrder); assertEquals(23, bean2.startOrder); assertEquals(28, bean3.createOrder); assertEquals(29, bean3.startOrder); assertEquals(35, bean4.createOrder); assertEquals(36, bean4.startOrder); assertEquals(41, bean5.createOrder); assertEquals(42, bean5.startOrder); assertTrue(bean1 == bean5.createBean); assertTrue(bean2 == bean5.startBean); assertNull(bean5.stopBean); assertNull(bean5.destroyBean); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); assertEquals(-1, bean2.stopOrder); assertEquals(-1, bean2.destroyOrder); assertEquals(-1, bean3.stopOrder); assertEquals(-1, bean3.destroyOrder); assertEquals(-1, bean4.stopOrder); assertEquals(-1, bean4.destroyOrder); assertEquals(-1, bean5.stopOrder); assertEquals(-1, bean5.destroyOrder); } public void complicatedLifecycleDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", SimpleBeanWithComplicatedLifecycle.class.getName()); AbstractLifecycleMetaData create = new AbstractLifecycleMetaData(); create.setMethodName("notCreate"); AbstractParameterMetaData parameter = new AbstractParameterMetaData(SimpleBeanWithLifecycle.class.getName(), new AbstractDependencyValueMetaData("Name1")); create.setParameters(Collections.singletonList((ParameterMetaData) parameter)); metaData5.setCreate(create); AbstractLifecycleMetaData start = new AbstractLifecycleMetaData(); start.setMethodName("notStart"); parameter = new AbstractParameterMetaData(); parameter.setValue(new AbstractDependencyValueMetaData("Name2")); start.setParameters(Collections.singletonList((ParameterMetaData) parameter)); metaData5.setStart(start); AbstractLifecycleMetaData stop = new AbstractLifecycleMetaData(); stop.setMethodName("notStop"); parameter = new AbstractParameterMetaData(); parameter.setValue(new AbstractDependencyValueMetaData("Name3")); stop.setParameters(Collections.singletonList((ParameterMetaData) parameter)); metaData5.setStop(stop); AbstractLifecycleMetaData destroy = new AbstractLifecycleMetaData(); destroy.setMethodName("notDestroy"); parameter = new AbstractParameterMetaData(); parameter.setValue(new AbstractDependencyValueMetaData("Name4")); destroy.setParameters(Collections.singletonList((ParameterMetaData) parameter)); metaData5.setDestroy(destroy); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3, metaData4, metaData5 }); } protected void setUp() throws Exception { super.setUp(); SimpleBeanWithLifecycle.resetOrder(); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001465310771262000033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimplerBean; /** * Property Dependency Test Case. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryPropertyDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryPropertyDependencyTestCase.class); } public GenericBeanFactoryPropertyDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryPropertyDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryPropertyDependencyCorrectOrder() throws Throwable { propertyDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimplerBean bean2 = (SimplerBean) factory.createBean(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryPropertyDependencyWrongOrder() throws Throwable { propertyDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimplerBean bean2 = (SimplerBean) factory.createBean(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryPropertyDependencyReinstall() throws Throwable { propertyDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimplerBean bean2 = (SimplerBean) factory.createBean(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory = (GenericBeanFactory) context2.getTarget(); bean2 = (SimplerBean) factory.createBean(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); assertUninstall("Name2"); context1 = assertContext("Name1"); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory = (GenericBeanFactory) context2.getTarget(); bean2 = (SimplerBean) factory.createBean(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); metaData1.addProperty(new AbstractPropertyMetaData("string", "String1")); GenericBeanFactoryMetaData metaData2 = createBeanFactory(); addBeanProperty(metaData2, new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string"))); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2.getBeans().get(0) }); } protected GenericBeanFactoryMetaData createBeanFactory() { return new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName()); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/NestedPropertyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000272010756342051033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Nested property xml tests. * * @author Ales Justin */ public class NestedPropertyXMLTestCase extends NestedPropertyTestCase { public NestedPropertyXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(NestedPropertyXMLTestCase.class); } }././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryField2PropertyDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000473710771262000033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.test.kernel.dependency.support.SimplerBeanImpl2; import org.jboss.test.AbstractTestDelegate; /** * Property Field Dependency Test Case. * * @author Ales Justin */ public class GenericBeanFactoryField2PropertyDependencyTestCase extends GenericBeanFactoryPropertyDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryField2PropertyDependencyTestCase.class); } public GenericBeanFactoryField2PropertyDependencyTestCase(String name) throws Throwable { super(name); } protected GenericBeanFactoryMetaData createBeanFactory() { GenericBeanFactoryMetaData beanFactoryMetaData = new GenericBeanFactoryMetaData("Name2", SimplerBeanImpl2.class.getName()); beanFactoryMetaData.setAccessMode(BeanAccessMode.ALL); return beanFactoryMetaData; } /** * Default setup with security manager disabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = false; return delegate; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/FromContextTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001753010771262000033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.factory.BeanFactory; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.deployment.support.NameAwareBean; /** * @author Ales Justin */ public class FromContextTestCase extends AbstractKernelDependencyTest { private boolean isXML; public FromContextTestCase(String name) throws Throwable { super(name); } public FromContextTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); isXML = xmltest; } public static Test suite() { return suite(FromContextTestCase.class); } protected Object getBean(int number, String name) throws Throwable { ControllerContext context; if (isXML) context = assertContext(name); else context = assertInstall(number, name); assertNotNull(context); return context.getTarget(); } public void testNameInjection() throws Throwable { setBeanMetaDatas(); NameAwareBean nsb = (NameAwareBean)getBean(0, "set_name_bean"); assertNotNull(nsb); assertEquals("set_name_bean", nsb.getName()); BeanFactory nsf = (BeanFactory)getBean(1, "set_name_factory"); assertNotNull(nsf); NameAwareBean b3 = (NameAwareBean)nsf.createBean(); assertNotNull(b3); assertEquals("set_name_factory", b3.getName()); NameAwareBean b4 = (NameAwareBean)nsf.createBean(); assertNotNull(b4); assertEquals("set_name_factory", b4.getName()); NameAwareBean alias = (NameAwareBean)getBean(2, "aliases"); assertNotNull(alias); Set aliases = alias.getAliases(); checkAliases(aliases); NameAwareBean metadata = (NameAwareBean)getBean(3, "metadata"); assertNotNull(metadata); assertNotNull(metadata.getMetadata()); NameAwareBean beaninfo = (NameAwareBean)getBean(4, "beaninfo"); assertNotNull(beaninfo); assertNotNull(beaninfo.getBeaninfo()); NameAwareBean scopekey = (NameAwareBean)getBean(5, "scopekey"); assertNotNull(scopekey); assertNotNull(scopekey.getScopeKey()); NameAwareBean other = (NameAwareBean)getBean(6, "other"); assertNotNull(other); assertEquals("set_name_bean", other.getName()); NameAwareBean context = (NameAwareBean)getBean(7, "context"); assertNotNull(context); assertNotNull(context.getContext()); NameAwareBean state = (NameAwareBean)getBean(8, "state"); assertNotNull(state); assertEquals(ControllerState.INSTANTIATED, state.getState()); } protected void checkAliases(Set aliases) throws Throwable { assertNotNull(aliases); assertFalse(aliases.isEmpty()); assertTrue(aliases.contains("a1")); assertTrue(aliases.contains("a2")); assertTrue(aliases.contains("a3")); } protected void setBeanMetaDatas() throws Throwable { BeanMetaDataBuilder b1 = BeanMetaDataBuilderFactory.createBuilder("set_name_bean", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v1 = new AbstractInjectionValueMetaData(); v1.setFromContext(FromContext.NAME); b1.addPropertyMetaData("name", v1); GenericBeanFactoryMetaData b2 = new GenericBeanFactoryMetaData("set_name_factory", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v2 = new AbstractInjectionValueMetaData(); v2.setFromContext(FromContext.NAME); addBeanProperty(b2, new AbstractPropertyMetaData("name", v2)); BeanMetaDataBuilder b3 = BeanMetaDataBuilderFactory.createBuilder("aliases", NameAwareBean.class.getName()); Set aliases = new HashSet(); aliases.addAll(Arrays.asList("a1", "a2", "a3")); b3.setAliases(aliases); AbstractInjectionValueMetaData v3 = new AbstractInjectionValueMetaData(); v3.setFromContext(FromContext.ALIASES); b3.addPropertyMetaData("aliases", v3); BeanMetaDataBuilder b4 = BeanMetaDataBuilderFactory.createBuilder("metadata", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v4 = new AbstractInjectionValueMetaData(); v4.setFromContext(FromContext.METADATA); b4.addPropertyMetaData("metadata", v4); BeanMetaDataBuilder b5 = BeanMetaDataBuilderFactory.createBuilder("beaninfo", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v5 = new AbstractInjectionValueMetaData(); v5.setFromContext(FromContext.BEANINFO); b5.addPropertyMetaData("beaninfo", v5); BeanMetaDataBuilder b6 = BeanMetaDataBuilderFactory.createBuilder("scopekey", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v6 = new AbstractInjectionValueMetaData(); v6.setFromContext(FromContext.SCOPE); b6.addPropertyMetaData("scopeKey", v6); BeanMetaDataBuilder b8 = BeanMetaDataBuilderFactory.createBuilder("other", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v8 = new AbstractInjectionValueMetaData(); v8.setValue("set_name_bean"); v8.setFromContext(FromContext.NAME); b8.addPropertyMetaData("name", v8); BeanMetaDataBuilder b9 = BeanMetaDataBuilderFactory.createBuilder("context", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v9 = new AbstractInjectionValueMetaData(); v9.setFromContext(FromContext.CONTEXT); b9.addPropertyMetaData("context", v9); BeanMetaDataBuilder b10 = BeanMetaDataBuilderFactory.createBuilder("state", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v10 = new AbstractInjectionValueMetaData(); v10.setFromContext(FromContext.STATE); b10.addPropertyMetaData("state", v10); setBeanMetaDatas(new BeanMetaData[] { b1.getBeanMetaData(), getBeanMetaData(b2), b3.getBeanMetaData(), b4.getBeanMetaData(), b5.getBeanMetaData(), b6.getBeanMetaData(), b8.getBeanMetaData(), b9.getBeanMetaData(), b10.getBeanMetaData(), } ); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001500410654125045033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependencyImpl; /** * Plain Dependency Test Case. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class PlainDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(PlainDependencyTestCase.class); } public PlainDependencyTestCase(String name) throws Throwable { super(name); } public PlainDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testPlainDependencyCorrectOrder() throws Throwable { plainDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void plainDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testPlainDependencyWrongOrder() throws Throwable { plainDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void plainDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testPlainDependencyReinstall() throws Throwable { plainDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name2"); context1 = assertContext("Name1"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void plainDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName()); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1"))); metaData2.setProperties(attributes2); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } }././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000300110331006762033273 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ComplicatedLifecycleDependencyXMLTestCase extends ComplicatedLifecycleDependencyTestCase { public static Test suite() { return suite(ComplicatedLifecycleDependencyXMLTestCase.class); } public ComplicatedLifecycleDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PropertyField2DependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000511210767766613033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.test.kernel.dependency.support.SimplerBeanImpl2; import org.jboss.test.AbstractTestDelegate; /** * Property Field Dependency Test Case. * * @author Ales Justin */ public class PropertyField2DependencyTestCase extends PropertyDependencyTestCase { public static Test suite() { return suite(PropertyField2DependencyTestCase.class); } public PropertyField2DependencyTestCase(String name) throws Throwable { super(name); } protected AbstractBeanMetaData createName1() { AbstractBeanMetaData metaData = new AbstractBeanMetaData("Name1", SimplerBeanImpl2.class.getName()); metaData.setAccessMode(BeanAccessMode.ALL); return metaData; } protected AbstractBeanMetaData createName2() { AbstractBeanMetaData metaData = new AbstractBeanMetaData("Name2", SimplerBeanImpl2.class.getName()); metaData.setAccessMode(BeanAccessMode.ALL); return metaData; } /** * Default setup with security manager disabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = false; return delegate; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PropertyDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000435310654125045033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl; import org.jboss.test.kernel.dependency.support.PropertyDependecySimpleBeanImpl; /** * Property Dependency Test Case. * * @author Ales Justin */ public class PropertyDependencyAnnotationTestCase extends PropertyDependencyTestCase { public static Test suite() { return suite(PropertyDependencyAnnotationTestCase.class); } public PropertyDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void buildMetaData() { BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName()); BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", PropertyDependecySimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() }); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001511110771262000033275 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryPlainLifecycleDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryPlainLifecycleDependencyTestCase.class); } public GenericBeanFactoryPlainLifecycleDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryPlainLifecycleDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryPlainLifecycleDependencyCorrectOrder() throws Throwable { plainLifecycleDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); } public void plainLifecycleDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryPlainLifecycleDependencyWrongOrder() throws Throwable { plainLifecycleDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.CONFIGURED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); } public void plainLifecycleDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryPlainLifecycleDependencyReinstall() throws Throwable { plainLifecycleDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanWithLifecycle bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithLifecycle bean2 = (SimpleBeanWithLifecycle) factory.createBean(); assertNotNull(bean2); assertEquals(1, bean1.createOrder); assertEquals(2, bean1.startOrder); assertEquals(3, bean2.createOrder); assertEquals(4, bean2.startOrder); uninstall("Name1"); assertContext("Name2", ControllerState.CONFIGURED); assertEquals(5, bean1.stopOrder); assertEquals(6, bean1.destroyOrder); context1 = assertInstall(0, "Name1"); bean1 = (SimpleBeanWithLifecycle) context1.getTarget(); assertNotNull(bean1); assertContext("Name2", ControllerState.INSTALLED); assertEquals(7, bean1.createOrder); assertEquals(8, bean1.startOrder); uninstall("Name2"); assertContext("Name1", ControllerState.INSTALLED); assertEquals(-1, bean1.stopOrder); assertEquals(-1, bean1.destroyOrder); context2 = assertInstall(1, "Name2"); factory = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBeanWithLifecycle) factory.createBean(); assertNotNull(bean2); assertContext("Name1", ControllerState.INSTALLED); assertEquals(9, bean2.createOrder); assertEquals(10, bean2.startOrder); assertEquals(7, bean1.createOrder); assertEquals(8, bean1.startOrder); } public void plainLifecycleDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName()); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithLifecycle.class.getName()); HashSet depends = new HashSet(); depends.add(new AbstractDependencyMetaData("Name1")); metaData2.setDepends(depends); setBeanMetaDatas(new BeanMetaData[] { metaData1, getBeanMetaData(metaData2) }); } protected void setUp() throws Exception { super.setUp(); SimpleBeanWithLifecycle.resetOrder(); } }././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000301610364450402033301 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Demand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40434 $ */ public class GenericBeanFactoryDemandDependencyXMLTestCase extends GenericBeanFactoryDemandDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryDemandDependencyXMLTestCase.class); } public GenericBeanFactoryDemandDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackCollectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000554010656541211033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.kernel.dependency.support.SimpleBeanRepository; /** * Callback collection tests. * * @author Ales Justin */ public class CallbackCollectionTestCase extends CallbackTestCase { public CallbackCollectionTestCase(String name) throws Throwable { super(name); } public CallbackCollectionTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(CallbackCollectionTestCase.class); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { AbstractBeanMetaData repository = new AbstractBeanMetaData("Name1", SimpleBeanRepository.class.getName()); List installs = new ArrayList(); repository.setInstallCallbacks(installs); InstallCallbackMetaData install = new InstallCallbackMetaData(); install.setMethodName("setBeans"); if (cardinality != null) install.setCardinality(cardinality); installs.add(install); List unstalls = new ArrayList(); repository.setUninstallCallbacks(unstalls); UninstallCallbackMetaData uninstall = new UninstallCallbackMetaData(); uninstall.setMethodName("setBeans"); unstalls.add(uninstall); return repository; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000270110331006762033301 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Plain Dependency Test Case. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class PlainDependencyXMLTestCase extends PlainDependencyTestCase { public static Test suite() { return suite(PlainDependencyXMLTestCase.class); } public PlainDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ConstructorDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001637410654125045033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithConstructorDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithConstructorDependencyImpl; /** * Constructor Dependency Test Case. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class ConstructorDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(ConstructorDependencyTestCase.class); } public ConstructorDependencyTestCase(String name) throws Throwable { super(name); } public ConstructorDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testConstructorDependencyCorrectOrder() throws Throwable { constructorDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void constructorDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testConstructorDependencyWrongOrder() throws Throwable { constructorDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.DESCRIBED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void constructorDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testConstructorDependencyReinstall() throws Throwable { constructorDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBeanWithConstructorDependency bean2 = (SimpleBeanWithConstructorDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.DESCRIBED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.DESCRIBED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithConstructorDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); assertUninstall("Name2"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(ControllerState.ERROR, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBeanWithConstructorDependency) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(bean1, bean2.getSimpleBean()); } public void constructorDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName()); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); metaData2.setProperties(attributes2); ArrayList constructor2 = new ArrayList(); constructor2.add(new AbstractParameterMetaData(SimpleBean.class.getName(), new AbstractDependencyValueMetaData("Name1"))); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); metaData2.setConstructor(cmd); cmd.setParameters(constructor2); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PropertyDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001423210767766613033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimplerBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Property Dependency Test Case. * * @author Adrian Brock * @version $Revision: 70952 $ */ public class PropertyDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(PropertyDependencyTestCase.class); } public PropertyDependencyTestCase(String name) throws Throwable { super(name); } public PropertyDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testPropertyDependencyCorrectOrder() throws Throwable { propertyDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimplerBean bean2 = (SimplerBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testPropertyDependencyWrongOrder() throws Throwable { propertyDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimplerBean bean2 = (SimplerBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testPropertyDependencyReinstall() throws Throwable { propertyDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimplerBean bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimplerBean bean2 = (SimplerBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimplerBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); assertUninstall("Name2"); context1 = assertContext("Name1"); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimplerBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimplerBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String1", bean2.getString()); } public void propertyDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = createName1(); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); AbstractBeanMetaData metaData2 = createName2(); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string"))); metaData2.setProperties(attributes2); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } protected AbstractBeanMetaData createName1() { return new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); } protected AbstractBeanMetaData createName2() { return new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()); } }././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ConstructorClassLoaderXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000274410334002015033276 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Constructor ClassLoader Test Case. * * @author Adrian Brock * @version $Revision: 37927 $ */ public class ConstructorClassLoaderXMLTestCase extends ConstructorClassLoaderTestCase { public static Test suite() { return suite(ConstructorClassLoaderXMLTestCase.class); } public ConstructorClassLoaderXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000306110364473115033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Lifecycle Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40441 $ */ public class GenericBeanFactoryPlainLifecycleDependencyXMLTestCase extends GenericBeanFactoryPlainLifecycleDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryPlainLifecycleDependencyXMLTestCase.class); } public GenericBeanFactoryPlainLifecycleDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainAliasTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001514111032416742033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.Controller; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Plain alias tests. * * @author Ales Justin */ public class PlainAliasTestCase extends AbstractKernelDependencyTest { public PlainAliasTestCase(String name) throws Throwable { super(name); } public PlainAliasTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(PlainAliasTestCase.class); } protected ControllerContext getAlias(String name) throws Throwable { installAlias(); return getUtil().getContext(name); } protected String getControllerId() { Controller controller = getUtil().getKernel().getController(); StringBuffer buffer = new StringBuffer(); buffer.append(controller.getClass().getSimpleName()); buffer.append("[").append(System.identityHashCode(controller)).append("]"); return buffer.toString(); } public void testPlainAliasCorrectOrder() throws Throwable { buildMetaData(); ControllerContext context1 = assertInstall(0, "OriginalBean"); ControllerContext context2 = getAlias("MyAlias"); assertContext("MyAlias_Alias_" + getControllerId()); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); assertEquals(ControllerState.INSTALLED, context2.getState()); ControllerContext alias = assertContext("MyAlias"); assertEquals(alias, context1); } public void testPlainAliasWrongOrder() throws Throwable { buildMetaData(); ControllerContext context1 = getAlias("MyAlias"); assertNull(context1); checkDirectAlias(); ControllerContext context2 = assertInstall(0, "OriginalBean"); context1 = assertContext("MyAlias"); assertEquals(ControllerState.INSTALLED, context1.getState()); getDirectAlias(ControllerState.INSTALLED); SimpleBean bean1 = (SimpleBean) context2.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); ControllerContext alias = assertContext("MyAlias"); assertEquals(alias, context1); } protected void checkDirectAlias() throws Throwable { getDirectAlias(ControllerState.START).getState(); } protected ControllerContext getDirectAlias(ControllerState state) throws Throwable { return assertContext("MyAlias_Alias_" + getControllerId(), state); } public void testPlainAliasReinstall() throws Throwable { buildMetaData(); ControllerContext context1 = assertInstall(0, "OriginalBean"); ControllerContext context2 = getAlias("MyAlias"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); assertEquals(ControllerState.INSTALLED, context2.getState()); ControllerContext alias = assertContext("MyAlias"); assertEquals(alias, context1); ControllerContext directAlias = assertContext("MyAlias_Alias_" + getControllerId()); assertEquals(ControllerState.INSTALLED, directAlias.getState()); assertUninstall("OriginalBean"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.ERROR, alias.getState()); assertEquals(getDirectAliasUnistallState(), directAlias.getState()); assertNull(getUtil().getContext("OriginalBean")); assertNull(getUtil().getContext("MyAlias")); context1 = assertInstall(0, "OriginalBean"); directAlias = assertContext("MyAlias_Alias_" + getControllerId()); assertEquals(ControllerState.INSTALLED, directAlias.getState()); assertEquals(context1, assertContext("MyAlias")); assertUninstall("MyAlias_Alias_" + getControllerId()); assertEquals(ControllerState.ERROR, directAlias.getState()); assertEquals(ControllerState.INSTALLED, context1.getState()); assertNull(getUtil().getContext("MyAlias")); checkLastSimpleAliasInstall(context1); } protected ControllerState getDirectAliasUnistallState() { return ControllerState.START; } protected void checkLastSimpleAliasInstall(ControllerContext context) throws Throwable { installAlias(); assertEquals(context, assertContext("MyAlias")); } protected void buildMetaData() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("OriginalBean", SimpleBeanImpl.class.getName()); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); setBeanMetaDatas(new BeanMetaData[]{metaData1}); } protected void installAlias() throws Throwable { Controller controller = getUtil().getKernel().getController(); controller.addAlias("MyAlias", "OriginalBean"); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryFieldPropertyDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000473710771262000033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.dependency.support.SimplerBeanImpl; /** * Property Field Dependency Test Case. * * @author Ales Justin */ public class GenericBeanFactoryFieldPropertyDependencyTestCase extends GenericBeanFactoryPropertyDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryFieldPropertyDependencyTestCase.class); } public GenericBeanFactoryFieldPropertyDependencyTestCase(String name) throws Throwable { super(name); } protected GenericBeanFactoryMetaData createBeanFactory() { GenericBeanFactoryMetaData beanFactoryMetaData = new GenericBeanFactoryMetaData("Name2", SimplerBeanImpl.class.getName()); beanFactoryMetaData.setAccessMode(BeanAccessMode.FIELDS); return beanFactoryMetaData; } /** * Default setup with security manager disabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = false; return delegate; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainAliasXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000451110656042363033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.net.URL; import java.util.Set; import junit.framework.Test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.dependency.spi.Controller; import org.jboss.beans.metadata.spi.NamedAliasMetaData; /** * Plain alias tests. * * @author Ales Justin */ public class PlainAliasXMLTestCase extends PlainAliasTestCase { public PlainAliasXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(PlainAliasXMLTestCase.class); } protected void installAlias() throws Throwable { String url = getClass().getSimpleName() + "_Alias.xml"; URL resource = getResource(url); if (resource == null) throw new IllegalArgumentException("Null resource: " + url); KernelDeployment deployment = getUtil().deploy(resource); Set aliases = deployment.getAliases(); if (aliases != null && aliases.isEmpty() == false) { Controller controller = getUtil().getKernel().getController(); for (NamedAliasMetaData namd : aliases) { controller.addAlias(namd.getAliasValue(), namd.getName()); } } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/BeanValidatorBridgeTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000615011216157032033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.validation.basic.BasicKernelBeanValidator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.validation.KernelBeanValidator; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.dependency.support.BVBTester; import org.jboss.test.kernel.dependency.support.MockBeanValidatorBridge; /** * BVB test. * * @author Ales Justin */ public class BeanValidatorBridgeTestCase extends AbstractKernelTest { public BeanValidatorBridgeTestCase(String name) { super(name); } public static Test suite() { return suite(BeanValidatorBridgeTestCase.class); } public void testBVBLookup() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); KernelBeanValidator validator = kernel.getValidator(); BasicKernelBeanValidator bkbv = assertInstanceOf(validator, BasicKernelBeanValidator.class); bkbv.setDisabled(false); try { MockBeanValidatorBridge bridge = new MockBeanValidatorBridge(); controller.install(new AbstractBeanMetaData("bvb", MockBeanValidatorBridge.class.getName()), bridge); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("tester", BVBTester.class.getName()); builder.addPropertyMetaData("something", 123); builder.addInstall("invokeSomething", Object.class.getName(), "123"); controller.install(builder.getBeanMetaData()); assertNotNull(bridge.getJoinpoint()); assertInstanceOf(bridge.getTarget(), BVBTester.class); assertEquals("something", bridge.getProperty()); assertEquals("invokeSomething", bridge.getMethod()); } finally { bkbv.setDisabled(true); } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DuplicateAliasAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000373511032416742033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.deployment.support.AnnSimpleBeanImpl; /** * Duplicate alias tests. * * @author Ales Justin */ public class DuplicateAliasAnnotationTestCase extends DuplicateAliasTestCase { public DuplicateAliasAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(DuplicateAliasAnnotationTestCase.class); } protected void buildMetaData() throws Throwable { BeanMetaData bmd1 = new AbstractBeanMetaData("OriginalBean", AnnSimpleBeanImpl.class.getName()); BeanMetaData bmd2 = new AbstractBeanMetaData("DuplicateBean", AnnSimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[]{bmd1, bmd2}); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/NestedPropertyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001351510756342051033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Collections; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.test.kernel.dependency.support.NestedBean; /** * Nested property tests. * * @author Ales Justin */ public class NestedPropertyTestCase extends OldAbstractKernelDependencyTest { public NestedPropertyTestCase(String name) throws Throwable { super(name); } public NestedPropertyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(NestedPropertyTestCase.class); } public void testNestedSet() throws Throwable { buildSetMetaData(); ControllerContext context = assertInstall(0, "NestedBean"); Object target = context.getTarget(); assertNotNull(target); assertInstanceOf(target, NestedBean.class); NestedBean root = (NestedBean)target; NestedBean lev1 = root.getBean(); assertNotNull(lev1); NestedBean lev2 = lev1.getBean(); assertNotNull(lev2); assertEquals("String12", lev2.getString()); } public void testNestedInject() throws Throwable { buildInjectMetaData(); ControllerContext context = assertInstall(1, "NestedBean"); Object target = context.getTarget(); assertNotNull(target); assertInstanceOf(target, NestedBean.class); NestedBean root = (NestedBean)target; NestedBean lev1 = root.getBean(); assertNotNull(lev1); NestedBean lev2 = lev1.getBean(); assertNotNull(lev2); assertEquals("String1234", lev2.getString()); ControllerContext injecteeCC = assertInstall(0, "InjecteeBean"); Object injectee = injecteeCC.getTarget(); assertNotNull(injectee); assertInstanceOf(injectee, NestedBean.class); NestedBean injecteeBean = (NestedBean)injectee; assertEquals("String1234", injecteeBean.getString()); } protected void buildSetMetaData() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("NestedBean", NestedBean.class.getName()); AbstractConstructorMetaData constructor1 = new AbstractConstructorMetaData(); ParameterMetaData parameter1 = new AbstractParameterMetaData(int.class.getName(), 5); constructor1.setParameters(Collections.singletonList(parameter1)); metaData1.setConstructor(constructor1); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("bean.bean.string", "String12")); metaData1.setProperties(attributes1); setBeanMetaDatas(new BeanMetaData[]{metaData1}); } protected void buildInjectMetaData() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("InjecteeBean", NestedBean.class.getName()); AbstractConstructorMetaData constructor1 = new AbstractConstructorMetaData(); ParameterMetaData parameter1 = new AbstractParameterMetaData(int.class.getName(), 5); constructor1.setParameters(Collections.singletonList(parameter1)); metaData1.setConstructor(constructor1); HashSet attributes1 = new HashSet(); AbstractDependencyValueMetaData injectedValue = new AbstractDependencyValueMetaData("NestedBean", "bean.bean.string"); AbstractPropertyMetaData propertyMetaData = new AbstractPropertyMetaData("string", injectedValue); attributes1.add(propertyMetaData); metaData1.setProperties(attributes1); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("NestedBean", NestedBean.class.getName()); AbstractConstructorMetaData constructor2 = new AbstractConstructorMetaData(); ParameterMetaData parameter2 = new AbstractParameterMetaData(int.class.getName(), 5); constructor2.setParameters(Collections.singletonList(parameter2)); metaData2.setConstructor(constructor1); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("bean.bean.string", "String1234")); metaData2.setProperties(attributes2); setBeanMetaDatas(new BeanMetaData[]{metaData1, metaData2}); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ConstructorClassLoaderTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000004004210446736533033316 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Non-kernel ClassLoader dependency test case. * * @author Scott.Stark@jboss.org * @version $Revision: 45764 $ */ public class ConstructorClassLoaderTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(ConstructorClassLoaderTestCase.class); } public ConstructorClassLoaderTestCase(String name) throws Throwable { super(name); } public ConstructorClassLoaderTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testConstructorClassLoaderCorrectOrder() throws Throwable { constructorClassLoaderCorrectOrder(); assertInstall(3, "URL"); ControllerContext clCtx = assertInstall(0, "VFSClassLoader"); ControllerContext bean1Ctx = assertInstall(1, "VFSBean1"); ControllerContext bean2Ctx = assertInstall(2, "VFSBean2"); Object clTarget = clCtx.getTarget(); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", clTarget.getClass().getName()); ClassLoader cl0 = clTarget.getClass().getClassLoader(); assertNotSame("org.jboss.test.classloading.vfs.VFSClassLoader", cl0.getClass().getName()); Object bean2 = bean2Ctx.getTarget(); ClassLoader cl2 = bean2.getClass().getClassLoader(); assertEquals(clTarget, cl2); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl2.getClass().getName()); Object bean1 = bean1Ctx.getTarget(); ClassLoader cl1 = bean1.getClass().getClassLoader(); assertEquals(clTarget, cl1); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl1.getClass().getName()); } public void constructorClassLoaderCorrectOrder() throws Throwable { AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("URL", "java.net.URL"); AbstractConstructorMetaData cmd3 = new AbstractConstructorMetaData(); metaData3.setConstructor(cmd3); cmd3.setFactoryClass("org.jboss.test.classloading.vfs.ClassLoaderUtil"); cmd3.setFactoryMethod("getLocation"); AbstractParameterMetaData pmd3 = new AbstractParameterMetaData(getClass().getName()); ArrayList params3 = new ArrayList(); params3.add(pmd3); cmd3.setParameters(params3); AbstractDependencyValueMetaData url = new AbstractDependencyValueMetaData("URL"); AbstractBeanMetaData metaData0 = new AbstractBeanMetaData("VFSClassLoader", "org.jboss.test.classloading.vfs.VFSClassLoader"); AbstractConstructorMetaData clCMD = new AbstractConstructorMetaData(); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(url); AbstractParameterMetaData urls = new AbstractParameterMetaData(null, array); ArrayList constructor0 = new ArrayList(); constructor0.add(urls); clCMD.setParameters(constructor0); clCMD.setFactoryClass("org.jboss.test.classloading.vfs.VFSClassLoaderFactory"); clCMD.setFactoryMethod("newClassLoader"); metaData0.setConstructor(clCMD); AbstractDependencyValueMetaData vfsCL = new AbstractDependencyValueMetaData("VFSClassLoader"); String bean1Type = "org.jboss.test.kernel.dependency.classloader.SimpleBeanImpl"; AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("VFSBean1", bean1Type); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); metaData1.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("VFSBean2", "org.jboss.test.kernel.dependency.classloader.SimpleBeanWithConstructorClassLoaderImpl"); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); metaData2.setProperties(attributes2); metaData2.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); ArrayList constructor2 = new ArrayList(); String bean1Iface = "org.jboss.test.kernel.dependency.classloader.SimpleBean"; AbstractDependencyValueMetaData bean2Depends = new AbstractDependencyValueMetaData("VFSBean1"); AbstractParameterMetaData param = new AbstractParameterMetaData(bean1Iface, bean2Depends); constructor2.add(param); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); metaData2.setConstructor(cmd); cmd.setParameters(constructor2); setBeanMetaDatas(new BeanMetaData[] { metaData0, metaData1, metaData2, metaData3 }); } public void testConstructorClassLoaderWrongOrder() throws Throwable { constructorClassLoaderWrongOrder(); assertInstall(3, "URL"); ControllerContext bean1Ctx = assertInstall(1, "VFSBean1", ControllerState.NOT_INSTALLED); ControllerContext bean2Ctx = assertInstall(2, "VFSBean2", ControllerState.NOT_INSTALLED); ControllerContext clCtx = assertInstall(0, "VFSClassLoader"); assertEquals(ControllerState.INSTALLED, bean1Ctx.getState()); assertEquals(ControllerState.INSTALLED, bean2Ctx.getState()); Object clTarget = clCtx.getTarget(); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", clTarget.getClass().getName()); ClassLoader cl0 = clTarget.getClass().getClassLoader(); assertNotSame("org.jboss.test.classloading.vfs.VFSClassLoader", cl0.getClass().getName()); Object bean2 = bean2Ctx.getTarget(); ClassLoader cl2 = bean2.getClass().getClassLoader(); assertEquals(clTarget, cl2); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl2.getClass().getName()); Object bean1 = bean1Ctx.getTarget(); ClassLoader cl1 = bean1.getClass().getClassLoader(); assertEquals(clTarget, cl1); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl1.getClass().getName()); } public void constructorClassLoaderWrongOrder() throws Throwable { AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("URL", "java.net.URL"); AbstractConstructorMetaData cmd3 = new AbstractConstructorMetaData(); metaData3.setConstructor(cmd3); cmd3.setFactoryClass("org.jboss.test.classloading.vfs.ClassLoaderUtil"); cmd3.setFactoryMethod("getLocation"); AbstractParameterMetaData pmd3 = new AbstractParameterMetaData(getClass().getName()); ArrayList params3 = new ArrayList(); params3.add(pmd3); cmd3.setParameters(params3); AbstractDependencyValueMetaData url = new AbstractDependencyValueMetaData("URL"); AbstractBeanMetaData metaData0 = new AbstractBeanMetaData("VFSClassLoader", "org.jboss.test.classloading.vfs.VFSClassLoader"); AbstractConstructorMetaData clCMD = new AbstractConstructorMetaData(); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(url); AbstractParameterMetaData urls = new AbstractParameterMetaData(null, array); ArrayList constructor0 = new ArrayList(); constructor0.add(urls); clCMD.setParameters(constructor0); clCMD.setFactoryClass("org.jboss.test.classloading.vfs.VFSClassLoaderFactory"); clCMD.setFactoryMethod("newClassLoader"); metaData0.setConstructor(clCMD); AbstractDependencyValueMetaData vfsCL = new AbstractDependencyValueMetaData("VFSClassLoader"); String bean1Type = "org.jboss.test.kernel.dependency.classloader.SimpleBeanImpl"; AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("VFSBean1", bean1Type); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); metaData1.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("VFSBean2", "org.jboss.test.kernel.dependency.classloader.SimpleBeanWithConstructorClassLoaderImpl"); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); metaData2.setProperties(attributes2); metaData2.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); ArrayList constructor2 = new ArrayList(); String bean1Iface = "org.jboss.test.kernel.dependency.classloader.SimpleBean"; AbstractDependencyValueMetaData bean2Depends = new AbstractDependencyValueMetaData("VFSBean1"); AbstractParameterMetaData param = new AbstractParameterMetaData(bean1Iface, bean2Depends); constructor2.add(param); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); metaData2.setConstructor(cmd); cmd.setParameters(constructor2); setBeanMetaDatas(new BeanMetaData[] { metaData0, metaData1, metaData2, metaData3 }); } public void testConstructorClassLoaderReinstall() throws Throwable { constructorClassLoaderReinstall(); assertInstall(3, "URL"); ControllerContext clCtx = assertInstall(0, "VFSClassLoader"); ControllerContext bean1Ctx = assertInstall(1, "VFSBean1"); ControllerContext bean2Ctx = assertInstall(2, "VFSBean2"); Object clTarget = clCtx.getTarget(); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", clTarget.getClass().getName()); ClassLoader cl0 = clTarget.getClass().getClassLoader(); assertNotSame("org.jboss.test.classloading.vfs.VFSClassLoader", cl0.getClass().getName()); Object bean2 = bean2Ctx.getTarget(); ClassLoader cl2 = bean2.getClass().getClassLoader(); assertEquals(clTarget, cl2); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl2.getClass().getName()); Object bean1 = bean1Ctx.getTarget(); ClassLoader cl1 = bean1.getClass().getClassLoader(); assertEquals(clTarget, cl1); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl1.getClass().getName()); assertUninstall("VFSClassLoader"); assertEquals(ControllerState.ERROR, clCtx.getState()); assertEquals(ControllerState.NOT_INSTALLED, bean1Ctx.getState()); assertEquals(ControllerState.NOT_INSTALLED, bean2Ctx.getState()); clCtx = assertInstall(0, "VFSClassLoader"); assertEquals(ControllerState.INSTALLED, bean1Ctx.getState()); assertEquals(ControllerState.INSTALLED, bean2Ctx.getState()); clTarget = clCtx.getTarget(); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", clTarget.getClass().getName()); cl0 = clTarget.getClass().getClassLoader(); assertNotSame("org.jboss.test.classloading.vfs.VFSClassLoader", cl0.getClass().getName()); bean2 = bean2Ctx.getTarget(); cl2 = bean2.getClass().getClassLoader(); assertEquals(clTarget, cl2); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl2.getClass().getName()); bean1 = bean1Ctx.getTarget(); cl1 = bean1.getClass().getClassLoader(); assertEquals(clTarget, cl1); assertEquals("org.jboss.test.classloading.vfs.VFSClassLoader", cl1.getClass().getName()); } public void constructorClassLoaderReinstall() throws Throwable { AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("URL", "java.net.URL"); AbstractConstructorMetaData cmd3 = new AbstractConstructorMetaData(); metaData3.setConstructor(cmd3); cmd3.setFactoryClass("org.jboss.test.classloading.vfs.ClassLoaderUtil"); cmd3.setFactoryMethod("getLocation"); AbstractParameterMetaData pmd3 = new AbstractParameterMetaData(getClass().getName()); ArrayList params3 = new ArrayList(); params3.add(pmd3); cmd3.setParameters(params3); AbstractDependencyValueMetaData url = new AbstractDependencyValueMetaData("URL"); AbstractBeanMetaData metaData0 = new AbstractBeanMetaData("VFSClassLoader", "org.jboss.test.classloading.vfs.VFSClassLoader"); AbstractConstructorMetaData clCMD = new AbstractConstructorMetaData(); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(url); AbstractParameterMetaData urls = new AbstractParameterMetaData(null, array); ArrayList constructor0 = new ArrayList(); constructor0.add(urls); clCMD.setParameters(constructor0); clCMD.setFactoryClass("org.jboss.test.classloading.vfs.VFSClassLoaderFactory"); clCMD.setFactoryMethod("newClassLoader"); metaData0.setConstructor(clCMD); AbstractDependencyValueMetaData vfsCL = new AbstractDependencyValueMetaData("VFSClassLoader"); String bean1Type = "org.jboss.test.kernel.dependency.classloader.SimpleBeanImpl"; AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("VFSBean1", bean1Type); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); metaData1.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("VFSBean2", "org.jboss.test.kernel.dependency.classloader.SimpleBeanWithConstructorClassLoaderImpl"); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); metaData2.setProperties(attributes2); metaData2.setClassLoader(new AbstractClassLoaderMetaData(vfsCL)); ArrayList constructor2 = new ArrayList(); String bean1Iface = "org.jboss.test.kernel.dependency.classloader.SimpleBean"; AbstractDependencyValueMetaData bean2Depends = new AbstractDependencyValueMetaData("VFSBean1"); AbstractParameterMetaData param = new AbstractParameterMetaData(bean1Iface, bean2Depends); constructor2.add(param); AbstractConstructorMetaData cmd = new AbstractConstructorMetaData(); metaData2.setConstructor(cmd); cmd.setParameters(constructor2); setBeanMetaDatas(new BeanMetaData[] { metaData0, metaData1, metaData2, metaData3 }); } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainAliasAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000456311032213730033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.AliasSimpleBeanImpl; /** * Plain alias tests. * * @author Ales Justin */ public class PlainAliasAnnotationTestCase extends PlainAliasTestCase { public PlainAliasAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(PlainAliasAnnotationTestCase.class); } protected void checkLastSimpleAliasInstall(ControllerContext context) throws Throwable { // do nothing } protected void buildMetaData() throws Throwable { setBeanMetaDatas(new BeanMetaData[]{new AbstractBeanMetaData("OriginalBean", AliasSimpleBeanImpl.class.getName())}); } protected void checkDirectAlias() throws Throwable { // not yet registered } protected void installAlias() throws Throwable { // do nothing should be part of @annotations } protected ControllerState getDirectAliasUnistallState() { return ControllerState.ERROR; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000402010654624420033302 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithKernelControllerContextAware; /** * KernelControllerContextAware Test Case. * * @author Ales Justin */ public class KernelControllerContextAwareAnnotationTestCase extends KernelControllerContextAwareTestCase { public static Test suite() { return suite(KernelControllerContextAwareAnnotationTestCase.class); } public KernelControllerContextAwareAnnotationTestCase(String name) throws Throwable { super(name); } public void kernelControllerContextAware() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", AnnotatedSimpleBeanWithKernelControllerContextAware.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1 }); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000302610364450530033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * GenericBeanFactory Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40435 $ */ public class GenericBeanFactoryPlainDependencyXMLTestCase extends GenericBeanFactoryPlainDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryPlainDependencyXMLTestCase.class); } public GenericBeanFactoryPlainDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DemandDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000456510654125045033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.dependency.support.DemandSimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SupplyPlainDependecySimpleBeanImpl; import org.jboss.dependency.spi.ControllerState; /** * Demand Dependency Test Case. * * @author Ales Justin */ public class DemandDependencyAnnotationTestCase extends DemandDependencyTestCase { public static Test suite() { return suite(DemandDependencyAnnotationTestCase.class); } public DemandDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected ControllerState getWhenRequiredState() { return ControllerState.DESCRIBED; } protected void buildMetaData() { BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", SupplyPlainDependecySimpleBeanImpl.class.getName()); BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", DemandSimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() }); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OptionalXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000265511066446716033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Optional tests. * * @author Ales Justin */ public class OptionalXMLTestCase extends OptionalTestCase { public OptionalXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(OptionalXMLTestCase.class); } }././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackCollectionFields2TestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000643010767766613033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.kernel.dependency.support.SimpleFieldsBeanRepository2; import org.jboss.test.AbstractTestDelegate; /** * Callback collection tests. * * @author Ales Justin */ public class CallbackCollectionFields2TestCase extends CallbackTestCase { public CallbackCollectionFields2TestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(CallbackCollectionFields2TestCase.class); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { AbstractBeanMetaData repository = new AbstractBeanMetaData("Name1", SimpleFieldsBeanRepository2.class.getName()); repository.setAccessMode(BeanAccessMode.ALL); List installs = new ArrayList(); repository.setInstallCallbacks(installs); InstallCallbackMetaData install = new InstallCallbackMetaData(); install.setProperty("beans"); if (cardinality != null) install.setCardinality(cardinality); installs.add(install); List unstalls = new ArrayList(); repository.setUninstallCallbacks(unstalls); UninstallCallbackMetaData uninstall = new UninstallCallbackMetaData(); uninstall.setProperty("beans"); unstalls.add(uninstall); return repository; } /** * Default setup with security manager disabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = false; return delegate; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000377410756342051033321 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.kernel.dependency.support.CallbackCardinalitySimpleBeanRepository; import org.jboss.test.kernel.dependency.support.CallbackSimpleBeanRepository; /** * Callback tests. * * @author Ales Justin */ public class CallbackAnnotationTestCase extends CallbackTestCase { public CallbackAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(CallbackAnnotationTestCase.class); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { Class clazz = cardinality != null ? CallbackCardinalitySimpleBeanRepository.class : CallbackSimpleBeanRepository.class; return new AbstractBeanMetaData("Name1", clazz.getName()); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallSelfDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000273310366730626033321 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 40727 $ */ public class InstallSelfDependencyXMLTestCase extends InstallSelfDependencyTestCase { public static Test suite() { return suite(InstallSelfDependencyXMLTestCase.class); } public InstallSelfDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OldAbstractKernelDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001372610771262000033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.net.URL; import java.util.Set; import java.util.HashSet; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.dependency.support.TestUtil; import org.jboss.util.Classes; /** * An abstract kernel config test. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class OldAbstractKernelDependencyTest extends AbstractKernelTest { /** The test utility */ private TestUtil util; /** Whether this is an xml test */ private boolean xmltest; /** The BeanMetaDatas */ private BeanMetaData[] beanMetaDatas; public OldAbstractKernelDependencyTest(String name) throws Throwable { this(name, false); } public OldAbstractKernelDependencyTest(String name, boolean xmltest) throws Throwable { super(name); this.xmltest = xmltest; } protected void setUp() throws Exception { super.setUp(); try { Kernel kernel = bootstrap(); this.util = new TestUtil(kernel, this); } catch (Exception e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } protected TestUtil getUtil() { return util; } protected ControllerContext install(int number, String name) throws Throwable { if (xmltest) { deploy(number); return util.getContext(name); } else { return util.install(beanMetaDatas[number]); } } protected void uninstall(String name) throws Throwable { util.uninstall(name); } protected ControllerContext assertInstall(int number, String name) throws Throwable { ControllerContext result = assertInstall(number, name, ControllerState.INSTALLED); assertContext(name); return result; } protected ControllerContext assertInstall(int number, String name, ControllerState expected) throws Throwable { ControllerContext context = install(number, name); assertNotNull(context); assertEquals(expected, context.getState()); return context; } protected ControllerContext assertContext(String name) throws Throwable { return assertContext(name, ControllerState.INSTALLED); } protected ControllerContext assertContext(String name, ControllerState expected) throws Throwable { ControllerContext context = util.getContext(name); assertNotNull("Expected " + name + " state=" + expected.toShortString(), context); assertEquals(expected, context.getState()); return context; } protected void assertUninstall(String name) throws Throwable { uninstall(name); assertNotInstalled(name); ControllerContext context = util.getContext(name); assertNull(context); } protected void assertNotInstalled(String name) throws Throwable { if (util.getInstalledContext(name) != null) fail("Should not be installed"); } protected void setBeanMetaDatas(BeanMetaData[] beanMetaDatas) { if (xmltest) return; this.beanMetaDatas = beanMetaDatas; } protected void addBeanProperty(GenericBeanFactoryMetaData factory, PropertyMetaData property) { Set propertys = factory.getProperties(); if (propertys == null) { propertys = new HashSet(); factory.setProperties(propertys); } propertys.add(property); } protected BeanMetaData getBeanMetaData(GenericBeanFactoryMetaData factory) { List beans = factory.getBeans(); assertNotNull(beans); assertEquals(1, beans.size()); return beans.get(0); } protected String createName(int number) { String packageName = Classes.getPackageName(getClass()); packageName = packageName.replace('.', '/'); return "/xml-test/" + packageName + '/' + getName() + number + ".xml"; } protected void deploy(int number) throws Throwable { String name = createName(number); getLog().debug("Using " + name); URL url = getResource(name); if (url == null) throw new RuntimeException("Resource not found: " + name); getLog().debug("url=" + url); util.deploy(url); } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.beans"); //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.joinpoint.plugins.config"); //enableTrace("org.jboss.kernel.plugins.config"); //enableTrace("org.jboss.kernel.plugins.dependency"); //if (xmltest) // enableTrace("org.jboss.xb"); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DuplicateAliasTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000563511032416742033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Collections; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.deployment.support.SimpleBeanImpl; /** * Duplicate alias tests. * * @author Ales Justin */ public class DuplicateAliasTestCase extends AbstractKernelDependencyTest { public DuplicateAliasTestCase(String name) throws Throwable { super(name); } protected DuplicateAliasTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(DuplicateAliasTestCase.class); } public void testDuplicate() throws Throwable { buildMetaData(); assertInstall(0, "OriginalBean"); try { assertInstall(1, "DuplicateBean", ControllerState.ERROR); } catch (Throwable t) { assertInstanceOf(t, getFailureCause()); } } protected Class getFailureCause() { return IllegalStateException.class; } protected void buildMetaData() throws Throwable { Object alias = "alias"; AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("OriginalBean", SimpleBeanImpl.class.getName()); metaData1.setAliases(Collections.singleton(alias)); addAnnotation(metaData1); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("DuplicateBean", SimpleBeanImpl.class.getName()); metaData2.setAliases(Collections.singleton(alias)); addAnnotation(metaData2); setBeanMetaDatas(new BeanMetaData[]{metaData1, metaData2}); } protected void addAnnotation(AbstractBeanMetaData bmd) { // noop } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DemandDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001517010654125045033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Demand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class DemandDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(DemandDependencyTestCase.class); } public DemandDependencyTestCase(String name) throws Throwable { super(name); } public DemandDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testDemandDependencyCorrectOrder() throws Throwable { demandDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testDemandDependencyWrongOrder() throws Throwable { demandDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", getWhenRequiredState()); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testDemandDependencyReinstall() throws Throwable { demandDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); SimpleBean bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(getWhenRequiredState(), context2.getState()); assertNotInstalled("Name2"); assertContext("Name2", getWhenRequiredState()); context1 = assertInstall(0, "Name1"); assertNotNull(context1); assertEquals(ControllerState.INSTALLED, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertUninstall("Name2"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(ControllerState.ERROR, context2.getState()); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); bean1 = (SimpleBean) context1.getTarget(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); bean2 = (SimpleBean) context2.getTarget(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyReinstall() throws Throwable { buildMetaData(); } protected ControllerState getWhenRequiredState() { return ControllerState.PRE_INSTALL; } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName()); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); HashSet supplies = new HashSet(); supplies.add(new AbstractSupplyMetaData("WhatIWant")); metaData1.setSupplies(supplies); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()); HashSet attributes2 = new HashSet(); attributes2.add(new AbstractPropertyMetaData("string", "String2")); metaData2.setProperties(attributes2); HashSet demands = new HashSet(); demands.add(new AbstractDemandMetaData("WhatIWant")); metaData2.setDemands(demands); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OptionalAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000335211066446716033321 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.test.kernel.dependency.support.SimpleBeanDelegateAnnotated; /** * Optional tests. * * @author Ales Justin */ public class OptionalAnnotationTestCase extends OptionalTestCase { public OptionalAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(OptionalAnnotationTestCase.class); } protected AbstractBeanMetaData buildRepository() { return new AbstractBeanMetaData("Name1", SimpleBeanDelegateAnnotated.class.getName()); } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000274411032416742033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Duplicate alias tests. * * @author Ales Justin */ public class ScopedDuplicateAliasXMLTestCase extends ScopedDuplicateAliasTestCase { public ScopedDuplicateAliasXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(ScopedDuplicateAliasXMLTestCase.class); } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000002531110767766613033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.List; import java.util.ArrayList; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.BeanRepository; import org.jboss.test.kernel.dependency.support.SimpleBeanRepository; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Callback tests. * * @author Ales Justin */ public class CallbackTestCase extends OldAbstractKernelDependencyTest { public CallbackTestCase(String name) throws Throwable { super(name); } public CallbackTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(CallbackTestCase.class); } public void testCallbackCorrectOrder() throws Throwable { callbackCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertEmpty(repository.getBeans()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); assertFalse(repository.getBeans().isEmpty()); assertEquals(1, repository.getBeans().size()); assertTrue(bean == repository.getBeans().get(0)); } protected void callbackCorrectOrder() throws Throwable { buildMetaData(buildRepository()); } public void testCallbackWrongOrder() throws Throwable { callbackWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); ControllerContext context1 = assertInstall(0, "Name1"); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); List beans = repository.getBeans(); assertFalse(beans.isEmpty()); assertEquals(1, beans.size()); assertTrue(bean == beans.get(0)); } protected void callbackWrongOrder() throws Throwable { buildMetaData(buildRepository()); } public void testCallbackReinstall() throws Throwable { callbackReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertEmpty(repository.getBeans()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); assertFalse(repository.getBeans().isEmpty()); assertEquals(1, repository.getBeans().size()); assertTrue(bean == repository.getBeans().get(0)); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEmpty(repository.getBeans()); context1 = assertInstall(0, "Name1"); repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertFalse(repository.getBeans().isEmpty()); assertEquals(1, repository.getBeans().size()); assertTrue(bean == repository.getBeans().get(0)); assertUninstall("Name2"); assertEquals(ControllerState.ERROR, context2.getState()); assertEmpty(repository.getBeans()); } protected void callbackReinstall() throws Throwable { buildMetaData(buildRepository()); } public void testCardinalityCallbackCorrectOrder() throws Throwable { callbackCardinalityCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.START); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertEmpty(repository.getBeans()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean)context2.getTarget(); assertNotNull(bean1); assertEmpty(repository.getBeans()); ControllerContext context3 = assertInstall(2, "Name3"); SimpleBean bean2 = (SimpleBean)context3.getTarget(); assertNotNull(bean2); assertEquals(ControllerState.INSTALLED, context1.getState()); assertFalse(repository.getBeans().isEmpty()); assertEquals(2, repository.getBeans().size()); boolean first = bean1 == repository.getBeans().get(0); if (first) assertTrue(bean2 == repository.getBeans().get(1)); else assertTrue(bean2 == repository.getBeans().get(0)); } protected void callbackCardinalityCorrectOrder() throws Throwable { AbstractBeanMetaData repository = buildRepository(Cardinality.createUnlimitedCardinality(2)); buildMetaData(repository); } public void testCardinalityCallbackWrongOrder() throws Throwable { callbackCardinalityWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean)context2.getTarget(); assertNotNull(bean1); ControllerContext context3 = assertInstall(2, "Name3"); SimpleBean bean2 = (SimpleBean)context3.getTarget(); ControllerContext context1 = assertInstall(0, "Name1"); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertFalse(repository.getBeans().isEmpty()); assertEquals(2, repository.getBeans().size()); boolean first = bean1 == repository.getBeans().get(0); if (first) assertTrue(bean2 == repository.getBeans().get(1)); else assertTrue(bean2 == repository.getBeans().get(0)); } protected void callbackCardinalityWrongOrder() throws Throwable { AbstractBeanMetaData repository = buildRepository(Cardinality.createUnlimitedCardinality(2)); buildMetaData(repository); } public void testCardinalityCallbackReinstall() throws Throwable { callbackCardinalityReinstall(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.START); BeanRepository repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertEmpty(repository.getBeans()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean1 = (SimpleBean)context2.getTarget(); assertNotNull(bean1); assertEmpty(repository.getBeans()); ControllerContext context3 = assertInstall(2, "Name3"); SimpleBean bean2 = (SimpleBean)context3.getTarget(); assertNotNull(bean2); assertEquals(ControllerState.INSTALLED, context1.getState()); assertFalse(repository.getBeans().isEmpty()); assertEquals(2, repository.getBeans().size()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEmpty(repository.getBeans()); context1 = assertInstall(0, "Name1"); repository = (BeanRepository)context1.getTarget(); assertNotNull(repository); assertFalse(repository.getBeans().isEmpty()); assertEquals(2, repository.getBeans().size()); assertUninstall("Name2"); assertEquals(ControllerState.ERROR, context2.getState()); assertEquals(ControllerState.START, context1.getState()); assertEmpty(repository.getBeans()); assertInstall(1, "Name2"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(2, repository.getBeans().size()); assertUninstall("Name3"); assertEquals(ControllerState.ERROR, context3.getState()); assertEquals(ControllerState.START, context1.getState()); assertEmpty(repository.getBeans()); } protected void callbackCardinalityReinstall() throws Throwable { AbstractBeanMetaData repository = buildRepository(Cardinality.createUnlimitedCardinality(2)); buildMetaData(repository); } protected void buildMetaData(BeanMetaData repository) { setBeanMetaDatas(new BeanMetaData[]{ repository, new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()), new AbstractBeanMetaData("Name3", SimpleBeanImpl.class.getName()) }); } protected AbstractBeanMetaData buildRepository() { return buildRepository(null); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { AbstractBeanMetaData repository = new AbstractBeanMetaData("Name1", SimpleBeanRepository.class.getName()); List installs = new ArrayList(); repository.setInstallCallbacks(installs); InstallCallbackMetaData install = new InstallCallbackMetaData(); install.setMethodName("addSimpleBean"); if (cardinality != null) install.setCardinality(cardinality); installs.add(install); List unstalls = new ArrayList(); repository.setUninstallCallbacks(unstalls); UninstallCallbackMetaData uninstall = new UninstallCallbackMetaData(); uninstall.setMethodName("removeSimpleBean"); unstalls.add(uninstall); return repository; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/OptionalTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001227011066446716033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.api.model.InjectOption; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanDelegate; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Optional tests. * * @author Ales Justin */ public class OptionalTestCase extends OldAbstractKernelDependencyTest { public OptionalTestCase(String name) throws Throwable { super(name); } public OptionalTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public static Test suite() { return suite(OptionalTestCase.class); } public void testOptionalCorrectOrder() throws Throwable { optionalCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); SimpleBeanDelegate repository = (SimpleBeanDelegate)context1.getTarget(); assertNotNull(repository); assertNull(repository.getDelegate()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); // still null assertNull(repository.getDelegate()); } protected void optionalCorrectOrder() throws Throwable { buildMetaData(buildRepository()); } public void testOptionalWrongOrder() throws Throwable { optionalWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); ControllerContext context1 = assertInstall(0, "Name1"); SimpleBeanDelegate repository = (SimpleBeanDelegate)context1.getTarget(); assertNotNull(repository); assertSame(bean, repository.getDelegate()); } protected void optionalWrongOrder() throws Throwable { buildMetaData(buildRepository()); } public void testOptionalReinstall() throws Throwable { optionalReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); SimpleBeanDelegate repository = (SimpleBeanDelegate)context1.getTarget(); assertNotNull(repository); assertNull(repository.getDelegate()); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBean bean = (SimpleBean)context2.getTarget(); assertNotNull(bean); // still null assertNull(repository.getDelegate()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); context1 = assertInstall(0, "Name1"); repository = (SimpleBeanDelegate)context1.getTarget(); assertNotNull(repository); assertSame(bean, repository.getDelegate()); assertUninstall("Name2"); assertEquals(ControllerState.ERROR, context2.getState()); // should be unwinded assertEquals(ControllerState.INSTANTIATED, context1.getState()); assertNull(repository.getDelegate()); } protected void optionalReinstall() throws Throwable { buildMetaData(buildRepository()); } protected void buildMetaData(BeanMetaData repository) { setBeanMetaDatas(new BeanMetaData[]{ repository, new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName()), }); } protected AbstractBeanMetaData buildRepository() { AbstractBeanMetaData repository = new AbstractBeanMetaData("Name1", SimpleBeanDelegate.class.getName()); AbstractInjectionValueMetaData vmd = new AbstractInjectionValueMetaData("Name2"); vmd.setInjectionOption(InjectOption.OPTIONAL); repository.addProperty(new AbstractPropertyMetaData("delegate", vmd)); return repository; } }././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001623310771262000033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Demand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryDemandDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryDemandDependencyTestCase.class); } public GenericBeanFactoryDemandDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryDemandDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryDemandDependencyCorrectOrder() throws Throwable { demandDependencyCorrectOrder(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBean bean2 = (SimpleBean) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyCorrectOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryDemandDependencyWrongOrder() throws Throwable { demandDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.PRE_INSTALL); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBean bean2 = (SimpleBean) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyWrongOrder() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryDemandDependencyReinstall() throws Throwable { demandDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBean bean2 = (SimpleBean) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.PRE_INSTALL, context2.getState()); assertNotInstalled("Name2"); assertContext("Name2", ControllerState.PRE_INSTALL); context1 = assertInstall(0, "Name1"); assertNotNull(context1); assertEquals(ControllerState.INSTALLED, context2.getState()); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBean) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertUninstall("Name2"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(ControllerState.ERROR, context2.getState()); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBean) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); } public void demandDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName()); addBeanProperty(metaData1, new AbstractPropertyMetaData("string", "String1")); HashSet supplies = new HashSet(); supplies.add(new AbstractSupplyMetaData("WhatIWant")); metaData1.setSupplies(supplies); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName()); addBeanProperty(metaData2, new AbstractPropertyMetaData("string", "String2")); HashSet demands = new HashSet(); demands.add(new AbstractDemandMetaData("WhatIWant")); metaData2.setDemands(demands); setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), getBeanMetaData(metaData2) }); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/InstallSelfDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001411710764340107033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.List; import java.util.Collections; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanInstallSelf; import org.jboss.test.kernel.dependency.support.SimpleBeanInstallsAware; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 70562 $ */ public class InstallSelfDependencyTestCase extends AbstractKernelDependencyTest { public static Test suite() { return suite(InstallSelfDependencyTestCase.class); } public InstallSelfDependencyTestCase(String name) throws Throwable { super(name); } public InstallSelfDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testInstallSelfDependencyCorrectOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context = assertInstall(0, "Name1"); SimpleBeanInstallSelf bean = (SimpleBeanInstallSelf) context.getTarget(); assertNotNull(bean); assertTrue(bean.getInstalled()); } public void testInstallSelfDependencyReinstall() throws Throwable { setupBeanMetaDatas(); ControllerContext context = assertInstall(0, "Name1"); SimpleBeanInstallSelf bean = (SimpleBeanInstallSelf) context.getTarget(); assertNotNull(bean); assertTrue(bean.getInstalled()); assertUninstall("Name1"); assertFalse(bean.getInstalled()); context = assertInstall(0, "Name1"); bean = (SimpleBeanInstallSelf) context.getTarget(); assertNotNull(bean); assertTrue(bean.getInstalled()); } public void testWhenRequiredInstalls() throws Throwable { setupBeanMetaDatas(); ControllerContext context2 = assertInstall(1, "Name2"); SimpleBeanInstallsAware bean = (SimpleBeanInstallsAware) context2.getTarget(); assertNotNull(bean); Set states = bean.getStates(); assertNotNull(states); assertEquals(4, states.size()); assertUninstall(context2.getName().toString()); assertEquals(1, states.size()); ControllerState state = states.iterator().next(); assertEquals(ControllerState.DESCRIBED, state); } protected void setupBeanMetaDatas() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanInstallSelf.class.getName()); ArrayList installs = new ArrayList(); AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setMethodName("install"); installs.add(install); metaData1.setInstalls(installs); ArrayList uninstalls = new ArrayList(); AbstractInstallMetaData uninstall = new AbstractInstallMetaData(); uninstall.setMethodName("uninstall"); uninstalls.add(uninstall); metaData1.setUninstalls(uninstalls); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanInstallsAware.class.getName()); ArrayList installs2 = new ArrayList(); addInstalls(ControllerState.INSTANTIATED, installs2, true); addInstalls(ControllerState.CONFIGURED, installs2, true); addInstalls(ControllerState.CREATE, installs2, true); addInstalls(ControllerState.START, installs2, true); metaData2.setInstalls(installs2); ArrayList uninstalls2 = new ArrayList(); addInstalls(ControllerState.INSTANTIATED, uninstalls2, false); addInstalls(ControllerState.CONFIGURED, uninstalls2, false); addInstalls(ControllerState.CREATE, uninstalls2, false); addInstalls(ControllerState.START, uninstalls2, false); metaData2.setUninstalls(uninstalls2); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } protected void addInstalls(ControllerState state, List installs, boolean add) { AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setState(state); install.setMethodName((add ? "add" : "remove") + state.getStateString()); AbstractInjectionValueMetaData injection = new AbstractInjectionValueMetaData(); injection.setFromContext(FromContext.STATE); ParameterMetaData paramater = new AbstractParameterMetaData(injection); install.setParameters(Collections.singletonList(paramater)); installs.add(install); } }././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryInstallDependencyXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000302310407477122033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 42504 $ */ public class GenericBeanFactoryInstallDependencyXMLTestCase extends GenericBeanFactoryInstallDependencyTestCase { public static Test suite() { return suite(GenericBeanFactoryInstallDependencyXMLTestCase.class); } public GenericBeanFactoryInstallDependencyXMLTestCase(String name) throws Throwable { super(name, true); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/FromContextAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001113610771262000033300 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.Set; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.deployment.support.NameAwareBean; import org.jboss.test.kernel.deployment.support.BeanNameAwareBean; import org.jboss.test.kernel.deployment.support.AliasesAwareBean; import org.jboss.test.kernel.deployment.support.MetaDataAwareBean; import org.jboss.test.kernel.deployment.support.BeanInfoAwareBean; import org.jboss.test.kernel.deployment.support.ScopeAwareBean; import org.jboss.test.kernel.deployment.support.ContextAwareBean; import org.jboss.test.kernel.deployment.support.OtherAwareBean; import org.jboss.test.kernel.deployment.support.StateAwareBean; import org.jboss.dependency.spi.ControllerContext; /** * @author Ales Justin */ public class FromContextAnnotationTestCase extends FromContextTestCase { public FromContextAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(FromContextAnnotationTestCase.class); } protected void checkAliases(Set aliases) throws Throwable { assertNull(aliases); ControllerContext c1 = assertContext("a1"); ControllerContext c2 = assertContext("a2"); ControllerContext c3 = assertContext("a3"); assertEquals(c1, c2); assertEquals(c2, c3); } protected void setBeanMetaDatas() throws Throwable { BeanMetaDataBuilder b1 = BeanMetaDataBuilderFactory.createBuilder("set_name_bean", BeanNameAwareBean.class.getName()); GenericBeanFactoryMetaData b2 = new GenericBeanFactoryMetaData("set_name_factory", NameAwareBean.class.getName()); AbstractInjectionValueMetaData v2 = new AbstractInjectionValueMetaData(); v2.setFromContext(FromContext.NAME); addBeanProperty(b2, new AbstractPropertyMetaData("name", v2)); BeanMetaDataBuilder b3 = BeanMetaDataBuilderFactory.createBuilder("aliases", AliasesAwareBean.class.getName()); BeanMetaDataBuilder b4 = BeanMetaDataBuilderFactory.createBuilder("metadata", MetaDataAwareBean.class.getName()); BeanMetaDataBuilder b5 = BeanMetaDataBuilderFactory.createBuilder("beaninfo", BeanInfoAwareBean.class.getName()); BeanMetaDataBuilder b6 = BeanMetaDataBuilderFactory.createBuilder("scopekey", ScopeAwareBean.class.getName()); BeanMetaDataBuilder b8 = BeanMetaDataBuilderFactory.createBuilder("other", OtherAwareBean.class.getName()); BeanMetaDataBuilder b9 = BeanMetaDataBuilderFactory.createBuilder("context", ContextAwareBean.class.getName()); BeanMetaDataBuilder b10 = BeanMetaDataBuilderFactory.createBuilder("state", StateAwareBean.class.getName()); setBeanMetaDatas(new BeanMetaData[] { b1.getBeanMetaData(), getBeanMetaData(b2), b3.getBeanMetaData(), b4.getBeanMetaData(), b5.getBeanMetaData(), b6.getBeanMetaData(), b8.getBeanMetaData(), b9.getBeanMetaData(), b10.getBeanMetaData(), } ); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/ScopedDuplicateAliasAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000400111032416742033276 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.deployment.support.ScopedAnnSimpleBeanImpl; /** * Duplicate alias tests. * * @author Ales Justin */ public class ScopedDuplicateAliasAnnotationTestCase extends DuplicateAliasTestCase { public ScopedDuplicateAliasAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(ScopedDuplicateAliasAnnotationTestCase.class); } protected void buildMetaData() throws Throwable { BeanMetaData bmd1 = new AbstractBeanMetaData("OriginalBean", ScopedAnnSimpleBeanImpl.class.getName()); BeanMetaData bmd2 = new AbstractBeanMetaData("DuplicateBean", ScopedAnnSimpleBeanImpl.class.getName()); setBeanMetaDatas(new BeanMetaData[]{bmd1, bmd2}); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/DependencyTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001463011066446716033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Dependency Test Suite. * * @author Adrian Brock * @version $Revision: 78824 $ */ public class DependencyTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Dependency Tests"); suite.addTest(PlainDependencyTestCase.suite()); suite.addTest(PlainDependencyXMLTestCase.suite()); suite.addTest(PlainDependencyAnnotationTestCase.suite()); suite.addTest(GenericBeanFactoryPlainDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryPlainDependencyXMLTestCase.suite()); suite.addTest(OnDemandDependencyTestCase.suite()); suite.addTest(OnDemandDependencyXMLTestCase.suite()); suite.addTest(GenericBeanFactoryOnDemandDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryOnDemandDependencyXMLTestCase.suite()); suite.addTest(PropertyDependencyTestCase.suite()); suite.addTest(PropertyDependencyXMLTestCase.suite()); suite.addTest(PropertyDependencyAnnotationTestCase.suite()); suite.addTest(PropertyFieldDependencyTestCase.suite()); suite.addTest(PropertyField2DependencyTestCase.suite()); suite.addTest(GenericBeanFactoryPropertyDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryPropertyDependencyXMLTestCase.suite()); suite.addTest(GenericBeanFactoryFieldPropertyDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryField2PropertyDependencyTestCase.suite()); suite.addTest(ConstructorDependencyTestCase.suite()); suite.addTest(ConstructorDependencyXMLTestCase.suite()); suite.addTest(ConstructorDependencyAnnotationTestCase.suite()); suite.addTest(GenericBeanFactoryConstructorDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryConstructorDependencyXMLTestCase.suite()); suite.addTest(DemandDependencyTestCase.suite()); suite.addTest(DemandDependencyXMLTestCase.suite()); suite.addTest(DemandDependencyAnnotationTestCase.suite()); suite.addTest(GenericBeanFactoryDemandDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryDemandDependencyXMLTestCase.suite()); suite.addTest(PlainLifecycleDependencyTestCase.suite()); suite.addTest(PlainLifecycleDependencyXMLTestCase.suite()); suite.addTest(PlainLifecycleDependencyAnnotationTestCase.suite()); suite.addTest(GenericBeanFactoryPlainLifecycleDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryPlainLifecycleDependencyXMLTestCase.suite()); suite.addTest(ComplicatedLifecycleDependencyTestCase.suite()); suite.addTest(ComplicatedLifecycleDependencyXMLTestCase.suite()); suite.addTest(ComplicatedLifecycleDependencyAnnotationTestCase.suite()); suite.addTest(KernelControllerContextAwareTestCase.suite()); suite.addTest(KernelControllerContextAwareXMLTestCase.suite()); suite.addTest(KernelControllerContextAwareAnnotationTestCase.suite()); suite.addTest(InstallDependencyTestCase.suite()); suite.addTest(InstallDependencyXMLTestCase.suite()); suite.addTest(InstallDependencyAnnotationTestCase.suite()); suite.addTest(GenericBeanFactoryInstallDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryInstallDependencyXMLTestCase.suite()); suite.addTest(GenericBeanFactoryCallbackDependencyTestCase.suite()); suite.addTest(GenericBeanFactoryCallbackDependencyXMLTestCase.suite()); suite.addTest(InstallSelfDependencyTestCase.suite()); suite.addTest(InstallSelfDependencyXMLTestCase.suite()); suite.addTest(InstallSelfDependencyAnnotationTestCase.suite()); suite.addTest(FromContextTestCase.suite()); suite.addTest(FromContextXMLTestCase.suite()); suite.addTest(FromContextAnnotationTestCase.suite()); suite.addTest(PlainAliasTestCase.suite()); suite.addTest(PlainAliasXMLTestCase.suite()); suite.addTest(PlainAliasAnnotationTestCase.suite()); suite.addTest(CallbackTestCase.suite()); suite.addTest(CallbackXMLTestCase.suite()); suite.addTest(CallbackAnnotationTestCase.suite()); suite.addTest(CallbackCollectionTestCase.suite()); suite.addTest(CallbackCollectionXMLTestCase.suite()); suite.addTest(CallbackCollectionAnnotationTestCase.suite()); suite.addTest(CallbackCollectionFieldsTestCase.suite()); suite.addTest(CallbackCollectionFields2TestCase.suite()); suite.addTest(MatcherDemandSupplyTestCase.suite()); suite.addTest(MatcherDemandSupplyXMLTestCase.suite()); suite.addTest(MatcherDemandSupplyAnnotationTestCase.suite()); suite.addTest(NestedPropertyTestCase.suite()); suite.addTest(NestedPropertyXMLTestCase.suite()); suite.addTest(BeanValidatorBridgeTestCase.suite()); suite.addTest(DuplicateAliasTestCase.suite()); suite.addTest(DuplicateAliasXMLTestCase.suite()); suite.addTest(DuplicateAliasAnnotationTestCase.suite()); suite.addTest(ScopedDuplicateAliasTestCase.suite()); suite.addTest(ScopedDuplicateAliasXMLTestCase.suite()); suite.addTest(ScopedDuplicateAliasAnnotationTestCase.suite()); suite.addTest(OptionalTestCase.suite()); suite.addTest(OptionalXMLTestCase.suite()); suite.addTest(OptionalAnnotationTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001455110771262000033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependencyImpl; /** * GenericBeanFactory Dependency Test Case. * * @author Bill Burke * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryPlainDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryPlainDependencyTestCase.class); } public GenericBeanFactoryPlainDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryPlainDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryDependencyCorrectOrder() throws Throwable { genericBeanFactoryDependencyCorrectOrder(); assertInstall(0, "simple"); ControllerContext context2 = assertInstall(1, "aspect"); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean(); assertEquals("factory", bean.getString()); assertEquals("String1", bean.getSimpleBean().getString()); } public void genericBeanFactoryDependencyCorrectOrder() { buildMetaData(); } public void testGenericBeanFactoryDependencyWrongOrder() throws Throwable { genericBeanFactoryDependencyWrongOrder(); ControllerContext context2 = assertInstall(1, "aspect", ControllerState.INSTANTIATED); assertInstall(0, "simple"); assertEquals(ControllerState.INSTALLED, context2.getState()); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean(); assertEquals("factory", bean.getString()); assertEquals("String1", bean.getSimpleBean().getString()); } public void genericBeanFactoryDependencyWrongOrder() { buildMetaData(); } public void testGenericBeanFactoryDependencyReinstall() throws Throwable { genericBeanFactoryDependencyReinstall(); ControllerContext context1 = assertInstall(0, "simple"); ControllerContext context2 = assertInstall(1, "aspect"); GenericBeanFactory factory = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean = (SimpleBeanWithDependency) factory.createBean(); assertEquals("factory", bean.getString()); assertEquals("String1", bean.getSimpleBean().getString()); assertUninstall("simple"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); context1 = assertInstall(0, "simple"); assertEquals(ControllerState.INSTALLED, context2.getState()); factory = (GenericBeanFactory) context2.getTarget(); bean = (SimpleBeanWithDependency) factory.createBean(); assertEquals("factory", bean.getString()); assertEquals("String1", bean.getSimpleBean().getString()); assertUninstall("aspect"); assertEquals(ControllerState.INSTALLED, context1.getState()); assertEquals(ControllerState.ERROR, context2.getState()); context2 = assertInstall(1, "aspect"); factory = (GenericBeanFactory) context2.getTarget(); bean = (SimpleBeanWithDependency) factory.createBean(); assertEquals("factory", bean.getString()); assertEquals("String1", bean.getSimpleBean().getString()); } public void genericBeanFactoryDependencyReinstall() { buildMetaData(); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("simple", SimpleBeanImpl.class.getName()); HashSet attributes1 = new HashSet(); attributes1.add(new AbstractPropertyMetaData("string", "String1")); metaData1.setProperties(attributes1); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData(); metaData2.setName("aspect"); metaData2.setBean(SimpleBeanWithDependencyImpl.class.getName()); metaData2.setConstructor(new AbstractConstructorMetaData()); addBeanProperty(metaData2, new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("simple"))); addBeanProperty(metaData2, new AbstractPropertyMetaData("string", new AbstractValueMetaData("factory"))); setBeanMetaDatas(new BeanMetaData[] { metaData1, getBeanMetaData(metaData2) }); } }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryInstallDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001523410771262000033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.GenericBeanFactoryRepository; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; /** * Install Dependency Test Case. * * @author Adrian Brock * @version $Revision: 71173 $ */ public class GenericBeanFactoryInstallDependencyTestCase extends AbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryInstallDependencyTestCase.class); } public GenericBeanFactoryInstallDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryInstallDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testInstallDependencyCorrectOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactoryRepository bean1 = (GenericBeanFactoryRepository) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory bean2 = (GenericBeanFactory) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyWrongOrder() throws Throwable { setupBeanMetaDatas(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.START); ControllerContext context1 = assertInstall(0, "Name1"); GenericBeanFactoryRepository bean1 = (GenericBeanFactoryRepository) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory bean2 = (GenericBeanFactory) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } public void testInstallDependencyReinstall() throws Throwable { setupBeanMetaDatas(); ControllerContext context1 = assertInstall(0, "Name1"); ControllerContext context2 = assertInstall(1, "Name2"); GenericBeanFactoryRepository bean1 = (GenericBeanFactoryRepository) context1.getTarget(); assertNotNull(bean1); GenericBeanFactory bean2 = (GenericBeanFactory) context2.getTarget(); assertNotNull(bean2); ArrayList expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name1"); assertContext("Name2", ControllerState.START); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context1 = assertInstall(0, "Name1"); assertContext("Name2", ControllerState.INSTALLED); bean1 = (GenericBeanFactoryRepository) context1.getTarget(); assertNotNull(bean1); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); assertUninstall("Name2"); assertContext("Name1", ControllerState.INSTALLED); expected = new ArrayList(); assertEquals(expected, bean1.getBeans()); context2 = assertInstall(1, "Name2"); assertContext("Name1", ControllerState.INSTALLED); bean2 = (GenericBeanFactory) context2.getTarget(); assertNotNull(bean2); expected = new ArrayList(); expected.add(bean2); assertEquals(expected, bean1.getBeans()); } protected void setupBeanMetaDatas() throws Throwable { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", GenericBeanFactoryRepository.class.getName()); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName()); ArrayList installs = new ArrayList(); AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setBean("Name1"); install.setMethodName("addGenericBeanFactory"); ArrayList parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(null, new ThisValueMetaData())); install.setParameters(parameters); installs.add(install); metaData2.setInstalls(installs); ArrayList uninstalls = new ArrayList(); AbstractInstallMetaData uninstall = new AbstractInstallMetaData(); uninstall.setBean("Name1"); uninstall.setMethodName("removeGenericBeanFactory"); parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(null, new ThisValueMetaData())); uninstall.setParameters(parameters); uninstalls.add(uninstall); metaData2.setUninstalls(uninstalls); setBeanMetaDatas(new BeanMetaData[] { metaData1, getBeanMetaData(metaData2) }); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackCollectionFieldsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000552310767766613033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.kernel.dependency.support.SimpleFieldsBeanRepository; /** * Callback collection tests. * * @author Ales Justin */ public class CallbackCollectionFieldsTestCase extends CallbackTestCase { public CallbackCollectionFieldsTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(CallbackCollectionFieldsTestCase.class); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { AbstractBeanMetaData repository = new AbstractBeanMetaData("Name1", SimpleFieldsBeanRepository.class.getName()); repository.setAccessMode(BeanAccessMode.FIELDS); List installs = new ArrayList(); repository.setInstallCallbacks(installs); InstallCallbackMetaData install = new InstallCallbackMetaData(); install.setProperty("beans"); if (cardinality != null) install.setCardinality(cardinality); installs.add(install); List unstalls = new ArrayList(); repository.setUninstallCallbacks(unstalls); UninstallCallbackMetaData uninstall = new UninstallCallbackMetaData(); uninstall.setProperty("beans"); unstalls.add(uninstall); return repository; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000001700011216157032033277 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.dependency.support.SimpleBean; import org.jboss.test.kernel.dependency.support.SimpleBeanImpl; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependency; import org.jboss.test.kernel.dependency.support.SimpleBeanWithDependencyImpl; /** * OnDemand Dependency Test Case. * * @author Adrian Brock * @version $Revision: 90317 $ */ public class GenericBeanFactoryOnDemandDependencyTestCase extends OldAbstractKernelDependencyTest { public static Test suite() { return suite(GenericBeanFactoryOnDemandDependencyTestCase.class); } public GenericBeanFactoryOnDemandDependencyTestCase(String name) throws Throwable { super(name); } public GenericBeanFactoryOnDemandDependencyTestCase(String name, boolean xmltest) throws Throwable { super(name, xmltest); } public void testGenericBeanFactoryOnDemandDependencyOnDemandFirst() throws Throwable { onDemandDependencyOnDemandFirst(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED); ControllerContext context2 = assertInstall(1, "Name2"); assertContext("Name1"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void onDemandDependencyOnDemandFirst() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryOnDemandDependencyOnDemandSecond() throws Throwable { onDemandDependencyOnDemandSecond(); ControllerContext context2 = assertInstall(1, "Name2", ControllerState.INSTANTIATED); ControllerContext context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void onDemandDependencyOnDemandSecond() throws Throwable { buildMetaData(); } public void testGenericBeanFactoryOnDemandDependencyReinstall() throws Throwable { onDemandDependencyReinstall(); ControllerContext context1 = assertInstall(0, "Name1", ControllerState.DESCRIBED); ControllerContext context2 = assertInstall(1, "Name2"); assertContext("Name1"); GenericBeanFactory factory1 = (GenericBeanFactory) context1.getTarget(); SimpleBean bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); GenericBeanFactory factory2 = (GenericBeanFactory) context2.getTarget(); SimpleBeanWithDependency bean2 = (SimpleBeanWithDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); assertUninstall("Name1"); assertEquals(ControllerState.ERROR, context1.getState()); assertEquals(ControllerState.INSTANTIATED, context2.getState()); assertNotInstalled("Name2"); context2 = assertContext("Name2", ControllerState.INSTANTIATED); context1 = assertInstall(0, "Name1"); assertEquals(ControllerState.INSTALLED, context2.getState()); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBeanWithDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); assertUninstall("Name2"); context1 = assertContext("Name1"); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); context2 = assertInstall(1, "Name2"); factory1 = (GenericBeanFactory) context1.getTarget(); bean1 = (SimpleBean) factory1.createBean(); assertNotNull(bean1); assertEquals("String1", bean1.getString()); factory2 = (GenericBeanFactory) context2.getTarget(); bean2 = (SimpleBeanWithDependency) factory2.createBean(); assertNotNull(bean2); assertEquals("String2", bean2.getString()); assertEquals(factory1, bean2.getFactory()); } public void onDemandDependencyReinstall() throws Throwable { buildMetaData(); } protected void buildMetaData() { GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName()); metaData1.setMode(ControllerMode.ON_DEMAND); addBeanProperty(metaData1, new AbstractPropertyMetaData("string", "String1")); GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName()); addBeanProperty(metaData2, new AbstractPropertyMetaData("string", "String2")); addBeanProperty(metaData2, new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Name1"))); setBeanMetaDatas(new BeanMetaData[] { getBeanMetaData(metaData1), getBeanMetaData(metaData2) }); } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/CallbackCollectionAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000410210756342051033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.kernel.dependency.support.CallbackCollectionCardinalitySimpleBeanRepository; import org.jboss.test.kernel.dependency.support.CallbackCollectionSimpleBeanRepository; /** * Callback tests. * * @author Ales Justin */ public class CallbackCollectionAnnotationTestCase extends CallbackTestCase { public CallbackCollectionAnnotationTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(CallbackCollectionAnnotationTestCase.class); } protected AbstractBeanMetaData buildRepository(Cardinality cardinality) { Class clazz = cardinality != null ? CallbackCollectionCardinalitySimpleBeanRepository.class : CallbackCollectionSimpleBeanRepository.class; return new AbstractBeanMetaData("Name1", clazz.getName()); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/te0000644000175000017500000000417010654125045033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.test.kernel.dependency.support.DependSimpleBeanWithLifecycle; import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle; /** * Lifecycle Dependency Test Case. * * @author Ales Justin */ public class PlainLifecycleDependencyAnnotationTestCase extends PlainLifecycleDependencyTestCase { public static Test suite() { return suite(PlainLifecycleDependencyAnnotationTestCase.class); } public PlainLifecycleDependencyAnnotationTestCase(String name) throws Throwable { super(name); } protected void buildMetaData() { AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName()); AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", DependSimpleBeanWithLifecycle.class.getName()); setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 }); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000755000175000017500000000000011620312155033314 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimplerBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000230510767766613033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * A SimplerBean. * * @author Ales Justin */ public interface SimplerBean { String getString(); } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithConstructorDependencyImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000344210674773017033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; /** * A simple bean * * @author Adrian Brock * @version $Revision: 40438 $ */ public class AnnotatedSimpleBeanWithConstructorDependencyImpl extends SimpleBeanWithConstructorDependencyImpl { private static final long serialVersionUID = 3905240143387505464L; @Constructor public AnnotatedSimpleBeanWithConstructorDependencyImpl(@Inject(bean = "Name1") SimpleBean bean) { super(bean); } @StringValue("String2") public void setString(String string) { super.setString(string); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/StatesAndBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000234610767766613033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.Set; import org.jboss.dependency.spi.ControllerState; public interface StatesAndBeanRepository extends BeanRepository { Set getStates(); } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SupplyPlainDependecySimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000270210711377006033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; /** * A simple bean * * @author Ales Justin */ @Supplys({@Supply("WhatIWant")}) public class SupplyPlainDependecySimpleBeanImpl extends PlainDependecySimpleBeanImpl { private static final long serialVersionUID = 3258132440433243443L; } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CallbackCollectionCardinalitySimpleBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000265610674773017033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; public class CallbackCollectionCardinalitySimpleBeanRepository extends SimpleBeanRepository { @Install(cardinality = "2..n") @Uninstall public void setBeans(List beans) { super.setBeans(beans); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/PlainDependecySimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000271210674773017033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ public class PlainDependecySimpleBeanImpl extends SimpleBeanImpl { private static final long serialVersionUID = 3258132440433243443L; @StringValue("String1") public void setString(String string) { super.setString(string); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/DemandSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000312710674773017033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.Demand; /** * A simple bean * * @author Ales Justin */ @Demands({@Demand("WhatIWant")}) public class DemandSimpleBeanImpl extends SimpleBeanImpl { private static final long serialVersionUID = 3258132440433243443L; @StringValue("String2") public void setString(String string) { super.setString(string); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleFieldsBeanRepository2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000273110767766613033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; import org.jboss.dependency.spi.ControllerState; public class SimpleFieldsBeanRepository2 implements BeanRepository { List beans = new ArrayList(); Set states = new HashSet(); public List getBeans() { return beans; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000257711066446716033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; public class SimpleBeanDelegate { private SimpleBean delegate; public SimpleBeanDelegate() { } public SimpleBeanDelegate(SimpleBean delegate) { this.delegate = delegate; } public SimpleBean getDelegate() { return delegate; } public void setDelegate(SimpleBean delegate) { this.delegate = delegate; } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CallbackSimpleBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000272010674773017033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; public class CallbackSimpleBeanRepository extends SimpleBeanRepository { @Install public void addSimpleBean(SimpleBean bean) { super.addSimpleBean(bean); } @Uninstall public void removeSimpleBean(SimpleBean bean) { super.removeSimpleBean(bean); } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000406110331006762033321 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; /** * A simple bean that is kernel controllercontext aware * * @author Adrian Brock * @version $Revision: 37459 $ */ public class SimpleBeanWithKernelControllerContextAware implements Serializable, KernelControllerContextAware { private static final long serialVersionUID = 3258132440433243443L; private static final Logger log = Logger.getLogger(SimpleBeanWithKernelControllerContextAware.class); public KernelControllerContext context; public void setKernelControllerContext(KernelControllerContext context) throws Exception { log.info("Setting context " + context); this.context = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { log.info("Unsetting context " + context); this.context = null; } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/ExternalInstallSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000535510674773017033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.api.annotations.ThisValue; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @ExternalInstalls({@ExternalInstall(bean = "Name1", method = "addSimpleBean", parameters = {@Value(thisValue = @ThisValue)})}) @ExternalUninstalls({@ExternalInstall(bean = "Name1", method = "removeSimpleBean", parameters = {@Value(thisValue = @ThisValue)})}) public class ExternalInstallSimpleBeanImpl implements Serializable, SimpleBean { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258132440433243443L; // Attributes ---------------------------------------------------- private String constructorString; private String string; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public ExternalInstallSimpleBeanImpl() { constructorString = "()"; } public ExternalInstallSimpleBeanImpl(String string) { constructorString = string; } // Public -------------------------------------------------------- public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/DependSimpleBeanWithLifecycle.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000260310674773017033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Depends; /** * A simple bean with a lifecycle * * @author Ales Justin */ @Depends({"Name1"}) public class DependSimpleBeanWithLifecycle extends SimpleBeanWithLifecycle { private static final long serialVersionUID = 3258132440433243443L; } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/TestUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000741610656042363033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.net.URL; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.kernel.AbstractKernelTest; /** * A helper for tests. * * @author Adrian Brock * @version $Revision: 64479 $ */ public class TestUtil { /** The kernel */ private Kernel kernel; /** The kernel controller */ private KernelController controller; /** The xml deployer */ private BasicXMLDeployer deployer; /** The test */ private AbstractKernelTest test; /** * Create a new TestUtil. * * @param kernel the kernel * @param test the test * @throws Throwable for any error */ public TestUtil(Kernel kernel, AbstractKernelTest test) throws Throwable { this.kernel = kernel; this.controller = kernel.getController(); this.deployer = new BasicXMLDeployer(kernel); this.test = test; } /** * Get the kernel * * @return the kernel */ public Kernel getKernel() { return kernel; } /** * Get the test * * @return the test */ public AbstractKernelTest getTest() { return test; } /** * Install a BeanMetaData * * @param beanMetaData the bean meta data * @return the context * @throws Throwable for any error */ public KernelControllerContext install(BeanMetaData beanMetaData) throws Throwable { return controller.install(beanMetaData); } /** * Uninstall * * @param name the name * @throws Throwable for any error */ public void uninstall(String name) throws Throwable { controller.uninstall(name); } /** * Get a context * * @param name the name * @return the context * @throws Throwable for any error */ public ControllerContext getContext(String name) throws Throwable { return controller.getContext(name, null); } /** * Get installed context * * @param name the name * @return the context * @throws Throwable for any error */ public ControllerContext getInstalledContext(String name) throws Throwable { return controller.getInstalledContext(name); } /** * Deploy a url * * @param url the url * @return KernelDeployment the deployment * @throws Throwable for any error */ public KernelDeployment deploy(URL url) throws Throwable { return deployer.deploy(url); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/BeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000221610767766613033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; public interface BeanRepository { List getBeans(); } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/ExternalInstallWithStateSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000001113010764340107033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.Value; /** * A simple bean * * @author Ales Justin */ @ExternalInstalls ( { @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "PreInstall"), @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Described"), @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Instantiated"), @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Configured"), @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Create"), @ExternalInstall(bean = "Name1", method = "addState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Start") } ) @ExternalUninstalls ( { @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "PreInstall"), @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Described"), @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Instantiated"), @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Configured"), @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Create"), @ExternalInstall(bean = "Name1", method = "removeState", parameters = {@Value(inject = @Inject(fromContext = FromContext.STATE))}, whenRequired = "Start") } ) public class ExternalInstallWithStateSimpleBeanImpl implements Serializable, SimpleBean { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258132440433243443L; // Attributes ---------------------------------------------------- private String constructorString; private String string; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public ExternalInstallWithStateSimpleBeanImpl() { constructorString = "()"; } public ExternalInstallWithStateSimpleBeanImpl(String string) { constructorString = string; } // Public -------------------------------------------------------- public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/IntervalDemander.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000252410711377006033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Demand; /** * @author Ales Justin */ @Demands({@Demand(value = "(1,10]", transformer = "interval")}) public class IntervalDemander { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithLifecycle.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000367710622567717033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import java.util.concurrent.atomic.AtomicInteger; /** * A simple bean with a lifecycle * * @author Adrian Brock * @version $Revision: 63094 $ */ public class SimpleBeanWithLifecycle implements Serializable { public static AtomicInteger order = new AtomicInteger(0); private static final long serialVersionUID = 3258132440433243443L; public static void resetOrder() { order.set(0); } public int createOrder = -1; public int startOrder = -1; public int stopOrder = -1; public int destroyOrder = -1; public void create() { createOrder = order.incrementAndGet(); } public void start() { startOrder = order.incrementAndGet(); } public void stop() { stopOrder = order.incrementAndGet(); } public void destroy() { destroyOrder = order.incrementAndGet(); } }././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithConstructorDependencyImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000413410364457166033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; /** * A simple bean * * @author Adrian Brock * @version $Revision: 40438 $ */ public class SimpleBeanWithConstructorDependencyImpl implements Serializable, SimpleBeanWithConstructorDependency { private static final long serialVersionUID = 3905240143387505464L; private String string; private SimpleBean bean; private GenericBeanFactory factory; public SimpleBeanWithConstructorDependencyImpl() { } public SimpleBeanWithConstructorDependencyImpl(SimpleBean bean) { this.bean = bean; } public SimpleBeanWithConstructorDependencyImpl(GenericBeanFactory factory) throws Throwable { this.factory = factory; } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getSimpleBean() { return bean; } public GenericBeanFactory getFactory() { return factory; } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/NestedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000315110756342051033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * @author Ales Justin */ public class NestedBean { private NestedBean bean; private String string; public NestedBean(int limit) { if (limit > 0) bean = new NestedBean(limit - 1); } public NestedBean getBean() { return bean; } public void setBean(NestedBean bean) { this.bean = bean; } public String getString() { return string; } public void setString(String string) { this.string = string; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanDelegateAnnotated.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000260611066446716033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.InjectOption; public class SimpleBeanDelegateAnnotated extends SimpleBeanDelegate { @Inject(bean = "Name2", option = InjectOption.OPTIONAL) public void setDelegate(SimpleBean delegate) { super.setDelegate(delegate); } }././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CallbackCollectionSimpleBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000261510674773017033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; public class CallbackCollectionSimpleBeanRepository extends SimpleBeanRepository { @Install @Uninstall public void setBeans(List beans) { super.setBeans(beans); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/GenericBeanFactoryRepositoryBF.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000352710771262000033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; import java.util.ArrayList; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.kernel.spi.config.KernelConfigurator; /** * GenericBeanFactoryRepositoryBF. * * @author Ales Justin */ public class GenericBeanFactoryRepositoryBF extends GenericBeanFactory { List beans = new ArrayList(); public GenericBeanFactoryRepositoryBF(KernelConfigurator configurator) { super(configurator); } public List getBeans() { return beans; } public void addGenericBeanFactory(SimpleBean bean) { beans.add(bean); } public void removeGenericBeanFactory(SimpleBean bean) { beans.remove(bean); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CustomSupplier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000251010711377006033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; /** * @author Ales Justin */ @Supplys({@Supply(value = "i supply fragment word")}) public class CustomSupplier { } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/RegexpSupplier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000247510711377006033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; /** * @author Ales Justin */ @Supplys({@Supply(value = "aj@acme.org")}) public class RegexpSupplier { } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanInstallsAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000425710757136565033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.HashSet; import java.util.Set; import org.jboss.dependency.spi.ControllerState; /** * SimpleBeanInstallAware * * @author Adrian Brock */ public class SimpleBeanInstallsAware { protected Set states = new HashSet(); public Set getStates() { return states; } public void addInstantiated(ControllerState state) { states.add(state); } public void addConfigured(ControllerState state) { states.add(state); } public void addCreate(ControllerState state) { states.add(state); } public void addStart(ControllerState state) { states.add(state); } public void removeInstantiated(ControllerState state) { states.remove(state); } public void removeConfigured(ControllerState state) { states.remove(state); } public void removeCreate(ControllerState state) { states.remove(state); } public void removeStart(ControllerState state) { states.remove(state); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallSelf.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000302110674773017033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.api.annotations.UninstallMethod; /** * SimpleBeanInstallSelf. * * @author Ales Justin */ public class AnnotatedSimpleBeanInstallSelf extends SimpleBeanInstallSelf { @InstallMethod public void install() { installed = true; } @UninstallMethod public void uninstall() { installed = false; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CustomMatcherTransfomer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000374010775133546033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.api.dependency.NonNullMatcherTransformer; import org.jboss.kernel.api.dependency.StringMatcher; /** * @author Ales Justin */ public class CustomMatcherTransfomer extends NonNullMatcherTransformer { protected Matcher internalTransform(Object value) { return new FragmentMatcher(value.toString()); } private class FragmentMatcher extends StringMatcher { private String fragment; public FragmentMatcher(String string) { if (string == null) throw new IllegalArgumentException("Null fragment"); this.fragment = string; } protected boolean matchByType(String other) { return other.contains(fragment); } public String toString() { return fragment; } } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallsAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000565510764340107033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.api.annotations.UninstallMethod; import org.jboss.dependency.spi.ControllerState; /** * SimpleBeanInstallAware * * @author Adrian Brock */ public class AnnotatedSimpleBeanInstallsAware extends SimpleBeanInstallsAware { @InstallMethod(whenRequired = "Instantiated") public void addInstantiated(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.add(state); } @InstallMethod(whenRequired = "Configured") public void addConfigured(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.add(state); } @InstallMethod(whenRequired = "Create") public void addCreate(@Inject(fromContext= FromContext.STATE) ControllerState state) { states.add(state); } @InstallMethod(whenRequired = "Start") public void addStart(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.add(state); } @UninstallMethod(whenRequired = "Instantiated") public void removeInstantiated(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.remove(state); } @UninstallMethod(whenRequired = "Configured") public void removeConfigured(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.remove(state); } @UninstallMethod(whenRequired = "Create") public void removeCreate(@Inject(fromContext= FromContext.STATE) ControllerState state) { states.remove(state); } @UninstallMethod(whenRequired = "Start") public void removeStart(@Inject(fromContext=FromContext.STATE) ControllerState state) { states.remove(state); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000457010331006762033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; /** * A simple bean * * @author Adrian Brock * @version $Revision: 37459 $ */ public class SimpleBeanImpl implements Serializable, SimpleBean { // Constants ----------------------------------------------------- private static final long serialVersionUID = 3258132440433243443L; // Attributes ---------------------------------------------------- private String constructorString; private String string; // Static -------------------------------------------------------- // Constructors -------------------------------------------------- public SimpleBeanImpl() { constructorString = "()"; } public SimpleBeanImpl(String string) { constructorString = string; } // Public -------------------------------------------------------- public String getConstructorString() { return constructorString; } public String getString() { return string; } public void setString(String string) { this.string = string; } // Package protected --------------------------------------------- // Protected ----------------------------------------------------- // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/PropertyDependecySimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000273510674773017033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Inject; /** * A simple bean * * @author Ales Justin */ public class PropertyDependecySimpleBeanImpl extends SimpleBeanImpl { private static final long serialVersionUID = 3258132440433243443L; @Inject(bean = "Name1", property = "string") public void setString(String string) { super.setString(string); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanInstallSelf.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000265010654125045033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * SimpleBeanInstallSelf. * * @author Adrian Brock * @version $Revision: 64400 $ */ public class SimpleBeanInstallSelf { protected boolean installed = false; public boolean getInstalled() { return installed; } public void install() { installed = true; } public void uninstall() { installed = false; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimplerBeanImpl2.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000263111301242575033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; /** * A simpler bean * * @author Ales Justin */ public class SimplerBeanImpl2 implements Serializable, SimplerBean { private static final long serialVersionUID = 3258132440433243443L; private String string; public String getString() { return string; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CustomDemander.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000261410711377006033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Demand; /** * @author Ales Justin */ @Demands({@Demand(value = "fragment", transformer = "org.jboss.test.kernel.dependency.support.CustomMatcherTransfomer")}) public class CustomDemander { } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithDependencyImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000377510364464416033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; /** * A simple bean * * @author Adrian Brock * @version $Revision: 40439 $ */ public class SimpleBeanWithDependencyImpl implements Serializable, SimpleBeanWithDependency { private static final long serialVersionUID = 3257004371517454132L; private String string; private SimpleBean bean; private GenericBeanFactory factory; public SimpleBeanWithDependencyImpl() { } public String getString() { return string; } public void setString(String string) { this.string = string; } public SimpleBean getSimpleBean() { return bean; } public void setSimpleBean(SimpleBean bean) { this.bean = bean; } public GenericBeanFactory getFactory() { return factory; } public void setFactory(GenericBeanFactory factory) { this.factory = factory; } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/InstallSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000244010756342051033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * A simple bean * * @author Ales Justin */ public class InstallSimpleBeanImpl extends SimpleBeanImpl { /** The serialVersionUID */ private static final long serialVersionUID = 1L; } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithComplicatedLifecycle.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000421310674773017033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.api.annotations.Inject; /** * A simple bean with a complicated lifecycle * * @author Ales Justin */ public class AnnotatedSimpleBeanWithComplicatedLifecycle extends SimpleBeanWithComplicatedLifecycle { private static final long serialVersionUID = 3258132440433243443L; @Create public void notCreate(@Inject(bean = "Name1") SimpleBeanWithLifecycle bean) { super.notCreate(bean); } @Start public void notStart(@Inject(bean = "Name2")SimpleBeanWithLifecycle bean) { super.notStart(bean); } @Stop public void notStop(@Inject(bean = "Name3")SimpleBeanWithLifecycle bean) { super.notStop(bean); } @Destroy public void notDestroy(@Inject(bean = "Name4")SimpleBeanWithLifecycle bean) { super.notDestroy(bean); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/RegexpDemander.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000256210711377006033331 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Demand; /** * @author Ales Justin */ @Demands({@Demand(value = "^[a-zA-Z0-9._%+-]+@acme\\.((org)|(com))$", transformer = "regexp")}) public class RegexpDemander { } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000274410364464416033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; /** * A SimpleBeanWithDependency. * * @author Adrian Brock * @version $Revision: 40439 $ */ public interface SimpleBeanWithDependency { String getString(); void setString(String string); SimpleBean getSimpleBean(); void setSimpleBean(SimpleBean bean); GenericBeanFactory getFactory(); void setFactory(GenericBeanFactory factory); }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000273010767766613033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * A SimpleBean. * * @author Adrian Brock * @version $Revision: 70952 $ */ public interface SimpleBean extends SimplerBean { // Constants ----------------------------------------------------- // Public -------------------------------------------------------- String getConstructorString(); void setString(String string); // Inner classes ------------------------------------------------- }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimplerBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000262710767766613033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; /** * A simpler bean * * @author Ales Justin */ public class SimplerBeanImpl implements Serializable, SimplerBean { private static final long serialVersionUID = 3258132440433243443L; public String string; public String getString() { return string; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleFieldsBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000274610767766613033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.List; import java.util.ArrayList; import java.util.Set; import java.util.HashSet; import org.jboss.dependency.spi.ControllerState; public class SimpleFieldsBeanRepository implements BeanRepository { public List beans = new ArrayList(); public Set states = new HashSet(); public List getBeans() { return beans; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/IntervalSupplier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000251310764340107033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; /** * @author Ales Justin */ @Supplys({@Supply(value = "5", type = Integer.class)}) public class IntervalSupplier { } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AliasSimpleBeanImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000302210674773017033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Ales Justin */ @Aliases({"MyAlias"}) public class AliasSimpleBeanImpl extends SimpleBeanImpl { private static final long serialVersionUID = 3258132440433243443L; @StringValue("String1") public void setString(String string) { super.setString(string); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/MockBeanValidatorBridge.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000502211014574040033315 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.kernel.plugins.dependency.BeanValidatorBridge; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.reflect.spi.MethodInfo; /** * @author Ales Justin */ public class MockBeanValidatorBridge implements BeanValidatorBridge { private Joinpoint joinpoint; private Object target; private String property; private String method; public Joinpoint getJoinpoint() { return joinpoint; } public Object getTarget() { return target; } public String getProperty() { return property; } public String getMethod() { return method; } public void validateConstructorValues(KernelControllerContext context, Joinpoint joinpoint) throws Throwable { this.joinpoint = joinpoint; } public void validateInstance(KernelControllerContext context, Object target) throws Throwable { this.target = target; } public void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo propertyInfo, Object value) throws Throwable { property = propertyInfo.getName(); } public void validateMethodValues(KernelControllerContext context, Object target, MethodInfo methodInfo, Object[] parameters) throws Throwable { method = methodInfo.getName(); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithConstructorDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000264010364457166033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; /** * A SimpleBeanWithConstructorDependency. * * @author Adrian Brock * @version $Revision: 40438 $ */ public interface SimpleBeanWithConstructorDependency { String getString(); void setString(String string); SimpleBean getSimpleBean(); GenericBeanFactory getFactory(); }././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000337710764340107033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.model.FromContext; /** * A simple bean that is kernel controllercontext aware * * @author Ales Justin */ public class AnnotatedSimpleBeanWithKernelControllerContextAware extends SimpleBeanWithKernelControllerContextAware { /** The serialVersionUID */ private static final long serialVersionUID = 1L; @Inject(fromContext = FromContext.CONTEXT) public void setKernelControllerContext(KernelControllerContext context) throws Exception { super.setKernelControllerContext(context); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/CallbackCardinalitySimpleBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000276110674773017033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; public class CallbackCardinalitySimpleBeanRepository extends SimpleBeanRepository { @Install(cardinality = "2..n") public void addSimpleBean(SimpleBean bean) { super.addSimpleBean(bean); } @Uninstall public void removeSimpleBean(SimpleBean bean) { super.removeSimpleBean(bean); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/BVBTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000241011014574040033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; /** * @author Ales Justin */ public class BVBTester { public void setSomething(Object object) { } public void invokeSomething(Object object) { } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/GenericBeanFactoryRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000343710756342051033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; /** * GenericBeanFactoryRepository. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class GenericBeanFactoryRepository { List beans = new ArrayList(); public List getBeans() { return beans; } public void addGenericBeanFactory(GenericBeanFactory bean) { System.out.println("-------> addGenericBeanFactory"); beans.add(bean); } public void removeGenericBeanFactory(GenericBeanFactory bean) { System.out.println("-------> removeGenericBeanFactory"); beans.remove(bean); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000367410767766613033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.util.ArrayList; import java.util.List; import java.util.Set; import java.util.HashSet; import org.jboss.dependency.spi.ControllerState; public class SimpleBeanRepository implements StatesAndBeanRepository { List beans = new ArrayList(); Set states = new HashSet(); public List getBeans() { return beans; } public void setBeans(List beans) { this.beans = beans; } public void addSimpleBean(SimpleBean bean) { beans.add(bean); } public void removeSimpleBean(SimpleBean bean) { beans.remove(bean); } public Set getStates() { return states; } public boolean addState(ControllerState state) { return states.add(state); } public boolean removeState(ControllerState state) { return states.remove(state); } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithDependencyImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000326110674773017033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.StringValue; /** * A simple bean * * @author Adrian Brock * @version $Revision: 40439 $ */ public class AnnotatedSimpleBeanWithDependencyImpl extends SimpleBeanWithDependencyImpl { private static final long serialVersionUID = 3257004371517454132L; @StringValue("String2") public void setString(String string) { super.setString(string); } @Inject(bean = "Name1") public void setSimpleBean(SimpleBean bean) { super.setSimpleBean(bean); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/support/SimpleBeanWithComplicatedLifecycle.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/dependency/su0000644000175000017500000000457610622567717033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.dependency.support; import java.io.Serializable; /** * A simple bean with a complicated lifecycle * * @author Adrian Brock * @version $Revision: 63094 $ */ public class SimpleBeanWithComplicatedLifecycle implements Serializable { private static final long serialVersionUID = 3258132440433243443L; public int createOrder = -1; public int startOrder = -1; public int stopOrder = -1; public int destroyOrder = -1; public SimpleBeanWithLifecycle createBean; public SimpleBeanWithLifecycle startBean; public SimpleBeanWithLifecycle stopBean; public SimpleBeanWithLifecycle destroyBean; public void notCreate(SimpleBeanWithLifecycle bean) { createBean = bean; destroyBean = null; createOrder = SimpleBeanWithLifecycle.order.incrementAndGet(); } public void notStart(SimpleBeanWithLifecycle bean) { startBean = bean; stopBean = null; startOrder = SimpleBeanWithLifecycle.order.incrementAndGet(); } public void notStop(SimpleBeanWithLifecycle bean) { stopBean = bean; startBean = null; stopOrder = SimpleBeanWithLifecycle.order.incrementAndGet(); } public void notDestroy(SimpleBeanWithLifecycle bean) { destroyBean = bean; createBean = null; destroyOrder = SimpleBeanWithLifecycle.order.incrementAndGet(); } }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/0000755000175000017500000000000011620312152032640 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/tes0000755000175000017500000000000011620312152033354 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/test/BootstrapTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/tes0000644000175000017500000001146511014301412033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.bootstrap.test; import junit.framework.Test; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * Bootstrap Test Case. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class BootstrapTestCase extends AbstractTestCaseWithSetup { public static Test suite() { return suite(BootstrapTestCase.class); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = true; return delegate; } public BootstrapTestCase(String name) { super(name); } public void testBasicBootstrap() throws Exception { BasicBootstrap bootstrap = new BasicBootstrap(); bootstrap.run(); Kernel kernel = bootstrap.getKernel(); getLog().debug("Got kernel: " + kernel); assertNotNull(kernel); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); assertNotNull(registry); check("Kernel", registry, kernel, KernelConstants.KERNEL_NAME, Kernel.class.getName()); check("KernelRegistry", registry, registry, KernelConstants.KERNEL_REGISTRY_NAME, KernelConstants.KERNEL_REGISTRY_CLASS); KernelBus bus = kernel.getBus(); check("KernelBus", registry, bus, KernelConstants.KERNEL_BUS_NAME, KernelConstants.KERNEL_BUS_CLASS); KernelConfig config = kernel.getConfig(); check("KernelConfig", registry, config, KernelConstants.KERNEL_CONFIG_NAME, PropertyKernelConfig.class.getName()); KernelConfigurator configurator = kernel.getConfigurator(); check("KernelConfigurator", registry, configurator, KernelConstants.KERNEL_CONFIGURATOR_NAME, KernelConstants.KERNEL_CONFIGURATOR_CLASS); KernelController controller = kernel.getController(); check("KernelController", registry, controller, KernelConstants.KERNEL_CONTROLLER_NAME, KernelConstants.KERNEL_CONTROLLER_CLASS); KernelEventManager eventManager = kernel.getEventManager(); check("KernelEventManager", registry, eventManager, KernelConstants.KERNEL_EVENT_MANAGER_NAME, KernelConstants.KERNEL_EVENT_MANAGER_CLASS); KernelMetaDataRepository metaDataRepository = kernel.getMetaDataRepository(); check("KernelMetaDataRepository", registry, metaDataRepository, KernelConstants.KERNEL_METADATA_REPOSITORY_NAME, KernelConstants.KERNEL_METADATA_REPOSITORY_CLASS); } protected void check(String context, org.jboss.kernel.spi.registry.KernelRegistry registry, Object object, Object name, String className) throws Exception { getLog().debug("Checking " + context + ": " + object); assertNotNull(object); assertEquals(object.getClass().getName(), className); KernelRegistryEntry entry = registry.getEntry(name); Object registered = entry.getTarget(); assertEquals(object, registered); } protected void configureLogging() { //enableTrace("org.jboss"); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/test/BootstrapTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/bootstrap/tes0000644000175000017500000000403710331006762033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.bootstrap.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Bootstrap Test Suite. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class BootstrapTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Bootstrap Tests"); suite.addTest(BootstrapTestCase.suite()); return suite; } // Constructors -------------------------------------------------- // Public -------------------------------------------------------- // TestSuite overrides ------------------------------------------- // Package protected --------------------------------------------- // Protected ----------------------------------------------------- // Private ------------------------------------------------------- // Inner classes ------------------------------------------------- } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/0000755000175000017500000000000011620312151033157 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312151033343 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/FactoryMethodBadTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000403511026665501033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.joinpoint.spi.JoinpointException; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.deployment.test.AbstractOnDemandDeploymentTest; /** * @author Ales Justin */ public class FactoryMethodBadTestCase extends AbstractOnDemandDeploymentTest { public FactoryMethodBadTestCase(String name) throws Throwable { super(name); } public static Test suite() { return suite(FactoryMethodBadTestCase.class); } public void testFactoryMethodBad() throws Throwable { KernelControllerContext context = getControllerContext("Tester", null); change(context, ControllerState.INSTALLED); assertEquals(ControllerState.ERROR, context.getState()); assertNotNull(context.getError()); assertInstanceOf(context.getError(), JoinpointException.class); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/CleanupAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000743510760376602033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.test.kernel.annotations.support.TestAnnotationAdapter; import org.jboss.test.kernel.annotations.support.TestCleanupOnlyPlugin; import org.jboss.test.kernel.annotations.support.TestCleanupPlugin; import org.jboss.test.kernel.annotations.support.TestApplyOnlyPlugin; import org.jboss.test.kernel.annotations.support.TestCleanupBean; import org.jboss.test.kernel.annotations.support.TestCleanupOnlyBean; import org.jboss.test.kernel.annotations.support.TestApplyOnlyBean; /** * Test the @Cleanup and @CleanupOnly * * @author Ales Justin */ public class CleanupAnnotationTestCase extends AbstractBeanAnnotationAdapterTest { public CleanupAnnotationTestCase(String name) { super(name); } public static Test suite() { return suite(CleanupAnnotationTestCase.class); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { return TestAnnotationAdapter.INSTANCE; } protected void reset() { TestCleanupPlugin.INSTANCE.reset(); TestCleanupOnlyPlugin.INSTANCE.reset(); TestApplyOnlyPlugin.INSTANCE.reset(); } public void testCleanup() throws Throwable { reset(); runAnnotationsOnTarget(new TestCleanupBean()); assertTrue(TestCleanupPlugin.INSTANCE.isApplied()); assertTrue(TestCleanupPlugin.INSTANCE.isCleaned()); assertFalse(TestCleanupOnlyPlugin.INSTANCE.isApplied()); assertFalse(TestCleanupOnlyPlugin.INSTANCE.isCleaned()); assertFalse(TestApplyOnlyPlugin.INSTANCE.isApplied()); assertFalse(TestApplyOnlyPlugin.INSTANCE.isCleaned()); } public void testCleanupOnly() throws Throwable { reset(); runAnnotationsOnTarget(new TestCleanupOnlyBean()); assertFalse(TestCleanupPlugin.INSTANCE.isApplied()); assertFalse(TestCleanupPlugin.INSTANCE.isCleaned()); assertFalse(TestCleanupOnlyPlugin.INSTANCE.isApplied()); assertTrue(TestCleanupOnlyPlugin.INSTANCE.isCleaned()); assertFalse(TestApplyOnlyPlugin.INSTANCE.isApplied()); assertFalse(TestApplyOnlyPlugin.INSTANCE.isCleaned()); } public void testApplyOnly() throws Throwable { reset(); runAnnotationsOnTarget(new TestApplyOnlyBean()); assertFalse(TestCleanupPlugin.INSTANCE.isApplied()); assertFalse(TestCleanupPlugin.INSTANCE.isCleaned()); assertFalse(TestCleanupOnlyPlugin.INSTANCE.isApplied()); assertFalse(TestCleanupOnlyPlugin.INSTANCE.isCleaned()); assertTrue(TestApplyOnlyPlugin.INSTANCE.isApplied()); assertFalse(TestApplyOnlyPlugin.INSTANCE.isCleaned()); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/AbstractRunAnnotationsTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001336211042111600033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import java.util.Map; import java.util.HashMap; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.BaseTestCase; import org.jboss.test.kernel.annotations.support.AfterInstallVerifier; import org.jboss.dependency.spi.ControllerState; /** * Abstract annotation runner test. * * @author Ales Justin */ public abstract class AbstractRunAnnotationsTest extends BaseTestCase { private KernelController controller; private Map, AfterInstallVerifier> verifiers = new HashMap, AfterInstallVerifier>(); protected AbstractRunAnnotationsTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); controller = createController(); } protected void tearDown() throws Exception { if (controller != null) controller.shutdown(); controller = null; super.tearDown(); } protected void runAnnotationsOnTarget(Object target) throws Throwable { runAnnotationsOnTarget(target, BeanAccessMode.STANDARD); } @SuppressWarnings("unchecked") protected void runAnnotationsOnTarget(Object target, BeanAccessMode mode) throws Throwable { assertNotNull("Target is null", target); Class clazz = target.getClass(); runAnnotations(clazz, target, mode); } protected void runAnnotationsOnClass(Class clazz) throws Throwable { runAnnotationsOnClass(clazz, BeanAccessMode.STANDARD); } protected void runAnnotationsOnClass(Class clazz, BeanAccessMode mode) throws Throwable { runAnnotations(clazz, null, mode); } protected void runAnnotations(Class clazz, T target) throws Throwable { runAnnotations(clazz, target, BeanAccessMode.STANDARD); } protected void runAnnotations(Class clazz, T target, BeanAccessMode mode) throws Throwable { KernelController controller = getController(); String className = clazz.getName(); String name = target != null ? target.toString() : (className + System.currentTimeMillis()); AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData(name, className); beanMetaData.setAccessMode(mode); try { KernelControllerContext context = controller.install(beanMetaData, target); checkContextState(clazz, context); if (target == null) target = clazz.cast(context.getTarget()); doTestAfterInstall(clazz, target); } finally { controller.uninstall(name); } } @SuppressWarnings("unchecked") protected void checkContextState(Class clazz, KernelControllerContext context) { AfterInstallVerifier verifier = verifiers.get(clazz); if (verifier != null) verifier.verifyContext(context); else assertEquals(ControllerState.INSTALLED, context.getState()); } protected void addVerifier(AfterInstallVerifier verifier) { verifiers.put(verifier.getTargetClass(), verifier); } protected void removeVerifier(Class clazz) { verifiers.remove(clazz); } /** * Useful for single tests. * Else determine the test by parameters. * * @param the type * @param clazz the class * @param target the target */ @SuppressWarnings("unchecked") protected void doTestAfterInstall(Class clazz, T target) { AfterInstallVerifier verifier = (AfterInstallVerifier) verifiers.get(clazz); if (verifier != null) verifier.verify(target); else doTestAfterInstall(target); } protected void doTestAfterInstall(Object target) { doTestAfterInstall(); } protected void doTestAfterInstall() { } protected KernelController createController() throws Exception { // bootstrap KernelConfig config = createKernelConfig(); BasicBootstrap bootstrap = config != null ? new BasicBootstrap(config) : new BasicBootstrap(); bootstrap.run(); Kernel kernel = bootstrap.getKernel(); return kernel.getController(); } protected KernelConfig createKernelConfig() { return null; } protected KernelController getController() { return controller; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/BeanAnnotationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000673511014243570033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.spi.annotations.AnnotationToBeanMetaDataFactory; import org.jboss.test.kernel.annotations.support.BeanAnnotationHolder; import org.jboss.test.kernel.config.test.AbstractKernelConfigTest; /** * BeanAnnotationTestCase. * * @author Ales Justin */ public class BeanAnnotationTestCase extends AbstractKernelConfigTest { public BeanAnnotationTestCase(String name) { super(name); } public static Test suite() { return suite(BeanAnnotationTestCase.class); } public void testInitialValues() throws Throwable { SecurityManager sm = suspendSecurity(); try { BeanMetaData bmd = AnnotationToBeanMetaDataFactory.createBeanMetaData(BeanAnnotationHolder.class); assertEquals(AutowireType.CONSTRUCTOR, bmd.getAutowireType()); assertEquals(ControllerMode.ASYNCHRONOUS, bmd.getMode()); assertEquals(ErrorHandlingMode.MANUAL, bmd.getErrorHandlingMode()); assertEquals(BeanAccessMode.STANDARD, bmd.getAccessMode()); // standard, since we set it in A2BMD } finally { resumeSecurity(sm); } } public void testOverriddenValues() throws Throwable { SecurityManager sm = suspendSecurity(); try { AbstractBeanMetaData abmd = new AbstractBeanMetaData(); abmd.setAutowireType(AutowireType.BY_NAME); abmd.setMode(ControllerMode.DISABLED); abmd.setErrorHandlingMode(ErrorHandlingMode.DISCARD); abmd.setAccessMode(BeanAccessMode.FIELDS); BeanMetaData bmd = AnnotationToBeanMetaDataFactory.fillBeanMetaData(BeanAnnotationHolder.class, BeanAccessMode.FIELDS, abmd); assertEquals(AutowireType.BY_NAME, bmd.getAutowireType()); assertEquals(ControllerMode.DISABLED, bmd.getMode()); assertEquals(ErrorHandlingMode.DISCARD, bmd.getErrorHandlingMode()); assertEquals(BeanAccessMode.FIELDS, bmd.getAccessMode()); } finally { resumeSecurity(sm); } } } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/factory/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312151033343 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/factory/AnnotationFactoryTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000315410777663234033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.factory; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Annotation factory tests. * * @author Ales Justin */ public class AnnotationFactoryTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Annotation factory Tests"); suite.addTest(AnnotationToBeanMetaDataFactoryTestCase.suite()); return suite; } }././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/factory/AnnotationToBeanMetaDataFactoryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000002014310777663234033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.factory; import java.util.Collections; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.spi.annotations.AnnotationToBeanMetaDataFactory; import org.jboss.metadata.plugins.context.AbstractMetaDataContext; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.test.BaseTestCase; import org.jboss.test.kernel.annotations.support.AliasesImpl; import org.jboss.test.kernel.annotations.support.AllIoCAnnotations; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.annotations.support.SimpleBeanMetaDataAnnotationAdapter; import org.jboss.test.kernel.annotations.support.ConstructorAnnotationTester; /** * Simple field test. * * @author Ales Justin */ public class AnnotationToBeanMetaDataFactoryTestCase extends BaseTestCase { public AnnotationToBeanMetaDataFactoryTestCase(String name) { super(name); } public static Test suite() { return suite(AnnotationToBeanMetaDataFactoryTestCase.class); } protected void testInstalls(List installs) { assertNotNull(installs); assertEquals(2, installs.size()); for (InstallMetaData imd : installs) { Object bean = imd.getBean(); if (bean == null) { assertEquals("invoke", imd.getMethodName()); } else { assertEquals("bean", bean); assertEquals("method", imd.getMethodName()); } } } protected void testLifecycle(LifecycleMetaData lifecycle, String method) { assertNotNull(lifecycle); assertEquals(method, lifecycle.getMethodName()); } protected void testBMD(BeanMetaData bmd) throws Throwable { assertNotNull(bmd); assertEquals(Collections.singleton((Object)"alias"), bmd.getAliases()); assertEquals(Collections.singleton((SupplyMetaData)new AbstractSupplyMetaData("supply")), bmd.getSupplies()); assertEquals(Collections.singleton((DemandMetaData)new AbstractDemandMetaData("demand")), bmd.getDemands()); assertEquals(Collections.singleton((DependencyMetaData)new AbstractDependencyMetaData("depend")), bmd.getDepends()); ConstructorMetaData cmd = bmd.getConstructor(); assertNotNull(cmd); assertEquals(AnnotationTester.class.getName(), cmd.getFactoryClass()); assertEquals("factoryMethod", cmd.getFactoryMethod()); testInstalls(bmd.getInstalls()); testInstalls(bmd.getUninstalls()); List callbacks = bmd.getInstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); CallbackMetaData callback = callbacks.get(0); assertTrue(callback.getMethodName().contains("Something")); callbacks = bmd.getUninstallCallbacks(); assertNotNull(callbacks); assertEquals(1, callbacks.size()); callback = callbacks.get(0); assertTrue(callback.getMethodName().contains("Something")); BeanAccessMode mode = bmd.getAccessMode(); if (mode == BeanAccessMode.ALL) { Set propertys = bmd.getProperties(); assertNotNull(propertys); assertEquals(2, propertys.size()); } else { Set propertys = bmd.getProperties(); assertNotNull(propertys); assertEquals(1, propertys.size()); PropertyMetaData pmd = propertys.iterator().next(); assertEquals("number", pmd.getName()); assertInstanceOf(pmd.getValue(), AbstractDependencyValueMetaData.class); } testLifecycle(bmd.getCreate(), "myCreate"); testLifecycle(bmd.getStart(), "myStart"); testLifecycle(bmd.getStop(), "myStop"); testLifecycle(bmd.getDestroy(), "myDestroy"); } public void testDefaultAnnotation2BMDFactory() throws Throwable { BeanMetaData bmd1 = AnnotationToBeanMetaDataFactory.createBeanMetaData(AllIoCAnnotations.class); testBMD(bmd1); bmd1 = AnnotationToBeanMetaDataFactory.createBeanMetaData(AllIoCAnnotations.class, BeanAccessMode.ALL); testBMD(bmd1); bmd1 = AnnotationToBeanMetaDataFactory.createBeanMetaData(ConstructorAnnotationTester.class); ConstructorMetaData cmd = bmd1.getConstructor(); assertNotNull(cmd); List parameters = cmd.getParameters(); assertNotNull(parameters); assertEquals(1, parameters.size()); } public void testProvidedMetaData() throws Throwable { MemoryMetaDataLoader memory = new MemoryMetaDataLoader(new ScopeKey(CommonLevels.INSTANCE, "foobar")); memory.addAnnotation(new AliasesImpl("alias")); MetaDataRetrieval retrieval = new AbstractMetaDataContext(null, memory); MetaData metaData = new MetaDataRetrievalToMetaDataBridge(retrieval); BeanMetaData bmd = AnnotationToBeanMetaDataFactory.createBeanMetaData(Object.class, metaData); assertNotNull(bmd); assertEquals(Collections.singleton((Object)"alias"), bmd.getAliases()); } public void testCustomAdapter() throws Throwable { BeanMetaData bmd = AnnotationToBeanMetaDataFactory.createBeanMetaData(Object.class, new SimpleBeanMetaDataAnnotationAdapter()); assertEquals(ControllerMode.ASYNCHRONOUS, bmd.getMode()); } public void testIllegalAccessMode() throws Throwable { AbstractBeanMetaData abmd = new AbstractBeanMetaData(); abmd.setAccessMode(BeanAccessMode.FIELDS); try { AnnotationToBeanMetaDataFactory.fillBeanMetaData(Object.class, BeanAccessMode.ALL, abmd); fail("Should not be here."); } catch (Throwable t) { assertInstanceOf(t, IllegalArgumentException.class); } } }././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312151033343 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/AbstractAnnotationInheritanceTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000354510770176053033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import org.jboss.test.kernel.annotations.test.AbstractRunAnnotationsTest; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; /** * Testing annotations inheritance. * * @author Ales Justin */ public abstract class AbstractAnnotationInheritanceTest extends AbstractRunAnnotationsTest { protected AbstractAnnotationInheritanceTest(String name) { super(name); } protected KernelControllerContext install(String name, Class clazz) throws Throwable { KernelController controller = getController(); return controller.install(new AbstractBeanMetaData(name, clazz.getName())); } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/InstallationAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000431110760522134033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.InstallationAnnotationTester; import org.jboss.test.kernel.annotations.support.MyDeployer; import org.jboss.test.kernel.annotations.support.SubInstallationAnnotationTester; /** * Installation annotation inheritance test. * * @author Ales Justin */ public class InstallationAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public InstallationAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(InstallationAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { install("deployer", MyDeployer.class); InstallationAnnotationTester tester = new SubInstallationAnnotationTester(); runAnnotationsOnTarget(tester); assertTrue(0 == tester.getValue()); } protected void doTestAfterInstall(Object target) { InstallationAnnotationTester tester = (InstallationAnnotationTester)target; assertTrue(1 == tester.getValue()); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/CallbackAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000425210760522134033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.CallbackAnnotationTester; import org.jboss.test.kernel.annotations.support.SubCallbackAnnotationTester; import org.jboss.test.kernel.annotations.support.MyDeployer; /** * Callback annotation inheritance test. * * @author Ales Justin */ public class CallbackAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public CallbackAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(CallbackAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { install("deployer", MyDeployer.class); SubCallbackAnnotationTester tester = new SubCallbackAnnotationTester(); runAnnotationsOnTarget(tester); assertTrue(0 == tester.getValue()); } protected void doTestAfterInstall(Object target) { CallbackAnnotationTester tester = (CallbackAnnotationTester)target; assertTrue(1 == tester.getValue()); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/ConstructorAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000462510760522134033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.test.kernel.annotations.support.ConstructorInheritanceTester; import org.jboss.test.kernel.annotations.support.SubConstructorInheritanceTester; /** * Constructor annotation inheritance test. * * @author Ales Justin */ public class ConstructorAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public ConstructorAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(ConstructorAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { install("somebean", Object.class); runAnnotationsOnTarget(new SubConstructorInheritanceTester()); ControllerContext kcc = install("cit", ConstructorInheritanceTester.class); assertNotNull(kcc); assertNotNull(kcc.getTarget()); assertInstanceOf(kcc.getTarget(), ConstructorInheritanceTester.class); assertNotNull(((ConstructorInheritanceTester)kcc.getTarget()).getValue()); } protected void doTestAfterInstall(Object target) { SubConstructorInheritanceTester tester = (SubConstructorInheritanceTester)target; assertNull(tester.getValue()); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/FactoryAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000355710760522134033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.FactoryAnnotationTester; import org.jboss.test.kernel.annotations.support.SubFactoryAnnotationTester; /** * Factory annotation inheritance test. * * @author Ales Justin */ public class FactoryAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public FactoryAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(FactoryAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { FactoryAnnotationTester tester = new SubFactoryAnnotationTester(); runAnnotationsOnTarget(tester); assertNull(tester.getValue()); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/ExternalAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000332410760522134033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.SubExternalAnnotationTester; /** * External annotation inheritance test. * * @author Ales Justin */ public class ExternalAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public ExternalAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(ExternalAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { runAnnotationsOnTarget(new SubExternalAnnotationTester()); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/PropertyAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000406610760522134033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.SubPropertyInheritanceTester; /** * Property annotation inheritance test. * * @author Ales Justin */ public class PropertyAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public PropertyAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(PropertyAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { install("somebean", Object.class); SubPropertyInheritanceTester tester = new SubPropertyInheritanceTester(); runAnnotationsOnTarget(new SubPropertyInheritanceTester()); assertNull(tester.getValue()); } protected void doTestAfterInstall(Object target) { SubPropertyInheritanceTester tester = (SubPropertyInheritanceTester)target; assertNotNull(tester.getValue()); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/AnnotationsInheritanceTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000414610760376602033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Testing annotations inheritance. * * @author Ales Justin */ public class AnnotationsInheritanceTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Annotation Inheritance tests"); suite.addTest(PropertyAnnotationInheritanceTestCase.suite()); suite.addTest(ConstructorAnnotationInheritanceTestCase.suite()); suite.addTest(LifecycleAnnotationInheritanceTestCase.suite()); suite.addTest(CallbackAnnotationInheritanceTestCase.suite()); suite.addTest(InstallationAnnotationInheritanceTestCase.suite()); suite.addTest(SetsAnnotationInheritanceTestCase.suite()); suite.addTest(FactoryAnnotationInheritanceTestCase.suite()); suite.addTest(ExternalAnnotationInheritanceTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/SetsAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000606610760376602033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.test.kernel.annotations.support.SubSetsAnnotationTester; import org.jboss.test.kernel.annotations.support.SetsAnnotationTester; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Sets annotation inheritance test. * * @author Ales Justin */ public class SetsAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public SetsAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(SetsAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { KernelController controller = getController(); AbstractBeanMetaData bmd1 = new AbstractBeanMetaData("deployer", Object.class.getName()); controller.install(bmd1); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("demander", Object.class.getName()); builder.addDemand("somesupply"); controller.install(builder.getBeanMetaData()); runAnnotationsOnClass(SubSetsAnnotationTester.class); controller.install(new AbstractBeanMetaData("setssupplier", SetsAnnotationTester.class.getName())); checkDemander(ControllerState.INSTALLED); } protected void doTestAfterInstall() { checkDemander(ControllerState.PRE_INSTALL); } protected void checkDemander(ControllerState state) { try { Controller controller = getController(); ControllerContext context = controller.getContext("demander", state); assertNotNull(context); } catch (Throwable t) { throw new RuntimeException(t); } } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/inheritance/LifecycleAnnotationInheritanceTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000421110760376602033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.inheritance; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.SubLifecycleAnnotationTester; /** * Lifecycle annotation inheritance test. * * @author Ales Justin */ public class LifecycleAnnotationInheritanceTestCase extends AbstractAnnotationInheritanceTest { public LifecycleAnnotationInheritanceTestCase(String name) { super(name); } public static Test suite() { return suite(LifecycleAnnotationInheritanceTestCase.class); } public void testInheritance() throws Throwable { SubLifecycleAnnotationTester tester = new SubLifecycleAnnotationTester(); runAnnotationsOnTarget(tester); Object[] value = tester.getValue(); assertEquals(new Object[]{null, null, "dewdew", "dew"}, value); } protected void doTestAfterInstall(Object target) { SubLifecycleAnnotationTester tester = (SubLifecycleAnnotationTester)target; Object[] value = tester.getValue(); assertEquals(new Object[]{"dew", "dewdew", null, null}, value); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/FactoryMethodXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000346110661317020033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.config.support.XMLUtil; import junit.framework.Test; /** * @author Ales Justin */ public class FactoryMethodXMLTestCase extends FactoryMethodTestCase { public FactoryMethodXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(FactoryMethodXMLTestCase.class); } protected AnnotationTester getTester() throws Throwable { XMLUtil util = bootstrapXML(true); Object tester = util.getBean("Tester"); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/OwnDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000433011014545271033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.annotations.BasicBeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.SecurityDomainAnnotationPlugin; import org.jboss.test.kernel.annotations.support.MyOwnDependency; /** * @author Ales Justin */ public class OwnDependencyTestCase extends AbstractBeanAnnotationAdapterTest { public OwnDependencyTestCase(String name) { super(name); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { BasicBeanAnnotationAdapter adapter = BasicBeanAnnotationAdapter.INSTANCE; adapter.addAnnotationPlugin(new SecurityDomainAnnotationPlugin()); return adapter; } public void testCustomDependency() throws Throwable { runAnnotationsOnTarget(new MyOwnDependency()); } protected void checkContextState(Class clazz, KernelControllerContext context) { assertEquals(ControllerState.DESCRIBED, context.getState()); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/wb/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312151033343 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/wb/WBInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001270511014545271033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.wb; import java.lang.annotation.Annotation; import java.util.HashSet; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.annotations.AbstractBeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.Annotation2ValueMetaDataAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.ConstructorParameterAnnotationPlugin; import org.jboss.kernel.plugins.annotations.StartLifecycleAnnotationPlugin; import org.jboss.kernel.plugins.annotations.wb.WBInjectAnnotationPlugin; import org.jboss.kernel.plugins.annotations.wb.WBInjectFieldAnnotationPlugin; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.AfterInstallVerifier; import org.jboss.test.kernel.annotations.support.GBProvider; import org.jboss.test.kernel.annotations.support.RBProvider; import org.jboss.test.kernel.annotations.support.RGBProvider; import org.jboss.test.kernel.annotations.support.RGProvider; import org.jboss.test.kernel.annotations.support.WBTester; import org.jboss.test.kernel.annotations.test.AbstractBeanAnnotationAdapterTest; /** * WB injection tests. * * @author Ales Justin */ public class WBInjectionTestCase extends AbstractBeanAnnotationAdapterTest { public WBInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(WBInjectionTestCase.class); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { AbstractBeanAnnotationAdapter adapter = new AbstractBeanAnnotationAdapter(); // wb injection adapter.addAnnotationPlugin(WBInjectFieldAnnotationPlugin.INSTANCE); adapter.addAnnotationPlugin(WBInjectAnnotationPlugin.INSTANCE); // parameter adapter Annotation2ValueMetaDataAdapter paramAdapter = WBInjectAnnotationPlugin.INSTANCE; Set> adapters = new HashSet>(); adapters.add(paramAdapter); // parameter injections adapter.addAnnotationPlugin(new ConstructorParameterAnnotationPlugin(adapters)); adapter.addAnnotationPlugin(new StartLifecycleAnnotationPlugin(adapters)); return adapter; } public void testInjection() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("rg", RGProvider.class.getName())); controller.install(new AbstractBeanMetaData("rb", RBProvider.class.getName())); controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName())); runAnnotationsOnClass(WBTester.class, BeanAccessMode.ALL); } public void testMultiple() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("gb", GBProvider.class.getName())); controller.install(new AbstractBeanMetaData("rgb", RGBProvider.class.getName())); AfterInstallVerifier verifier = new AfterInstallVerifier() { public void verifyContext(KernelControllerContext context) { assertEquals(ControllerState.DESCRIBED, context.getState()); } public void verify(WBTester target) { assertNull(target); } public Class getTargetClass() { return WBTester.class; } }; addVerifier(verifier); try { runAnnotationsOnClass(WBTester.class, BeanAccessMode.ALL); } finally { removeVerifier(WBTester.class); } } protected void doTestAfterInstall(Object target) { WBTester demander = (WBTester)target; assertEquals("RG", demander.getRg_provider() + ""); assertEquals("RB", demander.getRb_provider() + ""); assertEquals("GB", demander.getGb_provider1() + ""); assertEquals("GB", demander.getGb_provider2() + ""); assertEquals(demander.getGb_provider1(), demander.getGb_provider2()); } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/wb/WBTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000315311014545271033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.wb; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * WB annotations tests. * * @author Ales Justin */ public class WBTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("WB Tests"); suite.addTest(AnnotationsMatchingTestCase.suite()); suite.addTest(WBInjectionTestCase.suite()); return suite; } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/wb/AnnotationsMatchingTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001070411042111600033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.wb; import junit.framework.Test; import org.jboss.kernel.plugins.annotations.AnnotationPlugin; import org.jboss.kernel.plugins.annotations.BasicBeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.wb.AnnotationsAnnotationPluginFactory; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.annotations.support.Blue; import org.jboss.test.kernel.annotations.support.Green; import org.jboss.test.kernel.annotations.support.Red; import org.jboss.test.kernel.annotations.support.RGBSupplier; import org.jboss.test.kernel.annotations.support.RGBDemander; import org.jboss.test.kernel.annotations.test.AbstractBeanAnnotationAdapterTest; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.info.spi.BeanAccessMode; /** * WB annotations matching tests. * * @author Ales Justin */ public class AnnotationsMatchingTestCase extends AbstractBeanAnnotationAdapterTest { public AnnotationsMatchingTestCase(String name) { super(name); } public static Test suite() { return suite(AnnotationsMatchingTestCase.class); } @SuppressWarnings("unchecked") protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { BasicBeanAnnotationAdapter basic = BasicBeanAnnotationAdapter.INSTANCE; // injection AnnotationPlugin redInjection = AnnotationsAnnotationPluginFactory.createPropertyInjectionPlugin(Red.class); basic.addAnnotationPlugin(redInjection); redInjection = AnnotationsAnnotationPluginFactory.createFieldInjectionPlugin(Red.class); basic.addAnnotationPlugin(redInjection); AnnotationPlugin greenInjection = AnnotationsAnnotationPluginFactory.createPropertyInjectionPlugin(Green.class); basic.addAnnotationPlugin(greenInjection); greenInjection = AnnotationsAnnotationPluginFactory.createFieldInjectionPlugin(Green.class); basic.addAnnotationPlugin(greenInjection); AnnotationPlugin blueInjection = AnnotationsAnnotationPluginFactory.createPropertyInjectionPlugin(Blue.class); basic.addAnnotationPlugin(blueInjection); blueInjection = AnnotationsAnnotationPluginFactory.createFieldInjectionPlugin(Blue.class); basic.addAnnotationPlugin(blueInjection); // class AnnotationPlugin redSupply = AnnotationsAnnotationPluginFactory.createClassPlugin(Red.class); basic.addAnnotationPlugin(redSupply); AnnotationPlugin greenSupply = AnnotationsAnnotationPluginFactory.createClassPlugin(Green.class); basic.addAnnotationPlugin(greenSupply); AnnotationPlugin blueSupply = AnnotationsAnnotationPluginFactory.createClassPlugin(Blue.class); basic.addAnnotationPlugin(blueSupply); return basic; } public void testAnnotationsInjection() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("supplier", RGBSupplier.class.getName())); runAnnotationsOnClass(RGBDemander.class, BeanAccessMode.ALL); } protected void doTestAfterInstall(Object target) { RGBDemander demander = (RGBDemander)target; assertNotNull(demander.getRg()); assertNotNull(demander.getGb()); assertNotNull(demander.getRb()); assertNotNull(demander.getRgb()); } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/AfterInstantiateAnnotationsTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001236410772216276033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import java.util.List; import java.util.Set; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapterFactory; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.AfterInstantiateTester; import org.jboss.test.kernel.annotations.support.OtherVerifier; /** * @author Ales Justin */ public class AfterInstantiateAnnotationsTestCase extends AbstractBeanAnnotationAdapterTest { public AfterInstantiateAnnotationsTestCase(String name) { super(name); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { return BeanAnnotationAdapterFactory.getInstance().getBeanAnnotationAdapter(); } public static Test suite() { return suite(AfterInstantiateAnnotationsTestCase.class); } public void testAfterInstantiationBeanInfo() throws Throwable { KernelController controller = getController(); // other KernelControllerContext occ = controller.install(new AbstractBeanMetaData("other", OtherVerifier.class.getName())); assertNotNull(occ); Object tcc = occ.getTarget(); assertNotNull(tcc); // tester AbstractBeanMetaData abmd = new AbstractBeanMetaData(); BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(abmd); builder.setName("tester"); builder.setAccessMode(BeanAccessMode.ALL); builder.setFactoryClass(AfterInstantiateTester.class.getName()); builder.setFactoryMethod("getTester"); KernelControllerContext kcc = controller.install(builder.getBeanMetaData()); try { assertNotNull(kcc); BeanMetaData beanMetaData = kcc.getBeanMetaData(); // test aliases assertNotNull(controller.getContext("qwert", null)); // propertys Set properties = beanMetaData.getProperties(); assertNotNull(properties); assertEquals(2, properties.size()); // lifecycle LifecycleMetaData create = beanMetaData.getCreate(); assertNotNull(create); assertEquals("createMe", create.getMethodName()); LifecycleMetaData start = beanMetaData.getStart(); assertNotNull(start); assertEquals("startMe", start.getMethodName()); LifecycleMetaData stop = beanMetaData.getStop(); assertNotNull(stop); assertEquals("stopMe", stop.getMethodName()); LifecycleMetaData destroy = beanMetaData.getDestroy(); assertNotNull(destroy); assertEquals("destroyMe", destroy.getMethodName()); // callbacks List incallbacks = beanMetaData.getInstallCallbacks(); assertNotNull(incallbacks); assertEquals(2, incallbacks.size()); List uncallbacks = beanMetaData.getUninstallCallbacks(); assertNotNull(uncallbacks); assertEquals(2, uncallbacks.size()); // installs List installs = beanMetaData.getInstalls(); assertNotNull(installs); assertEquals(2, installs.size()); List uninstalls = beanMetaData.getUninstalls(); assertNotNull(uninstalls); assertEquals(2, uninstalls.size()); Object tkcc = kcc.getTarget(); assertNotNull(tkcc); AfterInstantiateTester tester = assertInstanceOf(tkcc, AfterInstantiateTester.class); assertTrue(tester.time != 0); } finally { controller.uninstall(kcc.getName()); } } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312150033342 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/CallbackAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000736310756342051033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.annotations.support.MyDeployer; /** * @author Ales Justin */ public class CallbackAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { private Controller controller; public CallbackAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public CallbackAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(CallbackAnnotationOverrideTestCase.class); } protected String getType() { return "Callback"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { List installs = new ArrayList(); InstallCallbackMetaData in = new InstallCallbackMetaData(); in.setMethodName("addMyDeployer"); installs.add(in); List uninstalls = new ArrayList(); UninstallCallbackMetaData un = new UninstallCallbackMetaData(); un.setMethodName("removeMyDeployer"); uninstalls.add(un); beanMetaData.setInstallCallbacks(installs); beanMetaData.setUninstallCallbacks(uninstalls); } public void testCallbackOverride() throws Throwable { AnnotationTester tester = getTester(); Object val = tester.getValue(); assertInstanceOf(val, Integer.class); Integer count = (Integer)val; assertNotNull(count); assertEquals(1, count.intValue()); doUndeploy(); val = tester.getValue(); assertInstanceOf(val, Integer.class); count = (Integer)val; assertNotNull(count); assertEquals(0, count.intValue()); } protected void afterInstall(KernelController controller, KernelControllerContext context) throws Throwable { controller.install(new AbstractBeanMetaData("deployer", MyDeployer.class.getName())); this.controller = controller; } protected void doUndeploy() { controller.uninstall("deployer"); controller = null; } } ././@LongLink0000000000000000000000000000023200000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/LifecycleAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000633210661317020033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * @author Ales Justin */ public class LifecycleAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { private Controller controller; private ControllerContext context; public LifecycleAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public LifecycleAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(LifecycleAnnotationOverrideTestCase.class); } protected String getType() { return "Lifecycle"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { beanMetaData.setCreate(new AbstractLifecycleMetaData("fromXMLCreate")); beanMetaData.setStart(new AbstractLifecycleMetaData("fromXMLStart")); beanMetaData.setStop(new AbstractLifecycleMetaData("fromXMLStop")); beanMetaData.setDestroy(new AbstractLifecycleMetaData("fromXMLDestroy")); } public void testLifecycleOverride() throws Throwable { AnnotationTester tester = getTester(); Object[] values = (Object[])tester.getValue(); assertEquals(new Object[]{FROM_XML, FROM_XML, null, null}, values); doUndeploy(); values = (Object[])tester.getValue(); assertEquals(new Object[]{null, null, FROM_XML, FROM_XML}, values); } protected void afterInstall(KernelController controller, KernelControllerContext context) { this.controller = controller; this.context = context; } protected void doUndeploy() { controller.uninstall(context.getName()); controller = null; context = null; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/InstallationAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000376310661317020033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.config.support.XMLUtil; /** * @author Ales Justin */ public class InstallationAnnotationOverrideXMLTestCase extends InstallationAnnotationOverrideTestCase { private XMLUtil util; public InstallationAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(InstallationAnnotationOverrideXMLTestCase.class); } protected AnnotationTester getTester() throws Throwable { util = bootstrapXML(true); Object tester = util.getBean(getTesterName()); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } protected void doUndeploy() { util.undeploy(); util = null; } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/ConstructorAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000276710661317020033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; /** * @author Ales Justin */ public class ConstructorAnnotationOverrideXMLTestCase extends ConstructorAnnotationOverrideTestCase { public ConstructorAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(ConstructorAnnotationOverrideXMLTestCase.class); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/ExternalAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001113110661317020033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import java.util.ArrayList; import java.util.List; import java.util.Collections; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.annotations.support.HolderAnnotationTester; /** * @author Ales Justin */ public class ExternalAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { private KernelController controller; public ExternalAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public ExternalAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ExternalAnnotationOverrideTestCase.class); } protected String getType() { return "External"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { ParameterMetaData parameter = new AbstractParameterMetaData(new ThisValueMetaData()); List installs = new ArrayList(); AbstractInstallMetaData in = new AbstractInstallMetaData(); in.setBean("Holder"); in.setMethodName("addTester"); in.setParameters(Collections.singletonList(parameter)); installs.add(in); List uninstalls = new ArrayList(); AbstractInstallMetaData un = new AbstractInstallMetaData(); un.setBean("Holder"); un.setMethodName("removeTester"); un.setParameters(Collections.singletonList(parameter)); uninstalls.add(un); beanMetaData.setInstalls(installs); beanMetaData.setUninstalls(uninstalls); } public void testExternalOverride() throws Throwable { getTester(getTesterName(), ControllerState.START); AnnotationTester holder = getHolder(); Object val = holder.getValue(); assertInstanceOf(val, Integer.class); Integer count = (Integer)val; assertNotNull(count); assertEquals(1, count.intValue()); doUndeploy(); val = holder.getValue(); assertInstanceOf(val, Integer.class); count = (Integer)val; assertNotNull(count); assertEquals(0, count.intValue()); } protected void afterInstall(KernelController controller, KernelControllerContext context) throws Throwable { controller.install(new AbstractBeanMetaData("Holder", HolderAnnotationTester.class.getName())); this.controller = controller; } protected AnnotationTester getHolder() throws Throwable { ControllerContext context = controller.getInstalledContext("Holder"); assertNotNull(context); Object target = context.getTarget(); assertInstanceOf(target, HolderAnnotationTester.class); return (AnnotationTester)target; } protected void doUndeploy() { controller.uninstall(getTesterName()); controller = null; } } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/SetsAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000742710756342051033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import java.util.Collections; import java.util.Set; import java.util.HashSet; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.MyDeployer; /** * @author Ales Justin */ public class SetsAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { private KernelControllerContext context; public SetsAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public SetsAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(SetsAnnotationOverrideTestCase.class); } protected String getType() { return "Sets"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { Set demands = Collections.singleton((DemandMetaData)new AbstractDemandMetaData("deployer")); beanMetaData.setDemands(new HashSet(demands)); Set depends = Collections.singleton((DependencyMetaData)new AbstractDependencyMetaData("deployer")); beanMetaData.setDepends(new HashSet(depends)); Set supplys = Collections.singleton((SupplyMetaData)new AbstractSupplyMetaData("somesupply")); beanMetaData.setSupplies(new HashSet(supplys)); } public void testSetsOverride() throws Throwable { getTester(); BeanMetaData beanMetaData = getBeanMetaData(); assertSet(beanMetaData.getDemands()); assertSet(beanMetaData.getDepends()); assertSet(beanMetaData.getSupplies()); } protected BeanMetaData getBeanMetaData() { return context.getBeanMetaData(); } protected void assertSet(Set set) { assertNotNull(set); assertEquals(1, set.size()); } protected void afterInstall(KernelController controller, KernelControllerContext context) throws Throwable { controller.install(new AbstractBeanMetaData("deployer", MyDeployer.class.getName())); this.context = context; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/CallbackAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000414510661317020033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.kernel.spi.dependency.KernelController; import junit.framework.Test; /** * @author Ales Justin */ public class CallbackAnnotationOverrideXMLTestCase extends CallbackAnnotationOverrideTestCase { private XMLUtil util; public CallbackAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(CallbackAnnotationOverrideXMLTestCase.class); } protected AnnotationTester getTester() throws Throwable { util = bootstrapXML(true); Object tester = util.getBean(getTesterName()); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } protected void doUndeploy() { KernelController kc = util.getKernel().getController(); kc.uninstall("deployer"); util = null; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/LifecycleAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000374710661317020033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.annotations.support.AnnotationTester; /** * @author Ales Justin */ public class LifecycleAnnotationOverrideXMLTestCase extends LifecycleAnnotationOverrideTestCase { private XMLUtil util; public LifecycleAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(LifecycleAnnotationOverrideXMLTestCase.class); } protected AnnotationTester getTester() throws Throwable { util = bootstrapXML(true); Object tester = util.getBean(getTesterName()); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } protected void doUndeploy() { util.undeploy(); util = null; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/InstallationAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000724510661317020033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.annotations.support.AnnotationTester; /** * @author Ales Justin */ public class InstallationAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { private Controller controller; private ControllerContext context; public InstallationAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public InstallationAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(InstallationAnnotationOverrideTestCase.class); } protected String getType() { return "Installation"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { List installs = new ArrayList(); AbstractInstallMetaData in = new AbstractInstallMetaData(); in.setMethodName("addMyDeployer"); installs.add(in); List uninstalls = new ArrayList(); AbstractInstallMetaData un = new AbstractInstallMetaData(); un.setMethodName("removeMyDeployer"); uninstalls.add(un); beanMetaData.setInstalls(installs); beanMetaData.setUninstalls(uninstalls); } public void testCallbackOverride() throws Throwable { AnnotationTester tester = getTester(); Object val = tester.getValue(); assertInstanceOf(val, Integer.class); Integer count = (Integer)val; assertNotNull(count); assertEquals(1, count.intValue()); doUndeploy(); val = tester.getValue(); assertInstanceOf(val, Integer.class); count = (Integer)val; assertNotNull(count); assertEquals(0, count.intValue()); } protected void afterInstall(KernelController controller, KernelControllerContext context) throws Throwable { this.controller = controller; this.context = context; } protected void doUndeploy() { controller.uninstall(context.getName()); controller = null; context = null; } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/ExternalAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000454110661317020033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.annotations.support.HolderAnnotationTester; import org.jboss.dependency.spi.ControllerState; import junit.framework.Test; /** * @author Ales Justin */ public class ExternalAnnotationOverrideXMLTestCase extends ExternalAnnotationOverrideTestCase { private XMLUtil util; public ExternalAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(ExternalAnnotationOverrideXMLTestCase.class); } protected AnnotationTester getTester(String name, ControllerState state) throws Throwable { util = bootstrapXML(true); Object tester = util.getBean(getTesterName()); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } protected AnnotationTester getHolder() throws Throwable { Object holder = util.getBean("Holder"); assertInstanceOf(holder, HolderAnnotationTester.class); return (AnnotationTester)holder; } protected void doUndeploy() { util.undeploy(); util = null; } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/PropertyAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000403310661317020033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; /** * @author Ales Justin */ public class PropertyAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { public PropertyAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public PropertyAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(PropertyAnnotationOverrideTestCase.class); } protected String getType() { return "Property"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { beanMetaData.addProperty(new AbstractPropertyMetaData("value", "FromXML")); } public void testPropertyOverride() throws Throwable { checkOverride(); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/PropertyAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000275110661317020033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; /** * @author Ales Justin */ public class PropertyAnnotationOverrideXMLTestCase extends PropertyAnnotationOverrideTestCase { public PropertyAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(PropertyAnnotationOverrideXMLTestCase.class); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000274510667033716033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; /** * @author Ales Justin */ public class FactoryAnnotationOverrideXMLTestCase extends FactoryAnnotationOverrideTestCase { public FactoryAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(FactoryAnnotationOverrideXMLTestCase.class); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/AnnotationsOverrideTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000516710661317020033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.textui.TestRunner; import junit.framework.Test; import junit.framework.TestSuite; /** * Testing XML override of annotations. * * @author Ales Justin */ public class AnnotationsOverrideTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Annotation Override tests"); suite.addTest(PropertyAnnotationOverrideTestCase.suite()); suite.addTest(PropertyAnnotationOverrideXMLTestCase.suite()); suite.addTest(ConstructorAnnotationOverrideTestCase.suite()); suite.addTest(ConstructorAnnotationOverrideXMLTestCase.suite()); suite.addTest(LifecycleAnnotationOverrideTestCase.suite()); suite.addTest(LifecycleAnnotationOverrideXMLTestCase.suite()); suite.addTest(CallbackAnnotationOverrideTestCase.suite()); suite.addTest(CallbackAnnotationOverrideXMLTestCase.suite()); suite.addTest(InstallationAnnotationOverrideTestCase.suite()); suite.addTest(InstallationAnnotationOverrideXMLTestCase.suite()); suite.addTest(SetsAnnotationOverrideTestCase.suite()); suite.addTest(SetsAnnotationOverrideXMLTestCase.suite()); suite.addTest(FactoryAnnotationOverrideTestCase.suite()); suite.addTest(FactoryAnnotationOverrideXMLTestCase.suite()); suite.addTest(ExternalAnnotationOverrideTestCase.suite()); suite.addTest(ExternalAnnotationOverrideXMLTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/FactoryAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000441410661317020033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.test.kernel.annotations.support.FactoryTesterCreator; /** * @author Ales Justin */ public class FactoryAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { public FactoryAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public FactoryAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(FactoryAnnotationOverrideTestCase.class); } protected String getType() { return "Factory"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(FactoryTesterCreator.class.getName()); constructor.setFactoryMethod("fromXML"); beanMetaData.setConstructor(constructor); } public void testFactoryOverride() throws Throwable { checkOverride(); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/SetsAnnotationOverrideXMLTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000452410661317020033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import junit.framework.Test; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.config.support.XMLUtil; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * @author Ales Justin */ public class SetsAnnotationOverrideXMLTestCase extends SetsAnnotationOverrideTestCase { private XMLUtil util; public SetsAnnotationOverrideXMLTestCase(String name) throws Throwable { super(name, true); } public static Test suite() { return suite(SetsAnnotationOverrideXMLTestCase.class); } protected AnnotationTester getTester() throws Throwable { util = bootstrapXML(true); Object tester = util.getBean(getTesterName()); assertInstanceOf(tester, AnnotationTester.class, false); return (AnnotationTester)tester; } protected BeanMetaData getBeanMetaData() { KernelController kc = util.getKernel().getController(); KernelControllerContext context = (KernelControllerContext)kc.getInstalledContext(getTesterName()); assertNotNull(context); return context.getBeanMetaData(); } } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/ConstructorAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000475410661317020033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import java.util.List; import java.util.ArrayList; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; /** * @author Ales Justin */ public class ConstructorAnnotationOverrideTestCase extends AbstractAnnotationOverrideTestCase { public ConstructorAnnotationOverrideTestCase(String name) throws Throwable { super(name); } public ConstructorAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(ConstructorAnnotationOverrideTestCase.class); } protected String getType() { return "Constructor"; } protected void addMetaData(AbstractBeanMetaData beanMetaData) { AbstractConstructorMetaData constructorMetaData = new AbstractConstructorMetaData(); List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData("FromXML")); constructorMetaData.setParameters(parameters); beanMetaData.setConstructor(constructorMetaData); } public void testConstructorOverride() throws Throwable { checkOverride(); } } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/override/AbstractAnnotationOverrideTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000700210661317020033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.override; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.config.test.AbstractKernelConfigTest; import org.jboss.test.kernel.config.support.XMLUtil; /** * @author Ales Justin */ public abstract class AbstractAnnotationOverrideTestCase extends AbstractKernelConfigTest { protected static final String FROM_XML = "FromXML"; protected AbstractAnnotationOverrideTestCase(String name) throws Throwable { super(name); } protected AbstractAnnotationOverrideTestCase(String name, boolean xmltest) { super(name, xmltest); } protected abstract void addMetaData(AbstractBeanMetaData beanMetaData); protected abstract String getType(); protected String getClasName() { String name = AnnotationTester.class.getName(); int p = name.lastIndexOf(".") + 1; return new StringBuilder(name).insert(p, getType()).toString(); } protected Object getBean(String name, ControllerState state) throws Throwable { if (xmltest) { XMLUtil util = bootstrapXML(true); return util.getBean(name); } else { AbstractBeanMetaData bean = new AbstractBeanMetaData("Tester", getClasName()); addMetaData(bean); return instantiate(bean, state); } } protected String getTesterName() { return "Tester"; } protected AnnotationTester getTester() throws Throwable { return getTester(getTesterName()); } protected AnnotationTester getTester(String name) throws Throwable { return getTester(name, null); } protected AnnotationTester getTester(String name, ControllerState state) throws Throwable { Object tester = getBean(name, state); assertNotNull(tester); assertInstanceOf(tester, AnnotationTester.class, false); Class clazz = Class.forName(getClasName()); assertInstanceOf(tester, clazz); return (AnnotationTester)tester; } protected void assertOverride(Object value) { assertEquals("Should be from xml.", FROM_XML, value); } // simple check protected void checkOverride() throws Throwable { AnnotationTester tester = getTester(); assertOverride(tester.getValue()); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/AnnotationSupportTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000360211014243570033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Additional annotation features tests. * * @author Ales Justin */ public class AnnotationSupportTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Annotation Support Tests"); suite.addTest(FactoryMethodTestCase.suite()); suite.addTest(FactoryMethodXMLTestCase.suite()); suite.addTest(FactoryMethodBadTestCase.suite()); suite.addTest(CleanupAnnotationTestCase.suite()); suite.addTest(AfterInstantiateAnnotationsTestCase.suite()); suite.addTest(BeanAnnotationTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/AnnotationsTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000454611034660617033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.jboss.test.kernel.annotations.test.factory.AnnotationFactoryTestSuite; import org.jboss.test.kernel.annotations.test.field.AnnotationFieldTestSuite; import org.jboss.test.kernel.annotations.test.inheritance.AnnotationsInheritanceTestSuite; import org.jboss.test.kernel.annotations.test.override.AnnotationsOverrideTestSuite; import org.jboss.test.kernel.annotations.test.wb.WBTestSuite; import org.jboss.test.kernel.annotations.test.search.SearchTestSuite; /** * Annotations tests. * * @author Ales Justin */ public class AnnotationsTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Annotations Tests"); suite.addTest(AnnotationSupportTestSuite.suite()); suite.addTest(AnnotationsOverrideTestSuite.suite()); suite.addTest(AnnotationsInheritanceTestSuite.suite()); suite.addTest(AnnotationFieldTestSuite.suite()); suite.addTest(AnnotationFactoryTestSuite.suite()); suite.addTest(WBTestSuite.suite()); suite.addTest(SearchTestSuite.suite()); return suite; } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312151033343 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/SearchTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000331211035634543033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.search; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Search annotation tests. * * @author Ales Justin */ public class SearchTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Search Tests"); suite.addTest(BasicSearchAnnotationSupportTestCase.suite()); suite.addTest(OrderSearchAnnotationSupportTestCase.suite()); suite.addTest(ScopeKeySearchTestCase.suite()); return suite; } }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/AbstractSearchAnnotationSupportTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000761511035124176033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.search; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.plugins.annotations.AbstractBeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BasicBeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.SearchPropertyAnnotationPlugin; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; import org.jboss.metadata.plugins.scope.InstanceScope; import org.jboss.test.kernel.annotations.support.ScopeTester; import org.jboss.test.kernel.annotations.test.AbstractBeanAnnotationAdapterTest; /** * Abstract search annotation IoC support * * @author Ales Justin */ public abstract class AbstractSearchAnnotationSupportTest extends AbstractBeanAnnotationAdapterTest { protected static int counter = 0; protected AbstractSearchAnnotationSupportTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); AbstractBeanAnnotationAdapter adapter = BasicBeanAnnotationAdapter.INSTANCE; adapter.addAnnotationPlugin(SearchPropertyAnnotationPlugin.INSTANCE); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { return BasicBeanAnnotationAdapter.INSTANCE; } protected void tearDown() throws Exception { AbstractBeanAnnotationAdapter adapter = BasicBeanAnnotationAdapter.INSTANCE; adapter.removeAnnotationPlugin(SearchPropertyAnnotationPlugin.INSTANCE); super.tearDown(); } protected void assertScopeTester(ScopeTester tester, String scope) { assertNotNull(scope, tester); assertEquals(scope, tester.getScope()); } protected ControllerContext install(String scope, String app, String deployment, int id) throws Throwable { BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("tester" + (++counter), ScopeTester.class.getName()); builder.addConstructorParameter(String.class.getName(), scope); builder.addAnnotation("@" + Aliases.class.getName() + "({\"bean\"})"); if (app != null) builder.addAnnotation("@" + ApplicationScope.class.getName() + "(\"" + app + "\")"); if (deployment != null) builder.addAnnotation("@" + DeploymentScope.class.getName() + "(\"" + deployment + "\")"); if (id > 0) builder.addAnnotation("@" + InstanceScope.class.getName() + "(\"id-" + Integer.toString(id) + "\")"); KernelController controller = getController(); return controller.install(builder.getBeanMetaData()); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/BasicSearchAnnotationSupportTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000560011035103604033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.search; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.test.kernel.annotations.support.SearchInjection; /** * Basic search annotation IoC support * * @author Ales Justin */ public class BasicSearchAnnotationSupportTestCase extends AbstractSearchAnnotationSupportTest { public BasicSearchAnnotationSupportTestCase(String name) { super(name); } public static Test suite() { return suite(BasicSearchAnnotationSupportTestCase.class); } public void testSearchTypes() throws Throwable { List contexts = new ArrayList(); try { contexts.add(install("top", null, null, -1)); contexts.add(install("parent", "main", null, -1)); contexts.add(install("local", "main", "core", -1)); contexts.add(install("child", "main", "core", 1)); runAnnotationsOnClass(SearchInjection.class); } finally { ListIterator iter = contexts.listIterator(contexts.size()); while (iter.hasPrevious()) { getController().uninstall(iter.previous().getName()); } } } protected void doTestAfterInstall(Object target) { SearchInjection si = (SearchInjection)target; assertScopeTester(si.getTop(), "top"); assertScopeTester(si.getParent(), "parent"); assertScopeTester(si.getLocal(), "local"); assertScopeTester(si.getNormal(), "local"); assertScopeTester(si.getWithChildren(), "local"); assertScopeTester(si.getChildrenOnly(), "child"); assertScopeTester(si.getLeaves(), "child"); } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/OrderSearchAnnotationSupportTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000672711035124176033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.search; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.annotations.support.SearchInjection; /** * Order search annotation IoC support * * @author Ales Justin */ public class OrderSearchAnnotationSupportTestCase extends AbstractSearchAnnotationSupportTest { public OrderSearchAnnotationSupportTestCase(String name) { super(name); } public static Test suite() { return suite(OrderSearchAnnotationSupportTestCase.class); } public void testWrongOrder() throws Throwable { KernelController controller = getController(); ControllerContext context = controller.install(new AbstractBeanMetaData("si", SearchInjection.class.getName())); assertEquals(ControllerState.INSTANTIATED, context.getState()); List contexts = new ArrayList(); try { contexts.add(install("child", "main", "core", 1)); contexts.add(install("parent", "main", null, -1)); contexts.add(install("local", "main", "core", -1)); contexts.add(install("top", null, null, -1)); // here we need a little push - since by default we only do parent hierarchy resolution controller.change(context, ControllerState.INSTALLED); assertEquals(ControllerState.INSTALLED, context.getState()); doTestAfterInstall(context.getTarget()); } finally { ListIterator iter = contexts.listIterator(contexts.size()); while (iter.hasPrevious()) { Object name = iter.previous().getName(); getController().uninstall(name); } } } protected void doTestAfterInstall(Object target) { SearchInjection si = (SearchInjection)target; // ony check exact one's assertScopeTester(si.getTop(), "top"); assertScopeTester(si.getParent(), "parent"); assertScopeTester(si.getLocal(), "local"); assertScopeTester(si.getChildrenOnly(), "child"); assertScopeTester(si.getLeaves(), "child"); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/search/ScopeKeySearchTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000640611035634543033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.search; import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import junit.framework.Test; import org.jboss.dependency.plugins.graph.ScopeKeySearchInfo; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.graph.GraphController; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.scope.CommonLevels; /** * Search scopes by scope key. * * @author Ales Justin */ public class ScopeKeySearchTestCase extends AbstractSearchAnnotationSupportTest { public ScopeKeySearchTestCase(String name) { super(name); } public static Test suite() { return suite(ScopeKeySearchTestCase.class); } public void testScopeKeyControllers() throws Throwable { List contexts = new ArrayList(); try { contexts.add(assertScopeBean("child", "main", "core", 1)); contexts.add(assertScopeBean("parent", "main", null, -1)); contexts.add(assertScopeBean("local", "main", "core", -1)); } finally { ListIterator iter = contexts.listIterator(contexts.size()); while (iter.hasPrevious()) { Object name = iter.previous().getName(); getController().uninstall(name); } } } protected ControllerContext assertScopeBean(String scope, String app, String deployment, int id) throws Throwable { ControllerContext context = install(scope, app, deployment, id); ScopeKey scopeKey = new ScopeKey(); if (app != null) scopeKey.addScope(CommonLevels.APPLICATION, app); if (deployment != null) scopeKey.addScope(CommonLevels.DEPLOYMENT, deployment); if (id > 0) scopeKey.addScope(CommonLevels.INSTANCE, "id-" + id); SearchInfo searchInfo = new ScopeKeySearchInfo(scopeKey); GraphController gc = (GraphController)getController(); ControllerContext lookup = gc.getContext("bean", null, searchInfo); assertSame(context, lookup); return context; } }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/AbstractBeanAnnotationAdapterTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000722310772216276033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.Set; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.plugins.dependency.AbstractKernelController; import org.jboss.kernel.plugins.dependency.DescribeAction; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.config.KernelConfig; /** * Abstract bean annotation adapter test. * * @author Ales Justin */ public abstract class AbstractBeanAnnotationAdapterTest extends AbstractRunAnnotationsTest { protected AbstractBeanAnnotationAdapterTest(String name) { super(name); } protected abstract BeanAnnotationAdapter getBeanAnnotationAdapterClass(); protected Set getAnnotations() { return Collections.emptySet(); } protected KernelConfig createKernelConfig() { return new TestKernelConfig(); } private class TestKernelConfig extends PropertyKernelConfig { public TestKernelConfig() { super(null); } public KernelController createKernelController() throws Throwable { return new TestController(); } } private class TestController extends AbstractKernelController { private TestDescribeAction describe = new TestDescribeAction(); public TestController() throws Exception { } protected void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { if (ControllerState.DESCRIBED.equals(toState) && (context instanceof KernelControllerContext)) describe.install(context); else super.install(context, fromState, toState); } protected void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { if (ControllerState.DESCRIBED.equals(fromState) && (context instanceof KernelControllerContext)) describe.uninstall(context); else super.uninstall(context, fromState, toState); } } private class TestDescribeAction extends DescribeAction { protected BeanAnnotationAdapter getBeanAnnotationAdapter() { return getBeanAnnotationAdapterClass(); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/FactoryMethodTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000441610661317020033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test; import junit.framework.Test; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.test.kernel.annotations.support.AnnotationTester; import org.jboss.test.kernel.annotations.support.FactoryMethodAnnotationTester; import org.jboss.test.kernel.config.test.AbstractKernelConfigTest; /** * @author Ales Justin */ public class FactoryMethodTestCase extends AbstractKernelConfigTest { public FactoryMethodTestCase(String name) throws Throwable { super(name); } public FactoryMethodTestCase(String name, boolean xmltest) { super(name, xmltest); } public static Test suite() { return suite(FactoryMethodTestCase.class); } public void testFactoryMethod() throws Throwable { AnnotationTester tester = getTester(); assertEquals("FromAnnotations", tester.getValue()); } protected AnnotationTester getTester() throws Throwable { Object tester = instantiate(new AbstractBeanMetaData("Tester", FactoryMethodAnnotationTester.class.getName())); assertNotNull(tester); assertInstanceOf(tester, AnnotationTester.class); return (AnnotationTester)tester; } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/field/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000755000175000017500000000000011620312150033342 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/field/AnnotationFieldTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000321410770176053033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.field; import junit.textui.TestRunner; import junit.framework.Test; import junit.framework.TestSuite; /** * Field annotation tests. * * @author Ales Justin */ public class AnnotationFieldTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Fields Tests"); suite.addTest(SimpleFieldTestCase.suite()); suite.addTest(BasicFieldAnnotationSupportTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/field/BasicFieldAnnotationSupportTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000001773311014545271033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.field; import junit.framework.Test; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapterFactory; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.test.kernel.annotations.support.AbstractAfterInstallVerifier; import org.jboss.test.kernel.annotations.support.AfterInstallVerifier; import org.jboss.test.kernel.annotations.support.CallbacksTester; import org.jboss.test.kernel.annotations.support.InjectTester; import org.jboss.test.kernel.annotations.support.MyDeployer; import org.jboss.test.kernel.annotations.support.TestBean; import org.jboss.test.kernel.annotations.support.ValueFactoryTester; import org.jboss.test.kernel.annotations.test.AbstractBeanAnnotationAdapterTest; /** * Basic field annotation IoC support * * @author Ales Justin */ public class BasicFieldAnnotationSupportTestCase extends AbstractBeanAnnotationAdapterTest { public BasicFieldAnnotationSupportTestCase(String name) { super(name); } public static Test suite() { return suite(BasicFieldAnnotationSupportTestCase.class); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { return BeanAnnotationAdapterFactory.getInstance().getBeanAnnotationAdapter(); } protected void testFields(T target, AfterInstallVerifier verifier, BeanAccessMode mode) throws Throwable { addVerifier(verifier); try { runAnnotationsOnTarget(target, mode); } finally { removeVerifier(target.getClass()); } } public void testInjection() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("pb1", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb2", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb3", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("deployer", MyDeployer.class.getName())); InjectTester tester = new InjectTester(); testFields(tester, new InjectTesterVerifier(), BeanAccessMode.FIELDS); assertTesterAfterUninstall(tester); testFields(tester, new AllInjectTesterVerifier(), BeanAccessMode.ALL); assertTesterAfterUninstall(tester); } protected void assertTesterAfterUninstall(InjectTester tester) { assertNull(tester.getPrivateBean()); assertNull(tester.getProtectedBean()); assertNull(tester.publicBean); assertNull(tester.getPrivateDeployer()); assertNull(tester.getProtectedDeployer()); assertNull(tester.publicDeployer); } public void testValueFactory() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("pb1", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb2", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb3", TestBean.class.getName())); ValueFactoryTester tester = new ValueFactoryTester(); testFields(tester, new VFTesterVerifier(), BeanAccessMode.FIELDS); assertTesterAfterInstall(tester); testFields(tester, new AllVFTesterVerifier(), BeanAccessMode.ALL); assertTesterAfterInstall(tester); } protected void assertTesterAfterInstall(ValueFactoryTester tester) { assertNull(tester.getPrivateBean()); assertNull(tester.getProtectedBean()); assertNull(tester.publicBean); } public void testInstalls() throws Throwable { KernelController controller = getController(); controller.install(new AbstractBeanMetaData("pb1", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb2", TestBean.class.getName())); controller.install(new AbstractBeanMetaData("pb3", TestBean.class.getName())); CallbacksTester tester = new CallbacksTester(); testFields(tester, new CallbacksTesterVerifier(), BeanAccessMode.FIELDS); assertTesterAfterInstall(tester); testFields(tester, new AllCallbacksTesterVerifier(), BeanAccessMode.ALL); assertTesterAfterInstall(tester); } protected void assertTesterAfterInstall(CallbacksTester tester) { // both - null or empty are acceptable assertTrue(tester.getPrivateBeans() == null || tester.getPrivateBeans().isEmpty()); assertTrue(tester.getProtectedBeans() == null || tester.getProtectedBeans().isEmpty()); assertTrue(tester.publicBeans == null || tester.publicBeans.isEmpty()); } private class InjectTesterVerifier extends AbstractAfterInstallVerifier { public void verify(InjectTester target) { assertNotNull(target.publicBean); assertNotNull(target.publicDeployer); } public Class getTargetClass() { return InjectTester.class; } } private class AllInjectTesterVerifier extends InjectTesterVerifier { public void verify(InjectTester target) { super.verify(target); assertNotNull(target.getPrivateBean()); assertNotNull(target.getProtectedBean()); assertNotNull(target.getPrivateDeployer()); assertNotNull(target.getProtectedDeployer()); } } private class VFTesterVerifier extends AbstractAfterInstallVerifier { public void verify(ValueFactoryTester target) { assertEquals("PB3", target.publicBean); } public Class getTargetClass() { return ValueFactoryTester.class; } } private class AllVFTesterVerifier extends VFTesterVerifier { public void verify(ValueFactoryTester target) { super.verify(target); assertEquals("PB1", target.getPrivateBean()); assertEquals("PB2", target.getProtectedBean()); } } private class CallbacksTesterVerifier extends AbstractAfterInstallVerifier { public void verify(CallbacksTester target) { assertNotNull(target.publicBeans); assertEquals(3, target.publicBeans.size()); } public Class getTargetClass() { return CallbacksTester.class; } } private class AllCallbacksTesterVerifier extends CallbacksTesterVerifier { public void verify(CallbacksTester target) { super.verify(target); assertNotNull(target.getProtectedBeans()); assertEquals(3, target.getProtectedBeans().size()); assertNotNull(target.getPrivateBeans()); assertEquals(3, target.getPrivateBeans().size()); } } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/test/field/SimpleFieldTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/t0000644000175000017500000000476310767571152033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.test.field; import java.util.Set; import java.util.HashSet; import java.util.Arrays; import junit.framework.Test; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.test.kernel.annotations.test.AbstractBeanAnnotationAdapterTest; import org.jboss.test.kernel.annotations.support.MockFieldBeanAnnotationAdapter; import org.jboss.test.kernel.annotations.support.MockFieldTester; import org.jboss.test.kernel.annotations.support.MockInjectPlugin; import org.jboss.beans.info.spi.BeanAccessMode; /** * Simple field test. * * @author Ales Justin */ public class SimpleFieldTestCase extends AbstractBeanAnnotationAdapterTest { public SimpleFieldTestCase(String name) { super(name); } public static Test suite() { return suite(SimpleFieldTestCase.class); } protected BeanAnnotationAdapter getBeanAnnotationAdapterClass() { return new MockFieldBeanAnnotationAdapter(); } public void testFieldUsage() throws Throwable { MockFieldTester tester = new MockFieldTester(); try { runAnnotationsOnTarget(tester, BeanAccessMode.ALL); Set expected = new HashSet(Arrays.asList("date", "time", "string")); assertEquals(expected, MockInjectPlugin.INSTANCE.getFieldNames()); } finally { MockInjectPlugin.INSTANCE.clear(); } } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000755000175000017500000000000011620312152033343 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/Provider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000246511014545271033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class Provider { private String type; public Provider(String type) { this.type = type; } public String toString() { return type; } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/RGBSupplier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000225711003122212033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @Red @Green @Blue public class RGBSupplier { } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MyOwnDependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000230611000664467033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @SecurityDomain(domain = "somedomain") public class MyOwnDependency { } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SetsAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000317210711377006033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Demand; import org.jboss.beans.metadata.api.annotations.Depends; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; /** * @author Ales Justin */ @Demands({@Demand("deployer")}) @Depends({"deployer"}) @Supplys({@Supply("somesupply")}) public class SetsAnnotationTester implements AnnotationTester { public Object getValue() { return null; } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubConstructorInheritanceTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000256110760376602033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubConstructorInheritanceTester extends ConstructorInheritanceTester { public SubConstructorInheritanceTester() { super(); } public SubConstructorInheritanceTester(int someint) { this(); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/GBProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000235711014545271033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @Green @Blue public class GBProvider extends Provider { public GBProvider() { super("GB"); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SimpleBeanMetaDataAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000322610777663234033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.kernel.spi.annotations.BeanMetaDataAnnotationAdapter; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.metadata.spi.MetaData; import org.jboss.dependency.spi.ControllerMode; /** * @author Ales Justin */ public class SimpleBeanMetaDataAnnotationAdapter implements BeanMetaDataAnnotationAdapter { public void applyAnnotations(BeanInfo beanInfo, MetaData metaData, BeanMetaData beanMetaData) throws Throwable { beanMetaData.setMode(ControllerMode.ASYNCHRONOUS); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanupOnly.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000273210727246365033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.jboss.beans.metadata.api.annotations.CleanupOnly; /** * @author Ales Justin */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @CleanupOnly public @interface TestCleanupOnly { } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/CallbackAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000314210760522134033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; /** * @author Ales Justin */ public class CallbackAnnotationTester implements AnnotationTester { private int counter; @Install public void addMyDeployer(MyDeployer deployer) { counter++; } @Uninstall public void removeMyDeployer(MyDeployer deployer) { counter--; } public Integer getValue() { return counter; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000311610727246365033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.kernel.plugins.annotations.AbstractBeanAnnotationAdapter; /** * @author Ales Justin */ public class TestAnnotationAdapter extends AbstractBeanAnnotationAdapter { public static final TestAnnotationAdapter INSTANCE = new TestAnnotationAdapter(); private TestAnnotationAdapter() { addAnnotationPlugin(TestCleanupPlugin.INSTANCE); addAnnotationPlugin(TestCleanupOnlyPlugin.INSTANCE); addAnnotationPlugin(TestApplyOnlyPlugin.INSTANCE); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/FactoryAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000314710764340107033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Factory; /** * @author Ales Justin */ @Factory(factoryClass = org.jboss.test.kernel.annotations.support.FactoryTesterCreator.class, factoryMethod = "fromAnnotations") public class FactoryAnnotationTester implements AnnotationTester { private Object value; public FactoryAnnotationTester() { } public FactoryAnnotationTester(Object value) { this.value = value; } public Object getValue() { return value; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MockFieldTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000252610770176053033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.util.Date; /** * @author Ales Justin */ public class MockFieldTester { @SuppressWarnings("unused") @MockInject private String string; @MockInject protected Long time; @MockInject public Date date; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AfterInstallVerifier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000264711014545271033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Abstract annotation runner test. * * @param exact type * @author Ales Justin */ public interface AfterInstallVerifier { void verifyContext(KernelControllerContext context); void verify(T target); Class getTargetClass(); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/InjectTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000360011301242575033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Inject; /** * @author Ales Justin */ public class InjectTester { @Inject(bean = "pb1") private TestBean privateBean; @Inject(bean = "pb2") protected TestBean protectedBean; @Inject(bean = "pb3") public TestBean publicBean; @Inject private MyDeployer privateDeployer; @Inject protected MyDeployer protectedDeployer; @Inject public MyDeployer publicDeployer; public TestBean getPrivateBean() { return privateBean; } public TestBean getProtectedBean() { return protectedBean; } public MyDeployer getPrivateDeployer() { return privateDeployer; } public MyDeployer getProtectedDeployer() { return protectedDeployer; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AbstractAfterInstallVerifier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000321711014545271033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Abstract annotation runner test. * * @param exact type * @author Ales Justin */ public abstract class AbstractAfterInstallVerifier implements AfterInstallVerifier { public void verifyContext(KernelControllerContext context) { if (ControllerState.INSTALLED.equals(context.getState()) == false) throw new IllegalArgumentException("Expecting INSTALLED state, but is " + context.getState()); } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MyDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000223110652365637033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class MyDeployer { } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/Green.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000267611003122212033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) public @interface Green { }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AfterInstantiateTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000700210774662535033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.io.PrintStream; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Demand; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Depends; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; import org.jboss.beans.metadata.api.annotations.Supply; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Uninstall; import org.jboss.beans.metadata.api.annotations.UninstallMethod; import org.jboss.beans.metadata.api.annotations.ValueFactory; /** * @author Ales Justin */ @Aliases("qwert") @Demands(@Demand("other")) @Supplys({@Supply("qaz")}) @Depends("other") @ExternalInstalls(@ExternalInstall(bean = "other", method = "touch")) @ExternalUninstalls(@ExternalInstall(bean = "other", method = "touch")) public class AfterInstantiateTester { public static AfterInstantiateTester getTester() { return new AfterInstantiateTester(); } @Inject(bean = "other", property = "currentTime") public int time; @Create public void createMe() { } @Start public void startMe() { } @Stop public void stopMe() { } @Destroy public void destroyMe() { } @ValueFactory(bean = "other", method = "getSystemErr") public void setSystemErr(PrintStream err) { } @Install @Uninstall public void setVerifiers(Set> verifiers) { } @Install public void addVerifier(AfterInstallVerifier verifier) { } @Uninstall public void removeVerifier(AfterInstallVerifier verifier) { } @InstallMethod public void applyAfterAtInstall() { } @UninstallMethod public void applyAfterAtUninstall() { } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000235710652365637033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestBean { public String getValue(String param) { return param.toUpperCase(); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubFactoryAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000231110760522134033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubFactoryAnnotationTester extends FactoryAnnotationTester { } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AliasesImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000315410777663234033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.api.annotations.Aliases; /** * @author Ales Justin */ public class AliasesImpl implements Aliases { private String[] aliases; public AliasesImpl(String... aliases) { this.aliases = aliases; } public String[] value() { return aliases; } public boolean replace() { return true; } public Class annotationType() { return Aliases.class; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/ScopeTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000250211034660617033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class ScopeTester { private String scope; public ScopeTester(String scope) { this.scope = scope; } public String getScope() { return scope; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/CallbacksTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000325311301242575033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; /** * @author Ales Justin */ public class CallbacksTester { @Install @Uninstall private Set privateBeans; @Install @Uninstall protected Set protectedBeans; @Install @Uninstall public Set publicBeans; public Set getPrivateBeans() { return privateBeans; } public Set getProtectedBeans() { return protectedBeans; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/BeanAnnotationHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000315511014243570033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Bean; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; /** * @author Ales Justin */ @Bean( autowireType = AutowireType.CONSTRUCTOR, mode = ControllerMode.ASYNCHRONOUS, errorHandlingMode = ErrorHandlingMode.MANUAL, accessMode = BeanAccessMode.ALL ) public class BeanAnnotationHolder { } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestApplyOnly.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000261210727246365033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author Ales Justin */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface TestApplyOnly { } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/RGProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000235611014545271033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @Red @Green public class RGProvider extends Provider { public RGProvider() { super("RG"); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubSetsAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000230310760376602033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubSetsAnnotationTester extends SetsAnnotationTester { } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/FactoryMethodAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000313110674773017033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.FactoryMethod; /** * @author Ales Justin */ public class FactoryMethodAnnotationTester implements AnnotationTester { private String value; private FactoryMethodAnnotationTester(String value) { this.value = value; } public String getValue() { return value; } @FactoryMethod public static AnnotationTester getTester() { return new FactoryMethodAnnotationTester("FromAnnotations"); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/RBProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000235511014545271033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @Red @Blue public class RBProvider extends Provider { public RBProvider() { super("RB"); } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/ConstructorAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000305710674773017033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.StringValue; /** * @author Ales Justin */ public class ConstructorAnnotationTester implements AnnotationTester { private String value; @Constructor public ConstructorAnnotationTester(@StringValue("FromAnnotations") String value) { this.value = value; } public String getValue() { return value; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/ExternalAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000352710674773017033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.api.annotations.ThisValue; import org.jboss.beans.metadata.api.annotations.Value; /** * @author Ales Justin */ @ExternalInstalls ( {@ExternalInstall(bean = "Holder", method = "addTester", parameters = {@Value(thisValue = @ThisValue)})} ) @ExternalUninstalls ( {@ExternalInstall(bean = "Holder", method = "removeTester", parameters = {@Value(thisValue = @ThisValue)})} ) public class ExternalAnnotationTester implements AnnotationTester { public Object getValue() { return null; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SecurityDomain.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000314711000664467033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import org.jboss.beans.metadata.api.annotations.Dependency; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Dependency(name="domain", factory= SecurityDomainDependencyFactory.class) public @interface SecurityDomain { String domain(); String securityManagerName() default "SecurityManager"; } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000227210661317020033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public interface AnnotationTester { Object getValue(); } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubCallbackAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000231310760522134033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubCallbackAnnotationTester extends CallbackAnnotationTester { } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanupOnlyBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000235011026665501033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestCleanupOnlyBean { @TestCleanupOnly public void setName(String name) { } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/PropertyInheritanceTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000271010760376602033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Inject; /** * @author Ales Justin */ public class PropertyInheritanceTester implements AnnotationTester { private Object value; public Object getValue() { return value; } @Inject(bean = "somebean") public void setValue(Object value) { this.value = value; } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/Red.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000267411003122212033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) public @interface Red { }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/ConstructorInheritanceTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000313510760376602033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; /** * @author Ales Justin */ public class ConstructorInheritanceTester implements AnnotationTester { private Object value; public ConstructorInheritanceTester() { } @Constructor public ConstructorInheritanceTester(@Inject(bean = "somebean") Object value) { this.value = value; } public Object getValue() { return value; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/RGBProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000237011014545271033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ @Red @Green @Blue public class RGBProvider extends Provider { public RGBProvider() { super("RGB"); } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SearchInjection.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000610411034660617033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Search; import org.jboss.metadata.plugins.scope.ApplicationScope; import org.jboss.metadata.plugins.scope.DeploymentScope; /** * @author Ales Justin */ @ApplicationScope("main") @DeploymentScope("core") public class SearchInjection { private ScopeTester top; private ScopeTester parent; private ScopeTester local; private ScopeTester normal; private ScopeTester withChildren; private ScopeTester childrenOnly; private ScopeTester leaves; public ScopeTester getTop() { return top; } @Search(bean = "bean", type = "toplevel") public void setTop(ScopeTester top) { this.top = top; } public ScopeTester getParent() { return parent; } @Search(bean = "bean", type = "parentonly") public void setParent(ScopeTester parent) { this.parent = parent; } public ScopeTester getLocal() { return local; } @Search(bean = "bean", type = "local") public void setLocal(ScopeTester local) { this.local = local; } public ScopeTester getNormal() { return normal; } @Search(bean = "bean", type = "") public void setNormal(ScopeTester normal) { this.normal = normal; } public ScopeTester getWithChildren() { return withChildren; } @Search(bean = "bean", type = "depth") public void setWithChildren(ScopeTester withChildren) { this.withChildren = withChildren; } public ScopeTester getChildrenOnly() { return childrenOnly; } @Search(bean = "bean", type = "ChildrenOnlyDepth") public void setChildrenOnly(ScopeTester childrenOnly) { this.childrenOnly = childrenOnly; } public ScopeTester getLeaves() { return leaves; } @Search(bean = "bean", type = "leavesfirst") public void setLeaves(ScopeTester leaves) { this.leaves = leaves; } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MockInject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000264510767461133033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * @author Ales Justin */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) public @interface MockInject { String value() default ""; } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestApplyOnlyBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000234411026665501033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestApplyOnlyBean { @TestApplyOnly public void setName(String name) { } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000515711026665501033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.List; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.kernel.plugins.annotations.AbstractAnnotationPlugin; import org.jboss.kernel.plugins.annotations.PropertyAware; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; /** * @param the annotation type * @author Ales Justin */ public class TestAnnotationPlugin extends AbstractAnnotationPlugin implements PropertyAware { private boolean applied; private boolean cleaned; public TestAnnotationPlugin(Class clazz) { super(clazz); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.METHOD == type; } protected List internalApplyAnnotation(PropertyInfo info, MetaData retrieval, T annotation, KernelControllerContext context) throws Throwable { applied = true; return null; } protected void internalCleanAnnotation(PropertyInfo info, MetaData retrieval, T annotation, KernelControllerContext context) throws Throwable { cleaned = true; } public void reset() { applied = false; cleaned = false; } public boolean isApplied() { return applied; } public boolean isCleaned() { return cleaned; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SecurityDomainAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000621011000665234033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.util.List; import org.jboss.beans.metadata.api.annotations.Dependency; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.plugins.annotations.ClassAnnotationPlugin; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.ClassInfo; /** * @author Ales Justin */ public class SecurityDomainAnnotationPlugin extends ClassAnnotationPlugin { public SecurityDomainAnnotationPlugin() { super(SecurityDomain.class); } protected List internalApplyAnnotation(ClassInfo info, MetaData retrieval, SecurityDomain annotation, KernelControllerContext context) throws Throwable { Dependency dependency = annotation.annotationType().getAnnotation(Dependency.class); if (dependency == null) throw new IllegalArgumentException("Null @Dependency."); DependencyInfo dependencies = context.getDependencyInfo(); SecurityDomainDependencyFactory factory = null; // try to find existing security domain dependency factory // or what ever kind of lookup KernelController controller = context.getKernel().getController(); ControllerContext smCC = controller.getInstalledContext(annotation.securityManagerName()); if (smCC != null) { Object target = smCC.getTarget(); if (target != null && target instanceof SecurityDomainDependencyFactory) factory = SecurityDomainDependencyFactory.class.cast(target); } if (factory == null) factory = (SecurityDomainDependencyFactory)dependency.factory().newInstance(); DependencyItem item = factory.createDependencyItem(annotation, dependency); dependencies.addIDependOn(item); return null; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/PropertyAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000317710674773017033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.StringValue; /** * @author Ales Justin */ public class PropertyAnnotationTester implements AnnotationTester { private String value; public String getValue() { return value; } @StringValue("FromAnnotation") public void setValue(String value) { this.value = value; } public void setValue(Object value) { if (value == null) throw new IllegalArgumentException("Null value."); setValue(value.toString()); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/ValueFactoryTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000327011301242575033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.ValueFactory; /** * @author Ales Justin */ public class ValueFactoryTester { @ValueFactory(bean = "pb1", method = "getValue", parameter = "pb1") private String privateBean; @ValueFactory(bean = "pb2", method = "getValue", parameter = "pb2") protected String protectedBean; @ValueFactory(bean = "pb3", method = "getValue", parameter = "pb3") public String publicBean; public String getPrivateBean() { return privateBean; } public String getProtectedBean() { return protectedBean; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubPropertyInheritanceTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000231510760376602033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubPropertyInheritanceTester extends PropertyInheritanceTester { } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MockInjectPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000445110770176053033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.kernel.plugins.annotations.FieldAnnotationPlugin; import org.jboss.reflect.spi.FieldInfo; /** * @author Ales Justin */ public class MockInjectPlugin extends FieldAnnotationPlugin { public static MockInjectPlugin INSTANCE = new MockInjectPlugin(); private Set fieldNames = new HashSet(); private MockInjectPlugin() { super(MockInject.class); } public ValueMetaData createValueMetaData(MockInject annotation) { return new AbstractValueMetaData(); } protected List internalApplyAnnotation(FieldInfo info, MockInject annotation, BeanMetaData beanMetaData) throws Throwable { fieldNames.add(info.getName()); return null; } public Set getFieldNames() { return fieldNames; } public void clear() { fieldNames.clear(); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/MockFieldBeanAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000262010767461133033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.kernel.plugins.annotations.AbstractBeanAnnotationAdapter; /** * @author Ales Justin */ public class MockFieldBeanAnnotationAdapter extends AbstractBeanAnnotationAdapter { public MockFieldBeanAnnotationAdapter() { addAnnotationPlugin(MockInjectPlugin.INSTANCE); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/FactoryTesterCreator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000262310661317020033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class FactoryTesterCreator { public static AnnotationTester fromXML() { return new FactoryAnnotationTester("FromXML"); } public static AnnotationTester fromAnnotations() { return new FactoryAnnotationTester("FromAnnotations"); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/HolderAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000270510661317020033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class HolderAnnotationTester implements AnnotationTester { private int counter; public void addTester(AnnotationTester tester) { counter++; } public void removeTester(AnnotationTester tester) { counter--; } public Object getValue() { return counter; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanup.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000271610727246365033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import org.jboss.beans.metadata.api.annotations.Cleanup; /** * @author Ales Justin */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Cleanup public @interface TestCleanup { } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SecurityDomainDependencyFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000316011000664467033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Dependency; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.plugins.AbstractDependencyItem; /** * @author Ales Justin */ public class SecurityDomainDependencyFactory { public DependencyItem createDependencyItem(SecurityDomain annotation, Dependency dependency) { return new AbstractDependencyItem(annotation.domain(), dependency.name(), ControllerState.INSTANTIATED, null); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/Blue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000267711003122212033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) public @interface Blue { } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/WBTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000430511014545271033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.Start; /** * @author Ales Justin */ public class WBTester { @Red @Green @Inject private Provider rg_provider; private Provider rb_provider; private Provider gb_provider1; private Provider gb_provider2; @Constructor public WBTester(@Green @Blue @Inject Provider gb_provider1) { this.gb_provider1 = gb_provider1; } public Provider getRg_provider() { return rg_provider; } public Provider getRb_provider() { return rb_provider; } @Red @Blue @Inject public void setRb_provider(Provider rb_provider) { this.rb_provider = rb_provider; } public Provider getGb_provider1() { return gb_provider1; } public Provider getGb_provider2() { return gb_provider2; } @Start public void doStart(@Green @Blue @Inject Provider gb_provider2) { this.gb_provider2 = gb_provider2; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanupOnlyPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000257710727246365033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestCleanupOnlyPlugin extends TestAnnotationPlugin { public static final TestCleanupOnlyPlugin INSTANCE = new TestCleanupOnlyPlugin(); private TestCleanupOnlyPlugin() { super(TestCleanupOnly.class); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/RGBDemander.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000401711003122212033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.api.annotations.InstallMethod; /** * @author Ales Justin */ public class RGBDemander { @Red @Green private RGBSupplier rg; private RGBSupplier rb; private RGBSupplier gb; private RGBSupplier rgb; @Constructor public RGBDemander(@Green @Blue RGBSupplier gb) { this.gb = gb; } public RGBSupplier getRb() { return rb; } @Red @Blue public void setRb(RGBSupplier rb) { this.rb = rb; } public RGBSupplier getGb() { return gb; } public void setGb(RGBSupplier gb) { this.gb = gb; } @InstallMethod public void install(@Red @Green @Blue RGBSupplier rgb) { this.rgb = rgb; } public RGBSupplier getRgb() { return rgb; } public RGBSupplier getRg() { return rg; } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/LifecycleAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000443210760376602033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; import org.jboss.beans.metadata.api.annotations.Destroy; /** * @author Ales Justin */ public class LifecycleAnnotationTester implements AnnotationTester { private static String FROM_XML = "FromXML"; private Object[] value = new Object[4]; public void fromXMLCreate() { value[0] = FROM_XML; } public void fromXMLStart() { value[1] = FROM_XML; } public void fromXMLStop() { value[1] = null; value[2] = FROM_XML; } public void fromXMLDestroy() { value[0] = null; value[3] = FROM_XML; } @Create public void fromAnnCreate() { value[0] = "dew"; } @Start public void fromAnnStart() { value[1] = "dewdew"; } @Stop public void fromAnnStop() { value[1] = null; value[2] = "dewdew"; } @Destroy public void fromAnnDestroy() { value[0] = null; value[3] = "dew"; } public Object[] getValue() { return value; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/InstallationAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000312210760522134033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.api.annotations.UninstallMethod; /** * @author Ales Justin */ public class InstallationAnnotationTester implements AnnotationTester { private int counter; @InstallMethod public void addMyDeployer() { counter++; } @UninstallMethod public void removeMyDeployer() { counter--; } public Integer getValue() { return counter; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/AllIoCAnnotations.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000617511002141272033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.api.annotations.Create; import org.jboss.beans.metadata.api.annotations.Demand; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.api.annotations.Depends; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.api.annotations.Stop; import org.jboss.beans.metadata.api.annotations.Supply; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Uninstall; import org.jboss.beans.metadata.api.annotations.UninstallMethod; /** * All IoC annoattions. * * @author Ales Justin */ @Aliases("alias") @Demands({@Demand("demand")}) @Depends({"depend"}) @Supplys({@Supply("supply")}) @Factory(factoryClass = AnnotationTester.class, factoryMethod = "factoryMethod") @ExternalInstalls({@ExternalInstall(bean = "bean", method = "method")}) @ExternalUninstalls({@ExternalInstall(bean = "bean", method = "method")}) public class AllIoCAnnotations { @Inject @SuppressWarnings("unused") private int time; @Inject public void setNumber(int number) {} @Create public void myCreate() {} @Start public void myStart() {} @Stop public void myStop() {} @Destroy public void myDestroy() {} @Install public void addSomething(AnnotationTester tester) {} @Uninstall public void removeSomething(AnnotationTester tester) {} @InstallMethod @UninstallMethod public void invoke() {} } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/OtherVerifier.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000314611014545271033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import java.io.PrintStream; /** * @author Ales Justin */ public class OtherVerifier extends AbstractAfterInstallVerifier { public void verify(Object target) { } public Class getTargetClass() { return Object.class; } public PrintStream getSystemErr() { return System.err; } public long getCurrentTime() { return System.currentTimeMillis(); } public void touch() { System.out.println(getCurrentTime()); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestApplyOnlyPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000256310727246365033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestApplyOnlyPlugin extends TestAnnotationPlugin { public static final TestApplyOnlyPlugin INSTANCE = new TestApplyOnlyPlugin(); private TestApplyOnlyPlugin() { super(TestApplyOnly.class); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubLifecycleAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000231510760376602033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubLifecycleAnnotationTester extends LifecycleAnnotationTester { } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestConstructorBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000265610674773017033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.Constructor; /** * @author Ales Justin */ public class TestConstructorBean { @Constructor public TestConstructorBean(@Inject(bean = "testBean") TestBean test) { System.out.println("test = " + test); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubExternalAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000231310760522134033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubExternalAnnotationTester extends ExternalAnnotationTester { } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/FactoryMethodBadAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000313310674773017033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; import org.jboss.beans.metadata.api.annotations.FactoryMethod; /** * @author Ales Justin */ public class FactoryMethodBadAnnotationTester implements AnnotationTester { private String value; private FactoryMethodBadAnnotationTester(String value) { this.value = value; } public String getValue() { return value; } @FactoryMethod public AnnotationTester getTester() { return new FactoryMethodBadAnnotationTester("FromAnnotations"); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/SubInstallationAnnotationTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000232310760775374033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class SubInstallationAnnotationTester extends InstallationAnnotationTester { } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanupPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000255210727246365033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestCleanupPlugin extends TestAnnotationPlugin { public static final TestCleanupPlugin INSTANCE = new TestCleanupPlugin(); private TestCleanupPlugin() { super(TestCleanup.class); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/support/TestCleanupBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/annotations/s0000644000175000017500000000234111026665501033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.annotations.support; /** * @author Ales Justin */ public class TestCleanupBean { @TestCleanup public void setName(String param) { } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/0000755000175000017500000000000011620312136031604 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/0000755000175000017500000000000011620312136032563 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/LazyTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/Laz0000644000175000017500000000331010702533403033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.test; import junit.framework.TestSuite; import junit.framework.Test; import junit.textui.TestRunner; /** * @author Ales Justin */ public class LazyTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(LazyTestSuite.suite()); } public static Test suite() { TestSuite suite = new TestSuite("Lazy Proxy Tests"); // meta data suite.addTest(LazyMetaDataTestCase.suite()); // api test suite.addTest(JavassistLazyInstantiationTestCase.suite()); suite.addTest(JDKLazyInstantiationTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/LazyMetaDataTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/Laz0000644000175000017500000000434311216157032033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.test; import junit.framework.Test; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.kernel.lazy.support.IRare; import org.jboss.test.kernel.lazy.support.RareBean; /** * Test lazy metadata. * * @author Ales Justin */ public class LazyMetaDataTestCase extends MicrocontainerTest { public LazyMetaDataTestCase(String name) { super(name); } public static Test suite() { return suite(LazyMetaDataTestCase.class); } public void testLazyXMLTest() throws Throwable { Object proxy = getBean("proxy"); assertNotNull(proxy); assertInstanceOf(proxy, IRare.class); assertInstanceOf(proxy, RareBean.class); RareBean rare = (RareBean)proxy; RareBean bean = (RareBean)getBean("bean"); assertNotNull(bean); assertEquals(bean.getHits(), rare.getHits()); bean.setHits(123); assertEquals(bean.getHits(), rare.getHits()); bean.setHits(321); assertEquals(bean.getHits(), rare.getHits()); Object holder = getBean("holder"); assertNotNull(holder); assertInstanceOf(holder, IRare.class); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/JavassistLazyInstantiationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/Jav0000644000175000017500000000317011201770651033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.test; import junit.framework.Test; import org.jboss.test.kernel.lazy.support.JavassistLazyFactory; /** * Javassist lazy test. * * @author Ales Justin */ public class JavassistLazyInstantiationTestCase extends LazyInstantiationTest { public JavassistLazyInstantiationTestCase(String name) { super(name); } public static Test suite() { return suite(JavassistLazyInstantiationTestCase.class); } protected String getFactoryClassName() { return JavassistLazyFactory.class.getName(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/JDKLazyInstantiationTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/JDK0000644000175000017500000000312311201770651033122 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.test; import junit.framework.Test; import org.jboss.test.kernel.lazy.support.JDKLazyFactory; /** * JDK lazy test. * * @author Ales Justin */ public class JDKLazyInstantiationTestCase extends LazyInstantiationTest { public JDKLazyInstantiationTestCase(String name) { super(name); } public static Test suite() { return suite(JDKLazyInstantiationTestCase.class); } protected String getFactoryClassName() { return JDKLazyFactory.class.getName(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/LazyInstantiationTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/test/Laz0000644000175000017500000001411111216157032033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.test; import java.util.Collections; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractLazyMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.lazy.support.IRare; import org.jboss.test.kernel.lazy.support.RareBean; /** * @author Ales Justin */ public abstract class LazyInstantiationTest extends AbstractKernelTest { public LazyInstantiationTest(String name) { super(name); } /** * Default setup w/o security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new AbstractTestDelegate(clazz); } protected abstract String getFactoryClassName(); public void testLazy() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); try { AbstractBeanMetaData bean = new AbstractBeanMetaData("bean", RareBean.class.getName()); bean.setMode(ControllerMode.MANUAL); DemandMetaData demand = new AbstractDemandMetaData("foobar"); ((AbstractDemandMetaData)demand).setWhenRequired(ControllerState.INSTANTIATED); bean.setDemands(Collections.singleton(demand)); KernelControllerContext beanContext = controller.install(bean); controller.change(beanContext, ControllerState.NOT_INSTALLED); ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName()); lazy.setInterfaces(Collections.singleton(IRare.class.getName())); KernelControllerContext lazyContext = controller.install(lazy); assertNotNull(lazyContext); assertEquals(ControllerState.INSTALLED, lazyContext.getState()); controller.change(beanContext, ControllerState.DESCRIBED); controller.change(lazyContext, ControllerState.INSTALLED); IRare lazyRare = (IRare)lazyContext.getTarget(); assertNotNull(lazyRare); try { lazyRare.getHits(); throw new RuntimeException("Should not be here."); } catch(Throwable t) { assertInstanceOf(t, IllegalArgumentException.class); } controller.install(new AbstractBeanMetaData("foobar", Object.class.getName())); controller.change(beanContext, ControllerState.INSTALLED); assertEquals(0, lazyRare.getHits()); lazyRare.setHits(10); assertEquals(5, lazyRare.checkHits(15)); controller.uninstall(beanContext.getName()); assertEquals(ControllerState.DESCRIBED, lazyContext.getState()); } finally { controller.shutdown(); } } public void testOnDemand() throws Throwable { Kernel kernel = bootstrap(); KernelController controller = kernel.getController(); try { AbstractBeanMetaData bean = new AbstractBeanMetaData("bean", RareBean.class.getName()); bean.setMode(ControllerMode.ON_DEMAND); KernelControllerContext beanContext = controller.install(bean); ModifiedLazyMetaData lazy = new ModifiedLazyMetaData("bean", getFactoryClassName()); lazy.setInterfaces(Collections.singleton(IRare.class.getName())); KernelControllerContext lazyContext = controller.install(lazy); assertNotNull(lazyContext); assertEquals(ControllerState.INSTALLED, lazyContext.getState()); IRare lazyRare = (IRare)lazyContext.getTarget(); assertNotNull(lazyRare); // should not be fully installed yet assertEquals(ControllerState.DESCRIBED, beanContext.getState()); assertEquals(0, lazyRare.getHits()); // the hit should install it assertEquals(ControllerState.INSTALLED, beanContext.getState()); lazyRare.setHits(10); assertEquals(5, lazyRare.checkHits(15)); controller.uninstall(beanContext.getName()); assertEquals(ControllerState.DESCRIBED, lazyContext.getState()); } finally { controller.shutdown(); } } private class ModifiedLazyMetaData extends AbstractLazyMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 1L; public ModifiedLazyMetaData(String beanName, String factoryClassName) { super(beanName); setFactoryClassName(factoryClassName); } } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000755000175000017500000000000011620312136033320 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/JavassistLazyFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000644000175000017500000000316210702533403033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.support; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.lazy.JavassistLazyInitializer; import org.jboss.kernel.spi.lazy.LazyInitializer; /** * @author Ales Justin */ public class JavassistLazyFactory { public static Object getProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { LazyInitializer lazyInitializer = new JavassistLazyInitializer(); return lazyInitializer.initializeProxy(kernel, bean, exposeClass, interfaces); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/JDKLazyFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000644000175000017500000000314010702533403033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.support; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.lazy.JDKLazyInitializer; import org.jboss.kernel.spi.lazy.LazyInitializer; /** * @author Ales Justin */ public class JDKLazyFactory { public static Object getProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { LazyInitializer lazyInitializer = new JDKLazyInitializer(); return lazyInitializer.initializeProxy(kernel, bean, exposeClass, interfaces); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/IRare.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000644000175000017500000000235110702533403033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.support; /** * @author Ales Justin */ public interface IRare { int getHits(); void setHits(int hits); int checkHits(int expectedHits); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/RareBeanHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000644000175000017500000000303311216157032033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.support; /** * @author Ales Justin */ public class RareBeanHolder implements IRare { private IRare delegate; public RareBeanHolder(IRare delegate) { this.delegate = delegate; } public int getHits() { return delegate.getHits(); } public void setHits(int hits) { delegate.setHits(hits); } public int checkHits(int expectedHits) { return delegate.checkHits(expectedHits); } }././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/RareBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/lazy/support/0000644000175000017500000000262710702533403033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.lazy.support; /** * @author Ales Justin */ public class RareBean implements IRare { private int hits; public int getHits() { return hits; } public void setHits(int hits) { this.hits = hits; } public int checkHits(int expectedHits) { return expectedHits - hits; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/0000755000175000017500000000000011620312150032075 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/0000755000175000017500000000000011620312150033054 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/CardinalityCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000766310651430575033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Cardinality tests. * * @author Ales Justin */ public class CardinalityCallbackTestCase extends AbstractManualInjectTest { public CardinalityCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(CardinalityCallbackTestCase.class); } public void testCallback() throws Throwable { KernelControllerContext context = getControllerContext("testObject", ControllerState.NOT_INSTALLED); assertNull(context.getTarget()); assertEquals(ControllerState.NOT_INSTALLED, context.getState()); // move conetxt to change - triggering callback addition + cardinality dependency change(context, ControllerState.CREATE); CallbackTestObject injectee = (CallbackTestObject)context.getTarget(); assertNotNull(injectee); assertNull(injectee.getTesterInterfaces()); // install 1st - cardinality dependency not yet satisfied KernelControllerContext tester1 = getControllerContext("tester1", ControllerState.NOT_INSTALLED); assertNotNull(tester1); change(tester1, ControllerState.INSTALLED); assertNull(injectee.getTesterInterfaces()); // install 1st - cardinality dependency now satisfied KernelControllerContext tester2 = getControllerContext("tester2", ControllerState.NOT_INSTALLED); assertNotNull(tester2); change(tester2, ControllerState.INSTALLED); // can be moved to installed change(context, ControllerState.INSTALLED); assertEquals(ControllerState.INSTALLED, context.getState()); // collection should be there assertNotNull(injectee.getTesterInterfaces()); assertEquals(2, injectee.getTesterInterfaces().size()); // add another tester, should be injected as well KernelControllerContext tester3 = getControllerContext("tester3", ControllerState.NOT_INSTALLED); assertNotNull(tester3); change(tester3, ControllerState.INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(3, injectee.getTesterInterfaces().size()); // remove one of the first one added change(tester1, ControllerState.NOT_INSTALLED); assertEquals(2, injectee.getTesterInterfaces().size()); assertEquals(ControllerState.INSTALLED, context.getState()); // remove the one that was added after cardinality dependency was already resolved // now the cardinality dependency should uninstall main context - since cardinality is out of range change(tester3, ControllerState.NOT_INSTALLED); assertEquals(ControllerState.CONFIGURED, context.getState()); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/ConstructorContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000543710612500024033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.ConstructorInjectTestObject; import org.jboss.test.kernel.inject.support.ConstructorValueBean; /** * Constructor injection. * * @author Ales Justin */ public class ConstructorContextualInjectionTestCase extends SingleContextualInjectionAdapter { public ConstructorContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(ConstructorContextualInjectionTestCase.class); } protected String getResource() { return "ConstructorContextualInjection.xml"; } protected void checkInjection() { ConstructorInjectTestObject test1 = (ConstructorInjectTestObject) getBean("testObject1"); assertNotNull(test1.getTesterInterface()); ConstructorInjectTestObject test2 = (ConstructorInjectTestObject) getBean("testObject2"); assertFalse(test2.getTesterInterfaces().isEmpty()); ConstructorInjectTestObject test3 = (ConstructorInjectTestObject) getBean("testObject3"); assertNotNull(test3.getTesterInterface()); ConstructorInjectTestObject test4 = (ConstructorInjectTestObject) getBean("testObject4"); assertNotNull(test4.getTesterInterface()); ConstructorInjectTestObject test5 = (ConstructorInjectTestObject) getBean("testObject5"); assertNotNull(test5.getTesterInterface()); ConstructorValueBean constBean = (ConstructorValueBean) getBean("constBean"); ConstructorValueBean constBeanRef = (ConstructorValueBean) getBean("constBeanRef"); assertNotNull(constBean); assertNotNull(constBeanRef); assertEquals(constBean, constBeanRef); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/SimpleCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/S0000644000175000017500000000660010651430575033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Callback tests. * * @author Ales Justin */ public abstract class SimpleCallbackTestCase extends AbstractManualInjectTest { public SimpleCallbackTestCase(String name) { super(name); } public void testCallback() throws Throwable { KernelControllerContext context = getControllerContext("testObject", ControllerState.NOT_INSTALLED); assertNull(context.getTarget()); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); change(context, ControllerState.INSTALLED); CallbackTestObject injectee = (CallbackTestObject)context.getTarget(); assertNotNull(injectee); afterInstall(injectee); // install KernelControllerContext tester1 = getControllerContext("tester1", ControllerState.NOT_INSTALLED); assertNotNull(tester1); change(tester1, ControllerState.INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(1, injectee.getTesterInterfaces().size()); KernelControllerContext tester2 = getControllerContext("tester2", ControllerState.NOT_INSTALLED); assertNotNull(tester2); change(tester2, ControllerState.INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(2, injectee.getTesterInterfaces().size()); KernelControllerContext tester3 = getControllerContext("tester3", ControllerState.NOT_INSTALLED); assertNotNull(tester3); change(tester3, ControllerState.INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(3, injectee.getTesterInterfaces().size()); //uninstall change(tester3, ControllerState.NOT_INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(2, injectee.getTesterInterfaces().size()); change(tester2, ControllerState.NOT_INSTALLED); assertNotNull(injectee.getTesterInterfaces()); assertEquals(1, injectee.getTesterInterfaces().size()); change(tester1, ControllerState.NOT_INSTALLED); afterInstall(injectee); } protected abstract void afterInstall(CallbackTestObject testObject); } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/CandidateContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000433110630031724033167 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.PropertyInjectTestObject; import org.jboss.test.kernel.inject.support.TesterInterface; /** * Candidate injection. * * @author Ales Justin */ public class CandidateContextualInjectionTestCase extends SingleContextualInjectionAdapter { public CandidateContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(CandidateContextualInjectionTestCase.class); } protected String getResource() { return "CandidateContextualInjection.xml"; } protected void checkInjection() { PropertyInjectTestObject test1 = (PropertyInjectTestObject) getBean("testObject1"); PropertyInjectTestObject test2 = (PropertyInjectTestObject) getBean("testObject2"); TesterInterface ignored = (TesterInterface)getBean("ignored"); assertNotNull(ignored); TesterInterface used = (TesterInterface)getBean("used"); assertNotNull(used); assertEquals(used, test1.getTesterInterface()); assertNull(test2.getDuplicateTester()); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/AdditionCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/A0000644000175000017500000000315410612500024033161 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Callback tests. * * @author Ales Justin */ public class AdditionCallbackTestCase extends SimpleCallbackTestCase { public AdditionCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(AdditionCallbackTestCase.class); } protected void afterInstall(CallbackTestObject testObject) { assertNull(testObject.getTesterInterfaces()); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/CollectionAnnotationCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000351010777663234033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import java.util.Set; import junit.framework.Test; import org.jboss.test.kernel.inject.support.CallbackTestObject; import org.jboss.test.kernel.inject.support.TesterInterface; /** * Callback tests. * * @author Ales Justin */ public class CollectionAnnotationCallbackTestCase extends SimpleCallbackTestCase { public CollectionAnnotationCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(CollectionAnnotationCallbackTestCase.class); } protected void afterInstall(CallbackTestObject testObject) { Set interfaces = testObject.getTesterInterfaces(); assertNotNull(interfaces); assertTrue(interfaces.isEmpty()); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/CardinalityAnnotationCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000273210613653046033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; /** * Cardinality tests. * * @author Ales Justin */ public class CardinalityAnnotationCallbackTestCase extends CardinalityCallbackTestCase { public CardinalityAnnotationCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(CardinalityAnnotationCallbackTestCase.class); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/LifecycleContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/L0000644000175000017500000000352110612500024033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.LifecycleInjectTestObject; /** * Lifecycle method injection. * * @author Ales Justin */ public class LifecycleContextualInjectionTestCase extends SingleContextualInjectionAdapter { public LifecycleContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(LifecycleContextualInjectionTestCase.class); } protected String getResource() { return "LifecycleContextualInjection.xml"; } protected void checkInjection() { LifecycleInjectTestObject test1 = (LifecycleInjectTestObject) getBean("testObject1"); assertNotNull(test1.getTesterInterface()); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/ContextualInjectionAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000460110756342051033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * Test unit deployment contextual injection helper class. * * @author Ales Justin */ public abstract class ContextualInjectionAdapter extends MicrocontainerTest { public ContextualInjectionAdapter(String name) { super(name); } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = MicrocontainerTest.getDelegate(clazz); delegate.enableSecurity = true; return delegate; } protected void enableTrace() { } protected void execute(TestUnit testUnit) throws Throwable { enableTrace(); KernelDeployment deployment = deploy(testUnit.getResource()); try { validate(); testUnit.executeTest(); } finally { undeploy(deployment); } } protected interface TestUnit { String getResource(); void executeTest() throws Throwable; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/MultipleContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/M0000644000175000017500000000440011305760441033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Multiple injection - should 'fail'. * * @author Ales Justin */ public class MultipleContextualInjectionTestCase extends SingleContextualInjectionAdapter { public MultipleContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(MultipleContextualInjectionTestCase.class); } protected String getResource() { return "MultipleContextualInjection.xml"; } protected void checkInjection() { ControllerContext context = getControllerContext("testObject", null); assertEquals(ControllerState.INSTANTIATED, context.getState()); } protected void validate() throws Exception { try { super.validate(); fail("Should not be here!"); } catch (IllegalStateException e) { if (e.getMessage().startsWith("Incompletely")) getLog().debug("Got expected Incomplete deployment exception: " + e); else throw e; } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/CollectionCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000317410612500024033165 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Callback tests. * * @author Ales Justin */ public class CollectionCallbackTestCase extends SimpleCallbackTestCase { public CollectionCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(CollectionCallbackTestCase.class); } protected void afterInstall(CallbackTestObject testObject) { assertTrue(testObject.getTesterInterfaces().isEmpty()); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/BadCardinalityCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/B0000644000175000017500000000540510651430575033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Cardinality tests. * * @author Ales Justin */ public class BadCardinalityCallbackTestCase extends AbstractManualInjectTest { public BadCardinalityCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(BadCardinalityCallbackTestCase.class); } public void testCallback() throws Throwable { KernelControllerContext context = getControllerContext("testObject", ControllerState.NOT_INSTALLED); assertNull(context.getTarget()); assertEquals(ControllerState.NOT_INSTALLED, context.getState()); change(context, ControllerState.CREATE); CallbackTestObject injectee = (CallbackTestObject)context.getTarget(); assertNotNull(injectee); assertNull(injectee.getTesterInterfaces()); KernelControllerContext tester1 = getControllerContext("tester1", ControllerState.NOT_INSTALLED); assertNotNull(tester1); change(tester1, ControllerState.INSTALLED); assertEquals(ControllerState.CONFIGURED, context.getState()); assertNull(injectee.getTesterInterfaces()); KernelControllerContext tester2 = getControllerContext("tester2", ControllerState.NOT_INSTALLED); assertNotNull(tester2); change(tester2, ControllerState.INSTALLED); change(context, ControllerState.INSTALLED); assertNull(injectee.getTesterInterfaces()); assertEquals(ControllerState.INSTALLED, context.getState()); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/GenericsContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/G0000644000175000017500000000461610653175141033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import java.util.Collection; import junit.framework.Test; import org.jboss.test.kernel.inject.support.GenericsTestObject; import org.jboss.test.kernel.inject.support.TesterInterface; /** * Generics injection. * * @author Ales Justin */ public class GenericsContextualInjectionTestCase extends SingleContextualInjectionAdapter { public GenericsContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(GenericsContextualInjectionTestCase.class); } protected String getResource() { return "GenericsContextualInjection.xml"; } protected void checkInjection() { GenericsTestObject testBean = (GenericsTestObject)getBean("testObject"); assertNotNull(testBean); TesterInterface tester = (TesterInterface)getBean("duplicateTester"); checkCollection(testBean.getCollection(), tester); checkCollection(testBean.getList(), tester); checkCollection(testBean.getSet(), tester); assertNotNull(testBean.getGeneric()); } protected void checkCollection(Collection collection, TesterInterface tester) { assertNotNull(collection); assertFalse(collection.isEmpty()); assertEquals(collection.iterator().next(), tester); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/PropertyContextualInjectionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/P0000644000175000017500000000436510612500024033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.PropertyInjectTestObject; /** * Property injection. * * @author Ales Justin */ public class PropertyContextualInjectionTestCase extends SingleContextualInjectionAdapter { public PropertyContextualInjectionTestCase(String name) { super(name); } public static Test suite() { return suite(PropertyContextualInjectionTestCase.class); } protected String getResource() { return "PropertyContextualInjection.xml"; } protected void checkInjection() { PropertyInjectTestObject test1 = (PropertyInjectTestObject) getBean("testObject1"); assertNotNull(test1.getTesterInterface()); PropertyInjectTestObject test2 = (PropertyInjectTestObject) getBean("testObject2"); assertNotNull(test2.getDuplicateTester()); PropertyInjectTestObject test3 = (PropertyInjectTestObject) getBean("testObject3"); assertFalse(test3.getCollection().isEmpty()); PropertyInjectTestObject test4 = (PropertyInjectTestObject) getBean("testObject4"); assertFalse(test4.getMap().isEmpty()); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/SingleContextualInjectionAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/S0000644000175000017500000000347710612500024033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; /** * Single contextual injection unit test. * * @author Ales Justin */ public abstract class SingleContextualInjectionAdapter extends ContextualInjectionAdapter { public SingleContextualInjectionAdapter(String name) { super(name); } protected abstract String getResource(); protected abstract void checkInjection(); public void testInjection() throws Throwable { execute(new SingleTestUnit()); } private class SingleTestUnit implements TestUnit { public String getResource() { return SingleContextualInjectionAdapter.this.getResource(); } public void executeTest() throws Throwable { checkInjection(); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/ContextualInjectionTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/C0000644000175000017500000000471410653354622033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Contextual injection Test Suite. * * @author Ales Justin */ public class ContextualInjectionTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(ContextualInjectionTestSuite.suite()); } public static Test suite() { TestSuite suite = new TestSuite("Contextal injection Tests"); suite.addTest(ConstructorContextualInjectionTestCase.suite()); suite.addTest(LifecycleContextualInjectionTestCase.suite()); suite.addTest(PropertyContextualInjectionTestCase.suite()); suite.addTest(MultipleContextualInjectionTestCase.suite()); suite.addTest(InjectionValueCallbackTestCase.suite()); suite.addTest(AdditionCallbackTestCase.suite()); suite.addTest(CollectionCallbackTestCase.suite()); suite.addTest(CardinalityCallbackTestCase.suite()); suite.addTest(BadCardinalityCallbackTestCase.suite()); suite.addTest(CandidateContextualInjectionTestCase.suite()); suite.addTest(AdditionAnnotationCallbackTestCase.suite()); suite.addTest(CollectionAnnotationCallbackTestCase.suite()); suite.addTest(CardinalityAnnotationCallbackTestCase.suite()); suite.addTest(GenericsContextualInjectionTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/InjectionValueCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/I0000644000175000017500000000470311173121305033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.test.kernel.inject.support.PropertyInjectTestObject; /** * Callback tests. * * @author Ales Justin */ public class InjectionValueCallbackTestCase extends AbstractManualInjectTest { public InjectionValueCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(InjectionValueCallbackTestCase.class); } public void testInjectionValueMetaData() throws Throwable { KernelControllerContext context = getControllerContext("testObject", ControllerState.NOT_INSTALLED); assertNull(context.getTarget()); assertEquals(context.getState(), ControllerState.NOT_INSTALLED); ControllerState state = change(context, ControllerState.INSTALLED); assertEquals(ControllerState.INSTALLED, state); PropertyInjectTestObject injectee = (PropertyInjectTestObject)context.getTarget(); assertNotNull(injectee); assertNull(injectee.getTesterInterface()); KernelControllerContext tester = getControllerContext("tester", ControllerState.NOT_INSTALLED); assertNotNull(tester); change(tester, ControllerState.INSTALLED); assertNotNull(injectee.getTesterInterface()); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/AdditionAnnotationCallbackTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/A0000644000175000017500000000321210613653046033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.test.kernel.inject.support.CallbackTestObject; /** * Callback tests. * * @author Ales Justin */ public class AdditionAnnotationCallbackTestCase extends SimpleCallbackTestCase { public AdditionAnnotationCallbackTestCase(String name) { super(name); } public static Test suite() { return suite(AdditionAnnotationCallbackTestCase.class); } protected void afterInstall(CallbackTestObject testObject) { assertNull(testObject.getTesterInterfaces()); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/AbstractManualInjectTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/A0000644000175000017500000000401310756342051033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import org.jboss.dependency.spi.ControllerMode; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.kernel.junit.MicrocontainerTest; import org.jboss.test.kernel.junit.MicrocontainerTestDelegate; /** * Abstract Inject Test Case. * * @author Adrian Brock * @version $Revision: 40428 $ */ public class AbstractManualInjectTest extends MicrocontainerTest { public AbstractManualInjectTest(String name) { super(name); } public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { MicrocontainerTestDelegate delegate = (MicrocontainerTestDelegate) MicrocontainerTest.getDelegate(clazz); delegate.setDefaultMode(ControllerMode.MANUAL); delegate.enableSecurity = true; return delegate; } protected void configureLogging() { //enableTrace("org.jboss.dependency"); //enableTrace("org.jboss.kernel.plugins.dependency"); //enableTrace("org.jboss.kernel.plugins.deployment"); } }././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/WiredTestTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/test/W0000644000175000017500000000433710763530750033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.test; import junit.framework.Test; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.test.kernel.inject.support.StringValueObject; import org.jboss.test.kernel.inject.support.TesterInterface; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * Test wired test. :-) * * @author Ales Justin */ public class WiredTestTestCase extends MicrocontainerTest { private TesterInterface tester; private StringValueObject valueObject; private boolean lifecycleExecuted = false; public WiredTestTestCase(String name) { super(name, true); } public static Test suite() { return suite(WiredTestTestCase.class); } public void start() { lifecycleExecuted = true; } @Inject public void setTester(TesterInterface tester) { this.tester = tester; } @Inject public void setValueObject(StringValueObject valueObject) { this.valueObject = valueObject; } public void testWiredTest() throws Throwable { assertTrue(lifecycleExecuted); assertNotNull(tester); assertNotNull(valueObject); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000755000175000017500000000000011620312150033346 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/CallbackTestObjectImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000377110613653046033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.HashSet; import java.util.Set; /** * @author Ales Justin */ public class CallbackTestObjectImpl implements CallbackTestObject { private Set testerInterfaces; protected void init() { if (testerInterfaces == null) { testerInterfaces = new HashSet(); } } public void addTesterInterface(TesterInterface tester) { init(); testerInterfaces.add(tester); } public void removeTesterInterface(TesterInterface tester) { init(); testerInterfaces.remove(tester); if (testerInterfaces.isEmpty()) testerInterfaces = null; } public Set getTesterInterfaces() { return testerInterfaces; } public void setTesterInterfaces(Set testerInterfaces) { this.testerInterfaces = testerInterfaces; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/SomeGenericObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000252710653175141033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @param exact type * @author Ales Justin */ public class SomeGenericObject { private T value; public SomeGenericObject(T value) { this.value = value; } public T getValue() { return value; } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/ConstructorValueBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000223610657020413033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public class ConstructorValueBean { } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/BadCallbackTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000256510613653046033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Set; /** * @author Ales Justin */ public class BadCallbackTestObject extends CallbackTestObjectImpl { public void setTesterInterfaces(Set testerInterfaces) { throw new UnsupportedOperationException("DOS test exception."); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/GenericsTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000417610653175141033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Collection; import java.util.Set; import java.util.List; /** * @author Ales Justin */ public class GenericsTestObject { private Collection collection; private Set set; private List list; private SomeGenericObject generic; public Collection getCollection() { return collection; } public void setCollection(Collection collection) { this.collection = collection; } public Set getSet() { return set; } public void setSet(Set set) { this.set = set; } public List getList() { return list; } public void setList(List list) { this.list = list; } public SomeGenericObject getGeneric() { return generic; } public void setGeneric(SomeGenericObject generic) { this.generic = generic; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/TesterInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000227010467641524033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public interface TesterInterface { void someMethod(); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/StringValueObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000241110653175141033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public class StringValueObject extends SomeGenericObject { public StringValueObject(String value) { super(value); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/LifecycleInjectTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000350310474363522033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public class LifecycleInjectTestObject { private TesterInterface testerInterface; public void create(TesterInterface ti) { testerInterface = ti; } public void startMeUp(TesterInterface ti) { testerInterface = ti; } public void stop(TesterInterface ti) { testerInterface = ti; } public void destruction(TesterInterface ti) { testerInterface = ti; } public void installIt(TesterInterface ti) { testerInterface = ti; } public void fromOutside(TesterInterface ti) { testerInterface = ti; } public TesterInterface getTesterInterface() { return testerInterface; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/CallbackTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000246010613653046033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Set; /** * @author Ales Justin */ public interface CallbackTestObject { Set getTesterInterfaces(); void setTesterInterfaces(Set testerInterfaces); } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/AnnotationCardinalityCallbackTestObjectImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000332110674773017033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; /** * @author Ales Justin */ public class AnnotationCardinalityCallbackTestObjectImpl implements CallbackTestObject { private Set testerInterfaces; public Set getTesterInterfaces() { return testerInterfaces; } @Install(cardinality = "2..10", whenRequired = "Create") @Uninstall public void setTesterInterfaces(Set testerInterfaces) { this.testerInterfaces = testerInterfaces; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/AnnotationCollectionCallbackTestObjectImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000324010674773017033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; /** * @author Ales Justin */ public class AnnotationCollectionCallbackTestObjectImpl implements CallbackTestObject { private Set testerInterfaces; public Set getTesterInterfaces() { return testerInterfaces; } @Install @Uninstall public void setTesterInterfaces(Set testerInterfaces) { this.testerInterfaces = testerInterfaces; } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/AnnotationAdditionCallbackTestObjectImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000423710674773017033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.HashSet; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.api.annotations.Uninstall; /** * @author Ales Justin */ public class AnnotationAdditionCallbackTestObjectImpl implements CallbackTestObject { private Set testerInterfaces; protected void init() { if (testerInterfaces == null) { testerInterfaces = new HashSet(); } } @Install public void addTesterInterface(TesterInterface tester) { init(); testerInterfaces.add(tester); } @Uninstall public void removeTesterInterface(TesterInterface tester) { init(); testerInterfaces.remove(tester); if (testerInterfaces.isEmpty()) testerInterfaces = null; } public Set getTesterInterfaces() { return testerInterfaces; } public void setTesterInterfaces(Set testerInterfaces) { this.testerInterfaces = testerInterfaces; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/ConstructorInjectTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000437610474363522033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.List; /** * @author Ales Justin */ public class ConstructorInjectTestObject { private TesterInterface testerInterface; private List testerInterfaces; public ConstructorInjectTestObject() { } public ConstructorInjectTestObject(TesterInterface testerInterface) { this.testerInterface = testerInterface; } public ConstructorInjectTestObject(String someString, List testerInterfaces) { this.testerInterfaces = testerInterfaces; } public ConstructorInjectTestObject(int x, String someString, TesterInterface testerInterface) { this.testerInterface = testerInterface; } public static ConstructorInjectTestObject getInstance(TesterInterface ti) { return new ConstructorInjectTestObject(ti); } public ConstructorInjectTestObject withParameter(TesterInterface ti) { this.testerInterface = ti; return this; } public TesterInterface getTesterInterface() { return testerInterface; } public List getTesterInterfaces() { return testerInterfaces; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/PropertyInjectTestObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000416710756342051033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; import java.util.Collection; import java.util.Map; /** * @author Ales Justin */ public class PropertyInjectTestObject { private TesterInterface testerInterface; private DuplicateTester duplicateTester; private Collection collection; private Map map; public TesterInterface getTesterInterface() { return testerInterface; } public void setTesterInterface(TesterInterface testerInterface) { this.testerInterface = testerInterface; } public DuplicateTester getDuplicateTester() { return duplicateTester; } public void setDuplicateTester(DuplicateTester duplicateTester) { this.duplicateTester = duplicateTester; } public Collection getCollection() { return collection; } public void setCollection(Collection collection) { this.collection = collection; } public Map getMap() { return map; } public void setMap(Map map) { this.map = map; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/DuplicateTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000234110467641524033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public class DuplicateTester implements TesterInterface { public void someMethod() { } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/support/SomeTester.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/inject/suppor0000644000175000017500000000233410630031724033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.inject.support; /** * @author Ales Justin */ public class SomeTester implements TesterInterface { public void someMethod() { } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/0000755000175000017500000000000011620312144031745 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/0000755000175000017500000000000011620312144032724 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/EmitterTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/Em0000644000175000017500000001032510446736533033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.test; import java.util.ArrayList; import junit.framework.Test; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.event.support.EventTestCaseSupport; import org.jboss.test.kernel.event.support.TestEmitter; import org.jboss.test.kernel.event.support.TestFilter; import org.jboss.test.kernel.event.support.TestListener; /** * Emitter Test Case. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class EmitterTestCase extends AbstractKernelTest { public static Test suite() { return suite(EmitterTestCase.class); } public EmitterTestCase(String name) { super(name); } public void testSimpleFireEvent() throws Throwable { TestEmitter emitter = new TestEmitter(); TestListener listener = new TestListener(); emitter.registerListener(listener, null, null); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); EventTestCaseSupport.check(listener, expected); } public void testDoubleFireEvent() throws Throwable { TestEmitter emitter = new TestEmitter(); TestListener listener = new TestListener(); emitter.registerListener(listener, null, null); emitter.testFire("testtype", null); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 1, null, null)); EventTestCaseSupport.check(listener, expected); } public void testFilter() throws Throwable { TestEmitter emitter = new TestEmitter(); TestListener listener = new TestListener(); TestFilter filter = new TestFilter(); emitter.registerListener(listener, filter, null); emitter.testFire("testtype", null); filter.fireEvent = false; emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); EventTestCaseSupport.check(listener, expected); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 1, null, null)); EventTestCaseSupport.check(filter, expected); } public void testHandback() throws Throwable { TestEmitter emitter = new TestEmitter(); TestListener listener = new TestListener(); TestFilter filter = new TestFilter(); Object handback = new Object(); emitter.registerListener(listener, filter, handback); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, handback)); EventTestCaseSupport.check(listener, expected); EventTestCaseSupport.check(filter, expected); } protected void setUp() throws Exception { super.setUp(); //enableTrace("org.jboss.kernel.plugins.event"); } }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/EventTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/Ev0000644000175000017500000000310510331006762033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Event Test Suite. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class EventTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Event Tests"); suite.addTest(EmitterTestCase.suite()); suite.addTest(EventManagerTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/EventManagerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/test/Ev0000644000175000017500000001531211014301412033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.test; import java.util.ArrayList; import junit.framework.Test; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.test.kernel.AbstractKernelTest; import org.jboss.test.kernel.event.support.EventTestCaseSupport; import org.jboss.test.kernel.event.support.TestEmitter; import org.jboss.test.kernel.event.support.TestFilter; import org.jboss.test.kernel.event.support.TestListener; /** * Event Manager Test Case. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class EventManagerTestCase extends AbstractKernelTest { public static Test suite() { return suite(EventManagerTestCase.class); } public EventManagerTestCase(String name) { super(name); } public void testSimpleFireEvent() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelEventManager eventManager = kernel.getEventManager(); TestEmitter emitter = new TestEmitter(); KernelRegistryEntry entry = makeEntry(emitter); registry.registerEntry("Emitter", entry); TestListener listener = new TestListener(); eventManager.registerListener("Emitter", listener, null, null); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); EventTestCaseSupport.check(listener, expected); } public void testDoubleFireEvent() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelEventManager eventManager = kernel.getEventManager(); TestEmitter emitter = new TestEmitter(); KernelRegistryEntry entry = makeEntry(emitter); registry.registerEntry("Emitter", entry); TestListener listener = new TestListener(); eventManager.registerListener("Emitter", listener, null, null); emitter.testFire("testtype", null); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 1, null, null)); EventTestCaseSupport.check(listener, expected); } public void testFilter() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelEventManager eventManager = kernel.getEventManager(); TestEmitter emitter = new TestEmitter(); KernelRegistryEntry entry = makeEntry(emitter); registry.registerEntry("Emitter", entry); TestListener listener = new TestListener(); TestFilter filter = new TestFilter(); eventManager.registerListener("Emitter", listener, filter, null); emitter.testFire("testtype", null); filter.fireEvent = false; emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, null)); EventTestCaseSupport.check(listener, expected); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 1, null, null)); EventTestCaseSupport.check(filter, expected); } public void testHandback() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelEventManager eventManager = kernel.getEventManager(); TestEmitter emitter = new TestEmitter(); KernelRegistryEntry entry = makeEntry(emitter); registry.registerEntry("Emitter", entry); TestListener listener = new TestListener(); TestFilter filter = new TestFilter(); Object handback = new Object(); eventManager.registerListener("Emitter", listener, filter, handback); emitter.testFire("testtype", null); ArrayList expected = new ArrayList(); expected.add(EventTestCaseSupport.makeExpected(emitter, "testtype", 0, null, handback)); EventTestCaseSupport.check(listener, expected); EventTestCaseSupport.check(filter, expected); } public void testDoesNotExist() throws Throwable { Kernel kernel = bootstrap(); KernelEventManager eventManager = kernel.getEventManager(); TestListener listener = new TestListener(); try { eventManager.registerListener("doesnotexist", listener, null, null); fail("Should not be here"); } catch (KernelRegistryEntryNotFoundException expected) { } } public void testNotAnEmitter() throws Throwable { Kernel kernel = bootstrap(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); KernelEventManager eventManager = kernel.getEventManager(); Object notAnEmitter = new Object(); KernelRegistryEntry entry = makeEntry(notAnEmitter); registry.registerEntry("notanemitter", entry); TestListener listener = new TestListener(); try { eventManager.registerListener("notanemitter", listener, null, null); fail("Should not be here"); } catch (ClassCastException expected) { } } protected void configureLoggingAfterBootstrap() { //enableTrace("org.jboss.kernel.plugins.event"); } }././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000755000175000017500000000000011620312144033402 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/TestEvent.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000644000175000017500000000643710446736533033437 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.support; import org.jboss.kernel.spi.event.KernelEvent; /** * An expected event. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class TestEvent implements KernelEvent { /** The source */ public Object source; /** The type */ public String type; /** The sequence */ public long sequence; /** The context */ public Object context; /** The handback */ public Object handback; public TestEvent(Object source, String type, long sequence, Object context, Object handback) { this.source = source; this.type = type; this.sequence = sequence; this.context = context; this.handback = handback; } public TestEvent(KernelEvent event, Object handback) { this.source = event.getSource(); this.type = event.getType(); this.sequence = event.getSequence(); this.context = event.getContext(); this.handback = handback; } public Object getContext() { return context; } public long getSequence() { return sequence; } public Object getSource() { return source; } public long getTimestamp() { return 0; } public String getType() { return type; } public boolean equals(Object object) { TestEvent other = (TestEvent) object; if (source.equals(other.source) == false) return false; if (type.equals(other.type) == false) return false; if (sequence != other.sequence) return false; if (context == null && other.context != null) return false; if (context != null && context.equals(other.context) == false) return false; if (handback == null && other.handback != null) return false; if (handback != null && handback.equals(other.handback) == false) return false; return true; } public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("(source=").append(source); buffer.append(" type=").append(type); buffer.append(" seqn=").append(sequence); buffer.append(" ctx=").append(context); buffer.append(" handback=").append(handback); buffer.append(")"); return buffer.toString(); } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/EventTestCaseSupport.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000644000175000017500000000617010446736533033431 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.support; import java.util.ArrayList; import junit.framework.AssertionFailedError; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.logging.Logger; /** * Event Test Case Support. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class EventTestCaseSupport { private static final Logger log = Logger.getLogger(EventTestCaseSupport.class); public static void check(TestListener listener, ArrayList expected) throws Exception { ArrayList received = listener.events; ArrayList actual = new ArrayList(received); ArrayList expect = new ArrayList(expected); log.debug("listener expect=" + expect); log.debug("listener actual=" + actual); actual.removeAll(expected); assertTrue("Didn't expect events: " + actual + " expected=" + expected, actual.isEmpty()); expect.removeAll(received); assertTrue("Expected events: " + expect + " received=" + received, expect.isEmpty()); } public static void check(TestFilter filter, ArrayList expected) throws Exception { ArrayList filtered = filter.events; ArrayList actual = new ArrayList(filtered); ArrayList expect = new ArrayList(expected); log.debug("filter expect=" + expect); log.debug("filter actual=" + actual); actual.removeAll(expected); assertTrue("Didn't expect to filter events: " + actual + " expected=" + expected, actual.isEmpty()); expect.removeAll(filtered); assertTrue("Expected to filter events: " + expect + " filtered=" + filtered, expect.isEmpty()); } public static TestEvent makeExpected(Object source, String type, long sequence, Object context, Object handback) { return new TestEvent(source, type, sequence, context, handback); } public static void assertTrue(String text, boolean assertion) { if (assertion == false) throw new AssertionFailedError(text); } }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/TestEmitter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000644000175000017500000000267510446736533033437 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.support; import org.jboss.kernel.plugins.event.AbstractEventEmitter; import org.jboss.kernel.spi.event.KernelEvent; /** * A test emitter. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class TestEmitter extends AbstractEventEmitter { public void testFire(String type, Object context) { KernelEvent event = createEvent(type, context); fireKernelEvent(event); } }././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/TestListener.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000644000175000017500000000331110446736533033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.support; import java.util.ArrayList; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.logging.Logger; /** * A test listener. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class TestListener implements KernelEventListener { private static Logger log = Logger.getLogger(TestListener.class); /** The events */ public ArrayList events = new ArrayList(); public void onEvent(KernelEvent event, Object handback) { log.debug(this + " onEvent=" + event + " handback=" + handback); events.add(new TestEvent(event, handback)); } }././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support/TestFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/kernel/event/support0000644000175000017500000000344710446736533033435 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.event.support; import java.util.ArrayList; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventFilter; import org.jboss.logging.Logger; /** * A test filter. * * @author Adrian Brock * @version $Revision: 45764 $ */ public class TestFilter implements KernelEventFilter { private static final Logger log = Logger.getLogger(TestFilter.class); /** The events */ public ArrayList events = new ArrayList(); /** The filter value */ public boolean fireEvent = true; public boolean wantEvent(KernelEvent event, Object handback) { log.debug(this + " wantEvent=" + event + " handback=" + handback); events.add(new TestEvent(event, handback)); return fireEvent; } }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/0000755000175000017500000000000011620312155032011 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/0000755000175000017500000000000011620312155032607 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/Sec0000644000175000017500000000445310446736533033271 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.classloading.vfs; import java.security.PrivilegedAction; import java.security.AccessController; import java.net.URL; /** @author Scott.Stark@jboss.org @version $Revision: 45764 $ */ public class SecurityActions { interface ClassLoaderActions { ClassLoaderActions PRIVILEGED = new ClassLoaderActions() { public VFSClassLoader newClassLoader(final URL[] urls) { PrivilegedAction action = new PrivilegedAction() { public VFSClassLoader run() { return new VFSClassLoader(urls); } }; return AccessController.doPrivileged(action); } }; ClassLoaderActions NON_PRIVILEGED = new ClassLoaderActions() { public VFSClassLoader newClassLoader(URL[] urls) { return new VFSClassLoader(urls); } }; VFSClassLoader newClassLoader(URL[] urls); } static VFSClassLoader newClassLoader(URL[] urls) { if(System.getSecurityManager() == null) { return ClassLoaderActions.NON_PRIVILEGED.newClassLoader(urls); } else { return ClassLoaderActions.PRIVILEGED.newClassLoader(urls); } } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/VFSClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/VFS0000644000175000017500000000400710756342051033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.classloading.vfs; import java.net.URLClassLoader; import java.net.URL; import java.net.URLStreamHandlerFactory; /** @author Scott.Stark@jboss.org @version $Revision: 69895 $ */ public class VFSClassLoader extends URLClassLoader { public VFSClassLoader(URL[] urls, ClassLoader parent) { super(urls, parent); } public VFSClassLoader(URL[] urls) { super(urls, new NullClassLoader()); } public VFSClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) { super(urls, parent, factory); } public Class loadClass(String name, boolean flag) throws ClassNotFoundException { if (name.startsWith("org.jboss.test") == false) return getClass().getClassLoader().loadClass(name); Class c; try { c = super.loadClass(name, flag); } catch(ClassNotFoundException e) { c = getClass().getClassLoader().loadClass(name); } return c; } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/NullClassLoader.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/Nul0000644000175000017500000000276310446736533033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.classloading.vfs; /** @author Scott.Stark@jboss.org @version $Revision: 45764 $ */ public class NullClassLoader extends ClassLoader { protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException { throw new ClassNotFoundException("No classes here"); } protected Class findClass(String name) throws ClassNotFoundException { throw new ClassNotFoundException("No classes here"); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/ClassLoaderUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/Cla0000644000175000017500000000437110756342051033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.classloading.vfs; import java.net.URL; import java.security.PrivilegedAction; import java.security.AccessController; /** * A ClassLoaderUtil. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class ClassLoaderUtil { /** * Get the location of a class * * @param className the class name * @return the location * @throws ClassNotFoundException if the class is not found */ public static URL getLocation(String className) throws ClassNotFoundException { Class clazz = Class.forName(className); return clazz.getProtectionDomain().getCodeSource().getLocation(); } /** * Get the classloader. * * @param clazz the class * @return the classloader */ public static ClassLoader getClassLoader(final Class clazz) { if (clazz == null) throw new IllegalArgumentException("Null clazz."); SecurityManager sm = System.getSecurityManager(); if (sm == null) return clazz.getClassLoader(); else return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { return clazz.getClassLoader(); } }); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/VFSClassLoaderFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/test/java/org/jboss/test/classloading/vfs/VFS0000644000175000017500000000245610333202250033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.classloading.vfs; import java.net.URL; /** @author Scott.Stark@jboss.org @version $Revision: 37875 $ */ public class VFSClassLoaderFactory { public static VFSClassLoader newClassLoader(URL[] urls) { return SecurityActions.newClassLoader(urls); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/etc/0000755000175000017500000000000011620312176023336 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/etc/default.mf0000644000175000017500000000100610274755776025330 0ustar twernertwernerManifest-Version: 1.0 Created-By: @java.vm.version@ (@java.vm.vendor@) Specification-Title: @specification.title@ Specification-Version: @specification.version@ Specification-Vendor: @specification.vendor@ Implementation-Title: @implementation.title@ Implementation-URL: @implementation.url@ Implementation-Version: @implementation.version@ Implementation-Vendor: @implementation.vendor@ Implementation-Vendor-Id: @implementation.vendor.id@ Main-Class: org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstraplibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/etc/conf/0000755000175000017500000000000011620312176024263 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/etc/conf/log4j.properties0000644000175000017500000000146010777274010027427 0ustar twernertwerner### ====================================================================== ### ## ## ## JBoss Bootstrap Log4j Configuration ## ## ## ### ====================================================================== ### ### $Id: log4j.properties 71868 2008-04-10 02:14:32Z scott.stark@jboss.org $ ### log4j.rootCategory=DEBUG, CONSOLE log4j.org.jboss.util=TRACE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.Threshold=INFO log4j.appender.CONSOLE.Target=System.out log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}] %m%n libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/assembly/0000755000175000017500000000000011620312135024375 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/assembly/spi.xml0000644000175000017500000000065310611746120025722 0ustar twernertwerner spi jar false target/classes org/jboss/kernel/spi/** org/jboss/beans/metadata/spi/** libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/assembly/plugins.xml0000644000175000017500000000066710611746120026615 0ustar twernertwerner plugins jar false target/classes org/jboss/kernel/plugins/** org/jboss/beans.metadata/plugins/** libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/assembly/annotations.xml0000644000175000017500000000063310674773017027500 0ustar twernertwerner annotations jar false target/classes org/jboss/beans/metadata/api/annotations/** libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/0000755000175000017500000000000011620312176023507 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/0000755000175000017500000000000011620312176025521 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/findbugs/0000755000175000017500000000000011620312176027322 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/findbugs/exclude.xml0000644000175000017500000003223111262376750031510 0ustar twernertwerner org.jboss.beans.metadata.plugins.AbstractBeanMetaData org.jboss.beans.metadata.plugins.AbstractCallbackMetaData org.jboss.beans.metadata.plugins.AbstractCollectionMetaData org.jboss.beans.metadata.plugins.AbstractConstructorMetaData org.jboss.beans.metadata.plugins.AbstractInstallMetaData org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData org.jboss.beans.metadata.plugins.AbstractListMetaData org.jboss.beans.metadata.plugins.AbstractMapMetaData org.jboss.beans.metadata.plugins.AbstractParameterMetaData org.jboss.beans.metadata.plugins.AbstractPropertyMetaData org.jboss.beans.metadata.plugins.AbstractSetMetaData org.jboss.beans.metadata.plugins.AbstractTypeMetaData libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/schema/0000755000175000017500000000000011620312176026761 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/schema/bean-deployer_2_0.xsd0000644000175000017500000003012111050031647032662 0ustar twernertwerner ... ]]> An extension value ]]> An extension value libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/schema/policy_1_0.xsd0000644000175000017500000000524110562407702031445 0ustar twernertwerner ]]> ]]> ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/schema/jboss-beans-common_2_0.xsdlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/resources/schema/jboss-beans-common_2_0.0000644000175000017500000013142511216157032033123 0ustar twernertwerner ]]> ]]> package com.acme.User; public class User { // factory has been configured at this point public void setFactory(GenericBeanFactory factory) { SomeBean bean1 = factory.createBean(); System.out.println(bean1.getSomeProperty()); // "SomeOtherBean" SomeBean bean2 = factory.createBean(); System.out.println(bean2.getSomeProperty()); // "SomeOtherBean" } } ]]> org.acme.domain.IUser ]]> String value e.g. static factory - com.acme.Factory.newInstance(new String("String value")); String value e.g. instance factory - "SomeOtherBean".newInstance(new String("String value")); String value ]]> An extension value String value ]]> If you don't include a bean attribute, the method is invoked on your bean e.g. ]]> ]]> ]]> e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty()); ]]> e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty()); e.g. Contextual injection - finding exactly one instance which matches property's class type e.g. Contextual injection - finding exactly one instance which matches property's name e.g. Contextual injection - set optional injection; execute callback if currently no matching context exists ]]> ]]> foo.bar.prop mydefault e.g. Bean instance - "InjectedIntoMe".setSomeProperty("ValueFactory".getValue("foo.bar.prop")); ]]> You can also inject a property of the bean bean e.g. Or you can construct a factory in place using a different schema/namsapce e.g. ]]> YourName ]]> 1st Parameter 2nd Parameter e.g. Explicitly stating the parameter type to resolve overloading 1st Parameter 2nd Parameter e.g. To override the injected type use 1st Parameter 2nd Parameter ]]> Some value e.g. Overridding the injected type Some value ]]> The elements that use this type designate the name of a Java class or interface. The name is in the form of a "binary name", as defined in the JLS and as used in Class.forName(). , or collection components e.g. Hello e.g. This also defines the null value as opposed to the empty string or the string "null" null The this operation lets you pass yourself as a parameter. e.g. ]]> An extension value xxx ]]> xxx ]]> ]]> An extension value http://localhost http://localhost ]]> ... ]]> ]]> ]]> ]]> package com.acme.User; public class User { // factory has been configured at this point public void setFactory(GenericBeanFactory factory) { SomeBean bean1 = factory.createBean(); System.out.println(bean1.getSomeProperty()); // "SomeOtherBean" SomeBean bean2 = factory.createBean(); System.out.println(bean2.getSomeProperty()); // "SomeOtherBean" } } ]]> String value e.g. static factory - com.acme.Factory.newInstance(new String("String value")); String value e.g. instance factory - "SomeOtherBean".newInstance(new String("String value")); String value ]]> String value ]]> e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty()); ]]> e.g. Bean property - "InjectedIntoMe".setSomeProperty("BeanInjected".getOtherProperty()); e.g. Contextual injection - finding exactly one instance which matches property's class type e.g. Contextual injection - finding exactly one instance which matches property's name e.g. Contextual injection - set optional injection; execute callback if currently no matching context exists ]]> 1st Parameter 2nd Parameter e.g. Explicitly stating the parameter type to resolve overloading 1st Parameter 2nd Parameter e.g. To override the injected type use 1st Parameter 2nd Parameter ]]> Some value e.g. Overridding the injected type Some value ]]> The elements that use this type designate the name of a Java class or interface. The name is in the form of a "binary name", as defined in the JLS and as used in Class.forName(). , or collection components e.g. Hello e.g. This also defines the null value as opposed to the empty string or the string "null" null TODO: "any" is currently unimplemented. ]]> An extension value xxx ]]> xxx ]]> ]]> An extension value http://localhost http://localhost ]]> libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/0000755000175000017500000000000011620312163024424 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/0000755000175000017500000000000011620312163025213 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/0000755000175000017500000000000011620312171026332 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/0000755000175000017500000000000011620312163027312 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/0000755000175000017500000000000011620312163030572 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/junit/0000755000175000017500000000000011620312163031723 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/junit/MicrocontainerTestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/junit/Microco0000644000175000017500000002741110764502416033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.junit; import java.net.URL; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.AbstractBootstrap; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.test.AbstractTestDelegate; /** * A MicrocontainerTestDelegate. * * @author Adrian Brock * @version $Revision: 70576 $ */ public class MicrocontainerTestDelegate extends AbstractTestDelegate { /** The kernel */ protected Kernel kernel; /** The deployer */ protected BasicXMLDeployer deployer; /** The default mode */ protected ControllerMode defaultMode = ControllerMode.AUTOMATIC; /** * Create a new MicrocontainerTestDelegate. * * @param clazz the test class * @throws Exception for any error */ public MicrocontainerTestDelegate(Class clazz) throws Exception { super(clazz); } public void setUp() throws Exception { super.setUp(); try { // Bootstrap the kernel AbstractBootstrap bootstrap = getBootstrap(); bootstrap.run(); kernel = bootstrap.getKernel(); // Create the deployer deployer = createDeployer(); // Deploy deploy(); } catch (Exception e) { super.tearDown(); throw e; } catch (Error e) { super.tearDown(); throw e; } catch (Throwable e) { super.tearDown(); throw new RuntimeException(e); } } protected BasicXMLDeployer createDeployer() { return new BasicXMLDeployer(kernel, defaultMode); } public void tearDown() throws Exception { try { undeploy(); } finally { super.tearDown(); } } /** * Get the defaultMode. * * @return the defaultMode. */ public ControllerMode getDefaultMode() { return defaultMode; } /** * Set the defaultMode. * * @param defaultMode the defaultMode. */ public void setDefaultMode(ControllerMode defaultMode) { this.defaultMode = defaultMode; } /** * Get the kernel bootstrap * * @return the bootstrap * @throws Exception for any error */ protected AbstractBootstrap getBootstrap() throws Exception { return new BasicBootstrap(); } /** * Get a bean * * @param name the name of the bean * @param state the state of the bean * @return the bean * @throws IllegalStateException when the bean does not exist at that state */ protected Object getBean(final Object name, final ControllerState state) { KernelControllerContext context = getControllerContext(name, state); return context.getTarget(); } /** * Get a bean * * @param the expected type * @param name the name of the bean * @param state the state of the bean * @param expected the expected type * @return the bean * @throws IllegalStateException when the bean does not exist at that state */ protected T getBean(final Object name, final ControllerState state, final Class expected) { if (expected == null) throw new IllegalArgumentException("Null expected"); Object bean = getBean(name, state); return expected.cast(bean); } /** * Get the metadata repository * @return the metadata repository * @throws IllegalStateException when the bean does not exist at that state */ protected KernelMetaDataRepository getMetaDataRepository() { return kernel.getMetaDataRepository(); } /** * Get a context * * @param name the name of the bean * @param state the state of the bean * @return the context * @throws IllegalStateException when the context does not exist at that state */ protected KernelControllerContext getControllerContext(final Object name, final ControllerState state) { KernelController controller = kernel.getController(); KernelControllerContext context = (KernelControllerContext) controller.getContext(name, state); if (context == null) return handleNotFoundContext(controller, name, state); return context; } /** * Assert there is no context at the given state * * @param name the name of the bean * @param state the state of the bean * @throws IllegalStateException when the context exists at that state */ protected void assertNoControllerContext(final Object name, final ControllerState state) { KernelController controller = kernel.getController(); KernelControllerContext context = (KernelControllerContext) controller.getContext(name, state); if (context != null) throw new IllegalStateException("Did not expect context at state " + state + " ctx=" + context); } /** * Handle not found context. * * @param controller the controller * @param name the name of the bean * @param state the state of the bean * @return the context * @throws IllegalStateException when the context does not exist at that state */ protected KernelControllerContext handleNotFoundContext(Controller controller, Object name, ControllerState state) { throw new IllegalStateException("Bean not found " + name + " at state " + state); } /** * Change the context to the given state * * @param context the context * @param required the required state * @return the actual state * @throws Throwable for any error */ protected ControllerState change(KernelControllerContext context, ControllerState required) throws Throwable { Controller controller = kernel.getController(); controller.change(context, required); return context.getState(); } /** * Validate * * @throws Exception for any error */ protected void validate() throws Exception { try { deployer.validate(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } /** * Deploy a url * * @param url the deployment url * @return the deployment * @throws Exception for any error */ protected KernelDeployment deploy(URL url) throws Exception { try { log.debug("Deploying " + url); KernelDeployment deployment = deployer.deploy(url); log.trace("Deployed " + url); return deployment; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } /** * Deploy a bean * * @param beanMetaData the bean metadata * @return the deployment * @throws Exception for any error */ protected KernelControllerContext deploy(BeanMetaData beanMetaData) throws Exception { KernelController controller = kernel.getController(); log.debug("Deploying " + beanMetaData); try { KernelControllerContext result = controller.install(beanMetaData); log.debug("Deployed " + result.getName()); return result; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException("Error deploying bean: " + beanMetaData, t); } } /** * Deploy a deployment * * @param deployment the deployment * @throws Exception for any error */ protected void deploy(KernelDeployment deployment) throws Exception { log.debug("Deploying " + deployment); try { deployer.deploy(deployment); log.debug("Deployed " + deployment); } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException("Error deploying deployment: " + deployment, t); } } /** * Undeploy a bean * * @param context the context */ protected void undeploy(KernelControllerContext context) { if (context == null) throw new IllegalArgumentException("Null context"); log.debug("Undeploying " + context.getName()); KernelController controller = kernel.getController(); controller.uninstall(context.getName()); log.debug("Undeployed " + context.getName()); } /** * Undeploy a deployment * * @param deployment the deployment */ protected void undeploy(KernelDeployment deployment) { log.debug("Undeploying " + deployment.getName()); try { deployer.undeploy(deployment); log.trace("Undeployed " + deployment.getName()); } catch (Throwable t) { log.warn("Error during undeployment: " + deployment.getName(), t); } } /** * Undeploy a deployment * * @param url the url */ protected void undeploy(URL url) { log.debug("Undeploying " + url); try { deployer.undeploy(url); log.trace("Undeployed " + url); } catch (Throwable t) { log.warn("Error during undeployment: " + url, t); } } /** * Deploy the beans * * @throws Exception for any error */ protected void deploy() throws Exception { String testName = getTestName(); URL url = getTestResource(testName); if (url != null) deploy(url); else log.debug("No test specific deployment " + testName); } protected void shutdown() { kernel.getController().shutdown(); } protected String getTestName() { String testName = clazz.getName(); return testName.replace('.', '/') + ".xml"; } protected URL getTestResource(String testName) { return clazz.getClassLoader().getResource(testName); } /** * Undeploy all */ protected void undeploy() { log.debug("Undeploying " + deployer.getDeploymentNames()); deployer.shutdown(); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/junit/MicrocontainerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/test/kernel/junit/Microco0000644000175000017500000002664711067201147033264 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.kernel.junit; import java.net.URL; import java.util.UUID; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.Kernel; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * A MicrocontainerTest. * * @author Adrian Brock * @version $Revision: 78898 $ */ public class MicrocontainerTest extends AbstractTestCaseWithSetup { /** Should we wire this bean */ private boolean autowireCandidate; /** The test bean name */ private String testBeanName; /** The method specific deployment */ private KernelDeployment methodDeployment; /** * Get the test delegate * * @param clazz the test class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new MicrocontainerTestDelegate(clazz); } /** * Create a new Microcontainer test * * @param name the test name */ public MicrocontainerTest(String name) { super(name); } public MicrocontainerTest(String name, boolean autowireCandidate) { super(name); this.autowireCandidate = autowireCandidate; } protected void setUp() throws Exception { super.setUp(); URL url = getMethodResource(); if (url != null) methodDeployment = deploy(url); else getLog().debug("No method specific deployment " + getMethodDeployment()); afterSetUp(); } protected String getMethodDeployment() { String testName = getClass().getName(); return "/" + testName.replace('.', '/') + "#" + getName() + ".xml"; } protected URL getMethodResource() { return getResource(getMethodDeployment()); } /** * Configure after set up. * * @throws Exception for any error */ protected void afterSetUp() throws Exception { if (autowireCandidate) autowireThis(); configureLogging(); // Validate everything deployed getMCDelegate().validate(); } @Override protected void tearDown() throws Exception { if (methodDeployment != null) undeploy(methodDeployment); if (autowireCandidate) clearAutowire(); super.tearDown(); } /** * Autowire this test instance. * Registering it into underlying controller. * * @throws Exception for any error */ protected void autowireThis() throws Exception { String beanName = createTestBeanName(); KernelController controller = getController(); try { controller.install(new AbstractBeanMetaData(beanName, getClass().getName()), this); // we're installed testBeanName = beanName; } catch (Throwable t) { throw new Exception(t); } } /** * Get the test's bean name. * By default it's random uuid. * * @return test's bean name */ protected String createTestBeanName() { return UUID.randomUUID().toString(); } /** * Clear things after autowiring. */ protected void clearAutowire() { if (testBeanName != null) { try { KernelController controller = getController(); controller.uninstall(testBeanName); } catch (Exception e) { getLog().warn("Exception while uninstalling test instance: " + e); } } } /** * Get the underlying controller. * * @return the controller */ private KernelController getController() { MicrocontainerTestDelegate delegate = getMCDelegate(); Kernel kernel = delegate.kernel; return kernel.getController(); } /** * Get a bean * * @param name the bean name * @return the bean * @throws IllegalStateException when the bean does not exist */ protected Object getBean(Object name) { return getBean(name, ControllerState.INSTALLED); } /** * Get a bean * * @param name the name of the bean * @param state the state of the bean * @return the bean * @throws IllegalStateException when the bean does not exist at that state */ protected Object getBean(Object name, ControllerState state) { return getMCDelegate().getBean(name, state); } /** * Get a bean * * @param the expected type * @param name the name of the bean * @param state the state of the bean * @param expected the expected type * @return the bean * @throws IllegalStateException when the bean does not exist at that state */ protected T assertBean(Object name, ControllerState state, Class expected) { return getMCDelegate().getBean(name, state, expected); } /** * Get a bean * * @param the expected type * @param name the name of the bean * @param expected the expected type * @return the bean * @throws IllegalStateException when the bean does not exist at that state */ protected T assertBean(Object name, Class expected) { return assertBean(name, ControllerState.INSTALLED, expected); } /** * Assert there is no bean * * @param name the name of the bean * @throws IllegalStateException when the bean exists */ protected void assertNoBean(Object name) { assertNoBean(name, ControllerState.INSTALLED); } /** * Assert there is no bean * * @param name the name of the bean * @param state the context state * @throws IllegalStateException when the bean exists */ protected void assertNoBean(Object name, ControllerState state) { assertNoControllerContext(name, state); } /** * Get a context * * @param name the bean name * @return the context * @throws IllegalStateException when the context does not exist */ protected KernelControllerContext getControllerContext(Object name) { return getControllerContext(name, ControllerState.INSTALLED); } /** * Get a context * * @param name the name of the bean * @param state the state of the bean * @return the context * @throws IllegalStateException when the context does not exist at that state */ protected KernelControllerContext getControllerContext(Object name, ControllerState state) { return getMCDelegate().getControllerContext(name, state); } /** * Assert there is no context at the given state * * @param name the name of the bean * @param state the state of the bean * @throws IllegalStateException when the context exists at that state */ protected void assertNoControllerContext(Object name, ControllerState state) { getMCDelegate().assertNoControllerContext(name, state); } /** * Change the context to the given state * * @param context the context * @param required the required state * @return the actual state * @throws Throwable for any error */ public ControllerState change(KernelControllerContext context, ControllerState required) throws Throwable { return getMCDelegate().change(context, required); } /** * Deploy a url * * @param url the deployment url * @return the deployment * @throws Exception for any error */ protected KernelDeployment deploy(URL url) throws Exception { return getMCDelegate().deploy(url); } /** * Deploy a resource * * @param resource the deployment resource * @return the deployment * @throws Exception for any error */ protected KernelDeployment deploy(String resource) throws Exception { URL url = getClass().getResource(resource); if (url == null) throw new IllegalArgumentException("Resource not found: " + resource); return getMCDelegate().deploy(url); } /** * Deploy a bean * * @param beanMetaData the bean metadata * @return the deployment * @throws Exception for any error */ protected KernelControllerContext deploy(BeanMetaData beanMetaData) throws Exception { return getMCDelegate().deploy(beanMetaData); } /** * Deploy a deployment * * @param deployment the deployment * @throws Exception for any error */ protected void deploy(KernelDeployment deployment) throws Exception { getMCDelegate().deploy(deployment); } /** * Undeploy a bean * * @param context the context */ protected void undeploy(KernelControllerContext context) { getMCDelegate().undeploy(context); } /** * Undeploy a deployment * * @param deployment the deployment */ protected void undeploy(KernelDeployment deployment) { getMCDelegate().undeploy(deployment); } /** * Undeploy a deployment * * @param resource the url */ protected void undeploy(String resource) { URL url = getClass().getResource(resource); if (url == null) throw new IllegalArgumentException("Resource not found: " + resource); getMCDelegate().undeploy(url); } /** * Validate * * @throws Exception for any error */ protected void validate() throws Exception { getMCDelegate().validate(); } /** * Get the metadata repository * * @return the metadata repository * @throws IllegalStateException when the bean does not exist at that state */ protected KernelMetaDataRepository getMetaDataRepository() { return getMCDelegate().getMetaDataRepository(); } /** * Shutdown the controller */ protected void shutdown() { getMCDelegate().shutdown(); } /** * Get the delegate * * @return the delegate */ protected MicrocontainerTestDelegate getMCDelegate() { return (MicrocontainerTestDelegate) getDelegate(); } /** * Set the autowire flag. * * @param autowireCandidate the autowire flag */ protected void setAutowireCandidate(boolean autowireCandidate) { this.autowireCandidate = autowireCandidate; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/0000755000175000017500000000000011620312171027422 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/0000755000175000017500000000000011620312175031206 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/0000755000175000017500000000000011620312175031757 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000755000175000017500000000000011620312175033057 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/FromContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000644000175000017500000000662311034355301033065 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.model; import java.util.Arrays; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.annotations.JBossXmlEnum; /** * Inject from controller context: * * name - controller context name * * aliases - aliases * * metadata - inject MetaData * * beaninfo - BeanInfo * * scope - ScopeKey * * id - identifier * * dynamic - method specific * * ... * * @author Ales Justin */ @JBossXmlEnum(ignoreCase=true) public enum FromContext { NOOP(FromContextDelegate.NOOP), NAME(FromContextDelegate.NAME), ALIASES(FromContextDelegate.ALIASES), METADATA(FromContextDelegate.METADATA), BEANINFO(FromContextDelegate.BEANINFO), SCOPE(FromContextDelegate.SCOPE), STATE(FromContextDelegate.STATE), ID(FromContextDelegate.ID), CONTEXT(FromContextDelegate.CONTEXT); /** The delegate */ private final FromContextDelegate delegate; /** * Create a new state * * @param delegate the delegate */ private FromContext(FromContextDelegate delegate) { if (delegate == null) throw new IllegalArgumentException("Null delegate"); this.delegate = delegate; } /** * When valid state. * * @return the when valid state */ public ControllerState getWhenValid() { return delegate.getWhenValid(); } /** * Execute injection on context. * * @param context the target context * @return lookup value * @throws Throwable for any error */ public Object executeLookup(ControllerContext context) throws Throwable { return delegate.executeLookup(context); } /** * Get the enum instance from string. * * @param fromString the type string * @return from context enum instance */ public static FromContext getInstance(String fromString) { if (fromString == null) throw new IllegalArgumentException("Null from string."); for(FromContext fromContext : values()) { if (fromString.equalsIgnoreCase(fromContext.delegate.getFromString())) return fromContext; } throw new IllegalArgumentException("No such FromContext for from string: " + fromString + ", available: " + Arrays.toString(values())); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/AutowireType.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000644000175000017500000000566011034370463033073 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.model; import javax.xml.bind.annotation.XmlEnumValue; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlEnum; /** * Autowire type: * * ByClass - matching the class type of value (default) * * ByName - matching the property name * * Constructor - matching the constructor args * * Auto - matching constructor or by type * * None - do not autowire * * @author Ales Justin */ @JBossXmlEnum(ignoreCase=true) public enum AutowireType { NONE(MicrocontainerConstants.NONE), @XmlEnumValue("ByClass") BY_CLASS(MicrocontainerConstants.BY_CLASS), @XmlEnumValue("ByName") BY_NAME(MicrocontainerConstants.BY_NAME), CONSTRUCTOR(MicrocontainerConstants.CONSTRUCTOR), AUTO(MicrocontainerConstants.AUTO); /** The type string */ private final String typeString; /** * Create a new state * * @param typeString the string representation */ private AutowireType(String typeString) { if (typeString == null) throw new IllegalArgumentException("Null type string"); this.typeString = typeString; } /** * Return injection type. * Or NONE if no matching type. * * @param typeString type * @return AutowireType instance */ public static AutowireType getInstance(String typeString) { if (typeString == null) throw new IllegalArgumentException("Null type string."); for(AutowireType type : values()) { if (typeString.equalsIgnoreCase(type.getTypeString())) return type; } return NONE; } /** * Get the state string * * @return the state string */ public String getTypeString() { return typeString; } public void toString(JBossStringBuilder buffer) { buffer.append(typeString); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/MicrocontainerConstants.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000644000175000017500000000452111066446716033100 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.model; /** * Microcontainer constants. * * @author Ales Justin */ public interface MicrocontainerConstants { // Controller states // POJO String NOT_INSTALLED = "Not Installed"; String PRE_INSTALL = "PreInstall"; String DESCRIBED = "Described"; String INSTANTIATED = "Instantiated"; String CONFIGURED = "Configured"; String CREATE = "Create"; String START = "Start"; String INSTALLED = "Installed"; // Deployment stages String PARSE = "Parse"; String POST_PARSE = "PostParse"; String PRE_DESCRIBE = "PreDescribe"; String CLASSLOADER = "ClassLoader"; String POST_CLASSLOADER = "PostClassLoader"; String PRE_REAL = "PreReal"; String REAL = "Real"; // Inject Option String STRICT = "Strict"; String CALLBACK = "Callback"; String OPTIONAL = "Optional"; // Autowire String NONE = "None"; String BY_CLASS = "ByClass"; String BY_NAME = "ByName"; String CONSTRUCTOR = "Constructor"; String AUTO = "Auto"; // FromContext String NAME = "name"; String ALIASES = "aliases"; String METADATA = "metadata"; String BEANINFO = "beaninfo"; String SCOPE = "scope"; String STATE = "state"; String ID = "id"; String CONTEXT = "context"; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/FromContextDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000644000175000017500000002544711301242575033077 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.model; import java.io.Serializable; import java.io.ObjectStreamException; import java.util.Collections; import java.util.Set; import java.util.Map; import java.util.HashMap; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.helpers.UnmodifiableBeanInfo; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.helpers.UnmodifiableControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.helpers.UnmodifiableKernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Inject from controller context: * * name - controller context name * * aliases - aliases * * metadata - inject MetaData * * beaninfo - BeanInfo * * scope - ScopeKey * * id - identifier * * dynamic - method specific * * ... * * @author Ales Justin */ abstract class FromContextDelegate extends JBossObject implements Serializable { private static final long serialVersionUID = 1L; /** name */ static final FromContextDelegate NOOP = new NoopFromContext("noop"); /** name */ static final FromContextDelegate NAME = new NameFromContext(MicrocontainerConstants.NAME); /** alias */ static final FromContextDelegate ALIASES = new AliasesFromContext(MicrocontainerConstants.ALIASES); /** metadata */ static final FromContextDelegate METADATA = new MetaDataFromContext(MicrocontainerConstants.METADATA); /** beaninfo */ static final FromContextDelegate BEANINFO = new BeanInfoFromContext(MicrocontainerConstants.BEANINFO); /** scope */ static final FromContextDelegate SCOPE = new ScopeFromContext(MicrocontainerConstants.SCOPE); /** state */ static final FromContextDelegate STATE = new StateFromContext(MicrocontainerConstants.STATE); /** id */ static final FromContextDelegate ID = new IdFromContext(MicrocontainerConstants.ID); /** context */ static final FromContextDelegate CONTEXT = new ThisContext(MicrocontainerConstants.CONTEXT); /** The type string */ protected final String fromString; /** The when valid state */ protected ControllerState whenValid; /** The values */ private static Map values = new HashMap(); static { values.put(NOOP.getFromString(), NOOP); values.put(NAME.getFromString(), NAME); values.put(ALIASES.getFromString(), ALIASES); values.put(METADATA.getFromString(), METADATA); values.put(BEANINFO.getFromString(), BEANINFO); values.put(SCOPE.getFromString(), SCOPE); values.put(STATE.getFromString(), STATE); values.put(ID.getFromString(), ID); values.put(CONTEXT.getFromString(), CONTEXT); } /** * Create a new state * * @param fromString the string representation */ protected FromContextDelegate(String fromString) { this(fromString, null); } /** * Create new state * * @param fromString the string representation * @param whenValid the when valid state */ protected FromContextDelegate(String fromString, ControllerState whenValid) { if (fromString == null) throw new IllegalArgumentException("Null from string"); this.fromString = fromString; if (whenValid == null) whenValid = ControllerState.PRE_INSTALL; this.whenValid = whenValid; } /** * Get when valid state. * * @return the when required state */ public ControllerState getWhenValid() { return whenValid; } /** * Validate context before execution. * After validation we must be able to cast context to T instance. * * @param context the context */ protected void validate(ControllerContext context) { } /** * Execute injection on context. * * @param context the target context * @return lookup value * @throws Throwable for any error */ public Object executeLookup(ControllerContext context) throws Throwable { validate(context); return internalExecute(context); } /** * Execute internal lookup on context. * * @param context the target context * @return lookup value * @throws Throwable for any error */ public abstract Object internalExecute(ControllerContext context) throws Throwable; /** * Get the from string * * @return the state string */ public String getFromString() { return fromString; } public boolean equals(Object object) { if (object == null || object instanceof FromContextDelegate == false) return false; FromContextDelegate other = (FromContextDelegate) object; return fromString.equals(other.getFromString()); } public void toString(JBossStringBuilder buffer) { buffer.append(fromString); } protected int getHashCode() { return fromString.hashCode(); } protected Object readResolve() throws ObjectStreamException { return values.get(fromString); } private static abstract class KernelFromContextDelegate extends FromContextDelegate { private static final long serialVersionUID = 1L; protected KernelFromContextDelegate(String fromString) { super(fromString); } protected KernelFromContextDelegate(String fromString, ControllerState whenRequired) { super(fromString, whenRequired); } protected void validate(ControllerContext context) { if (context instanceof KernelControllerContext == false) throw new UnsupportedOperationException("Cannot execute " + getFromString() + " on underlying context: " + context); } } private static class NoopFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public NoopFromContext(String fromString) { super(fromString); } public Object internalExecute(ControllerContext context) { throw new UnsupportedOperationException("Noop from context."); } } private static class NameFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public NameFromContext(String fromString) { super(fromString); } public Object internalExecute(ControllerContext context) { return context.getName(); } } private static class AliasesFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public AliasesFromContext(String fromString) { super(fromString); } public Set internalExecute(ControllerContext context) { Set aliases = context.getAliases(); return aliases != null ? Collections.unmodifiableSet(aliases) : null; } } private static class MetaDataFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public MetaDataFromContext(String fromString) { super(fromString); } public MetaData internalExecute(ControllerContext context) { return context.getScopeInfo().getMetaData(); } } private static class BeanInfoFromContext extends KernelFromContextDelegate { private static final long serialVersionUID = 1L; public BeanInfoFromContext(String fromString) { super(fromString, ControllerState.INSTANTIATED); } public BeanInfo internalExecute(ControllerContext context) { BeanInfo info = ((KernelControllerContext)context).getBeanInfo(); return info != null ? new UnmodifiableBeanInfo(info) : null; } } private static class ScopeFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public ScopeFromContext(String fromString) { super(fromString); } public ScopeKey internalExecute(ControllerContext context) { return context.getScopeInfo().getScope(); } } private static class StateFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public StateFromContext(String fromString) { super(fromString, ControllerState.NOT_INSTALLED); } public ControllerState internalExecute(ControllerContext context) { return context.getState(); } } private static class IdFromContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public IdFromContext(String fromString) { super(fromString); } public Object internalExecute(ControllerContext context) { // todo - change to actual id when impl return context.getName(); } } private static class ThisContext extends FromContextDelegate { private static final long serialVersionUID = 1L; public ThisContext(String fromString) { super(fromString); } public ControllerContext internalExecute(ControllerContext context) { if (context instanceof KernelControllerContext) return new UnmodifiableKernelControllerContext((KernelControllerContext)context); return new UnmodifiableControllerContext(context); } } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/InjectOption.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/model/0000644000175000017500000000316111066446716033077 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.model; import org.jboss.xb.annotations.JBossXmlEnum; /** * Injection option - strict or optional / callback. * * @author Ales Justin */ @JBossXmlEnum(ignoreCase=true) public enum InjectOption { STRICT(MicrocontainerConstants.STRICT), CALLBACK(MicrocontainerConstants.CALLBACK), OPTIONAL(MicrocontainerConstants.OPTIONAL); private String optionString; InjectOption(String optionString) { this.optionString = optionString; } public String toString() { return optionString; } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000755000175000017500000000000011620312175033160 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Parameter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000455210764340107033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * The parameter. * We must distingush between @Value and @Parameter, * since annotations don't allow cyclic dependencies. * ValueFactory uses @Parameter to break the cycle. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface Parameter { /** * Get they parameter type. * * @return the type */ Class type() default void.class; /** * Get the string value. * * @return the string value */ StringValue string() default @StringValue(value=""); /** * Get inject value. * * @return the inject value */ Inject inject() default @Inject(valid=false); /** * Get this value. * * @return this value */ ThisValue thisValue() default @ThisValue(valid = false); /** * Get null value. * * @return null value */ NullValue nullValue() default @NullValue(valid = false); /** * Get java bean value. * * @return java bean value */ JavaBeanValue javabean() default @JavaBeanValue; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/BeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000440711037360554033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.dependency.spi.ControllerMode; /** * Mark the MC bean factory. * * Only useful before actual metadata instantiation, * since we need to instantiate GenericBeanFactoryMetaData * and not BeanMetaData. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface BeanFactory { /** * Get the name. * * @return bean's name */ String name() default ""; /** * Get factory class. * * @return factory class */ Class getFactoryClass() default void.class; /** * Get the aliases. * * @return the aliases */ String[] aliases() default {}; /** * Get the mode * * @return the mode */ ControllerMode mode() default ControllerMode.AUTOMATIC; /** * Get the access mode * * @return the access mode */ BeanAccessMode accessMode() default BeanAccessMode.STANDARD; }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Inject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000577611147522315033204 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.model.InjectOption; /** * Beans when injected by class type are by default changed to configured * state - if not yet configured. * You can change this behavior by setting state. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public @interface Inject { /** * Get bean. * Default is no bean. * * @return bean name */ String bean() default ""; /** * Get property. * Default is no property. * * @return property name */ String property() default ""; /** * Get when required. * * @return when required. */ String whenRequired() default ""; /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default ""; /** * Get search type. * * @return the search type */ String search() default ""; /** * Get autowire type. * Default is by class. * * @return injection type */ AutowireType type() default AutowireType.BY_CLASS; /** * Get injection option. * Default is Strict. * * @return injection option */ InjectOption option() default InjectOption.STRICT; /** * Get from context injection. * * @return from context type */ FromContext fromContext() default FromContext.NOOP; /** * Is this @Inject valid. * Used with @Value. * * @return is this instance valid */ boolean valid() default true; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Uninstall.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000361511037360554033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Uninstall callback. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.FIELD}) public @interface Uninstall { /** * Get the cardinality. * Default is no cardinality. * * @return cardinality */ String cardinality() default ""; /** * Get when required. * Default is Configured. * * @return when required. */ String whenRequired() default "Installed"; /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default "Installed"; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Create.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000106111037360554033166 0ustar twernertwernerpackage org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark lifecycle create method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Create { /** * Is this lifecycle callback ignored. * * @return ignored */ boolean ignored() default false; } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Stop.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000105611037360554033172 0ustar twernertwernerpackage org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark stop lifecycle method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Stop { /** * Is this lifecycle callback ignored. * * @return ignored */ boolean ignored() default false; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/CollectionValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000344211037360554033173 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Collection injection. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface CollectionValue { /** * Get collection class. * * @return the collection class */ Class clazz() default void.class; /** * Get element class. * * @return the element class */ Class elementClass() default void.class; /** * Get values. * * @return the values */ Value[] value(); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/EntryValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000313010674773017033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * Map entry value. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface EntryValue { /** * Get the key. * * @return the key */ Value key(); /** * Get the value. * * @return the value */ Value value(); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Start.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000105711037360554033173 0ustar twernertwernerpackage org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark start lifecycle method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Start { /** * Is this lifecycle callback ignored. * * @return ignored */ boolean ignored() default false; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Demand.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000340310774662535033203 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The demand. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface Demand { /** * Get demand value. * * @return the demand */ String value(); /** * Get when required. * * @return the when required state */ String whenRequired() default "Instantiated"; /** * Get the transfomer. * * @return the transformer */ String transformer() default ""; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Cleanup.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000271710726773120033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Marks that an annotation is cleaned up while uninstalling. * * @author Ales Justin */ @Target(ElementType.ANNOTATION_TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface Cleanup { } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ExternalUninstalls.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000306111037360554033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Array of external uninstalls. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface ExternalUninstalls { /** * Get external uninstalls. * * @return the external uninstalls */ ExternalInstall[] value(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Factory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000361611037360554033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Define constructor factory. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Factory { /** * Get the factory. * * @return the factory value */ Value factory() default @Value(); /** * Get the factory class. * * @return the factory class */ Class factoryClass() default void.class; /** * Get the factory method. * * @return the factory method */ String factoryMethod(); /** * Get parameters. * * @return the parameters */ Value[] parameters() default {}; } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ExternalInstalls.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000305111037360554033167 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Array of external installs. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface ExternalInstalls { /** * Get external installs. * * @return the external installs */ ExternalInstall[] value(); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ListValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000343011037360554033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * List value injection. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ListValue { /** * Get list class. * * @return the list class */ Class clazz() default void.class; /** * Get the element class. * * @return the element class */ Class elementClass() default void.class; /** * Get the values. * * @return the values */ Value[] value(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Demands.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000276411037360554033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The demands. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Demands { /** * Get demands. * * @return the demands */ Demand[] value(); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/JavaBeanValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000312611037360554033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Java bean value. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface JavaBeanValue { /** * Get java bean class. * Must have default constructor. * * @return the class */ Class value() default void.class; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/StringValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000362311037360554033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * String value. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface StringValue { /** * Get the value. * * @return the value */ String value(); /** * Get type. * * @return the type */ Class type() default void.class; /** * Do replace with system properties. * * @return true for replace with system properties, false otherwise */ boolean replace() default true; /** * Do we trim. * * @return true to trim */ boolean trim() default true; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/MCAnnotations.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000352311173121305033161 0ustar twernertwerner/* * 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.beans.metadata.api.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Possible IoC annotations. * * @author Ales Justin */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface MCAnnotations { /** * Possible annotation classes. * * @return the possible annotation classes */ Class[] value() default {}; /** * Should we ignore IoC annotations lookup. * * @return true if we should ignore IoC annotations scan, false otherwise */ boolean ignore() default false; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ArrayValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000343011037360554033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Injecting array value. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ArrayValue { /** * Set the array class. * * @return array class */ Class clazz() default void.class; /** * Array's element class. * * @return element class */ Class elementClass() default void.class; /** * Get the values. * * @return the values */ Value[] value(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Install.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000361211037360554033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Install callback. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.FIELD}) public @interface Install { /** * Get the cardinality. * Default is no cardinality. * * @return cardinality */ String cardinality() default ""; /** * Get when required. * Default is Configured. * * @return when required. */ String whenRequired() default "Installed"; /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default "Installed"; } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/NullValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000313611037360554033173 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Null value. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface NullValue { /** * Is valid. * Used in @Parameter and @value to define * unused value. * * @return is value valid */ boolean valid() default true; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Search.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000370611147522315033173 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Do a search over GraphController for matching context. * * @author Ales Justin */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) @Deprecated public @interface Search { /** * Get bean. * Default is no bean. * * @return bean name */ String bean(); /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default ""; /** * Get search type. * * @return the search type */ String type(); /** * Get property. * Default is no property. * * @return property name */ String property() default ""; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Supplys.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000277211037360554033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The supplys. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Supplys { /** * Get supply values. * * @return the supplys */ Supply[] value(); } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Constructor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000270511037360554033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark the constructor used to instantiate bean. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.CONSTRUCTOR}) public @interface Constructor { } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ExternalInstall.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000404610757136565033207 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * Define external install. * Must define other bean to execute instal method on. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface ExternalInstall { /** * Get the bean. * * @return the bean */ String bean(); /** * Get the method. * * @return the method */ String method(); /** * Get the dependant state. * * @return the dependant state */ String dependantState() default ""; /** * Get the when required state. * * @return the when required state */ String whenRequired() default ""; /** * Get parameters. * * @return the parameters */ Value[] parameters() default {}; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/InstallMethod.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000326511037360554033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Internal installation method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface InstallMethod { /** * Get dependant state. * * @return the dependant state */ String dependantState() default ""; /** * Get when required state. * * @return the when required state */ String whenRequired() default ""; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Depends.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000300611037360554033167 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The depends values. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Depends { /** * Get the depends values. * * @return the depends */ String[] value(); } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/CleanupOnly.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000272210726773120033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Target; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Marks that an annotation is only used while uninstalling. * * @author Ales Justin */ @Target(ElementType.ANNOTATION_TYPE) @Retention(RetentionPolicy.RUNTIME) public @interface CleanupOnly { } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/UninstallMethod.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000327011037360554033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark the uninstall method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface UninstallMethod { /** * Get the dependant state. * * @return the dependant state */ String dependantState() default ""; /** * Get when required state. * * @return the when required state */ String whenRequired() default ""; } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Supply.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000317410774662535033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The supplys. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface Supply { /** * Get suppl values. * * @return the supply value */ String value(); /** * Get class type. * * @return the class type */ Class type() default void.class; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/FactoryMethod.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000267111037360554033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark static method as factory method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface FactoryMethod { } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ThisValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000330611037360554033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * This value. * Get the underlying target. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ThisValue { /** * Is instance valid. * * @see @org.jboss.beans.metadata.plugins.annotations.Value * @see @org.jboss.beans.metadata.plugins.annotations.Parameter * @return true for valid */ boolean valid() default true; } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Dependency.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000324111000664467033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Dependency. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 44529 $ */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Dependency { /** * Get the name. * * @return the name */ String name(); /** * Get the helper factory class. * * @return the factory class */ Class factory() default void.class; } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Bean.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000711211037360554033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; /** * Mark the MC bean. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Bean { /** * Get the name. * * This is only meant to be used before * bean meta data is already installed * in Controller. * * @return bean's name */ String name() default ""; /** * Get the aliases. * * This is only meant to be used before * bean meta data is already installed * in Controller. * * @return the aliases */ String[] aliases() default {}; /** * Get the parent. * * This is only meant to be used before * bean meta data is already installed * in Controller. * * @return the parent */ String parent() default ""; /** * Is abstract metadata. * * This is only meant to be used before * bean meta data is already installed * in Controller. * * @return is abstract */ boolean isAbstract() default false; /** * Get the autowire type. * * @return the autowire type */ AutowireType autowireType() default AutowireType.NONE; /** * Get the mode * * Note that this is only gonna be * used after Describe state. * * @return the mode */ ControllerMode mode() default ControllerMode.AUTOMATIC; /** * Get error handling mode * * Note that this is only gonna be * used after Describe state. * * @return the error handling mode */ ErrorHandlingMode errorHandlingMode() default ErrorHandlingMode.DISCARD; /** * Get the access mode * * @return the access mode */ BeanAccessMode accessMode() default BeanAccessMode.STANDARD; /** * Is this bean is a candidate for * getting injected via contextual matching * or callback resolution. * * This is only meant to be used before * bean meta data is already installed * in Controller. * * @return true (default) if used for autowiring */ boolean autowireCandidate() default true; }././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/SetValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000343011037360554033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Set value injection. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface SetValue { /** * Get the set class. * * @return the set class */ Class clazz() default void.class; /** * Get the element class. * * @return the element class */ Class elementClass() default void.class; /** * Get the values. * * @return the values */ Value[] value(); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/MapValue.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000363711037360554033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Map value injection. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface MapValue { /** * Get the map class. * * @return the map class */ Class clazz() default void.class; /** * Get the key class. * * @return the key class */ Class keyClass() default void.class; /** * Get the value class name. * * @return the value class name */ Class valueClass() default void.class; /** * Get the entries. * * @return the entries */ EntryValue[] value(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Destroy.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000106311037360554033170 0ustar twernertwernerpackage org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Mark destroy lifecycle method. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Destroy { /** * Is this lifecycle callback ignored. * * @return ignored */ boolean ignored() default false; } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/ValueFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000442111037360554033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The value factory. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD}) public @interface ValueFactory { /** * Get the bean. * * @return the bean */ String bean(); /** * Get the method. * * @return the method */ String method(); /** * Get single parameter. * * @return the single parameter */ String parameter() default ""; /** * Get parameters. * * @return the parameters */ Parameter[] parameters() default {}; /** * Get default value. * * @return the default value */ String defaultValue() default ""; /** * Get dependant state. * * @return the dependant state */ String dependantState() default "Installed"; /** * Get when required state. * * @return the when required state */ String whenRequiredState() default "Configured"; } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Value.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000457210764340107033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.annotation.ElementType; /** * The value. * @see Parameter * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.ANNOTATION_TYPE}) public @interface Value { /** * Get they parameter type. * * @return the type */ Class type() default void.class; /** * Get the string value. * * @return the string value */ StringValue string() default @StringValue(value=""); /** * Get the value factory. * * @return the value factory */ ValueFactory valueFactory() default @ValueFactory(bean = "", method = ""); /** * Get inject value. * * @return the inject value */ Inject inject() default @Inject(valid=false); /** * Get this value. * * @return this value */ ThisValue thisValue() default @ThisValue(valid = false); /** * Get null value. * * @return null value */ NullValue nullValue() default @NullValue(valid = false); /** * Get java bean value. * * @return java bean value */ JavaBeanValue javabean() default @JavaBeanValue; } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annotations/Aliases.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/api/annota0000644000175000017500000000332211037360554033170 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.api.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * The aliases. * Equivalent to deployment's alias element. * * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) @Cleanup public @interface Aliases { /** * Get aliases array. * * @return the aliases */ String[] value(); /** * Do system property replace. * * @return true to replace system property, false otherwise */ boolean replace() default true; } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/0000755000175000017500000000000011620312174032666 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractRelatedClassMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001167211044054767033155 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.Iterator; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.collection.CollectionsFactory; /** * Metadata for a related classes. * * @author Ales Justin */ @XmlType(name="relatedClassType", propOrder={"enabled"}) public class AbstractRelatedClassMetaData extends JBossObject implements RelatedClassMetaData, Serializable { private static final long serialVersionUID = 1L; private String className; private Set enabled; public AbstractRelatedClassMetaData() { } public AbstractRelatedClassMetaData(String className) { this.className = className; } public String getClassName() { if (className == null) throw new IllegalArgumentException("Null class name"); return className; } @XmlAttribute(name = "name") public void setClassName(String className) { this.className = className; } public Set getEnabled() { return enabled; } @XmlAnyElement public void setEnabled(Set enabled) { this.enabled = enabled; } @XmlValue public void setEnabledValue(Object value) { this.enabled = Collections.singleton(value); } public T getEnabled(Class type) { if (type == null) throw new IllegalArgumentException("Null type"); if (enabled == null || enabled.isEmpty()) return null; for (Object element : enabled) { if (type.isInstance(element)) return type.cast(element); } return null; } protected void toString(JBossStringBuilder buffer) { buffer.append("name=").append(className); buffer.append(", enabled=").append(enabled); } public void toShortString(JBossStringBuilder buffer) { buffer.append(className); } protected int getHashCode() { int hash = getClassName().hashCode(); if (enabled != null) hash += 7 * enabled.hashCode(); return hash; } public boolean equals(Object obj) { if (obj instanceof RelatedClassMetaData == false) return false; RelatedClassMetaData rcmd = (RelatedClassMetaData)obj; if (getClassName().equals(rcmd.getClassName()) == false) return false; return JBossObject.equals(enabled, rcmd.getEnabled()); } public AbstractRelatedClassMetaData clone() { AbstractRelatedClassMetaData clone = (AbstractRelatedClassMetaData)super.clone(); doClone(clone); return clone; } protected void doClone(AbstractRelatedClassMetaData clone) { if (enabled != null) clone.setEnabled(new HashSet(enabled)); } public void initialVisit(MetaDataVisitor vistor) { vistor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { if (enabled != null && enabled.isEmpty() == false) { Set children = CollectionsFactory.createLazySet(); for (Object element : enabled) { if (element instanceof MetaDataVisitorNode) { children.add(MetaDataVisitorNode.class.cast(element)); } } if (children.isEmpty() == false) return children.iterator(); } return null; } }././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractClassMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000354510776707200033153 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import org.jboss.beans.metadata.spi.ClassMetaData; import org.jboss.util.JBossObject; /** * Class metadata. * * @author Ales Justin */ public class AbstractClassMetaData extends JBossObject implements ClassMetaData, Serializable { private static final long serialVersionUID = 1L; private String className; public AbstractClassMetaData() { } public AbstractClassMetaData(String className) { this.className = className; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public AbstractClassMetaData clone() { return (AbstractClassMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractAliasMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000633611041140642033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Iterator; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Metadata for an alias. * * @author Ales Justin */ @XmlType(name="aliasType", propOrder="alias") public class AbstractAliasMetaData extends JBossObject implements AliasMetaData, Serializable { private static final long serialVersionUID = 2L; private Object alias; public Object getAliasValue() { if (alias == null) throw new IllegalArgumentException("Alias should not be null"); return alias; } @XmlValue public void setAliasValue(Object alias) { this.alias = alias; } @XmlAnyElement public void setAlias(Object alias) { setAliasValue(alias); } public void initialVisit(MetaDataVisitor visitor) { visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("alias=").append(getAliasValue()); } public void toShortString(JBossStringBuilder buffer) { buffer.append(getAliasValue()); } protected int getHashCode() { return getAliasValue().hashCode(); } public boolean equals(Object object) { if (object == null || object instanceof AbstractAliasMetaData == false) return false; AbstractAliasMetaData amd = (AbstractAliasMetaData)object; return getAliasValue().equals(amd.getAliasValue()); } public AbstractAliasMetaData clone() { return (AbstractAliasMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000755000175000017500000000000011620312174033225 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/package-info.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000644000175000017500000000346411147522315033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ @JBossXmlAdaptedTypes ({ @JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class), @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class), @JBossXmlAdaptedType(type=SearchInfo.class, valueAdapter=SearchInfoValueAdapter.class) }) package org.jboss.beans.metadata.plugins.policy; import org.jboss.beans.metadata.plugins.CardinalityValueAdapter; import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter; import org.jboss.beans.metadata.plugins.SearchInfoValueAdapter; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.xb.annotations.JBossXmlAdaptedType; import org.jboss.xb.annotations.JBossXmlAdaptedTypes; ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/AbstractPolicyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000644000175000017500000001042311173362527033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.policy; import java.io.Serializable; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.policy.BindingMetaData; import org.jboss.beans.metadata.spi.policy.PolicyMetaData; import org.jboss.beans.metadata.spi.policy.ScopeMetaData; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * Meta data for policy. * * @author Ales Justin */ @JBossXmlSchema(namespace="urn:jboss:policy:1.0", elementFormDefault= XmlNsForm.QUALIFIED) @XmlRootElement(name="policy") @XmlType(name="policyType", propOrder = {"scope", "annotations", "bindings"}) public class AbstractPolicyMetaData extends JBossObject implements PolicyMetaData, Serializable { private static final long serialVersionUID = 2; protected String name; protected String ext; protected ScopeMetaData scope; protected Set annotations; protected Set bindings; public String getName() { return name; } public String getExtends() { return ext; } public ScopeMetaData getScope() { return scope; } public Set getAnnotations() { return annotations; } public Set getBindings() { return bindings; } @XmlTransient public List getBeans() { return null; // todo } @XmlAttribute public void setName(String name) { this.name = name; } @XmlAttribute public void setExtends(String ext) { this.ext = ext; } @XmlElement(name="scope", type=AbstractScopeMetaData.class) public void setScope(ScopeMetaData scope) { this.scope = scope; } @XmlElement(name="annotation", type=AbstractAnnotationMetaData.class) public void setAnnotations(Set annotations) { this.annotations = annotations; } @XmlElement(name="binding", type=AbstractBindingMetaData.class) public void setBindings(Set bindings) { this.bindings = bindings; } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); buffer.append(" extends=").append(ext); buffer.append(" scope=").append(scope); super.toString(buffer); buffer.append(" bindings=").append(bindings); } public void toShortString(JBossStringBuilder buffer) { buffer.append(name); buffer.append('/'); buffer.append(ext); buffer.append('/'); buffer.append(scope); buffer.append('/'); super.toShortString(buffer); buffer.append('/'); buffer.append(bindings); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/MetaDataRepositoryInstaller.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000644000175000017500000000671410756342051033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.policy; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; import org.jboss.metadata.spi.MutableMetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataItem; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; /** * POJO binding bean meta data to scoped repository. * TODO - a lot more work (once we finalize scoped BeanMD deployment) * * @author Ales Justin */ public class MetaDataRepositoryInstaller { private Kernel underlyingKernel; private Set scopes; /* TODO What is this for, it is unreferenced? */ // private Map bindings; public void setKernel(Kernel kernel) { this.underlyingKernel = kernel; } public void setScopes(Set scopes) { this.scopes = scopes; } /* TODO What is this for? public void setBindings(Map bindings) { this.bindings = bindings; } */ public void start() { KernelMetaDataRepository kmdr = underlyingKernel.getMetaDataRepository(); MutableMetaDataRepository mmdr = kmdr.getMetaDataRepository(); ScopeKey scopeKey = new ScopeKey(scopes); MetaDataRetrieval retrieval = mmdr.getMetaDataRetrieval(scopeKey); // Not found create it if (retrieval == null) { retrieval = new MemoryMetaDataLoader(scopeKey); mmdr.addMetaDataRetrieval(retrieval); } MutableMetaData mmd = (MutableMetaData)retrieval; // deploy against this kernel Kernel kernel = underlyingKernel; // Get the parent scope - if exists ScopeKey parent = scopeKey.getParent(); if (parent != null) { MetaDataRetrieval pretrieval = mmdr.getMetaDataRetrieval(parent); MetaDataItem item = pretrieval.retrieveMetaData(Kernel.class); if (item != null) kernel = item.getValue(); } // Create a scoped kernel Kernel Kernel scopedKernel = kernel;// TODO new ScopedKernel(kernel); mmd.addMetaData(scopedKernel, Kernel.class); } public void stop() { } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/AbstractScopeMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000644000175000017500000001220010763032124033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.policy; import java.io.Serializable; import java.lang.annotation.Annotation; import java.util.Iterator; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.annotation.factory.AnnotationCreator; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.policy.ScopeMetaData; import org.jboss.metadata.spi.scope.ScopeFactory; import org.jboss.metadata.spi.scope.ScopeFactoryLookup; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.scope.ScopeLevel; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Meta data for scope. * * @author Ales Justin */ @XmlRootElement(name="scope") @XmlType(name="scopeType") public class AbstractScopeMetaData extends JBossObject implements ScopeMetaData, Serializable { private static final long serialVersionUID = 2; private String scope; private String level; private String qualifier; @XmlTransient public Object getUnderlyingValue() { return scope; } @SuppressWarnings("unchecked") public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { if (scope != null) { Annotation annotation = (Annotation)AnnotationCreator.createAnnotation(scope, cl); ScopeFactoryLookup scopeFactoryLookup = annotation.getClass().getAnnotation(ScopeFactoryLookup.class); if (scopeFactoryLookup != null) { // TODO do we really want to create a new factory for every annotation we look at? // We could use some kind of soft reference map here (per classloader) // Class clazz = scopeFactoryLookup.value(); // WeakHashMap.put(clazz.getClassLoader(), new SoftMap()) // SoftValueHashMap.put(clazz.getName(), instance) // If this is done, it should be moved to a common helper class // that does generic construction from a factory given on the meta annotations ScopeFactory scopeFactory = scopeFactoryLookup.value().newInstance(); return scopeFactory.create(annotation); } else { // todo - annotation.value(); return createScopeKey(annotation.getClass().getSimpleName(), annotation.toString()); } } else { return createScopeKey(level, qualifier); } } private ScopeKey createScopeKey(String name, String qualifier) { int level = ScopeLevel.getScopeLevel(name); return new ScopeKey(new ScopeLevel(level, name), qualifier); } public void initialVisit(MetaDataVisitor vistor) { vistor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { return null; } @XmlTransient public String getScope() { return scope; } public String getLevel() { return level; } public String getQualifier() { return qualifier; } public void setScope(String scope) { this.scope = scope; } @XmlAttribute public void setLevel(String level) { this.level = level; } @XmlAttribute public void setQualifier(String qualifier) { this.qualifier = qualifier; } public void toString(JBossStringBuilder buffer) { buffer.append("scope=").append(scope); buffer.append(" level=").append(level); buffer.append(" qualifier=").append(qualifier); } public void toShortString(JBossStringBuilder buffer) { buffer.append(scope); buffer.append('/'); buffer.append(level); buffer.append('/'); buffer.append(qualifier); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/policy/AbstractBindingMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/po0000644000175000017500000001227011173362527033243 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.policy; import java.io.Serializable; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.AbstractSearchValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.policy.BindingMetaData; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Meta data for bindings. * * @author Ales Justin */ @XmlRootElement(name="binding") @XmlType(name="bindingType", propOrder = {"value"}) public class AbstractBindingMetaData extends JBossObject implements BindingMetaData, ValueMetaDataAware, Serializable { private static final long serialVersionUID = 2; private String name; private String type; private ValueMetaData value; public String getName() { return name; } public String getType() { return type; } public ValueMetaData getValue() { return value; } @XmlAttribute public void setName(String name) { this.name = name; } @XmlAttribute(name = "class") public void setType(String type) { this.type = type; } @XmlElements ({ @XmlElement(name="array", type=AbstractArrayMetaData.class), @XmlElement(name="collection", type=AbstractCollectionMetaData.class), @XmlElement(name="inject", type=AbstractInjectionValueMetaData.class), @XmlElement(name="search", type= AbstractSearchValueMetaData.class), @XmlElement(name="list", type=AbstractListMetaData.class), @XmlElement(name="map", type=AbstractMapMetaData.class), @XmlElement(name="null", type=AbstractValueMetaData.class), @XmlElement(name="set", type=AbstractSetMetaData.class), @XmlElement(name="this", type=ThisValueMetaData.class), @XmlElement(name="value", type=StringValueMetaData.class), @XmlElement(name="value-factory", type=AbstractValueFactoryMetaData.class) }) public void setValue(ValueMetaData value) { this.value = value; } @XmlAnyElement public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue((ValueMetaData) value); else setValue(new AbstractValueMetaData(value)); } @XmlValue public void setValueString(String value) { if (value == null) setValue(null); else { ValueMetaData valueMetaData = getValue(); if (valueMetaData instanceof StringValueMetaData) { ((StringValueMetaData) valueMetaData).setValue(value); } else { StringValueMetaData stringValue = new StringValueMetaData(value); stringValue.setType(getType()); setValue(stringValue); } } } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); buffer.append(" value=").append(value); } public void toShortString(JBossStringBuilder buffer) { buffer.append(name); buffer.append('/'); buffer.append(value); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractValueFactoryMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002464211301240473033141 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.dispatch.InvokeDispatchHelper; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; /** * ValueFactory value. * * @author Adrian Brock * @author Ales Justin */ @XmlType(name="valueFactoryType", propOrder = {"parameters"}) public class AbstractValueFactoryMetaData extends AbstractValueMetaData implements MutableParameterizedMetaData { private static final long serialVersionUID = 2L; /** * The context */ protected transient KernelControllerContext context; /** * The property name */ protected String method; /** * The parameter */ protected String parameter; /** * The defaultValue */ protected String defaultValue; /** * The when required state of the dependency or null to use current context state */ protected ControllerState whenRequiredState; /** * The required state of the dependency or null to look in the registry */ protected ControllerState dependentState; /** The parameters */ protected List parameters; /** * Create a new dependency value */ public AbstractValueFactoryMetaData() { } /** * Create a new dependency value * * @param value the value */ public AbstractValueFactoryMetaData(Object value) { super(value); } /** * Create a new value-factory value * * @param value the value * @param method the method */ public AbstractValueFactoryMetaData(Object value, String method) { this(value, method, null); } /** * Create a new value-factory value * * @param value the value * @param method the method * @param defaultValue the default */ public AbstractValueFactoryMetaData(Object value, String method, String defaultValue) { super(value); this.method = method; this.defaultValue = defaultValue; } @XmlAttribute(name="bean", required = true) public void setBean(String bean) { setValue(bean); } /** * Get the method * * @return the method */ public String getMethod() { return method; } /** * Set the property * * @param method the property name */ @XmlAttribute(required = true) public void setMethod(String method) { this.method = method; } /** * Get the parameter. * * @return the parameter */ public String getParameter() { return parameter; } /** * Set the parameter. * * @param parameter the parameter */ @XmlAttribute public void setParameter(String parameter) { this.parameter = parameter; } /** * Set the when required state of the dependency * * @param whenRequiredState the when required state or null if it uses current context state */ @XmlAttribute(name="whenRequired") public void setWhenRequiredState(ControllerState whenRequiredState) { this.whenRequiredState = whenRequiredState; flushJBossObjectCache(); } /** * Get when required state. * * @return when required state */ public ControllerState getWhenRequiredState() { return whenRequiredState; } /** * Set the required state of the dependency * * @param dependentState the required state or null if it must be in the registry */ @XmlAttribute(name="state") public void setDependentState(ControllerState dependentState) { this.dependentState = dependentState; flushJBossObjectCache(); } /** * Get the dependant state. * * @return the dependant state */ public ControllerState getDependentState() { return dependentState; } /** * Get the default value. * * @return the default value */ public String getDefaultValue() { return defaultValue; } /** * Set the default value. * * @param defaultValue default value */ @XmlAttribute(name="default") public void setDefaultValue(String defaultValue) { this.defaultValue = defaultValue; } /** * Get the parameters. * * @return the parameters */ public List getParameters() { return parameters; } /** * Set the parameters. * * @param parameters the parameters */ @XmlElement(name="parameter", type=AbstractParameterMetaData.class) public void setParameters(List parameters) { this.parameters = parameters; } @Override public void initialVisit(MetaDataVisitor visitor) { if (getUnderlyingValue() == null || getMethod() == null) throw new IllegalArgumentException("Bean or method cannot null: " + this); if (getParameter() != null && getParameters() != null) throw new IllegalArgumentException("Both parameter and parameters cannot be set: " + this); if (getParameter() != null) { List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(String.class.getName(), getParameter())); setParameters(parameters); setParameter(null); } if (parameters != null) { for (int i = 0; i < parameters.size(); ++i) parameters.get(i).setIndex(i); } context = visitor.getControllerContext(); Object name = context.getName(); Object iDependOn = getUnderlyingValue(); ControllerState whenRequired = whenRequiredState; if (whenRequired == null) { whenRequired = visitor.getContextState(); } ControllerState state = dependentState; if (state == null) { state = ControllerState.INSTALLED; } DependencyItem item = new AbstractDependencyItem(name, iDependOn, whenRequired, state); visitor.addDependency(item); super.initialVisit(visitor); } @XmlTransient public Iterator getChildren() { if (getParameters() != null) return getParameters().iterator(); return null; } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { ControllerState state = dependentState; if (state == null) state = ControllerState.INSTALLED; KernelController controller = (KernelController)context.getController(); ControllerContext lookup = controller.getContext(getUnderlyingValue(), state); if (lookup == null) throw new Error("Should not be here - dependency failed - " + this); if (lookup instanceof InvokeDispatchContext == false) throw new IllegalArgumentException("Underlying context is not InvokeDispatchContext: " + context); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); Object result = InvokeDispatchHelper.invoke( configurator, lookup.getTarget(), (InvokeDispatchContext)lookup, getMethod(), getParameters() ); if (result == null) result = defaultValue; return info != null ? info.convertValue(result) : result; } public void toString(JBossStringBuilder buffer) { super.toString(buffer); if (method != null) buffer.append(" method=").append(method); if (whenRequiredState != null) buffer.append(" whenRequiredState=").append(whenRequiredState.getStateString()); if (dependentState != null) buffer.append(" dependentState=").append(dependentState.getStateString()); if (defaultValue != null) buffer.append(" default=").append(defaultValue); if (parameters != null && parameters.isEmpty() == false) buffer.append(" parameters=").append(parameters); } @SuppressWarnings("unchecked") public AbstractValueFactoryMetaData clone() { AbstractValueFactoryMetaData clone = (AbstractValueFactoryMetaData)super.clone(); clone.setParameters(CloneUtil.cloneList(parameters, ArrayList.class, ParameterMetaData.class)); return clone; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractConstructorMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002512111301240473033132 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.List; import java.util.Set; import java.util.ArrayList; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ConstructorInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.managed.api.annotation.ManagementProperty; /** * Metadata for construction. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 96562 $ */ @XmlType(name="constructorType", propOrder={"annotations", "factory", "parameters", "value"}) public class AbstractConstructorMetaData extends AbstractFeatureMetaData implements ConstructorMetaData, MutableParameterizedMetaData, ValueMetaDataAware, Serializable { private static final long serialVersionUID = 2L; /** * The paramaters List */ protected List parameters; /** * The value */ protected ValueMetaData value; /** * The factory */ protected ValueMetaData factory; /** * The factory class name */ protected String factoryClassName; /** * The factory method */ protected String factoryMethod; /** * Create a new constructor meta data */ public AbstractConstructorMetaData() { } /** * Set the parameters * * @param parameters List */ @XmlElement(name="parameter", type=AbstractParameterMetaData.class) public void setParameters(List parameters) { this.parameters = parameters; flushJBossObjectCache(); } /** * Set the value * * @param value the value */ @XmlElements ({ @XmlElement(name="bean", type=AbstractBeanMetaData.class), @XmlElement(name="lazy", type=AbstractLazyMetaData.class), @XmlElement(name="array", type=AbstractArrayMetaData.class), @XmlElement(name="collection", type=AbstractCollectionMetaData.class), @XmlElement(name="list", type=AbstractListMetaData.class), @XmlElement(name="map", type=AbstractMapMetaData.class), @XmlElement(name="set", type=AbstractSetMetaData.class), @XmlElement(name="value", type=StringValueMetaData.class), @XmlElement(name="inject", type=AbstractInjectionValueMetaData.class), @XmlElement(name="search", type= AbstractSearchValueMetaData.class), @XmlElement(name="value-factory", type=AbstractValueFactoryMetaData.class) }) public void setValue(ValueMetaData value) { this.value = value; flushJBossObjectCache(); } @XmlAnyElement @ManagementProperty(ignored = true) public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue((ValueMetaData) value); else setValue(new AbstractValueMetaData(value)); } /** * Set the factory * * @param factory the factory */ @XmlElement(name="factory", type=AbstractDependencyValueMetaData.class) public void setFactory(ValueMetaData factory) { // HACK to have wildcard factories if (factory != null && factory instanceof AbstractDependencyValueMetaData) { Object underlying = factory.getUnderlyingValue(); if (underlying != null && underlying instanceof ValueMetaData) factory = (ValueMetaData) underlying; } this.factory = factory; flushJBossObjectCache(); } /** * Set the factory class name * * @param name the factory class name */ @XmlAttribute(name="factoryClass") public void setFactoryClass(String name) { this.factoryClassName = name; flushJBossObjectCache(); } /** * Set the factory method * * @param name the factory method */ @XmlAttribute(name="factoryMethod") public void setFactoryMethod(String name) { this.factoryMethod = name; flushJBossObjectCache(); } public List getParameters() { return parameters; } public ValueMetaData getValue() { return value; } public ValueMetaData getFactory() { return factory; } public String getFactoryClass() { return factoryClassName; } public String getFactoryMethod() { return factoryMethod; } @Override public void initialVisit(MetaDataVisitor visitor) { ValueMetaData factory = getFactory(); if (factory != null || getFactoryClass() != null) { if (getFactoryMethod() == null) throw new IllegalArgumentException("Constructor needs a factoryMethod attribute when there is a factoryClass attribute or factory element."); } if (factory != null) { if (factory.getUnderlyingValue() == null) throw new IllegalArgumentException("Factory should have a bean attribute or nested element."); } if (parameters != null) { for (int i = 0; i < parameters.size(); ++i) parameters.get(i).setIndex(i); } super.initialVisit(visitor); } protected void addChildren(Set children) { super.addChildren(children); if (parameters != null) children.addAll(parameters); if (value != null) children.add(value); if (factory != null) children.add(factory); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (factory != null || factoryClassName != null) { KernelControllerContext context = visitor.getControllerContext(); ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData()); KernelConfigurator configurator = context.getKernel().getConfigurator(); ClassInfo classInfo; if (factory != null) { Object target = factory.getValue(null, cl); classInfo = configurator.getClassInfo(target.getClass()); } else { classInfo = configurator.getClassInfo(factoryClassName, cl); } // should be parameter if (previous instanceof ParameterMetaData == false) throw new IllegalArgumentException("Previous node is not ParameterMetaData as expected: " + previous); ParameterMetaData parameter = (ParameterMetaData) previous; String[] parameterTypes = Configurator.getParameterTypes(false, parameters); MethodInfo methodInfo = Configurator.findMethodInfo(classInfo, factoryMethod, parameterTypes, factoryClassName != null, true); return applyCollectionOrMapCheck(methodInfo.getParameterTypes()[parameter.getIndex()]); } else { KernelControllerContext context = visitor.getControllerContext(); BeanInfo beanInfo = context.getBeanInfo(); // find matching parameter if (previous instanceof ParameterMetaData) { ParameterMetaData parameter = (ParameterMetaData) previous; String[] paramTypes = Configurator.getParameterTypes(false, parameters); ConstructorInfo ci = Configurator.findConstructorInfo(beanInfo.getClassInfo(), paramTypes); return applyCollectionOrMapCheck(ci.getParameterTypes()[parameter.getIndex()]); } else { // currently value constructor supports only values that are instances of class itself // this will add another instance with the same class to context ClassInfo type = beanInfo.getClassInfo(); log.debug("Constructing bean from injection value: results in multiple beans with same class type - " + type); return type; } } } public void toString(JBossStringBuilder buffer) { buffer.append("parameters="); JBossObject.list(buffer, parameters); if (value != null) buffer.append(" value=").append(value); if (factory != null) buffer.append(" factory=").append(factory); if (factoryClassName != null) buffer.append(" factoryClass=").append(factoryClassName); if (factoryMethod != null) buffer.append(" factoryMethod=").append(factoryMethod); super.toString(buffer); } public AbstractConstructorMetaData clone() { AbstractConstructorMetaData clone = (AbstractConstructorMetaData)super.clone(); doClone(clone); return clone; } @SuppressWarnings("unchecked") protected void doClone(AbstractConstructorMetaData clone) { super.doClone(clone); clone.setFactory(CloneUtil.cloneObject(factory, ValueMetaData.class)); clone.setValue(CloneUtil.cloneObject(value, ValueMetaData.class)); clone.setParameters(CloneUtil.cloneList(parameters, ArrayList.class, ParameterMetaData.class)); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractLifecycleMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001507111301240473033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Metadata for lifecycle. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 96562 $ */ @XmlType(name="lifecycleType", propOrder={"annotations", "parameters"}) public class AbstractLifecycleMetaData extends AbstractFeatureMetaData implements LifecycleMetaData, MutableParameterizedMetaData, Serializable { private static final long serialVersionUID = 2L; /** The state */ protected ControllerState state; /** The method name */ protected String methodName; /** The ignored attribute */ boolean ignored; /** The paramaters List */ protected List parameters; /** The type - create, start, stop, destroy, install */ protected String type; /** * Create a new lifecycle meta data */ public AbstractLifecycleMetaData() { } public AbstractLifecycleMetaData(String methodName) { this.methodName = methodName; } public ControllerState getState() { return state; } @XmlAttribute(name="whenRequired") public void setState(ControllerState state) { this.state = state; flushJBossObjectCache(); } public String getMethodName() { return methodName; } /** * Set the method name * * @param name the factory method */ @XmlAttribute(name="method") public void setMethodName(String name) { this.methodName = name; flushJBossObjectCache(); } public boolean isIgnored() { return ignored; } /** * Set ignored attribute. * * @param ignored the ignored */ @XmlAttribute public void setIgnored(boolean ignored) { this.ignored = ignored; } public List getParameters() { return parameters; } /** * Set the parameters * * @param parameters List */ @XmlElement(name="parameter", type=AbstractParameterMetaData.class) public void setParameters(List parameters) { this.parameters = parameters; flushJBossObjectCache(); } /** * Get type - create, start, stop, destroy, install * * @return lifecycle type */ public String getType() { return type; } public void setType(String type) { this.type = type; } @Override public void initialVisit(MetaDataVisitor visitor) { if (parameters != null) { for (int i = 0; i < parameters.size(); ++i) parameters.get(i).setIndex(i); } visitor.setContextState(state); super.initialVisit(visitor); } protected void addChildren(Set children) { super.addChildren(children); if (parameters != null) children.addAll(parameters); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (previous instanceof ParameterMetaData == false) throw new IllegalArgumentException("Previous node is not ParameterMetaData as expected: " + previous); ParameterMetaData parameter = (ParameterMetaData) previous; KernelControllerContext context = visitor.getControllerContext(); String method = (methodName != null ? methodName : type); String[] parameterTypes = Configurator.getParameterTypes(false, parameters); MethodInfo methodInfo = Configurator.findMethodInfo(getClassInfo(context), method, parameterTypes); return applyCollectionOrMapCheck(methodInfo.getParameterTypes()[parameter.getIndex()]); } protected ClassInfo getClassInfo(KernelControllerContext context) throws Throwable { return context.getBeanInfo().getClassInfo(); } public void toString(JBossStringBuilder buffer) { if (methodName != null) buffer.append("method=").append(methodName); buffer.append(" whenRequired=").append(state); buffer.append(" parameters="); JBossObject.list(buffer, parameters); buffer.append(" "); super.toString(buffer); } public void toShortString(JBossStringBuilder buffer) { buffer.append(methodName); } public AbstractLifecycleMetaData clone() { AbstractLifecycleMetaData clone = (AbstractLifecycleMetaData)super.clone(); doClone(clone); return clone; } @SuppressWarnings("unchecked") protected void doClone(AbstractLifecycleMetaData clone) { super.doClone(clone); clone.setIgnored(ignored); clone.setMethodName(methodName); clone.setParameters(CloneUtil.cloneList(parameters, ArrayList.class, ParameterMetaData.class)); clone.setState(state); clone.setType(type); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Se0000644000175000017500000001004111137570512033161 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; /** * SecurityActions. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 1.1 $ */ class SecurityActions { /** * Set context classloader. * * @param cl the classloader * @return previous context classloader * @throws Throwable for any error */ static ClassLoader setContextClassLoader(final ClassLoader cl) throws Throwable { if (System.getSecurityManager() == null) { ClassLoader result = Thread.currentThread().getContextClassLoader(); if (cl != null) Thread.currentThread().setContextClassLoader(cl); return result; } else { try { return AccessController.doPrivileged(new PrivilegedExceptionAction() { public ClassLoader run() throws Exception { try { ClassLoader result = Thread.currentThread().getContextClassLoader(); if (cl != null) Thread.currentThread().setContextClassLoader(cl); return result; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new RuntimeException("Error setting context classloader", e); } } }); } catch (PrivilegedActionException e) { throw e.getCause(); } } } /** * Reset context classloader. * * @param classLoader the classloader */ static void resetContextClassLoader(final ClassLoader classLoader) { if (System.getSecurityManager() == null) { Thread.currentThread().setContextClassLoader(classLoader); } else { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { Thread.currentThread().setContextClassLoader(classLoader); return null; } }); } } /** * Get classloader from class. * * @param clazz the class * @return class's classloader */ static ClassLoader getClassLoader(final Class clazz) { SecurityManager sm = System.getSecurityManager(); if (sm == null) { return clazz.getClassLoader(); } else { return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { return clazz.getClassLoader(); } }); } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractArrayMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001144210776707200033146 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Collection; import javax.xml.bind.annotation.XmlType; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.xb.annotations.JBossXmlChild; import org.jboss.xb.annotations.JBossXmlChildWildcard; import org.jboss.xb.annotations.JBossXmlChildren; import org.jboss.xb.annotations.JBossXmlNoElements; /** * Array metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71794 $ */ @XmlType(name="arrayType") @JBossXmlNoElements @JBossXmlChildren ({ @JBossXmlChild(name="bean", type=AbstractBeanMetaData.class), @JBossXmlChild(name="array", type=AbstractArrayMetaData.class), @JBossXmlChild(name="collection", type=AbstractCollectionMetaData.class), @JBossXmlChild(name="inject", type=AbstractInjectionValueMetaData.class), @JBossXmlChild(name="list", type=AbstractListMetaData.class), @JBossXmlChild(name="map", type=AbstractMapMetaData.class), @JBossXmlChild(name="null", type=AbstractValueMetaData.class), @JBossXmlChild(name="set", type=AbstractSetMetaData.class), @JBossXmlChild(name="this", type=ThisValueMetaData.class), @JBossXmlChild(name="value", type=StringValueMetaData.class), @JBossXmlChild(name="value-factory", type=AbstractValueFactoryMetaData.class) }) @JBossXmlChildWildcard(wrapper=AbstractValueMetaData.class, property="value") public class AbstractArrayMetaData extends AbstractListMetaData { private static final long serialVersionUID = 2L; /** * Create a new array value */ public AbstractArrayMetaData() { } @SuppressWarnings("unchecked") public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { Collection result = (Collection)super.getValue(info, cl); TypeInfo typeInfo = getClassInfo(cl); if (typeInfo != null && typeInfo instanceof ClassInfo == false) throw new IllegalArgumentException(typeInfo.getName() + " is not a class"); if (typeInfo == null) { // No type specified if (info == null) { info = getElementClassInfo(cl, null); if (info == null) return null; info = info.getArrayType(); } // Not a class if (info instanceof ClassInfo == false) return null; // Not an interface if (((ClassInfo) info).isInterface()) return null; // Type is too general if (Object.class.getName().equals(info.getName())) return null; // Try to use the passed type typeInfo = info; } Object array = typeInfo.newArrayInstance(result.size()); int i = 0; for(Object element : result) Array.set(array, i++, element); return array; } protected T getTypeInstance(TypeInfo info, ClassLoader cl, Class expected) throws Throwable { Collection result = new ArrayList(); Object preinstantiatedObject = preinstantiatedLookup(cl, Object[].class); if (preinstantiatedObject != null) { Object[] preinstantiatedArray = (Object[]) preinstantiatedObject; for(Object previous : preinstantiatedArray) { result.add(previous); } } return expected.cast(result); } protected T checkResult(Object result, Class expected) { if (result != null) { if (result.getClass().isArray() == false) throw new ClassCastException("Preinstantiated property is not an array: " + propertyName); } return expected.cast(result); } public AbstractArrayMetaData clone() { return (AbstractArrayMetaData)super.clone(); } }././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/CloneUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Cl0000644000175000017500000001203311301240473033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; /** * Clone util helper. * * @author Ales Justin */ class CloneUtil { /** * Simple clone object. * * @param the type * @param original the original * @param expectedClass the expected class * @return clone */ public static T cloneObject(T original, Class expectedClass) { if (original == null) return null; Object clone = original.clone(); if (expectedClass.isInstance(clone) == false) throw new IllegalArgumentException("Clone '" + clone + "' is not of expected class: " + expectedClass); return expectedClass.cast(clone); } /** * Simple collection clone. * * @param the collection type * @param the component type * @param collection the collection to be cloned * @param expectedClass expected collection class * @param componentType expected component class * @return cloned collection */ public static > T cloneCollection(T collection, Class expectedClass, Class componentType) { if (collection == null) return null; try { T clone = expectedClass.newInstance(); for (U item : collection) clone.add(cloneObject(item, componentType)); return clone; } catch (Throwable t) { throw new RuntimeException(t); } } /** * Simple set clone. * * @param the collection type * @param the component type * @param collection the set to be cloned * @param expectedClass expected set class * @param componentType expected component class * @return cloned collection */ public static > T cloneSet(T collection, Class expectedClass, Class componentType) { if (collection == null) return null; try { T clone = expectedClass.newInstance(); for (U item : collection) clone.add(cloneObject(item, componentType)); return clone; } catch (Throwable t) { throw new RuntimeException(t); } } /** * Simple set clone. * * @param the collection type * @param the component type * @param collection the list to be cloned * @param expectedClass expected set class * @param componentType expected component class * @return cloned collection */ public static > T cloneList(T collection, Class expectedClass, Class componentType) { if (collection == null) return null; try { T clone = expectedClass.newInstance(); for (U item : collection) clone.add(cloneObject(item, componentType)); return clone; } catch (Throwable t) { throw new RuntimeException(t); } } /** * Simple map clone. * * @param the collection type * @param the component type * @param map the map to clone * @param keyClass the key class * @param valueClass the value class * @return map clone */ public static Map cloneMap(Map map, Class keyClass, Class valueClass) { if (map == null) return null; Map clone = new HashMap(); for (Map.Entry entry : map.entrySet()) clone.put(cloneObject(entry.getKey(), keyClass), cloneObject(entry.getValue(), valueClass)); return clone; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractClassLoaderMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001104611050031647033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Collections; import java.util.Iterator; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * A classloader. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 76911 $ */ @XmlType(name="classloaderType", propOrder="classLoader") public class AbstractClassLoaderMetaData extends JBossObject implements ClassLoaderMetaData, Serializable { private static final long serialVersionUID = 2L; /** The classloader */ protected ValueMetaData classloader; /** * Create a new classloader */ public AbstractClassLoaderMetaData() { } /** * Create a new classloader * * @param classloader the classloader value */ public AbstractClassLoaderMetaData(ValueMetaData classloader) { this.classloader = classloader; } /** * Set the classloader * * @param classloader the classloader value */ @XmlElements ({ @XmlElement(name="bean", type=AbstractBeanMetaData.class), @XmlElement(name="inject", type=AbstractDependencyValueMetaData.class), @XmlElement(name="search", type= AbstractSearchValueMetaData.class), @XmlElement(name="null", type=AbstractValueMetaData.class) }) public void setClassLoader(ValueMetaData classloader) { this.classloader = classloader; flushJBossObjectCache(); } public ValueMetaData getClassLoader() { return classloader; } @XmlAnyElement @ManagementProperty(ignored = true) public void setClassLoaderObject(Object classloader) { if (classloader == null) setClassLoader(null); else if (classloader instanceof ValueMetaData) setClassLoader((ValueMetaData) classloader); else setClassLoader(new AbstractValueMetaData(classloader)); } public void initialVisit(MetaDataVisitor visitor) { if (getClassLoader() == null) throw new IllegalArgumentException("ClassLoader should have a nested value."); visitor.setContextState(ControllerState.PRE_INSTALL); visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { // todo - any context setting? vistor.describeVisit(this); } public Iterator getChildren() { if (classloader != null) return Collections.singletonList(classloader).iterator(); return null; } public void toString(JBossStringBuilder buffer) { buffer.append("classloader=").append(classloader); } public void toShortString(JBossStringBuilder buffer) { buffer.append(classloader); } public AbstractClassLoaderMetaData clone() { AbstractClassLoaderMetaData clone = (AbstractClassLoaderMetaData)super.clone(); doClone(clone); return clone; } protected void doClone(AbstractClassLoaderMetaData clone) { clone.setClassLoader(CloneUtil.cloneObject(classloader, ValueMetaData.class)); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractPropertyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002277511305760441033154 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Set; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; import org.jboss.managed.api.annotation.ManagementProperty; /** * Metadata for a property. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 97404 $ */ @XmlType(name="propertyType", propOrder={"annotations", "value"}) public class AbstractPropertyMetaData extends AbstractFeatureMetaData implements PropertyMetaData, ValueMetaDataAware, TypeProvider, Serializable { private static final long serialVersionUID = 3L; /** The property name */ protected String name; /** The preinstantiate */ protected boolean preInstantiate = true; /** The property value */ protected ValueMetaData value; /** The property type */ protected String type; /** The property replace */ private Boolean replace; /** Whether to trim */ private Boolean trim; /** * Create a new property meta data */ public AbstractPropertyMetaData() { } /** * Create a new property meta data * * @param name the name * @param value the value */ public AbstractPropertyMetaData(String name, Object value) { this.name = name; this.value = new AbstractValueMetaData(value); } /** * Create a new property meta data * * @param name the name * @param value the string value */ public AbstractPropertyMetaData(String name, String value) { this.name = name; this.value = new StringValueMetaData(value); } /** * Create a new attribute meta data * * @param name the name * @param value the value meta data */ public AbstractPropertyMetaData(String name, ValueMetaData value) { this.name = name; this.value = value; } /** * Create a new property meta data * * @param name the name * @param value the string value * @param type the type */ public AbstractPropertyMetaData(String name, String value, String type) { this.name = name; StringValueMetaData svmd = new StringValueMetaData(value); svmd.setType(type); this.value = svmd; } public String getName() { return name; } /** * Set the name * * @param name the name */ @XmlAttribute public void setName(String name) { this.name = name; flushJBossObjectCache(); } public String getType() { if (value instanceof AbstractTypeMetaData) { String valueType = ((AbstractTypeMetaData)value).getType(); if (valueType != null) return valueType; } return type; } public boolean isPreInstantiate() { return preInstantiate; } @XmlAttribute(name="preinstantiate") public void setPreInstantiate(boolean preInstantiate) { this.preInstantiate = preInstantiate; } public ValueMetaData getValue() { return value; } /** * Set the value * * @param value the value */ @XmlElements ({ @XmlElement(name="array", type=AbstractArrayMetaData.class), @XmlElement(name="collection", type=AbstractCollectionMetaData.class), @XmlElement(name="inject", type=AbstractInjectionValueMetaData.class), @XmlElement(name="search", type= AbstractSearchValueMetaData.class), @XmlElement(name="list", type=AbstractListMetaData.class), @XmlElement(name="map", type=AbstractMapMetaData.class), @XmlElement(name="set", type=AbstractSetMetaData.class), @XmlElement(name="null", type=AbstractValueMetaData.class), @XmlElement(name="this", type=ThisValueMetaData.class), @XmlElement(name="value", type=StringValueMetaData.class), @XmlElement(name="value-factory", type=AbstractValueFactoryMetaData.class) }) public void setValue(ValueMetaData value) { this.value = value; flushJBossObjectCache(); } @XmlAnyElement @ManagementProperty(ignored = true) public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue((ValueMetaData) value); else setValue(new AbstractValueMetaData(value)); } @XmlValue @ManagementProperty(ignored = true) public void setValueString(String value) { if (value == null) setValue(null); else { ValueMetaData valueMetaData = getValue(); if (valueMetaData instanceof StringValueMetaData) { ((StringValueMetaData) valueMetaData).setValue(value); } else { StringValueMetaData stringValue = new StringValueMetaData(value); stringValue.setType(getType()); setValue(stringValue); } } } public String getPropertyType() { return type; } @XmlAttribute(name="class") @ManagementProperty(ignored = true) public void setPropertyType(String type) { this.type = type; } @XmlAttribute(name="replace") @ManagementProperty(ignored = true) public void setPropertyReplace(boolean replace) { this.replace = replace; } @XmlAttribute(name="trim") @ManagementProperty(ignored = true) public void setPropertyTrim(boolean trim) { this.trim = trim; } public void initialVisit(MetaDataVisitor visitor) { String name = getName(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty property name."); ValueMetaData vmd = getValue(); if (vmd != null && vmd instanceof AbstractInjectionValueMetaData) ((AbstractInjectionValueMetaData) vmd).setPropertyMetaData(this); if (vmd != null && vmd instanceof StringValueMetaData) { StringValueMetaData svmd = (StringValueMetaData) vmd; if (type != null) svmd.setType(type); if (replace != null) svmd.setReplace(replace); if (trim != null) svmd.setTrim(trim); } visitor.setContextState(ControllerState.CONFIGURED); super.initialVisit(visitor); } @Override public void describeVisit(MetaDataVisitor visitor) { visitor.setContextState(ControllerState.CONFIGURED); super.describeVisit(visitor); } public void addChildren(Set children) { if (value != null) children.add(value); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { String type = getType(); if (type != null) { KernelControllerContext context = visitor.getControllerContext(); ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData()); KernelConfigurator configurator = context.getKernel().getConfigurator(); return configurator.getClassInfo(type, cl); } // check properties KernelControllerContext context = visitor.getControllerContext(); BeanInfo beanInfo = context.getBeanInfo(); PropertyInfo pi = beanInfo.getProperty(getName()); return applyCollectionOrMapCheck(pi.getType()); } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); if (value != null) buffer.append(" value=").append(value); super.toString(buffer); } public void toShortString(JBossStringBuilder buffer) { buffer.append(name); } public AbstractPropertyMetaData clone() { AbstractPropertyMetaData clone = (AbstractPropertyMetaData)super.clone(); doClone(clone); clone.setValue(CloneUtil.cloneObject(value, ValueMetaData.class)); return clone; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/SearchInfoValueAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Se0000644000175000017500000000270611147522315033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.dependency.plugins.graph.Search; import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter; /** * SearchInfoValueAdapter. * * @author Ales Justin */ public class SearchInfoValueAdapter implements ValueAdapter { @SuppressWarnings("unchecked") public Object cast(Object o, Class c) { return Search.getInstance((String)o); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/ControllerStateValueAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Co0000644000175000017500000000305710756342051033165 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.dependency.spi.ControllerState; import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter; /** * ControllerStateValueAdapter. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class ControllerStateValueAdapter implements ValueAdapter { @SuppressWarnings("unchecked") public Object cast(Object o, Class c) { return new ControllerState((String)o); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/TypeProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ty0000644000175000017500000000353510737544266033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.TypeInfo; /** * The class is able to provide exact type info for * contextual injection. * * @author Ales Justin */ public interface TypeProvider { // error msg static final String ERROR_MSG = "Node not of TypeProvider instance, cannot determine type info."; /** * Get the injectee type info. * * @param visitor meda data visitor * @param previous previous node in the stack * @return TypeInfo type info for injection ByClass * @throws Throwable if could not determine class */ TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable; } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001115211173362527033145 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Collections; import java.util.Iterator; import java.util.Stack; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.plugins.JMXObjectNameFix; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlNoElements; /** * Plain value. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 87640 $ */ @XmlType @JBossXmlNoElements public class AbstractValueMetaData extends JBossObject implements ValueMetaData, TypeProvider, Serializable { private static final long serialVersionUID = 2L; /** * The value */ private Object value; /** * Create a new plain value */ public AbstractValueMetaData() { } /** * Create a new plain value * * @param value the value */ public AbstractValueMetaData(Object value) { setValue(value); } @XmlTransient public Object getValue() { return value; } public void setValue(Object value) { Object jmxHack = null; if (isUseJMXObjectNameFix()) jmxHack = JMXObjectNameFix.needsAnAlias(value); if (jmxHack != null) this.value = jmxHack; else this.value = value; flushJBossObjectCache(); } @XmlTransient public Object getUnderlyingValue() { return value; } /** * Do we use jmx object name fix. * * @return do we use jmx object name fix */ protected boolean isUseJMXObjectNameFix() { return true; } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { return info != null ? info.convertValue(value) : value; } public void initialVisit(MetaDataVisitor visitor) { visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor visitor) { visitor.describeVisit(this); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { Stack visitorNodeStack = visitor.visitorNodeStack(); // see AbstractInjectionValueMetaData.describeVisit MetaDataVisitorNode node = visitorNodeStack.pop(); try { if (node instanceof TypeProvider) { TypeProvider typeProvider = (TypeProvider) node; return typeProvider.getType(visitor, this); } else { throw new IllegalArgumentException(TypeProvider.ERROR_MSG); } } finally { visitorNodeStack.push(node); } } @XmlTransient public Iterator getChildren() { if (value instanceof MetaDataVisitorNode) return Collections.singletonList((MetaDataVisitorNode) value).iterator(); return null; } public void toString(JBossStringBuilder buffer) { buffer.append("value=").append(value); } public void toShortString(JBossStringBuilder buffer) { buffer.append(value); } public AbstractValueMetaData clone() { AbstractValueMetaData clone = (AbstractValueMetaData)super.clone(); if (value instanceof MetaDataVisitorNode) clone.setValue(CloneUtil.cloneObject((MetaDataVisitorNode)value, MetaDataVisitorNode.class)); return clone; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/UninstallCallbackMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Un0000644000175000017500000000400211173362527033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.dependency.spi.CallbackItem; /** * Metadata for uninstall callback. * * @author Ales Justin * @author Adrian Brock */ @XmlType(name="uninstallCallbackType", propOrder={"annotations", "parameters"}) public class UninstallCallbackMetaData extends AbstractCallbackMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 2L; public UninstallCallbackMetaData() { super(); } @SuppressWarnings("unchecked") protected void addCallback(MetaDataVisitor visitor, CallbackItem callback) { visitor.addUninstallCallback(callback); } public UninstallCallbackMetaData clone() { UninstallCallbackMetaData clone = (UninstallCallbackMetaData)super.clone(); doClone(clone); return clone; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractFeatureMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001131311305760441033136 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.HashSet; import java.util.Iterator; import java.util.Set; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; import static org.jboss.beans.metadata.plugins.CloneUtil.cloneSet; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.FeatureMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.collection.CollectionsFactory; /** * General metadata. * * @author Adrian Brock * @version $Revision: 97404 $ */ public abstract class AbstractFeatureMetaData extends JBossObject implements FeatureMetaData, TypeProvider, Serializable { private static final long serialVersionUID = 2L; /** The description */ private String description; /** The annotations */ private Set annotations; /** * Create a new meta data */ public AbstractFeatureMetaData() { } /** * Set the description. * * @param description the description. */ public void setDescription(String description) { this.description = description; flushJBossObjectCache(); } /** * Set the annotations. * * @param annotations Set */ @XmlElement(name="annotation", type=AbstractAnnotationMetaData.class) public void setAnnotations(Set annotations) { this.annotations = annotations; flushJBossObjectCache(); } public String getDescription() { return description; } public Set getAnnotations() { return annotations; } public void initialVisit(MetaDataVisitor visitor) { visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor visitor) { visitor.describeVisit(this); } protected TypeInfo applyCollectionOrMapCheck(TypeInfo typeInfo) throws Throwable { // cannot determine on map, since we don't know if we are key or value if (typeInfo instanceof ClassInfo) { ClassInfo classInfo = (ClassInfo)typeInfo; TypeInfo componentType = classInfo.getComponentType(); if (componentType != null) return componentType; } if (typeInfo.isCollection() || typeInfo.isMap()) { throw new IllegalArgumentException("Should not be here - set element/value class type in collection/map: " + this); } return typeInfo; } @XmlTransient public Iterator getChildren() { Set children = CollectionsFactory.createLazySet(); addChildren(children); if (children.size() == 0) return null; else return children.iterator(); } protected void addChildren(Set children) { if (annotations != null && annotations.size() > 0) children.addAll(annotations); } public void toString(JBossStringBuilder buffer) { if (description != null) buffer.append("description=").append(description); if (annotations != null) buffer.append(" annotations=").append(annotations); } public void toShortString(JBossStringBuilder buffer) { buffer.append(description); } @SuppressWarnings("unchecked") protected void doClone(AbstractFeatureMetaData clone) { clone.setAnnotations(cloneSet(annotations, HashSet.class, AnnotationMetaData.class)); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/CardinalityValueAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ca0000644000175000017500000000305110756342051033141 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.xb.binding.sunday.unmarshalling.ValueAdapter; import org.jboss.dependency.spi.Cardinality; /** * CardinalityValueAdapter. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 1.1 $ */ public class CardinalityValueAdapter implements ValueAdapter { @SuppressWarnings("unchecked") public Object cast(Object o, Class c) { return Cardinality.toCardinality((String)o); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/MapEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ma0000644000175000017500000000362510761771011033160 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.xb.annotations.JBossXmlMapKey; import org.jboss.xb.annotations.JBossXmlMapValue; /** * MapEntry. * * @author Ales Justin * @author Adrian Brock */ @XmlType(name="entryType", propOrder= {"key", "value"}) public class MapEntry { /** The key */ private ValueMetaData key; /** The value */ private ValueMetaData value; @JBossXmlMapKey public ValueMetaData getKey() { return key; } public void setKey(ValueMetaData key) { this.key = key; } @JBossXmlMapValue public ValueMetaData getValue() { return value; } public void setValue(ValueMetaData value) { this.value = value; } }././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000755000175000017500000000000011620312174033215 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/StopLifecycleMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000347210777411017033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * StopLifecycleMetaDataBuilder. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class StopLifecycleMetaDataBuilder extends LifecycleMetaDataBuilder { /** * Create a new StopLifecycleMetaDataBuilder. * * @param beanMetaData */ public StopLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected LifecycleMetaData getLifecycle(AbstractBeanMetaData beanMetaData) { return beanMetaData.getStop(); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, LifecycleMetaData lifecycle) { beanMetaData.setStop(lifecycle); } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/UninstallMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000407110771175116033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; /** * UninstallMetaDataBuilder. * * @author Ales Justin */ public class UninstallMetaDataBuilder extends AbstractInstallMetaDataBuilder { /** * Create a new StartLifecycleMetaDataBuilder. * * @param beanMetaData the bean meta data */ public UninstallMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, AbstractInstallMetaData lifecycle) { List uninstalls = beanMetaData.getUninstalls(); if (uninstalls == null) { uninstalls = new ArrayList(); beanMetaData.setUninstalls(uninstalls); } uninstalls.add(lifecycle); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/PropertyInstallCallbackMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000322510771175116033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; /** * PropertyInstallCallbackMetaDataBuilder. * * @author Ales Justin */ public class PropertyInstallCallbackMetaDataBuilder extends InstallCallbackMetaDataBuilder { public PropertyInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setMethodInfo(AbstractCallbackMetaData lifecycle, String methodInfo) { lifecycle.setProperty(methodInfo); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/UninstallCallbackMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000425410771175116033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; /** * UninstallCallbackMetaDataBuilder. * * @author Ales Justin */ public class UninstallCallbackMetaDataBuilder extends AbstractCallbackMetaDataBuilder { public UninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, AbstractCallbackMetaData lifecycle) { List callbacks = beanMetaData.getUninstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setUninstallCallbacks(callbacks); } callbacks.add(lifecycle); } protected AbstractCallbackMetaData createLifecycleMetaData() { return new UninstallCallbackMetaData(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/AbstractInstallMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000344110771175116033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; /** * AbstractInstallMetaDataBuilder. * * @author Ales Justin * @author Adrian Brock */ public abstract class AbstractInstallMetaDataBuilder extends StateMetaDataBuilder { protected AbstractInstallMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected AbstractInstallMetaData createLifecycleMetaData() { return new AbstractInstallMetaData(); } protected void applyAfterSet(AbstractInstallMetaData lifecycle) { // do nothing } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/StateActionBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000306210771457472033241 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * State action builder. * e.g. lifecycle, install and callback * * @param exact state action metadata type * @author Ales Justin */ public interface StateActionBuilder { /** * Create state action meta data. * * @param methodInfo the method info * @return state action meta data */ T createStateActionMetaData(String methodInfo); } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/InstallCallbackMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000423610771175116033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.List; import java.util.ArrayList; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; /** * InstallCallbackMetaDataBuilder. * * @author Ales Justin */ public class InstallCallbackMetaDataBuilder extends AbstractCallbackMetaDataBuilder { public InstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, AbstractCallbackMetaData lifecycle) { List callbacks = beanMetaData.getInstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setInstallCallbacks(callbacks); } callbacks.add(lifecycle); } protected AbstractCallbackMetaData createLifecycleMetaData() { return new InstallCallbackMetaData(); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/DestroyLifecycleMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000353610771175116033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * DestroyLifecycleMetaDataBuilder. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class DestroyLifecycleMetaDataBuilder extends LifecycleMetaDataBuilder { /** * Create a new DestroyLifecycleMetaDataBuilder. * * @param beanMetaData the bean meta data */ public DestroyLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected LifecycleMetaData getLifecycle(AbstractBeanMetaData beanMetaData) { return beanMetaData.getDestroy(); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, LifecycleMetaData lifecycle) { beanMetaData.setDestroy(lifecycle); } }././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/AbstractCallbackMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000316410771175116033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; /** * AbstractCallbackMetaDataBuilder. * * @author Ales Justin */ public abstract class AbstractCallbackMetaDataBuilder extends StateMetaDataBuilder { protected AbstractCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void applyAfterSet(AbstractCallbackMetaData lifecycle) { // do nothing } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/MutableParameterizedMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000300110551435051033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.List; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ParameterizedMetaData; /** * MutableParameterizedMetaData. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface MutableParameterizedMetaData extends ParameterizedMetaData { /** * Set the parameters. * * @param parameters the parameters */ void setParameters(List parameters); } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000434711216157032033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; /** * Create new Builder. * * @author Ales Justin */ public class BeanMetaDataBuilderFactory { /** * Create builder from bean. * * @param beanClassName bean class name * @return new Builder */ public static BeanMetaDataBuilder createBuilder(String beanClassName) { return new BeanMetaDataBuilderImpl(beanClassName); } /** * Create builder from name and bean. * * @param beanInstanceName bean name * @param beanClassName bean class name * @return new Builder */ public static BeanMetaDataBuilder createBuilder(String beanInstanceName, String beanClassName) { return new BeanMetaDataBuilderImpl(beanInstanceName, beanClassName); } /** * Create builder from BeanMetaData. * * @param beanMetaData bean meta data * @return new builder */ public static BeanMetaDataBuilder createBuilder(AbstractBeanMetaData beanMetaData) { return new BeanMetaDataBuilderImpl(beanMetaData); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/CreateLifecycleMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000353010771175116033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * CreateLifecycleMetaDataBuilder. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class CreateLifecycleMetaDataBuilder extends LifecycleMetaDataBuilder { /** * Create a new CreateLifecycleMetaDataBuilder. * * @param beanMetaData the bean meta data */ public CreateLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected LifecycleMetaData getLifecycle(AbstractBeanMetaData beanMetaData) { return beanMetaData.getCreate(); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, LifecycleMetaData lifecycle) { beanMetaData.setCreate(lifecycle); } }././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/PropertyUninstallCallbackMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000323310771175116033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; /** * PropertyInstallCallbackMetaDataBuilder. * * @author Ales Justin */ public class PropertyUninstallCallbackMetaDataBuilder extends UninstallCallbackMetaDataBuilder { public PropertyUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setMethodInfo(AbstractCallbackMetaData lifecycle, String methodInfo) { lifecycle.setProperty(methodInfo); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/ParameterMetaDataBuilderImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000766510755316653033253 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.ParameterMetaDataBuilder; /** * Helper class. * * @param the parameter holder type * @see LifecycleMetaDataBuilder * @author Ales Justin * @author Adrian Brock */ public class ParameterMetaDataBuilderImpl implements ParameterMetaDataBuilder { /** The parameter holder */ private T parameterHolder; /** * Create a new ParameterMetaDataBuilder. * * @param parameterHolder the parameter holder * @throws IllegalArgumentException for a null parameter */ public ParameterMetaDataBuilderImpl(T parameterHolder) { if (parameterHolder == null) throw new IllegalArgumentException("Null parameter holder"); this.parameterHolder = parameterHolder; } /** * Get the parameters * * @return the parameters */ private List getParameters() { return parameterHolder.getParameters(); } /** * Set the parameters * * @param parameters the parameters */ private void setParameters(List parameters) { parameterHolder.setParameters(parameters); } /** * Check the parameters * * @return the parameters */ private List checkParameters() { List parameters = getParameters(); if (parameters == null) { parameters = new ArrayList(); setParameters(parameters); } return parameters; } /** * Add a parameter * * @param type the type * @param value the value * @return the parameter */ public ParameterMetaDataBuilder addParameterMetaData(String type, Object value) { List parameters = checkParameters(); parameters.add(new AbstractParameterMetaData(type, value)); return this; } /** * Add a parameter * * @param type the type * @param value the value * @return the parameter */ public ParameterMetaDataBuilder addParameterMetaData(String type, String value) { List parameters = checkParameters(); parameters.add(new AbstractParameterMetaData(type, value)); return this; } public ParameterMetaDataBuilder addParameterMetaData(String type, ValueMetaData value) { List parameters = checkParameters(); parameters.add(new AbstractParameterMetaData(type, value)); return this; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/StartLifecycleMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000352210771175116033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * StartLifecycleMetaDataBuilder. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class StartLifecycleMetaDataBuilder extends LifecycleMetaDataBuilder { /** * Create a new StartLifecycleMetaDataBuilder. * * @param beanMetaData the bean meta data */ public StartLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected LifecycleMetaData getLifecycle(AbstractBeanMetaData beanMetaData) { return beanMetaData.getStart(); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, LifecycleMetaData lifecycle) { beanMetaData.setStart(lifecycle); } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/InstallMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000411510771175116033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; /** * InstallMetaDataBuilder. * * @author Ales Justin */ public class InstallMetaDataBuilder extends AbstractInstallMetaDataBuilder { /** * Create a new StartLifecycleMetaDataBuilder. * * @param beanMetaData the bean meta data * @throws IllegalArgumentException */ public InstallMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } protected void setLifecycle(AbstractBeanMetaData beanMetaData, AbstractInstallMetaData lifecycle) { List installs = beanMetaData.getInstalls(); if (installs == null) { installs = new ArrayList(); beanMetaData.setInstalls(installs); } installs.add(lifecycle); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000011445011224616616033234 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import java.lang.annotation.Annotation; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.model.InjectOption; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractFeatureMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractRelatedClassMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.DirectAnnotationMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; 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.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.builder.ParameterMetaDataBuilder; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.dependency.spi.graph.SearchInfo; /** * Helper class. * Similar to StringBuffer, methods return current instance of BeanMetaDataBuilder. * * @author Ales Justin * @author Adrian Brock */ class BeanMetaDataBuilderImpl extends BeanMetaDataBuilder { /** The bean metadata */ private AbstractBeanMetaData beanMetaData; /** The constructor builder */ private ParameterMetaDataBuilderImpl constructorBuilder; /** The create lifecycle builder */ private LifecycleMetaDataBuilder createBuilder; /** The start lifecycle builder */ private LifecycleMetaDataBuilder startBuilder; /** The stop lifecycle builder */ private LifecycleMetaDataBuilder stopBuilder; /** The destroy lifecycle builder */ private LifecycleMetaDataBuilder destroyBuilder; /** The install builder */ private StateActionBuilder installBuilder; /** The uninstall builder */ private StateActionBuilder uninstallBuilder; /** The incallback builder */ private StateActionBuilder propIncallbackBuilder; /** The uncallback builder */ private StateActionBuilder propUncallbackBuilder; /** The incallback builder */ private StateActionBuilder incallbackBuilder; /** The uncallback builder */ private StateActionBuilder uncallbackBuilder; /** * Create a new BeanMetaDataBuilderImpl. * * @param bean the bean */ public BeanMetaDataBuilderImpl(String bean) { this(new AbstractBeanMetaData(bean)); } /** * Create a new BeanMetaDataBuilderImpl. * * @param name the bean name * @param bean the bean */ public BeanMetaDataBuilderImpl(String name, String bean) { this(new AbstractBeanMetaData(name, bean)); } /** * Create a new BeanMetaDataBuilderImpl. * * @param beanMetaData the bean metadata */ public BeanMetaDataBuilderImpl(AbstractBeanMetaData beanMetaData) { this.beanMetaData = beanMetaData; // lifecycle builders createBuilder = createCreateLifecycleMetaDataBuilder(beanMetaData); startBuilder = createStartLifecycleMetaDataBuilder(beanMetaData); stopBuilder = createStopLifecycleMetaDataBuilder(beanMetaData); destroyBuilder = createDestroyLifecycleMetaDataBuilder(beanMetaData); // install installBuilder = createInstallMetaDataBuilder(beanMetaData); uninstallBuilder = createUninstallMetaDataBuilder(beanMetaData); // callback propIncallbackBuilder = createPropertyInstallCallbackMetaDataBuilder(beanMetaData); propUncallbackBuilder = createPropertyUninstallCallbackMetaDataBuilder(beanMetaData); incallbackBuilder = createInstallCallbackMetaDataBuilder(beanMetaData); uncallbackBuilder = createUninstallCallbackMetaDataBuilder(beanMetaData); } /** * Create lifecycle metadata builder. * * @param beanMetaData the bean metadata * @return the lifecycle metadata builder */ protected LifecycleMetaDataBuilder createCreateLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new CreateLifecycleMetaDataBuilder(beanMetaData); } /** * Create lifecycle metadata builder. * * @param beanMetaData the bean metadata * @return the lifecycle metadata builder */ protected LifecycleMetaDataBuilder createStartLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new StartLifecycleMetaDataBuilder(beanMetaData); } /** * Create lifecycle metadata builder. * * @param beanMetaData the bean metadata * @return the lifecycle metadata builder */ protected LifecycleMetaDataBuilder createStopLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new StopLifecycleMetaDataBuilder(beanMetaData); } /** * Create lifecycle metadata builder. * * @param beanMetaData the bean metadata * @return the lifecycle metadata builder */ protected LifecycleMetaDataBuilder createDestroyLifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new DestroyLifecycleMetaDataBuilder(beanMetaData); } /** * Create install metadata builder. * * @param beanMetaData the bean metadata * @return the install builder */ protected StateActionBuilder createInstallMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new InstallMetaDataBuilder(beanMetaData); } /** * Create install metadata builder. * * @param beanMetaData the bean metadata * @return the install builder */ protected StateActionBuilder createUninstallMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new UninstallMetaDataBuilder(beanMetaData); } /** * Create callback metadata builder. * * @param beanMetaData the bean metadata * @return the callback metadata builder */ private StateActionBuilder createPropertyInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new PropertyInstallCallbackMetaDataBuilder(beanMetaData); } /** * Create callback metadata builder. * * @param beanMetaData the bean metadata * @return the callback metadata builder */ private StateActionBuilder createPropertyUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new PropertyUninstallCallbackMetaDataBuilder(beanMetaData); } /** * Create callback metadata builder. * * @param beanMetaData the bean metadata * @return the callback metadata builder */ private StateActionBuilder createInstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new InstallCallbackMetaDataBuilder(beanMetaData); } /** * Create callback metadata builder. * * @param beanMetaData the bean metadata * @return the callback metadata builder */ private StateActionBuilder createUninstallCallbackMetaDataBuilder(AbstractBeanMetaData beanMetaData) { return new UninstallCallbackMetaDataBuilder(beanMetaData); } public BeanMetaData getBeanMetaData() { return beanMetaData; } public BeanMetaDataFactory getBeanMetaDataFactory() { return beanMetaData; } public BeanMetaDataBuilder setName(String name) { beanMetaData.setName(name); return this; } public BeanMetaDataBuilder setBean(String bean) { beanMetaData.setBean(bean); return this; } public BeanMetaDataBuilder addRelatedClass(String className, Object... enabled) { RelatedClassMetaData related = createRelated(className, enabled); return addRelatedClass(related); } public BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related) { Set relatedSet = beanMetaData.getRelated(); if (relatedSet == null) { relatedSet = new HashSet(); beanMetaData.setRelated(relatedSet); } relatedSet.add(related); return this; } public BeanMetaDataBuilder setRelated(Set related) { beanMetaData.setRelated(related); return this; } public BeanMetaDataBuilder setAliases(Set aliases) { beanMetaData.setAliases(aliases); return this; } public BeanMetaDataBuilder addAlias(Object alias) { Set aliases = beanMetaData.getAliases(); if (aliases == null) { aliases = new HashSet(); beanMetaData.setAliases(aliases); } aliases.add(alias); return this; } /** * Create annotation metadata. * * @param annotation the string annotation * @return the annotation metadata */ protected AnnotationMetaData createAnnotationMetaData(String annotation) { return new AbstractAnnotationMetaData(annotation); } /** * Create annotation metadata. * * @param annotation the real annotation * @return the annotation metadata */ protected AnnotationMetaData createAnnotationMetaData(Annotation annotation) { return new DirectAnnotationMetaData(annotation); } /** * Create annotation metadata. * * @param annotation the string annotation * @param replace the replace flag * @return the annotation metadata */ protected AnnotationMetaData createAnnotationMetaData(String annotation, boolean replace) { AbstractAnnotationMetaData amd = new AbstractAnnotationMetaData(annotation); amd.setReplace(replace); return amd; } public BeanMetaDataBuilder setAnnotations(Set annotations) { if (annotations != null && annotations.isEmpty() == false) { Set amds = new HashSet(); for (String annotation : annotations) { AnnotationMetaData amd = createAnnotationMetaData(annotation); amds.add(amd); } beanMetaData.setAnnotations(amds); } return this; } /** * Get the annotations. * * @return the annotations */ protected Set getAnnotations() { Set annotations = beanMetaData.getAnnotations(); if (annotations == null) { annotations = new HashSet(); beanMetaData.setAnnotations(annotations); } return annotations; } public BeanMetaDataBuilder addAnnotation(String annotation) { Set annotations = getAnnotations(); AnnotationMetaData amd = createAnnotationMetaData(annotation); annotations.add(amd); return this; } public BeanMetaDataBuilder addAnnotation(Annotation annotation) { Set annotations = getAnnotations(); AnnotationMetaData amd = createAnnotationMetaData(annotation); annotations.add(amd); return this; } public BeanMetaDataBuilder addAnnotation(String annotation, boolean replace) { Set annotations = getAnnotations(); AnnotationMetaData amd = createAnnotationMetaData(annotation, replace); annotations.add(amd); return this; } public BeanMetaDataBuilder setMode(ControllerMode mode) { beanMetaData.setMode(mode); return this; } public BeanMetaDataBuilder setAccessMode(BeanAccessMode mode) { beanMetaData.setAccessMode(mode); return this; } public BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode) { beanMetaData.setErrorHandlingMode(mode); return this; } public BeanMetaDataBuilder setAutowireType(AutowireType type) { beanMetaData.setAutowireType(type); return this; } public BeanMetaDataBuilder setAutowireCandidate(boolean candidate) { beanMetaData.setAutowireCandidate(candidate); return null; } /** * Create class loader metadata. * * @param classLoader the classloader value * @return the classloader metadata */ protected ClassLoaderMetaData createClassLoaderMetaData(ValueMetaData classLoader) { return new AbstractClassLoaderMetaData(classLoader); } public BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader) { ClassLoaderMetaData clvmd = createClassLoaderMetaData(classLoader); beanMetaData.setClassLoader(clvmd); return this; } public BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader) { beanMetaData.setClassLoader(classLoader); return this; } /** * Create abstract constructor metadata. * * @return abstract constructor metadata */ protected AbstractConstructorMetaData createAbstractConstructorMetaData() { return new AbstractConstructorMetaData(); } /** * Create constructor metadata on demand. */ protected void checkConstructorBuilder() { AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor(); if (constructor == null) { constructor = createAbstractConstructorMetaData(); beanMetaData.setConstructor(constructor); constructorBuilder = new ParameterMetaDataBuilderImpl(constructor); } } public BeanMetaDataBuilder setFactory(ValueMetaData factory) { checkConstructorBuilder(); AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor(); constructor.setFactory(factory); return this; } public BeanMetaDataBuilder setFactoryClass(String factoryClass) { checkConstructorBuilder(); AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor(); constructor.setFactoryClass(factoryClass); return this; } public BeanMetaDataBuilder setFactoryMethod(String factoryMethod) { checkConstructorBuilder(); AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor(); constructor.setFactoryMethod(factoryMethod); return this; } public BeanMetaDataBuilder setConstructorValue(ValueMetaData value) { checkConstructorBuilder(); AbstractConstructorMetaData constructor = (AbstractConstructorMetaData) beanMetaData.getConstructor(); constructor.setValue(value); return this; } public BeanMetaDataBuilder addConstructorParameter(String type, Object value) { checkConstructorBuilder(); constructorBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addConstructorParameter(String type, String value) { checkConstructorBuilder(); constructorBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value) { checkConstructorBuilder(); constructorBuilder.addParameterMetaData(type, value); return this; } /** * Create property metadata. * * @param name the name * @param value the value * @return property metadata */ protected PropertyMetaData createPropertyMetaData(String name, Object value) { return new AbstractPropertyMetaData(name, value); } public BeanMetaDataBuilder addPropertyMetaData(String name, Object value) { Set properties = getProperties(); removeProperty(properties, name); properties.add(createPropertyMetaData(name, value)); return this; } /** * Create property metadata. * * @param name the name * @param value the value * @return property metadata */ protected PropertyMetaData createPropertyMetaData(String name, String value) { return new AbstractPropertyMetaData(name, value); } public BeanMetaDataBuilder addPropertyMetaData(String name, String value) { Set properties = getProperties(); removeProperty(properties, name); properties.add(createPropertyMetaData(name, value)); return this; } /** * Create property metadata. * * @param name the name * @param value the value * @return property metadata */ protected PropertyMetaData createPropertyMetaData(String name, ValueMetaData value) { return new AbstractPropertyMetaData(name, value); } public BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value) { Set properties = getProperties(); removeProperty(properties, name); properties.add(createPropertyMetaData(name, value)); return this; } public BeanMetaDataBuilder addPropertyMetaData(String name, Collection value) { Set properties = getProperties(); removeProperty(properties, name); if (value instanceof ValueMetaData) { properties.add(createPropertyMetaData(name, (ValueMetaData)value)); } else { properties.add(createPropertyMetaData(name, value)); } return this; } public BeanMetaDataBuilder addPropertyMetaData(String name, Map value) { Set properties = getProperties(); removeProperty(properties, name); if (value instanceof ValueMetaData) { properties.add(createPropertyMetaData(name, (ValueMetaData)value)); } else { properties.add(createPropertyMetaData(name, value)); } return this; } public BeanMetaDataBuilder addPropertyAnnotation(String name, String annotation) { AnnotationMetaData amd = createAnnotationMetaData(annotation); return addPropertyAnnotation(name, amd); } public BeanMetaDataBuilder addPropertyAnnotation(String name, String annotation, boolean replace) { AnnotationMetaData amd = createAnnotationMetaData(annotation, replace); return addPropertyAnnotation(name, amd); } public BeanMetaDataBuilder addPropertyAnnotation(String name, Annotation annotation) { AnnotationMetaData amd = createAnnotationMetaData(annotation); return addPropertyAnnotation(name, amd); } /** * Add property annotation metadata. * * @param name the property name * @param amd the annotation metadata * @return this builder */ protected BeanMetaDataBuilder addPropertyAnnotation(String name, AnnotationMetaData amd) { PropertyMetaData pmd = beanMetaData.getProperty(name); Set annotations = pmd.getAnnotations(); if (annotations == null) { if (pmd instanceof AbstractFeatureMetaData == false) throw new IllegalArgumentException("PropertyMetaData is not AbstractFeatureMetaData instance: " + pmd); annotations = new HashSet(); AbstractFeatureMetaData afmd = AbstractFeatureMetaData.class.cast(pmd); afmd.setAnnotations(annotations); } annotations.add(amd); return this; } /** * Remove previous matching property. * * @param properties the properties * @param name the name * @return modified set of properties */ private Set removeProperty(Set properties, String name) { for (Iterator it = properties.iterator() ; it.hasNext() ; ) { PropertyMetaData property = it.next(); if (name.equals(property.getName())) { it.remove(); } } return properties; } /** * Get the properties. * * @return the properties */ private Set getProperties() { Set properties = beanMetaData.getProperties(); if (properties == null) { properties = new HashSet(); beanMetaData.setProperties(properties); } return properties; } public BeanMetaDataBuilder ignoreCreate() { createBuilder.setIgnored(); return this; } public BeanMetaDataBuilder setCreate(String methodName) { createBuilder.createStateActionMetaData(methodName); return this; } public BeanMetaDataBuilder addCreateParameter(String type, Object value) { createBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addCreateParameter(String type, String value) { createBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value) { createBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder ignoreStart() { startBuilder.setIgnored(); return this; } public BeanMetaDataBuilder setStart(String methodName) { startBuilder.createStateActionMetaData(methodName); return this; } public BeanMetaDataBuilder addStartParameter(String type, Object value) { startBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addStartParameter(String type, String value) { startBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value) { startBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder ignoreStop() { stopBuilder.setIgnored(); return this; } public BeanMetaDataBuilder setStop(String methodName) { stopBuilder.createStateActionMetaData(methodName); return this; } public BeanMetaDataBuilder addStopParameter(String type, Object value) { stopBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addStopParameter(String type, String value) { stopBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value) { stopBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder ignoreDestroy() { destroyBuilder.setIgnored(); return this; } public BeanMetaDataBuilder setDestroy(String methodName) { destroyBuilder.createStateActionMetaData(methodName); return this; } public BeanMetaDataBuilder addDestroyParameter(String type, Object value) { destroyBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addDestroyParameter(String type, String value) { destroyBuilder.addParameterMetaData(type, value); return this; } public BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value) { destroyBuilder.addParameterMetaData(type, value); return this; } /** * Create supply metadata. * * @param supply the supply * @param type the type * @return supply metadata */ protected SupplyMetaData createSupplyMetaData(Object supply, String type) { AbstractSupplyMetaData asmd = new AbstractSupplyMetaData(supply); if (type != null) asmd.setType(type); return asmd; } public BeanMetaDataBuilder addSupply(Object supply, String type) { Set supplies = beanMetaData.getSupplies(); if (supplies == null) { supplies = new HashSet(); beanMetaData.setSupplies(supplies); } supplies.add(createSupplyMetaData(supply, type)); return this; } /** * Create demand metadata. * * @param demand the demand * @param whenRequired the when required * @param targetState the target state * @param transformer the transformer * @return the demand metadata */ protected DemandMetaData createDemandMetaData(Object demand, ControllerState whenRequired, ControllerState targetState, String transformer) { AbstractDemandMetaData admd = new AbstractDemandMetaData(demand); if (whenRequired != null) admd.setWhenRequired(whenRequired); if (targetState != null) admd.setTargetState(targetState); if (transformer != null) admd.setTransformer(transformer); return admd; } public BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, ControllerState targetState, String transformer) { Set demands = beanMetaData.getDemands(); if (demands == null) { demands = new HashSet(); beanMetaData.setDemands(demands); } demands.add(createDemandMetaData(demand, whenRequired, targetState, transformer)); return this; } /** * Create dependency metadata. * * @param dependency the dependency * @return the dependency metadata */ protected DependencyMetaData createDependencyMetaData(Object dependency) { return new AbstractDependencyMetaData(dependency); } public BeanMetaDataBuilder addDependency(Object dependency) { Set dependencies = beanMetaData.getDepends(); if (dependencies == null) { dependencies = new HashSet(); beanMetaData.setDepends(dependencies); } dependencies.add(createDependencyMetaData(dependency)); return this; } public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired) { AbstractInstallMetaData install = installBuilder.createStateActionMetaData(methodName); install.setBean(bean); if (state != null) install.setDependentState(state); if (whenRequired != null) install.setState(whenRequired); return new ParameterMetaDataBuilderImpl(install); } public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired) { AbstractInstallMetaData uninstall = uninstallBuilder.createStateActionMetaData(methodName); uninstall.setBean(bean); if (state != null) uninstall.setDependentState(state); if (whenRequired != null) uninstall.setState(whenRequired); return new ParameterMetaDataBuilderImpl(uninstall); } public BeanMetaDataBuilder addPropertyInstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { AbstractCallbackMetaData callback = propIncallbackBuilder.createStateActionMetaData(property); callback.setSignature(signature); callback.setState(whenRequired); if (dependentState != null) callback.setDependentState(dependentState); callback.setCardinality(cardinality); return this; } public BeanMetaDataBuilder addPropertyUninstallCallback(String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { AbstractCallbackMetaData callback = propUncallbackBuilder.createStateActionMetaData(property); callback.setSignature(signature); callback.setState(whenRequired); if (dependentState != null) callback.setDependentState(dependentState); callback.setCardinality(cardinality); return this; } public BeanMetaDataBuilder addMethodInstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { AbstractCallbackMetaData callback = incallbackBuilder.createStateActionMetaData(method); callback.setSignature(signature); callback.setState(whenRequired); if (dependentState != null) callback.setDependentState(dependentState); callback.setCardinality(cardinality); return this; } public BeanMetaDataBuilder addMethodUninstallCallback(String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { AbstractCallbackMetaData callback = uncallbackBuilder.createStateActionMetaData(method); callback.setSignature(signature); callback.setState(whenRequired); if (dependentState != null) callback.setDependentState(dependentState); callback.setCardinality(cardinality); return this; } public RelatedClassMetaData createRelated(String className, Object... enabled) { AbstractRelatedClassMetaData related = new AbstractRelatedClassMetaData(); related.setClassName(className); if (enabled != null && enabled.length > 0) related.setEnabled(new HashSet(Arrays.asList(enabled))); return related; } public ValueMetaData createNull() { return new AbstractValueMetaData(); } public ValueMetaData createThis() { return new ThisValueMetaData(); } public ValueMetaData createValue(Object value) { return new AbstractValueMetaData(value); } public ValueMetaData createValueFactory(Object bean, String method, ParameterMetaData... parameters) { AbstractValueFactoryMetaData value = new AbstractValueFactoryMetaData(bean, method); value.setParameters(Arrays.asList(parameters)); return value; } public ParameterMetaData createParameter(ValueMetaData value, String type, int index) { ParameterMetaData parameter = new AbstractParameterMetaData(type, value); parameter.setIndex(index); return parameter; } public ValueMetaData createString(String type, String value) { StringValueMetaData result = new StringValueMetaData(value); result.setType(type); return result; } /** * Create abstract dependency metadata. * * @param bean the bean * @param property the property * @return abstract dependency value metadata */ protected AbstractDependencyValueMetaData createAbstractDependencyValueMetaData(Object bean, String property) { return new AbstractDependencyValueMetaData(bean, property); } public ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState, SearchInfo search) { AbstractDependencyValueMetaData result = createAbstractDependencyValueMetaData(bean, property); if (whenRequired != null) result.setWhenRequiredState(whenRequired); if (dependentState != null) result.setDependentState(dependentState); if (search != null) result.setSearch(search); return result; } /** * Create abstract dependency metadata. * * @return abstract dependency value metadata */ protected AbstractInjectionValueMetaData createAbstractInjectionValueMetaData() { return new AbstractInjectionValueMetaData(); } /** * Create abstract dependency metadata. * * @param name the name * @return abstract dependency value metadata */ protected AbstractInjectionValueMetaData createAbstractInjectionValueMetaData(Object name) { return new AbstractInjectionValueMetaData(name); } public ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState, AutowireType autowire, InjectOption option, SearchInfo search) { AbstractInjectionValueMetaData result = createAbstractInjectionValueMetaData(); if (whenRequired != null) result.setWhenRequiredState(whenRequired); if (dependentState != null) result.setDependentState(dependentState); if (autowire != null) result.setInjectionType(autowire); if (option != null) result.setInjectionOption(option); if (search != null) result.setSearch(search); return result; } public ValueMetaData createFromContextInject(FromContext fromContext, Object contextName, ControllerState dependentState, SearchInfo search) { AbstractInjectionValueMetaData result = createAbstractInjectionValueMetaData(contextName); result.setFromContext(fromContext); if (dependentState != null) result.setDependentState(dependentState); if (search != null) result.setSearch(search); return result; } @SuppressWarnings("unchecked") public Collection createCollection(String collectionType, String elementType) { AbstractCollectionMetaData collection = new AbstractCollectionMetaData(); if (collectionType != null) collection.setType(collectionType); if (elementType != null) collection.setElementType(elementType); return (Collection) collection; } @SuppressWarnings("unchecked") public List createList(String listType, String elementType) { AbstractListMetaData collection = new AbstractListMetaData(); if (listType != null) collection.setType(listType); if (elementType != null) collection.setElementType(elementType); return (List) collection; } @SuppressWarnings("unchecked") public Set createSet(String setType, String elementType) { AbstractSetMetaData collection = new AbstractSetMetaData(); if (setType != null) collection.setType(setType); if (elementType != null) collection.setElementType(elementType); return (Set) collection; } @SuppressWarnings("unchecked") public List createArray(String arrayType, String elementType) { AbstractArrayMetaData collection = new AbstractArrayMetaData(); if (arrayType != null) collection.setType(arrayType); if (elementType != null) collection.setElementType(elementType); return (List) collection; } @SuppressWarnings("unchecked") public Map createMap(String mapType, String keyType, String valueType) { AbstractMapMetaData map = new AbstractMapMetaData(); if (mapType != null) map.setType(mapType); if (keyType != null) map.setKeyType(keyType); if (valueType != null) map.setValue(valueType); return (Map) map; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/LifecycleMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000747611101600654033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.beans.metadata.spi.builder.ParameterMetaDataBuilder; /** * Helper class. * @see BeanMetaDataBuilder * @see ParameterMetaDataBuilderImpl * * @author Ales Justin */ public abstract class LifecycleMetaDataBuilder extends StateMetaDataBuilder { protected ParameterMetaDataBuilderImpl builder; protected LifecycleMetaDataBuilder(AbstractBeanMetaData beanMetaData) { super(beanMetaData); } abstract LifecycleMetaData getLifecycle(AbstractBeanMetaData beanMetaData); protected LifecycleMetaData createLifecycleMetaData() { return new AbstractLifecycleMetaData(); } protected void applyAfterSet(LifecycleMetaData lifecycle) { builder = new ParameterMetaDataBuilderImpl((AbstractLifecycleMetaData)lifecycle); } /** * Set ignored no lifecycle metadata. */ public void setIgnored() { LifecycleMetaData lmd = getCheckedLifecycle(); if (lmd instanceof AbstractLifecycleMetaData) { AbstractLifecycleMetaData almd = (AbstractLifecycleMetaData)lmd; almd.setIgnored(true); } } /** * Check lifecycle. * * TODO - fix name in 2.2 version! */ protected void checkLlifecycle() { LifecycleMetaData lifecycle = getLifecycle(beanMetaData); if (lifecycle == null) { createStateActionMetaData(null); } } /** * Get checked lifecycle. * * @return checked lifecycle */ protected LifecycleMetaData getCheckedLifecycle() { LifecycleMetaData lifecycle = getLifecycle(beanMetaData); if (lifecycle == null) lifecycle = createStateActionMetaData(null); return lifecycle; } /** * Add parameter. * * @param type the type * @param value the value * @return parameter builder */ public ParameterMetaDataBuilder addParameterMetaData(String type, Object value) { checkLlifecycle(); return builder.addParameterMetaData(type, value); } /** * Add parameter. * * @param type the type * @param value the value * @return parameter builder */ public ParameterMetaDataBuilder addParameterMetaData(String type, ValueMetaData value) { checkLlifecycle(); return builder.addParameterMetaData(type, value); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/builder/StateMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/bu0000644000175000017500000000555010771457472033245 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.builder; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; /** * Helper class. * @see BeanMetaDataBuilder * @see org.jboss.beans.metadata.plugins.builder.ParameterMetaDataBuilderImpl * * @param exact type * @author Ales Justin */ public abstract class StateMetaDataBuilder implements StateActionBuilder { /** The bean meta data */ protected AbstractBeanMetaData beanMetaData; public StateMetaDataBuilder(AbstractBeanMetaData beanMetaData) { this.beanMetaData = beanMetaData; } /** * Set lifecycle metadata to bean metadata. * * @param beanMetaData the bean metadata * @param lifecycle the lifecycle */ protected abstract void setLifecycle(AbstractBeanMetaData beanMetaData, T lifecycle); /** * Create lifecycle meta data. * * @return lifecycle metadata instance */ protected abstract T createLifecycleMetaData(); /** * Invoke after set. * * @param lifecycle the lifecycle */ protected abstract void applyAfterSet(T lifecycle); public T createStateActionMetaData(String methodInfo) { T lifecycle = createLifecycleMetaData(); if (methodInfo != null) { setMethodInfo(lifecycle, methodInfo); } setLifecycle(beanMetaData, lifecycle); applyAfterSet(lifecycle); return lifecycle; } /** * Set the method info. * * @param lifecycle the lifecycle * @param methodInfo the method info */ protected void setMethodInfo(T lifecycle, String methodInfo) { lifecycle.setMethodName(methodInfo); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002447211262376750033160 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.plugins.graph.SearchDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlAttribute; /** * Dependency value. * * @author Adrian Brock * @author Ales Justin * @author Radim Marek (obrien) * @version $Revision: 94371 $ */ @XmlType(name="injectionType") public class AbstractDependencyValueMetaData extends AbstractValueMetaData { private static final long serialVersionUID = 3L; /** * The context */ protected transient KernelControllerContext context; /** * The when required, keep it for optional handling */ protected transient ControllerState optionalWhenRequired; /** * The property name */ protected String property; /** * The when required state of the dependency or null to use current context state */ protected ControllerState whenRequiredState; /** * The required state of the dependency or null to look in the registry */ protected ControllerState dependentState; /** * The search type */ protected SearchInfo search = Search.DEFAULT; /** * Create a new dependency value */ public AbstractDependencyValueMetaData() { } /** * Create a new dependency value * * @param value the value */ public AbstractDependencyValueMetaData(Object value) { super(value); } /** * Create a new dependency value * * @param value the value * @param property the property */ public AbstractDependencyValueMetaData(Object value, String property) { super(value); this.property = property; } /** * Get the property * * @return the property */ public String getProperty() { return property; } /** * Set the property * * @param property the property name */ @XmlAttribute public void setProperty(String property) { this.property = property; } /** * Set the when required state of the dependency * * @param whenRequiredState the when required state or null if it uses current context state */ @XmlAttribute(name="whenRequired") public void setWhenRequiredState(ControllerState whenRequiredState) { this.whenRequiredState = whenRequiredState; flushJBossObjectCache(); } /** * Get when required state. * * @return the when required state */ public ControllerState getWhenRequiredState() { return whenRequiredState; } /** * Set the required state of the dependency * * @param dependentState the required state or null if it must be in the registry */ @XmlAttribute(name="state") public void setDependentState(ControllerState dependentState) { this.dependentState = dependentState; flushJBossObjectCache(); } /** * Get the required state of dependency. * * @return the required dependency state */ public ControllerState getDependentState() { return dependentState; } @XmlAttribute(name="bean") @JBossXmlAttribute(type=String.class) public void setValue(Object value) { super.setValue(value); } @XmlAnyElement @ManagementProperty(ignored = true) public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue(value); else setValue(new AbstractValueMetaData(value)); } /** * Set search type. * * @param search the search type */ @XmlAttribute(name = "search") public void setSearch(SearchInfo search) { this.search = search; } /** * Get search type. * * @return the search type */ public SearchInfo getSearch() { return search; } /** * Is search applied. * * @return true if search is applied */ protected boolean isSearchApplied() { return (search != Search.DEFAULT); } protected boolean isLookupValid(ControllerContext lookup) { return (lookup != null); } protected boolean isOptional() { return false; } /** * Add optional dependency. * * @param controller the controller * @param lookup the lookup context */ protected void addOptionalDependency(Controller controller, ControllerContext lookup) { OptionalDependencyItem dependency = new OptionalDependencyItem(context.getName(), optionalWhenRequired, lookup.getName(), lookup.getState(), search); context.getDependencyInfo().addIDependOn(dependency); lookup.getDependencyInfo().addDependsOnMe(dependency); } /** * Get controller context. * * @param name the name * @param state the state * @return the controller context */ protected ControllerContext getControllerContext(Object name, ControllerState state) { Controller controller = context.getController(); LookupStrategy strategy = search.getStrategy(); return strategy.getContext(controller, name, state); } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { ControllerState state = dependentState; if (state == null) state = ControllerState.INSTALLED; if (context == null) throw new IllegalStateException("No context for " + this); ControllerContext lookup = getControllerContext(getUnderlyingValue(), state); if (isLookupValid(lookup) == false) throw new Error("Should not be here - dependency failed - " + this); if (lookup == null) { return null; } else if (isOptional()) { Controller controller = context.getController(); addOptionalDependency(controller, lookup); } Object result; if (property != null && property.length() > 0) { if (lookup instanceof AttributeDispatchContext) { AttributeDispatchContext adc = (AttributeDispatchContext)lookup; result = adc.get(property); } else throw new IllegalArgumentException( "Cannot use property attribute, context is not AttributeDispatchContext: " + lookup + ", metadata: " + this); } else { result = lookup.getTarget(); } return info != null ? info.convertValue(result) : result; } protected boolean addDependencyItem() { return true; } public void initialVisit(MetaDataVisitor visitor) { if (search == null) throw new IllegalArgumentException("Null search"); context = visitor.getControllerContext(); ControllerState whenRequired = whenRequiredState; if (whenRequired == null) { whenRequired = visitor.getContextState(); } if (isOptional()) optionalWhenRequired = whenRequired; // used for sub class optional handling if (addDependencyItem()) { Object name = context.getName(); Object iDependOn = getUnderlyingValue(); DependencyItem item; if (isSearchApplied()) { item = new SearchDependencyItem(name, iDependOn, whenRequired, dependentState, search); } else { item = new AbstractDependencyItem(name, iDependOn, whenRequired, dependentState); } visitor.addDependency(item); } super.initialVisit(visitor); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); if (property != null) buffer.append(" property=").append(property); if (whenRequiredState != null) buffer.append(" whenRequiredState=").append(whenRequiredState.getStateString()); if (dependentState != null) buffer.append(" dependentState=").append(dependentState.getStateString()); if (isSearchApplied()) buffer.append(" search=").append(search); } public AbstractDependencyValueMetaData clone() { return (AbstractDependencyValueMetaData)super.clone(); } /** * Optional depedency item. */ protected static class OptionalDependencyItem extends SearchDependencyItem { public OptionalDependencyItem(Object name, ControllerState optionalWhenRequired, Object iDependOn, ControllerState dependentState, SearchInfo search) { super(name, iDependOn, optionalWhenRequired, dependentState, search); setResolved(true); } } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDemandMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002004211147522315033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Iterator; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.plugins.JMXObjectNameFix; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.api.dependency.MatcherFactory; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.util.HashCode; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * A demand. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 84514 $ */ @XmlType(name="demandsType") public class AbstractDemandMetaData extends JBossObject implements DemandMetaData, Serializable { private static final long serialVersionUID = 3L; /** The demand */ protected Object demand; /** When the dependency is required */ protected ControllerState whenRequired = ControllerState.DESCRIBED; /** The target/dependency state */ protected ControllerState targetState; /** The transformer */ protected String transformer; /** * Create a new demand */ public AbstractDemandMetaData() { } /** * Create a new demand * * @param demand the demand */ public AbstractDemandMetaData(Object demand) { this.demand = demand; } /** * Set the required state of the dependency * * @param whenRequired when the dependecy is required */ @XmlAttribute(name="state") public void setWhenRequired(ControllerState whenRequired) { this.whenRequired = whenRequired; flushJBossObjectCache(); } /** * Set the demand * * @param demand the demand */ @XmlValue public void setDemand(Object demand) { this.demand = demand; flushJBossObjectCache(); } /** * Set the target/dependency state. * * @param targetState the target state */ @XmlAttribute(name="targetState") public void setTargetState(ControllerState targetState) { this.targetState = targetState; } public Object getDemand() { return demand; } public ControllerState getWhenRequired() { return whenRequired; } public ControllerState getTargetState() { return targetState; } /** * Get the transformer class name. * * @return the transformer class name */ public String getTransformer() { return transformer; } /** * Set the transformer class name. * * @param transformer the transformer class name */ @XmlAttribute public void setTransformer(String transformer) { this.transformer = transformer; } public void initialVisit(MetaDataVisitor visitor) { String name = (String) getDemand(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty demand."); KernelControllerContext context = visitor.getControllerContext(); DependencyItem item = new DemandDependencyItem(context.getName()); visitor.addDependency(item); visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("demand=").append(demand); if (whenRequired != null) buffer.append(" whenRequired=").append(whenRequired.getStateString()); if (targetState != null) buffer.append(" targetState=").append(targetState.getStateString()); } public void toShortString(JBossStringBuilder buffer) { buffer.append(demand); } public boolean equals(Object obj) { if (obj instanceof AbstractDemandMetaData == false) return false; return equals(demand, ((AbstractDemandMetaData)obj).demand); } protected int getHashCode() { return HashCode.generate(demand); } /** * Information about a demand dependency. */ public class DemandDependencyItem extends AbstractDependencyItem { /** The matcher */ private Matcher matcher; /** Cached demand name */ private transient Object demandObject; /** * Create a new demand dependecy * * @param name my name */ public DemandDependencyItem(Object name) { super(name, null, whenRequired, null); if (getTransformer() != null) matcher = MatcherFactory.getInstance().createMatcher(getTransformer(), getDemand()); } /** * Get the demand or matcher if set. * * @return more exact demand object */ protected Object getDemandObject() { if (demandObject == null) { if (matcher == null) { Object fixup = JMXObjectNameFix.needsAnAlias(getDemand()); demandObject = (fixup != null) ? fixup : getDemand(); } else { demandObject = matcher; } } return demandObject; } public boolean resolve(Controller controller) { Object name = getDemandObject(); ControllerContext context; if (targetState == null) context = controller.getInstalledContext(name); else context = controller.getContext(name, targetState); if (context != null) { setIDependOn(context.getName()); addDependsOnMe(controller, context); setResolved(true); } else { setResolved(false); } return isResolved(); } @Override public void unresolved() { setIDependOn(null); setResolved(false); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" demand=").append(getDemandObject()); } public void toShortString(JBossStringBuilder buffer) { buffer.append(getName()).append(" demands ").append(getDemandObject()); } @Override public String toHumanReadableString() { StringBuilder builder = new StringBuilder(); builder.append("Demands '").append(getDemandObject()).append("'"); return builder.toString(); } } public AbstractDemandMetaData clone() { return (AbstractDemandMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/fa0000755000175000017500000000000011620312171033172 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/fa0000644000175000017500000000151410271236104033177 0ustar twernertwerner

Classes used to dynamically create beans.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactoryMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/fa0000644000175000017500000001706010770473134033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.factory; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.spi.config.KernelConfigurator; /** * GenericBeanFactoryMetaData. * * @deprecated see org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71060 $ */ @Deprecated public class GenericBeanFactoryMetaData extends AbstractBeanMetaData { private static final long serialVersionUID = 2L; /** * Create a new GenericBeanFactoryMetaData. */ public GenericBeanFactoryMetaData() { setBean(GenericBeanFactory.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); ArrayList parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(KernelConfigurator.class.getName(), new AbstractDependencyValueMetaData(KernelConstants.KERNEL_CONFIGURATOR_NAME))); constructor.setParameters(parameters); setConstructor(constructor); setProperties(new HashSet()); } /** * Create a new GenericBeanFactoryMetaData. * * @param name the name */ public GenericBeanFactoryMetaData(String name) { this(); setName(name); } /** * Create a new GenericBeanFactoryMetaData. * * @param name the name * @param bean the bean class name */ public GenericBeanFactoryMetaData(String name, String bean) { this(name); setBeanClass(bean); } /** * Get the class of the bean created * * @return the class */ public String getBeanClass() { AbstractPropertyMetaData prop = (AbstractPropertyMetaData) getProperty("bean"); if (prop != null) { AbstractValueMetaData value = (AbstractValueMetaData) prop.getValue(); if (value != null) return (String) value.getUnderlyingValue(); } return null; } /** * Set the class of the bean created * * @param beanClass the class */ public void setBeanClass(String beanClass) { Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("bean", new AbstractValueMetaData(beanClass))); } public void setClassLoader(ClassLoaderMetaData classLoader) { super.setClassLoader(classLoader); Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("classLoader", new AbstractValueMetaData(classLoader))); } public void setAccessMode(BeanAccessMode accessMode) { Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("accessMode", new AbstractValueMetaData(accessMode))); } /** * Set the bean constructor * * @param constructor the constructor */ public void setBeanConstructor(ConstructorMetaData constructor) { Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("constructor", new AbstractValueMetaData(constructor))); } /** * Get a bean property * * @param name the name * @return the value metadata */ public ValueMetaData getBeanProperty(String name) { if (name == null) throw new IllegalArgumentException("Null name"); PropertyMetaData properties = getProperty("properties"); if (properties == null) return null; AbstractMapMetaData map = (AbstractMapMetaData) properties.getValue(); for (Iterator> i = map.entrySet().iterator(); i.hasNext();) { Map.Entry entry = i.next(); ValueMetaData key = (ValueMetaData) entry.getKey(); if (key.getUnderlyingValue().equals(name)) { ValueMetaData vmd = (ValueMetaData) entry.getValue(); return (ValueMetaData) vmd.getUnderlyingValue(); } } return null; } /** * Add a bean property * * @param property the property */ public void addBeanProperty(PropertyMetaData property) { PropertyMetaData properties = getProperty("properties"); AbstractMapMetaData map; if (properties == null) { map = new AbstractMapMetaData(); properties = new AbstractPropertyMetaData("properties", map); addProperty(properties); } else { map = (AbstractMapMetaData) properties.getValue(); } ValueMetaData valueMetaData = property.getValue(); valueMetaData = new AbstractValueMetaData(valueMetaData); map.put(new AbstractValueMetaData(property.getName()), valueMetaData); } public void setBeanCreate(LifecycleMetaData lifecycle) { Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("create", new AbstractValueMetaData(lifecycle))); } public void setBeanStart(LifecycleMetaData lifecycle) { Set properties = getProperties(); properties.add(new AbstractPropertyMetaData("start", new AbstractValueMetaData(lifecycle))); } /** * Set the bean factory class. * * Note: this class param must either extend GenericBeanFactory * or have the same constructor and properties aka 'callbacks'. * * @param factoryClass the factory class */ public void setFactoryClass(String factoryClass) { setBean(factoryClass); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/factory/GenericBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/fa0000644000175000017500000001600011137570512033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins.factory; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import java.util.Map; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.factory.AbstractBeanFactory; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.logging.Logger; /** * Bean factory metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 83467 $ */ public class GenericBeanFactory extends AbstractBeanFactory implements KernelControllerContextAware { /** The log */ private static final Logger log = Logger.getLogger(GenericBeanFactory.class); /** Our context */ protected KernelControllerContext context; /** * Create a new generic bean factory * * @param configurator the configurator */ public GenericBeanFactory(KernelConfigurator configurator) { super(configurator); } /** * Create a new bean * * @return the bean * @throws Throwable for any error */ public Object createBean() throws Throwable { final ClassLoader cl = getControllerContextClassLoader(); AccessControlContext acc = getAccessControlContext(); if (acc == null || System.getSecurityManager() == null) return createBean(cl); try { return AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { try { return createBean(cl); } catch (Error e) { throw e; } catch (Exception e) { throw e; } catch (Throwable t) { throw new RuntimeException("Error creating bean", t); } } }, acc); } catch (PrivilegedActionException e) { throw e.getCause(); } } public void setKernelControllerContext(KernelControllerContext context) throws Exception { this.context = context; } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { this.context = null; } /** * Get the classloader from the controller context * * @return the controller context * @throws Throwable for any error */ private ClassLoader getControllerContextClassLoader() throws Throwable { if (context != null) { if (System.getSecurityManager() == null) { try { return context.getClassLoader(); } catch (Throwable t) { log.trace("Unable to retrieve classloader from " + context); return null; } } return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { try { return context.getClassLoader(); } catch (Throwable t) { log.trace("Unable to retrieve classloader from " + context); return null; } } }); } return null; } /** * Get the access control context from the controller context * * @return the access control * @throws Throwable for any error */ private AccessControlContext getAccessControlContext() throws Throwable { if (context != null) { // TODO: JBMICROCONT-386, introduce interface if (context instanceof AbstractKernelControllerContext == false) return null; final AbstractKernelControllerContext akcc = (AbstractKernelControllerContext) context; if (System.getSecurityManager() == null) return akcc.getAccessControlContext(); return AccessController.doPrivileged(new PrivilegedAction() { public AccessControlContext run() { return akcc.getAccessControlContext(); } }); } return null; } /** * Create a new bean * * @param cl the classloader to use * @return the bean * @throws Throwable for any error */ protected Object createBean(ClassLoader cl) throws Throwable { ClassLoader loader = cl; if (loader == null) loader = Configurator.getClassLoader(classLoader); BeanInfo info = null; if (bean != null) info = configurator.getBeanInfo(bean, loader, accessMode); Joinpoint joinpoint = configurator.getConstructorJoinPoint(info, constructor, null); Object result = joinpoint.dispatch(); if (info == null && result != null) info = configurator.getBeanInfo(result.getClass(), accessMode); if (properties != null && properties.size() > 0) { for (Map.Entry entry : properties.entrySet()) { String property = entry.getKey(); ValueMetaData vmd = entry.getValue(); PropertyInfo pi = info.getProperty(property); pi.set(result, vmd.getValue(pi.getType(), loader)); } } invokeLifecycle("create", create, info, loader, result); invokeLifecycle("start", start, info, loader, result); return result; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractCallbackMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001550411305760441033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.plugins.dependency.CallbackDependencyItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.MethodInfo; import org.jboss.util.JBossStringBuilder; /** * Metadata for callback. * * @author Ales Justin */ public abstract class AbstractCallbackMetaData extends AbstractLifecycleMetaData implements CallbackMetaData, Serializable { private static final long serialVersionUID = 2L; /** The cardinality */ protected Cardinality cardinality; /** The property name */ protected String property; /** The required state of the dependency */ protected ControllerState dependentState = ControllerState.INSTALLED; /** The signature */ protected String signature; /** The property info */ protected transient PropertyInfo propertyInfo; /** The method info */ protected transient MethodInfo methodInfo; public AbstractCallbackMetaData() { setState(ControllerState.INSTALLED); } public String getProperty() { return property; } /** * Set the property. * * @param property property name */ @XmlAttribute public void setProperty(String property) { this.property = property; flushJBossObjectCache(); } public Cardinality getCardinality() { return cardinality; } /** * Set the cardinality. * * @param cardinality the cardinality */ @XmlAttribute public void setCardinality(Cardinality cardinality) { this.cardinality = cardinality; flushJBossObjectCache(); } public String getSignature() { return signature; } /** * Set the signature. * * @param signature method / property parameter signature */ @XmlAttribute public void setSignature(String signature) { this.signature = signature; flushJBossObjectCache(); } /** * Set the required state of the dependency * * @param dependentState the required state or null if it must be in the registry */ @XmlAttribute(name="state") public void setDependentState(ControllerState dependentState) { this.dependentState = dependentState; flushJBossObjectCache(); } public ControllerState getDependentState() { return dependentState; } @XmlTransient public void setPropertyInfo(PropertyInfo propertyInfo) { this.propertyInfo = propertyInfo; this.property = propertyInfo.getName(); } @XmlTransient public void setMethodInfo(MethodInfo methodInfo) { this.methodInfo = methodInfo; this.methodName = methodInfo.getName(); } /** * Add install / uninstrall callback. * * @param visitor the meta data visitor * @param callback the callback item */ protected abstract void addCallback(MetaDataVisitor visitor, CallbackItem callback); public void describeVisit(MetaDataVisitor visitor) { ControllerState whenRequired = getState(); try { KernelControllerContext context = visitor.getControllerContext(); CallbackItem callback; if (property != null) { if (propertyInfo == null) { ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData()); propertyInfo = Configurator.resolveProperty(log.isTraceEnabled(), context.getBeanInfo(), cl, property, signature); } callback = CallbackCreatorUtil.createCallback(context, propertyInfo, whenRequired, dependentState, cardinality); } else if (methodName != null) { if (methodInfo == null) methodInfo = Configurator.findMethodInfo(getClassInfo(context), methodName, new String[]{signature}); callback = CallbackCreatorUtil.createCallback(context, methodInfo, whenRequired, dependentState, cardinality); } else throw new IllegalArgumentException("Illegal usage - not property or method:" + this); // add callback addCallback(visitor, callback); // demand name is Class in this case if (cardinality != null) { visitor.addDependency(new CallbackDependencyItem(context.getName(), (Class)callback.getIDependOn(), whenRequired, dependentState, cardinality)); } } catch (Throwable t) { throw new Error(t); } super.describeVisit(visitor); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); if (property != null) buffer.append(" property=").append(property); if (cardinality != null) buffer.append(" cardinality=").append(cardinality); if (signature != null) buffer.append(" signature=").append(signature); if (ControllerState.INSTALLED.equals(dependentState) == false) buffer.append(" dependentState=" + dependentState); } public void toShortString(JBossStringBuilder buffer) { if (property != null) buffer.append("property=").append(property); if (methodName != null) buffer.append("method=").append(methodName); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/ValueMetaDataAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Va0000644000175000017500000000271110556376303033173 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Simple ValueMetaData aware. * * @author Ales Justin */ public interface ValueMetaDataAware { /** * Get the value. * * @return the value. */ ValueMetaData getValue(); /** * Set the value. * * @param value the value */ void setValue(ValueMetaData value); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/ThisValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Th0000644000175000017500000000556210776707200033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.reflect.spi.TypeInfo; import org.jboss.xb.annotations.JBossXmlNoElements; /** * Dependency value. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71794 $ */ @XmlType @JBossXmlNoElements public class ThisValueMetaData extends AbstractValueMetaData { private static final long serialVersionUID = 3L; /** The context */ protected transient ControllerContext context; /** * Create a new dependency value */ public ThisValueMetaData() { } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { Controller controller = context.getController(); ControllerContext context = controller.getContext(getUnderlyingValue(), ControllerState.INSTANTIATED); if (context == null) throw new Error("Could not deference this " + this); // TODO - add progression, see BeanMetaData, InjectionMetaData return context.getTarget(); } public void initialVisit(MetaDataVisitor visitor) { context = visitor.getControllerContext(); setValue(context.getName()); ControllerState whenRequired = visitor.getContextState(); DependencyItem item = new AbstractDependencyItem(getUnderlyingValue(), getUnderlyingValue(), whenRequired, ControllerState.INSTANTIATED); visitor.addDependency(item); super.initialVisit(visitor); } public ThisValueMetaData clone() { return (ThisValueMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/pa0000644000175000017500000000153310150404616033213 0ustar twernertwerner

Classes used to deploy beans, an abstract implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInstallMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001274311301240473033140 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.ClassInfo; import org.jboss.util.JBossStringBuilder; /** * Metadata for installation. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 96562 $ */ @XmlType(name="installType", propOrder={"annotations", "parameters"}) public class AbstractInstallMetaData extends AbstractLifecycleMetaData implements InstallMetaData, Serializable { private static final long serialVersionUID = 2L; /** The bean name */ protected String bean; /** The required state of the dependency or null to look in the registry */ protected ControllerState dependentState = ControllerState.INSTALLED; /** * Create a new install meta data */ public AbstractInstallMetaData() { setState(ControllerState.INSTALLED); } public String getBean() { return bean; } /** * Set the bean * * @param bean the bean */ @XmlAttribute public void setBean(String bean) { this.bean = bean; } /** * Set the required state of the dependency * * @param dependentState the required state or null if it must be in the registry */ @XmlAttribute(name="state") public void setDependentState(ControllerState dependentState) { this.dependentState = dependentState; flushJBossObjectCache(); } public ControllerState getDependentState() { return dependentState; } public void initialVisit(MetaDataVisitor visitor) { if (getMethodName() == null) throw new IllegalArgumentException("Install/uninstall should have method attribute."); KernelControllerContext context = visitor.getControllerContext(); if (bean != null) { DependencyItem item = new InstallationDependencyItem(context.getName(), bean, state, dependentState); visitor.addDependency(item); } super.initialVisit(visitor); } protected ClassInfo getClassInfo(KernelControllerContext context) throws Throwable { if (bean != null) { KernelController controller = (KernelController) context.getController(); ControllerContext beanContext = controller.getContext(bean, ControllerState.INSTANTIATED); if (beanContext != null) { KernelConfigurator configurator = controller.getKernel().getConfigurator(); Object target = beanContext.getTarget(); return configurator.getClassInfo(target.getClass()); } else { throw new IllegalArgumentException("Cannot determine install bean class: " + this); } } return super.getClassInfo(context); } public void toString(JBossStringBuilder buffer) { if (bean != null) buffer.append("bean=").append(bean); if (ControllerState.INSTALLED.equals(dependentState) == false) buffer.append(" dependentState=" + dependentState); buffer.append(" "); super.toString(buffer); } public void toShortString(JBossStringBuilder buffer) { if (bean != null) { buffer.append(bean).append("."); } if (methodName != null) buffer.append(methodName); } /** * An InstallationDependencyItem. */ public static class InstallationDependencyItem extends AbstractDependencyItem { /** * Create a new InstallationDependencyItem. * * @param name the name * @param bean the bean class * @param state the state of the bean * @param dependentState the state of the dependency */ public InstallationDependencyItem(Object name, String bean, ControllerState state, ControllerState dependentState) { super(name, bean, state, dependentState); } } public AbstractInstallMetaData clone() { return (AbstractInstallMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/InstallCallbackMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/In0000644000175000017500000000376211173362527033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.dependency.spi.CallbackItem; /** * Metadata for install callback. * * @author Ales Justin * @author Adrian Brock */ @XmlType(name="installCallbackType", propOrder={"annotations", "parameters"}) public class InstallCallbackMetaData extends AbstractCallbackMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 2L; public InstallCallbackMetaData() { super(); } @SuppressWarnings("unchecked") protected void addCallback(MetaDataVisitor visitor, CallbackItem callback) { visitor.addInstallCallback(callback); } public InstallCallbackMetaData clone() { InstallCallbackMetaData clone = (InstallCallbackMetaData)super.clone(); doClone(clone); return clone; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/NestedBeanHandler.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ne0000644000175000017500000001732711262376750033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.logging.Logger; /** * Handle nested beans util class. * Hidding the impl details from AbstractBeanMetaData * * @author Ales Justin */ public class NestedBeanHandler { private static Logger log = Logger.getLogger(NestedBeanHandler.class); protected BeanMetaData root; protected int counter; public NestedBeanHandler(BeanMetaData root) { this.root = root; } /** * Check for nested beans. * * @return list of bean meta data */ public List checkForNestedBeans() { List nestedBeans = findNestedBeans(); if (nestedBeans.isEmpty()) { return Collections.singletonList(prepareRoot(root)); } else { BeanMetaData clone = (BeanMetaData)root.clone(); List pairs = new ArrayList(); addPairs(clone, pairs); List result = new ArrayList(); for (Pair pair : pairs) { MetaDataVisitorNode previous = pair.getPrevious(); BeanMetaData bean = pair.getBean(); if (bean.getName() == null) bean.setName(generateName(previous)); replaceWithInjection(previous, bean); result.add(bean); } result.add(prepareRoot(clone)); return result; } } /** * Prepare root. * * Could be overriden to prehaps * allow null name on the root as well. * * @param bean the root bean or its clone * @return root */ protected BeanMetaData prepareRoot(BeanMetaData bean) { return bean; } /** * Fins the nested beans. * * @return list of nested beans */ private List findNestedBeans() { List allBeans = new ArrayList(); addBeans(root, allBeans); return allBeans; } /** * Add all nested beans to the list. * * @param current the current meta data visitor node child * @param list the nested beans list */ private void addBeans(MetaDataVisitorNode current, List list) { for (Iterator children = current.getChildren(); children != null && children.hasNext();) { MetaDataVisitorNode next = children.next(); addBeans(next, list); if (next instanceof BeanMetaData) { list.add((BeanMetaData)next); } } } /** * Add all nested beans to the list. * * @param current the current meta data visitor node child * @param list the nested beans pair list */ private void addPairs(MetaDataVisitorNode current, List list) { for (Iterator children = current.getChildren(); children != null && children.hasNext();) { MetaDataVisitorNode next = children.next(); addPairs(next, list); if (next instanceof BeanMetaData) { BeanMetaData bean = (BeanMetaData)next; list.add(new Pair(current, bean)); } } } /** * Generate the name. * * @param previous the previous / parent node * @return generated name */ protected String generateName(MetaDataVisitorNode previous) { ++counter; String name; if (previous instanceof PropertyMetaData) { PropertyMetaData pmd = (PropertyMetaData)previous; name = root.getName() + "$" + pmd.getName() + "#" + counter; } else { name = root.getName() + "#" + counter; } return name; } /** * Replace bean with injection. * * @param previous the previous / parent node * @param bean the bean to replace */ private static void replaceWithInjection(MetaDataVisitorNode previous, BeanMetaData bean) { ValueMetaData injection = new AbstractDependencyValueMetaData(bean.getName()); if (previous instanceof ValueMetaDataAware) { ValueMetaDataAware vmda = (ValueMetaDataAware)previous; vmda.setValue(injection); } else if (previous instanceof AbstractClassLoaderMetaData) { AbstractClassLoaderMetaData aclmd = (AbstractClassLoaderMetaData)previous; aclmd.setClassLoader(injection); } else if (previous instanceof AbstractListMetaData) { AbstractListMetaData almd = (AbstractListMetaData)previous; int index = almd.indexOf(bean); almd.remove(index); almd.add(index, injection); } else if (previous instanceof AbstractCollectionMetaData) { AbstractCollectionMetaData acmd = (AbstractCollectionMetaData)previous; acmd.remove(bean); acmd.add(injection); } else if (previous instanceof AbstractMapMetaData) { AbstractMapMetaData ammd = (AbstractMapMetaData)previous; for (Map.Entry entry : ammd.entrySet()) { MetaDataVisitorNode key = entry.getKey(); MetaDataVisitorNode value = entry.getValue(); if (key.equals(bean)) { ammd.remove(key); ammd.put(injection, value); } if (value.equals(bean)) { ammd.put(key, injection); } } } else if (previous instanceof AbstractValueMetaData) { AbstractValueMetaData avmd = (AbstractValueMetaData)previous; avmd.setValue(injection); } else { log.warn("Unknown previous type to do injection replacement: " + previous); } } /** * Simple pair class. */ private static class Pair { private MetaDataVisitorNode previous; private BeanMetaData bean; private Pair(MetaDataVisitorNode previous, BeanMetaData bean) { this.previous = previous; this.bean = bean; } public MetaDataVisitorNode getPrevious() { return previous; } public BeanMetaData getBean() { return bean; } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractCollectionMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001611411301240473033134 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlChild; import org.jboss.xb.annotations.JBossXmlChildWildcard; import org.jboss.xb.annotations.JBossXmlChildren; import org.jboss.xb.annotations.JBossXmlNoElements; /** * Collection metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 96562 $ */ @XmlType(name="collectionType") @JBossXmlNoElements @JBossXmlChildren ({ @JBossXmlChild(name="bean", type=AbstractBeanMetaData.class), @JBossXmlChild(name="array", type=AbstractArrayMetaData.class), @JBossXmlChild(name="collection", type=AbstractCollectionMetaData.class), @JBossXmlChild(name="inject", type=AbstractInjectionValueMetaData.class), @JBossXmlChild(name="list", type=AbstractListMetaData.class), @JBossXmlChild(name="map", type=AbstractMapMetaData.class), @JBossXmlChild(name="null", type=AbstractValueMetaData.class), @JBossXmlChild(name="set", type=AbstractSetMetaData.class), @JBossXmlChild(name="this", type=ThisValueMetaData.class), @JBossXmlChild(name="value", type=StringValueMetaData.class), @JBossXmlChild(name="value-factory", type=AbstractValueFactoryMetaData.class) }) @JBossXmlChildWildcard(wrapper=AbstractValueMetaData.class, property="value") public class AbstractCollectionMetaData extends AbstractTypeMetaData implements Collection, Serializable { private static final long serialVersionUID = 2L; /** The collection */ protected ArrayList collection = new ArrayList(); /** The element type */ protected String elementType; /** * Create a new collection value */ public AbstractCollectionMetaData() { } /** * Get the element type * * @return the element type */ public String getElementType() { return elementType; } /** * Set the element type * * @param elementType the element type */ @XmlAttribute(name="elementClass") public void setElementType(String elementType) { this.elementType = elementType; } @SuppressWarnings("unchecked") public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { Collection result = getTypeInstance(info, cl, Collection.class); TypeInfo elementTypeInfo = getElementClassInfo(cl, info); for (int i = 0; i < collection.size(); ++i) { ValueMetaData vmd = (ValueMetaData) collection.get(i); Object value = vmd.getValue(elementTypeInfo, cl); try { result.add(value); } catch (UnsupportedOperationException e) { if (i != 0) throw e; result = getTypeInstance(info, cl, Collection.class, false); result.add(value); } } return result; } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (elementType != null) { return getClass(visitor, elementType); } return super.getType(visitor, previous); } public boolean add(MetaDataVisitorNode o) { return collection.add(o); } public boolean addAll(Collection c) { return collection.addAll(c); } public void clear() { collection.clear(); } public boolean contains(Object o) { return collection.contains(o); } public boolean containsAll(Collection c) { return collection.containsAll(c); } @XmlTransient public boolean isEmpty() { return collection.isEmpty(); } public Iterator iterator() { return collection.iterator(); } public boolean remove(Object o) { return collection.remove(o); } public boolean removeAll(Collection c) { return collection.removeAll(c); } public boolean retainAll(Collection c) { return collection.retainAll(c); } public int size() { return collection.size(); } public Object[] toArray() { return collection.toArray(); } public T[] toArray(T[] a) { return collection.toArray(a); } public Iterator getChildren() { return collection.iterator(); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" collection="); JBossObject.list(buffer, collection); } /** * Create the default collection instance * * @return the class instance */ protected Collection getDefaultInstance() { return new ArrayList(); } /** * Get the class info for the element type * * @param cl the classloader * @param info the type info * @return the class info * @throws Throwable for any error */ protected TypeInfo getElementClassInfo(ClassLoader cl, TypeInfo info) throws Throwable { if (elementType != null) return configurator.getClassInfo(elementType, cl); // null is excluded if (info instanceof ClassInfo) { ClassInfo classInfo = (ClassInfo)info; return classInfo.getComponentType(); } return null; } @SuppressWarnings("unchecked") public AbstractCollectionMetaData clone() { AbstractCollectionMetaData clone = (AbstractCollectionMetaData)super.clone(); clone.collection = (ArrayList) CloneUtil.cloneList(collection, ArrayList.class, MetaDataVisitorNode.class); return clone; } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractSupplyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001132310776707200033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.beans.PropertyEditor; import java.io.Serializable; import java.util.Iterator; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.bind.annotation.XmlAttribute; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.logging.Logger; import org.jboss.util.HashCode; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.propertyeditor.PropertyEditors; /** * A supply. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71794 $ */ @XmlType(name="supplyType") public class AbstractSupplyMetaData extends JBossObject implements SupplyMetaData, Serializable { private static final long serialVersionUID = 2L; private static Logger log = Logger.getLogger(AbstractSupplyMetaData.class); static { try { PropertyEditors.init(); } catch (Throwable t) { log.debug("Unable to initialise property editors", t); } } /** The supply */ protected Object supply; /** The type */ protected String type; /** * Create a new supply */ public AbstractSupplyMetaData() { } /** * Create a new supply * * @param supply the supply */ public AbstractSupplyMetaData(Object supply) { this.supply = supply; } /** * Set the supply * * @param supply the supply */ @XmlValue public void setSupply(Object supply) { this.supply = supply; flushJBossObjectCache(); } /** * Get the class type. * * @return the class type */ public String getType() { return type; } /** * Set the class type * * @param type the type */ @XmlAttribute(name="class") public void setType(String type) { this.type = type; } public Object getSupply() { if (supply instanceof String && type != null) { PropertyEditor editor = getPropertyEditor(); editor.setAsText((String)supply); return editor.getValue(); } return supply; } protected PropertyEditor getPropertyEditor() { try { return PropertyEditors.getEditor(type); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } public void initialVisit(MetaDataVisitor visitor) { Object supply = getSupply(); if (supply == null || supply.toString().length() == 0) throw new IllegalArgumentException("Null or empty supply."); visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("supply=").append(supply); if (type != null) buffer.append(" class=").append(type); } public void toShortString(JBossStringBuilder buffer) { buffer.append(supply); } public boolean equals(Object obj) { if (obj instanceof AbstractSupplyMetaData == false) return false; return equals(supply, ((AbstractSupplyMetaData)obj).supply) && equals(type, ((AbstractSupplyMetaData)obj).type); } protected int getHashCode() { return HashCode.generate(supply); } public AbstractSupplyMetaData clone() { return (AbstractSupplyMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractParameterMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002073211050031647033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Set; import java.util.Stack; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; /** * Metadata for a parameter. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 76911 $ */ @XmlType(name="parameterType", propOrder={"annotations", "value"}) public class AbstractParameterMetaData extends AbstractFeatureMetaData implements ParameterMetaData, ValueMetaDataAware, Serializable { private static final long serialVersionUID = 2L; /** * The parameter type */ protected String type; /** * The parameter value */ protected ValueMetaData value; /** * The index in parameter list */ protected int index; /** Whether to replace */ protected Boolean replace; /** Whether to trim */ protected Boolean trim; /** * Create a new parameter meta data */ public AbstractParameterMetaData() { } /** * Create a new parameter meta data * * @param value the value */ public AbstractParameterMetaData(Object value) { this.type = value.getClass().getName(); this.value = new AbstractValueMetaData(value); } /** * Create a new parameter meta data * * @param value the value metadata */ public AbstractParameterMetaData(ValueMetaData value) { this.value = value; } /** * Create a new parameter meta data * * @param type the type * @param value the value */ public AbstractParameterMetaData(String type, Object value) { this.type = type; this.value = new AbstractValueMetaData(value); } /** * Create a new parameter meta data * * @param type the type * @param value the string value */ public AbstractParameterMetaData(String type, String value) { this.type = type; this.value = new StringValueMetaData(value); } /** * Create a new parameter meta data * * @param type the type * @param value the value meta data */ public AbstractParameterMetaData(String type, ValueMetaData value) { this.type = type; this.value = value; } public String getType() { return type; } @XmlAttribute(name="class") public void setType(String type) { this.type = type; flushJBossObjectCache(); } public ValueMetaData getValue() { return value; } public int getIndex() { return index; } public void setIndex(int index) { this.index = index; } @XmlElements ({ @XmlElement(name="array", type=AbstractArrayMetaData.class), @XmlElement(name="collection", type=AbstractCollectionMetaData.class), @XmlElement(name="inject", type=AbstractInjectionValueMetaData.class), @XmlElement(name="search", type= AbstractSearchValueMetaData.class), @XmlElement(name="list", type=AbstractListMetaData.class), @XmlElement(name="map", type=AbstractMapMetaData.class), @XmlElement(name="null", type=AbstractValueMetaData.class), @XmlElement(name="set", type=AbstractSetMetaData.class), @XmlElement(name="this", type=ThisValueMetaData.class), @XmlElement(name="value", type=StringValueMetaData.class), @XmlElement(name="value-factory", type=AbstractValueFactoryMetaData.class) }) public void setValue(ValueMetaData value) { this.value = value; flushJBossObjectCache(); } @XmlAnyElement @ManagementProperty(ignored = true) public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue((ValueMetaData) value); else setValue(new AbstractValueMetaData(value)); } @XmlValue @ManagementProperty(ignored = true) public void setValueString(String value) { if (value == null) setValue(null); else { StringValueMetaData stringValue = new StringValueMetaData(value); stringValue.setType(getType()); setValue(stringValue); } } @XmlAttribute(name="replace") @ManagementProperty(ignored = true) public void setPropertyReplace(boolean replace) { this.replace = replace; } @XmlAttribute(name="trim") @ManagementProperty(ignored = true) public void setPropertyTrim(boolean trim) { this.trim = trim; } @Override public void initialVisit(MetaDataVisitor visitor) { ValueMetaData vmd = getValue(); if (vmd != null && vmd instanceof StringValueMetaData) { StringValueMetaData svmd = (StringValueMetaData) vmd; if (replace != null) svmd.setReplace(replace); if (trim != null) svmd.setTrim(trim); } super.initialVisit(visitor); } protected void addChildren(Set children) { super.addChildren(children); if (value != null) children.add(value); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (type != null) { KernelControllerContext context = visitor.getControllerContext(); ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData()); KernelController controller = (KernelController) context.getController(); KernelConfigurator configurator = controller.getKernel().getConfigurator(); return applyCollectionOrMapCheck(configurator.getClassInfo(type, cl)); } else { Stack visitorNodeStack = visitor.visitorNodeStack(); // see AbstractInjectionValueMetaData.describeVisit MetaDataVisitorNode node = visitorNodeStack.pop(); try { if (node instanceof TypeProvider) { TypeProvider typeProvider = (TypeProvider) node; return typeProvider.getType(visitor, this); } else { throw new IllegalArgumentException(TypeProvider.ERROR_MSG); } } finally { visitorNodeStack.push(node); } } } public void toString(JBossStringBuilder buffer) { buffer.append("type=").append(type); buffer.append(" value=").append(value); super.toString(buffer); } public void toShortString(JBossStringBuilder buffer) { buffer.append(type); } public AbstractParameterMetaData clone() { AbstractParameterMetaData clone = (AbstractParameterMetaData)super.clone(); doClone(clone); clone.setValue(CloneUtil.cloneObject(value, ValueMetaData.class)); return clone; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractInjectionValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002637611301242575033154 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.model.InjectOption; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.plugins.AttributeCallbackItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.plugins.dependency.SearchClassContextDependencyItem; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; /** * Injection value. * * @author Ales Justin */ @XmlType public class AbstractInjectionValueMetaData extends AbstractDependencyValueMetaData { private static final long serialVersionUID = 3L; protected AutowireType injectionType = AutowireType.BY_CLASS; protected InjectOption injectionOption = InjectOption.STRICT; protected FromContext fromContext; /** * Simplyifies things with AutowireType.BY_NAME */ protected AbstractPropertyMetaData propertyMetaData; /** * Create a new injection value */ public AbstractInjectionValueMetaData() { } /** * Create a new injection value * * @param value the value */ public AbstractInjectionValueMetaData(Object value) { super(value); } /** * Create a new injection value * * @param value the value * @param property the property */ public AbstractInjectionValueMetaData(Object value, String property) { super(value, property); } public AutowireType getInjectionType() { return injectionType; } @XmlAttribute(name="type") public void setInjectionType(AutowireType injectionType) { this.injectionType = injectionType; } public InjectOption getInjectionOption() { return injectionOption; } @XmlAttribute(name="option") public void setInjectionOption(InjectOption injectionOption) { this.injectionOption = injectionOption; } public FromContext getFromContext() { return fromContext; } @XmlAttribute(name="fromContext") public void setFromContext(FromContext fromContext) { this.fromContext = fromContext; } public AbstractPropertyMetaData getPropertyMetaData() { return propertyMetaData; } @XmlTransient public void setPropertyMetaData(AbstractPropertyMetaData propertyMetaData) { this.propertyMetaData = propertyMetaData; } /** * Add install/callback item. * * @param name the callback name */ protected void addInstallItem(Object name) { if (propertyMetaData == null) throw new IllegalArgumentException("Illegal usage of option Callback - injection not used with property = " + this); context.getDependencyInfo().addInstallItem(new AttributeCallbackItem(name, whenRequiredState, dependentState, context, propertyMetaData.getName())); } protected boolean isLookupValid(ControllerContext lookup) { boolean lookupExists = super.isLookupValid(lookup); boolean isCallback = InjectOption.CALLBACK.equals(injectionOption); boolean isOptional = InjectOption.OPTIONAL.equals(injectionOption); if (lookupExists == false && isCallback) { addInstallItem(getUnderlyingValue()); } return lookupExists || isCallback || isOptional; } protected boolean isOptional() { return InjectOption.OPTIONAL.equals(injectionOption); } @SuppressWarnings({"deprecation"}) public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { // controller context property injection if (fromContext != null) { ControllerState state = dependentState; if (state == null) state = ControllerState.INSTANTIATED; ControllerContext lookup = getControllerContext(getUnderlyingValue(), state); if (lookup == null) throw new Error("Should not be here - dependency failed - " + this); return fromContext.executeLookup(lookup); } // by class type if (getUnderlyingValue() == null) { ControllerContext lookup = getControllerContext(info.getType(), ControllerState.INSTALLED); if (lookup == null) { if (InjectOption.STRICT.equals(injectionOption)) { throw new IllegalArgumentException("Possible multiple matching beans, see log for info."); } else { if (InjectOption.CALLBACK.equals(injectionOption)) addInstallItem(info.getType()); return null; } } // TODO - add progression here, then fix BeanMetaData as well return lookup.getTarget(); } return super.getValue(info, cl); } protected boolean addDependencyItem() { return InjectOption.STRICT.equals(injectionOption) || fromContext != null; } @XmlTransient public Object getUnderlyingValue() { Object original = super.getUnderlyingValue(); // might be used for internal compare, in that case context will still be null return (fromContext != null && original == null) ? (context != null ? context.getName() : null) : original; } public void initialVisit(MetaDataVisitor visitor) { // controller context property injection if (fromContext != null) { // check if dependent is not set when used on itself if (super.getUnderlyingValue() == null && dependentState == null) { dependentState = fromContext.getWhenValid(); } super.initialVisit(visitor); return; } // no bean specified if (getUnderlyingValue() == null) { // check for property if (property != null) { property = null; log.warn("Ignoring property - contextual injection: " + this); } if (AutowireType.BY_NAME.equals(injectionType)) { if (propertyMetaData == null) throw new IllegalArgumentException("Illegal usage of type ByName - injection not used with property = " + this); setValue(propertyMetaData.getName()); } else { visitor.initialVisit(this); } } // check if was maybe set with by_name if (getUnderlyingValue() != null) { super.initialVisit(visitor); } } @SuppressWarnings("deprecation") public void describeVisit(MetaDataVisitor visitor) { // no bean and not by_name if (getUnderlyingValue() == null) { if (AutowireType.BY_CLASS.equals(injectionType)) { context = visitor.getControllerContext(); // dependency item or install item if (InjectOption.STRICT.equals(injectionOption)) { // add dependency item only for strict inject behaviour // we pop it so that parent node has the same semantics as this one // meaning that his current peek is also his parent // and all other nodes that cannot determine type follow the same // contract - popping and pushing // maybe the whole thing can be rewritten to LinkedList // or simply using the fact that Stack is also a Vector? MetaDataVisitorNode node = visitor.visitorNodeStack().pop(); try { if (node instanceof TypeProvider) { TypeProvider typeProvider = (TypeProvider)node; Class injectionClass = typeProvider.getType(visitor, this).getType(); log.debug(context.getName() + ": Contextual injection usage (class -> classloader): " + injectionClass + " -> " + SecurityActions.getClassLoader(injectionClass) + " defined by " + node); // set when required ControllerState whenRequired = whenRequiredState; if (whenRequired == null) { whenRequired = visitor.getContextState(); } DependencyItem item = new SearchClassContextDependencyItem( context.getName(), injectionClass, whenRequired, dependentState, search); visitor.addDependency(item); } else { throw new Error(TypeProvider.ERROR_MSG); } } catch (Error error) { throw error; } catch (Throwable throwable) { throw new Error(throwable); } finally { visitor.visitorNodeStack().push(node); } } } else { throw new IllegalArgumentException("Unknown injection type=" + injectionType); } } super.describeVisit(visitor); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); if (injectionType != null) buffer.append(" injectionType=").append(injectionType); if (propertyMetaData != null) buffer.append(" propertyMetaData=").append(propertyMetaData.getName()); //else overflow - indefinite recursion if (fromContext != null) buffer.append(" fromContext=").append(fromContext); } public AbstractInjectionValueMetaData clone() { return (AbstractInjectionValueMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractSearchValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001334711147522315033147 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.plugins.graph.Search; import org.jboss.dependency.plugins.graph.SearchDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; import org.jboss.dependency.spi.graph.GraphController; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlAttribute; /** * Search value metadata. * * @deprecated use * @author Ales Justin */ @Deprecated @XmlType(name="searchType") public class AbstractSearchValueMetaData extends AbstractValueMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 1L; private ControllerState state; private SearchInfo search; private String property; private ControllerContext context; // Used in JBossXB public AbstractSearchValueMetaData() { } public AbstractSearchValueMetaData(Object value, ControllerState state, SearchInfo search, String property) { super(value); if (search == null) throw new IllegalArgumentException("Null search type"); this.state = state; this.search = search; this.property = property; } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { // we're here, so it must be GraphController instance Controller controller = context.getController(); GraphController gc = (GraphController)controller; ControllerState dependentState = state; if (dependentState == null) dependentState = ControllerState.INSTALLED; ControllerContext context = gc.getContext(getUnderlyingValue(), dependentState, search); Object result; if (property != null && property.length() > 0) { if (context instanceof AttributeDispatchContext) { AttributeDispatchContext adc = (AttributeDispatchContext)context; result = adc.get(property); } else throw new IllegalArgumentException( "Cannot use property attribute, context is not AttributeDispatchContext: " + context + ", metadata: " + this); } else { result = context.getTarget(); } return info != null ? info.convertValue(result) : result; } public void initialVisit(MetaDataVisitor visitor) { context = visitor.getControllerContext(); super.initialVisit(visitor); } public void describeVisit(MetaDataVisitor visitor) { Object name = context.getName(); Object iDependOn = getUnderlyingValue(); ControllerState whenRequired = visitor.getContextState(); ControllerState dependentState = state; if (dependentState == null) dependentState = ControllerState.INSTALLED; DependencyItem item = new SearchDependencyItem(name, iDependOn, whenRequired, dependentState, search); visitor.addDependency(item); super.describeVisit(visitor); } @XmlAttribute(name="bean") @JBossXmlAttribute(type=String.class) public void setValue(Object value) { super.setValue(value); } @XmlAnyElement @ManagementProperty(ignored = true) public void setValueObject(Object value) { if (value == null) setValue(null); else if (value instanceof ValueMetaData) setValue(value); else setValue(new AbstractValueMetaData(value)); } @XmlAttribute public void setState(ControllerState state) { this.state = state; } @XmlAttribute(name = "type") public void setSearch(Search search) { this.search = search; } @XmlAttribute public void setProperty(String property) { this.property = property; } public void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append("search=").append(search); } public void toShortString(JBossStringBuilder buffer) { super.toShortString(buffer); buffer.append("search=").append(search); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractAnnotationMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001265211054742724033152 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.lang.annotation.Annotation; import java.util.Iterator; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.annotation.factory.AnnotationCreator; import org.jboss.annotation.factory.ast.TokenMgrError; import org.jboss.beans.metadata.spi.CachingAnnotationMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.StringPropertyReplacer; /** * Metadata for an annotation. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 77476 $ */ @XmlType(name="annotationType", propOrder={"annotation"}) public class AbstractAnnotationMetaData extends JBossObject implements CachingAnnotationMetaData, Serializable { private static final long serialVersionUID = 2L; public String annotation; private Annotation ann; private boolean replace = true; /** * Create a new annotation meta data */ public AbstractAnnotationMetaData() { super(); } public AbstractAnnotationMetaData(String annotation) { this.annotation = annotation; } public String getAnnotation() { if (annotation == null) throw new IllegalArgumentException("Null string annotation value, illegal xml form?"); return annotation; } @XmlValue public void setAnnotation(String annotation) { this.annotation = annotation; flushJBossObjectCache(); } public boolean isReplace() { return replace; } @XmlAttribute(name="replace") public void setReplace(boolean replace) { this.replace = replace; } @XmlTransient public Annotation getAnnotationInstance() { return getAnnotationInstance(null); } public Annotation getAnnotationInstance(ClassLoader cl) { if (ann != null) return ann; String annString = getAnnotation(); try { if (replace) { annString = StringPropertyReplacer.replaceProperties(annString); } if (cl == null) { cl = Thread.currentThread().getContextClassLoader(); } ann = (Annotation)AnnotationCreator.createAnnotation(annString, cl); flushJBossObjectCache(); } catch(TokenMgrError e) { throw new RuntimeException("Error creating annotation for " + annotation, e); } catch (Throwable e) { throw new RuntimeException("Error creating annotation for " + annotation, e); } return ann; } public Annotation removeAnnotation() { Annotation result = ann; ann = null; flushJBossObjectCache(); return result; } public void initialVisit(MetaDataVisitor visitor) { String ann = getAnnotation().trim(); if (ann.length() == 0) throw new IllegalArgumentException("Empty annotation content"); if (ann.startsWith("@") == false) throw new IllegalArgumentException("Annotation content must be a fully qualified annotation type name prefixed with '@'"); visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("expr="); toShortString(buffer); } public void toShortString(JBossStringBuilder buffer) { if (ann == null) buffer.append(annotation); else buffer.append(ann); } protected int getHashCode() { return getAnnotation().hashCode(); } public boolean equals(Object object) { if (object == null || object instanceof AbstractAnnotationMetaData == false) return false; AbstractAnnotationMetaData amd = (AbstractAnnotationMetaData)object; // this is what we probably want? - never saw duplicate annotation on a bean/prop/... return (replace == amd.replace) && getAnnotation().equals(amd.getAnnotation()); } public AbstractAnnotationMetaData clone() { return (AbstractAnnotationMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractLazyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001252111201770651033137 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.HashSet; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.LazyMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.xb.annotations.JBossXmlSchema; /** * Lazy metadata. * * @author Ales Justin */ @JBossXmlSchema(namespace="urn:jboss:bean-deployer:2.0", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="lazy") @XmlType(name="lazyType", propOrder={"interfaces"}) public class AbstractLazyMetaData extends AbstractBeanMetaData implements LazyMetaData { private static final long serialVersionUID = 2L; private String beanName; private boolean exposeClass; private Set interfaces; private String factoryClassName; public AbstractLazyMetaData() { setAutowireCandidate(false); setFactoryClassName("org.jboss.kernel.spi.lazy.LazyProxyFactory"); } public AbstractLazyMetaData(String beanName) { this(); this.beanName = beanName; setName(beanName + "Proxy"); } public Object getUnderlyingValue() { return beanName; } public void initialVisit(MetaDataVisitor vistor) { if (beanName == null) throw new IllegalArgumentException("Null bean name."); KernelController controller = (KernelController)vistor.getControllerContext().getController(); Kernel kernel = controller.getKernel(); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(factoryClassName); constructor.setFactoryMethod("getProxy"); List parameters = new ArrayList(); parameters.add(new AbstractParameterMetaData(kernel)); parameters.add(new AbstractParameterMetaData(beanName)); parameters.add(new AbstractParameterMetaData(Boolean.TYPE.getName(), exposeClass)); parameters.add(new AbstractParameterMetaData(new AbstractValueMetaData(interfaces))); constructor.setParameters(parameters); setConstructor(constructor); // we just need the original bean to be present --> Not_Installed state vistor.addDependency(new AbstractDependencyItem(getName(), beanName, ControllerState.INSTANTIATED, ControllerState.NOT_INSTALLED)); super.initialVisit(vistor); } public Iterator getChildren() { return null; } public List getBeans() { return Collections.singletonList((BeanMetaData)this); } protected void setFactoryClassName(String factoryClassName) { this.factoryClassName = factoryClassName; } public String getBeanName() { return beanName; } @XmlAttribute(name="bean") public void setBeanName(String beanName) { this.beanName = beanName; if (getName() == null) setName(beanName + "Proxy"); } public boolean isExposeClass() { return exposeClass; } @XmlAttribute(name="exposeClass") public void setExposeClass(boolean exposeClass) { this.exposeClass = exposeClass; } public Set getInterfaces() { return interfaces; } @XmlElement(name="interface", type=String.class) public void setInterfaces(Set interfaces) { this.interfaces = interfaces; } public AbstractLazyMetaData clone() { AbstractLazyMetaData clone = (AbstractLazyMetaData)super.clone(); if (interfaces != null) clone.setInterfaces(new HashSet(interfaces)); return clone; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractBeanMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000006163411301240473033143 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import static org.jboss.beans.metadata.plugins.CloneUtil.cloneList; import static org.jboss.beans.metadata.plugins.CloneUtil.cloneObject; import static org.jboss.beans.metadata.plugins.CloneUtil.cloneSet; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.managed.api.annotation.ManagementObject; import org.jboss.managed.api.annotation.ManagementProperties; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Metadata for a bean. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 96562 $ */ @ManagementObject(properties = ManagementProperties.EXPLICIT) // TODO - explicitly add props we want to manage @XmlRootElement(name="bean") @XmlType(name="beanType", propOrder={"aliasMetaData", "related", "annotations", "classLoader", "constructor", "properties", "create", "start", "stop", "destroy", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class AbstractBeanMetaData extends AbstractFeatureMetaData implements BeanMetaData, BeanMetaDataFactory, MutableLifecycleHolder, Serializable { private static final long serialVersionUID = 4L; /** The bean fully qualified class name */ protected String bean; /** The name of this instance */ protected String name; /** The related */ protected Set related; /** The aliases */ protected Set aliases; /** The alias metadata */ protected Set aliasMetaData; /** The parent */ protected String parent; /** Is abstract */ protected boolean isAbstract; /** Autowire type */ protected AutowireType autowireType; /** The mode */ protected ControllerMode mode; /** The error handling mode */ protected ErrorHandlingMode errorHandlingMode; /** The access mode */ protected BeanAccessMode accessMode; /** Is contextual injection candidate */ protected boolean autowireCandidate = true; /** The properties configuration Set */ private Set properties; /** The bean ClassLoader */ protected ClassLoaderMetaData classLoader; /** The constructor */ protected ConstructorMetaData constructor; /** The create lifecycle */ protected LifecycleMetaData create; /** The start lifecycle */ protected LifecycleMetaData start; /** The stop lifecycle */ protected LifecycleMetaData stop; /** The destroy lifecycle */ protected LifecycleMetaData destroy; /** What the bean demands Set */ protected Set demands; /** What the bean supplies Set */ protected Set supplies; /** What the bean dependencies Set */ protected Set depends; /** The install operations List */ protected List installs; /** The uninstall operations List */ protected List uninstalls; /** The install callback List */ protected List installCallbacks; /** The uninstall callback List */ protected List uninstallCallbacks; /** The context */ protected transient ControllerContext context; /** * Create a new bean meta data */ public AbstractBeanMetaData() { super(); } /** * Create a new bean meta data * * @param bean the bean class name */ public AbstractBeanMetaData(String bean) { this.bean = bean; } /** * Create a new bean meta data * * @param name the name * @param bean the bean class name */ public AbstractBeanMetaData(String name, String bean) { this.name = name; this.bean = bean; } public List getBeans() { NestedBeanHandler handler = createNestedBeanHandler(); return handler.checkForNestedBeans(); } /** * Create nested bean handler. * Can be overridden to change generateName policy. * * @return nested bean handler */ protected NestedBeanHandler createNestedBeanHandler() { return new NestedBeanHandler(this); } /** * Get the bean class name. * @return the fully qualified bean class name. */ public String getBean() { return bean; } /** * Set the bean class name and flush the object cache. * * @param bean The bean class name to set. */ @XmlAttribute(name="class") public void setBean(String bean) { this.bean = bean; flushJBossObjectCache(); } /** * Get a property * * @param name the name * @return the property name */ public PropertyMetaData getProperty(String name) { if (name == null) throw new IllegalArgumentException("Null name"); if (properties != null && properties.size() > 0) { for (PropertyMetaData prop : properties) { if (name.equals(prop.getName())) return prop; } } return null; } /** * Add a property * * @param property the property */ public void addProperty(PropertyMetaData property) { if (property == null) throw new IllegalArgumentException("Null property"); if (properties == null) properties = new HashSet(); properties.add(property); flushJBossObjectCache(); } /** * Set the propertiess. * * @param properties Set */ @ManagementProperty(managed=true) // TODO - this ok? @XmlElement(name="property", type=AbstractPropertyMetaData.class) public void setProperties(Set properties) { this.properties = properties; flushJBossObjectCache(); } public ClassLoaderMetaData getClassLoader() { return classLoader; } @XmlElement(name="classloader", type=AbstractClassLoaderMetaData.class) public void setClassLoader(ClassLoaderMetaData classLoader) { this.classLoader = classLoader; } /** * Set the constructor * * @param constructor the constructor metadata */ @XmlElement(name="constructor", type=AbstractConstructorMetaData.class) public void setConstructor(ConstructorMetaData constructor) { this.constructor = constructor; } /** * Set what the bean demands. * * @param demands Set */ @XmlElement(name="demand", type=AbstractDemandMetaData.class) public void setDemands(Set demands) { this.demands = demands; flushJBossObjectCache(); } /** * Set what the bean supplies. * * @param supplies Set */ @XmlElement(name="supply", type=AbstractSupplyMetaData.class) public void setSupplies(Set supplies) { this.supplies = supplies; flushJBossObjectCache(); } /** * Set what the bean depends. * * @param depends Set */ @XmlElement(name="depends", type=AbstractDependencyMetaData.class) public void setDepends(Set depends) { this.depends = depends; flushJBossObjectCache(); } public String getName() { return name; } /** * Set the name. * * @param name The name to set. */ @XmlAttribute public void setName(String name) { this.name = name; flushJBossObjectCache(); } public Set getRelated() { return related; } @XmlElement(name="related-class", type=AbstractRelatedClassMetaData.class) public void setRelated(Set related) { this.related = related; } public Set getAliases() { return aliases; } @XmlTransient public void setAliases(Set aliases) { this.aliases = aliases; } public Set getAliasMetaData() { return aliasMetaData; } @XmlElement(name="alias", type=AbstractAliasMetaData.class) public void setAliasMetaData(Set aliases) { this.aliasMetaData = aliases; } public String getParent() { return parent; } /** * Set the parent. * * @param parent the parent name */ @XmlAttribute public void setParent(String parent) { this.parent = parent; } public boolean isAbstract() { return isAbstract; } /** * Set abstract. * * @param anAbstract is abstract */ @XmlAttribute public void setAbstract(boolean anAbstract) { isAbstract = anAbstract; } public AutowireType getAutowireType() { return autowireType; } /** * Set autowire type. * * @param autowireType the type */ @XmlAttribute(name="autowire-type") public void setAutowireType(AutowireType autowireType) { this.autowireType = autowireType; } public ControllerMode getMode() { return mode; } @XmlAttribute public void setMode(ControllerMode mode) { this.mode = mode; flushJBossObjectCache(); } public ErrorHandlingMode getErrorHandlingMode() { return errorHandlingMode; } @XmlAttribute(name="error-handling") public void setErrorHandlingMode(ErrorHandlingMode errorHandlingMode) { this.errorHandlingMode = errorHandlingMode; } public BeanAccessMode getAccessMode() { return accessMode; } @XmlAttribute(name="access-mode") public void setAccessMode(BeanAccessMode accessMode) { this.accessMode = accessMode; } public boolean isAutowireCandidate() { return autowireCandidate; } @XmlAttribute(name="autowire-candidate") public void setAutowireCandidate(boolean autowireCandidate) { this.autowireCandidate = autowireCandidate; } public Set getProperties() { return properties; } public ConstructorMetaData getConstructor() { return constructor; } public LifecycleMetaData getCreate() { return create; } /** * Set the lifecycle metadata * * @param lifecycle the lifecycle metadata */ @XmlElement(name="create", type=AbstractLifecycleMetaData.class) public void setCreate(LifecycleMetaData lifecycle) { if (lifecycle != null) lifecycle.setState(ControllerState.CREATE); this.create = lifecycle; } public LifecycleMetaData getStart() { return start; } /** * Set the start metadata * * @param lifecycle the lifecycle metadata */ @XmlElement(name="start", type=AbstractLifecycleMetaData.class) public void setStart(LifecycleMetaData lifecycle) { if (lifecycle != null) lifecycle.setState(ControllerState.START); this.start = lifecycle; } public LifecycleMetaData getStop() { return stop; } /** * Set the stop metadata * * @param lifecycle the lifecycle metadata */ @XmlElement(name="stop", type=AbstractLifecycleMetaData.class) public void setStop(LifecycleMetaData lifecycle) { if (lifecycle != null) lifecycle.setState(ControllerState.START); this.stop = lifecycle; } public LifecycleMetaData getDestroy() { return destroy; } /** * Set the destroy metadata * * @param lifecycle the lifecycle metadata */ @XmlElement(name="destroy", type=AbstractLifecycleMetaData.class) public void setDestroy(LifecycleMetaData lifecycle) { if (lifecycle != null) lifecycle.setState(ControllerState.CREATE); this.destroy = lifecycle; } public Set getDemands() { return demands; } public Set getSupplies() { return supplies; } public Set getDepends() { return depends; } public List getInstalls() { return installs; } /** * Set the installs * * @param installs List */ @XmlElement(name="install", type=AbstractInstallMetaData.class) public void setInstalls(List installs) { this.installs = installs; flushJBossObjectCache(); } public List getUninstalls() { return uninstalls; } /** * Set the uninstalls * * @param uninstalls List */ @XmlElement(name="uninstall", type=AbstractInstallMetaData.class) public void setUninstalls(List uninstalls) { this.uninstalls = uninstalls; flushJBossObjectCache(); } public List getInstallCallbacks() { return installCallbacks; } @XmlElement(name="incallback", type=InstallCallbackMetaData.class) public void setInstallCallbacks(List installCallbacks) { this.installCallbacks = installCallbacks; flushJBossObjectCache(); } public List getUninstallCallbacks() { return uninstallCallbacks; } @XmlElement(name="uncallback", type=UninstallCallbackMetaData.class) public void setUninstallCallbacks(List uninstallCallbacks) { this.uninstallCallbacks = uninstallCallbacks; flushJBossObjectCache(); } public void initialVisit(MetaDataVisitor visitor) { ConstructorMetaData constructor = getConstructor(); if (getBean() == null) { if (isAbstract() == false && getParent() == null) { if (constructor == null) throw new IllegalArgumentException("Bean should have a class attribute or a constructor element."); if (constructor.getFactoryMethod() == null) { if (constructor.getValue() == null) throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have either a factoryMethod attribute or embedded value."); } else if (constructor.getFactory() == null && constructor.getFactoryClass() == null) throw new IllegalArgumentException("Bean should have a class attribute or the constructor element should have one of a factoryClass attribute or a factory element, or embedded value."); } } else { checkConstructorFactoryClass(constructor); } KernelControllerContext ctx = visitor.getControllerContext(); if (ctx.getBeanMetaData() == this) context = ctx; boolean isInnerBean = visitor.visitorNodeStack().isEmpty() == false; if (isInnerBean) { Object name = ctx.getName(); Object iDependOn = getUnderlyingValue(); ControllerState whenRequired = visitor.getContextState(); DependencyItem di = new AbstractDependencyItem(name, iDependOn, whenRequired, ControllerState.INSTALLED); visitor.addDependency(di); } if (create != null && create.getMethodName() == null) create.setMethodName("create"); if (start != null && start.getMethodName() == null) start.setMethodName("start"); if (stop != null && stop.getMethodName() == null) stop.setMethodName("stop"); if (destroy != null && destroy.getMethodName() == null) destroy.setMethodName("destroy"); super.initialVisit(visitor); } /** * Check constructor factory class. * * @param constructor the constructor meta data */ protected void checkConstructorFactoryClass(ConstructorMetaData constructor) { if (constructor == null) return; if (constructor.getFactoryMethod() == null) return; if (constructor.getFactoryClass() != null) return; if (constructor.getValue() != null) return; if (constructor.getFactory() != null) return; if (constructor instanceof AbstractConstructorMetaData == false) return; AbstractConstructorMetaData acmd = AbstractConstructorMetaData.class.cast(constructor); acmd.setFactoryClass(getBean()); } protected void addChildren(Set children) { super.addChildren(children); if (classLoader != null && classLoader.getClassLoader() != this) children.add(classLoader); if (constructor != null) children.add(constructor); if (properties != null) children.addAll(properties); if (create != null) children.add(create); if (start != null) children.add(start); if (stop != null) children.add(stop); if (destroy != null) children.add(destroy); if (demands != null) children.addAll(demands); if (supplies != null) children.addAll(supplies); if (depends != null) children.addAll(depends); if (installs != null) children.addAll(installs); if (uninstalls != null) children.addAll(uninstalls); if (installCallbacks != null) children.addAll(installCallbacks); if (uninstallCallbacks != null) children.addAll(uninstallCallbacks); if (aliasMetaData != null) children.addAll(aliasMetaData); if (related != null) children.addAll(related); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { throw new IllegalArgumentException("Cannot determine inject class type: " + this); } public Object getUnderlyingValue() { return name; } @SuppressWarnings({"deprecation"}) public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { if (context == null) throw new IllegalStateException("Context has not been set: " + this); Controller controller = context.getController(); ControllerContext lookup = controller.getInstalledContext(name); if (lookup == null || lookup.getTarget() == null) { // possible call for classloader if (info == null && classLoader != null && classLoader.getClassLoader() == this) { return cl; } throw new IllegalArgumentException("Bean not yet installed: " + name); } Object target = lookup.getTarget(); // TODO - add progression here as well? if (info != null && info.getType().isAssignableFrom(target.getClass()) == false) { throw new ClassCastException(target + " is not a " + info); } return target; } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); if (aliases != null) buffer.append(" aliases=").append(aliases); buffer.append(" bean=").append(bean); buffer.append(" properties="); JBossObject.list(buffer, properties); if (classLoader != null && classLoader.getClassLoader() != this) buffer.append(" classLoader=").append(classLoader); buffer.append(" constructor=").append(constructor); buffer.append(" autowireCandidate=").append(autowireCandidate); if (create != null) buffer.append(" create=").append(create); if (start != null) buffer.append(" start=").append(start); if (stop != null) buffer.append(" stop=").append(stop); if (destroy != null) buffer.append(" destroy=").append(destroy); if (demands != null) { buffer.append(" demands="); JBossObject.list(buffer, demands); } super.toString(buffer); if (supplies != null) { buffer.append(" supplies="); JBossObject.list(buffer, supplies); } if (depends != null) { buffer.append(" depends="); JBossObject.list(buffer, depends); } if (installs != null) { buffer.append(" installs="); JBossObject.list(buffer, installs); } if (uninstalls != null) { buffer.append(" uninstalls="); JBossObject.list(buffer, uninstalls); } if (installCallbacks != null) { buffer.append(" installCallbacks="); JBossObject.list(buffer, installCallbacks); } if (uninstallCallbacks != null) { buffer.append(" uninstallCallbacks="); JBossObject.list(buffer, uninstallCallbacks); } if (aliasMetaData != null) { buffer.append(" aliasMetaData="); JBossObject.list(buffer, aliasMetaData); } if (related != null) { buffer.append(" related="); JBossObject.list(buffer, related); } } public void toShortString(JBossStringBuilder buffer) { buffer.append(bean); buffer.append('/'); buffer.append(name); } public AbstractBeanMetaData clone() { AbstractBeanMetaData clone = (AbstractBeanMetaData)super.clone(); doClone(clone); return clone; } @SuppressWarnings("unchecked") protected void doClone(AbstractBeanMetaData clone) { super.doClone(clone); if (aliases != null) clone.setAliases(new HashSet(aliases)); clone.setAliasMetaData(cloneSet(aliasMetaData, HashSet.class, AliasMetaData.class)); clone.setRelated(cloneSet(related, HashSet.class, RelatedClassMetaData.class)); clone.setClassLoader(cloneObject(classLoader, ClassLoaderMetaData.class)); clone.setConstructor(cloneObject(constructor, ConstructorMetaData.class)); clone.setCreate(cloneObject(create, LifecycleMetaData.class)); clone.setDemands(cloneSet(demands, HashSet.class, DemandMetaData.class)); clone.setDepends(cloneSet(depends, HashSet.class, DependencyMetaData.class)); clone.setDestroy(cloneObject(destroy, LifecycleMetaData.class)); clone.setInstallCallbacks(cloneList(installCallbacks, ArrayList.class, CallbackMetaData.class)); clone.setInstalls(cloneList(installs, ArrayList.class, InstallMetaData.class)); clone.setProperties(cloneSet(properties, HashSet.class, PropertyMetaData.class)); clone.setStart(cloneObject(start, LifecycleMetaData.class)); clone.setStop(cloneObject(stop, LifecycleMetaData.class)); clone.setSupplies(cloneSet(supplies, HashSet.class, SupplyMetaData.class)); clone.setUninstallCallbacks(cloneList(uninstallCallbacks, ArrayList.class, CallbackMetaData.class)); clone.setUninstalls(cloneList(uninstalls, ArrayList.class, InstallMetaData.class)); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/StringValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/St0000644000175000017500000001120511173362527033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.logging.Logger; import org.jboss.reflect.spi.TypeInfo; /** * String value. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 87640 $ */ @XmlType(name="plainValueType") public class StringValueMetaData extends AbstractTypeMetaData { private static final long serialVersionUID = 2L; /** The log */ private static final Logger log = Logger.getLogger(StringValueMetaData.class); /** * Do we replace String with System property, * by default it is true. */ private boolean replace = true; /** * Do we trim string value before usage, * by default is true. */ private boolean trim = true; /** * Create a new string value */ public StringValueMetaData() { } /** * Create a new string value * * @param value the value */ public StringValueMetaData(String value) { super(value); } @Override protected boolean isUseJMXObjectNameFix() { return false; } @Override public String getValue() { return (String) super.getValue(); } /** * Set the value * * @param value the value */ @XmlValue public void setValue(String value) { super.setValue(value); } public void setValue(Object value) { if (value != null && value instanceof String == false) throw new ClassCastException("value is not a String: " + value); super.setValue(value); } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("getValue value=" + getUnderlyingValue() + " type=" + type + " info=" + info); TypeInfo typeInfo = getTypeInfo(cl); if (typeInfo == null) typeInfo = info; if (typeInfo == null) throw new IllegalArgumentException("Unable to determine type for value: " + getUnderlyingValue()); // We need to set the context classloader // because some property editors use the context classloader ClassLoader oldCl = SecurityActions.setContextClassLoader(cl); try { // we convert it with more precise type // and then check for progression, ... if (typeInfo != info && info != null) { Object typeValue = typeInfo.convertValue(getUnderlyingValue()); return info.convertValue(typeValue, replace, trim); } return typeInfo.convertValue(getUnderlyingValue(), replace, trim); } finally { SecurityActions.resetContextClassLoader(oldCl); } } protected Object getDefaultInstance() { return null; } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (getType() != null) { return getClass(visitor, getType()); } return super.getType(visitor, previous); } public boolean isReplace() { return replace; } @XmlAttribute(name="replace") public void setReplace(boolean replace) { this.replace = replace; } public boolean isTrim() { return trim; } @XmlAttribute(name="trim") public void setTrim(boolean trim) { this.trim = trim; } public StringValueMetaData clone() { return (StringValueMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/MutableLifecycleHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Mu0000644000175000017500000000353610737443143033212 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import org.jboss.beans.metadata.spi.LifecycleMetaData; /** * Lifecycle metadata holder. * * @author Ales Justin */ public interface MutableLifecycleHolder { /** * Set create lifecycle metadata. * * @param create the lifecycle meta data */ void setCreate(LifecycleMetaData create); /** * Set start lifecycle metadata. * * @param start the lifecycle meta data */ void setStart(LifecycleMetaData start); /** * Set stop lifecycle metadata. * * @param stop the lifecycle meta data */ void setStop(LifecycleMetaData stop); /** * Set destroy lifecycle metadata. * * @param destroy the lifecycle meta data */ void setDestroy(LifecycleMetaData destroy); } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractTypeMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000002560511042077173033150 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Stack; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossStringBuilder; import org.jboss.joinpoint.spi.Joinpoint; /** * A typed value. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 76173 $ */ public abstract class AbstractTypeMetaData extends AbstractValueMetaData implements Serializable { private static final long serialVersionUID = 3L; /** * The type */ protected String type; /** * The context */ protected transient ControllerContext context; /** * The configurator */ protected transient KernelConfigurator configurator; /** * The property name */ protected String propertyName; /** * The bean name */ protected String beanName; /** * Create a new typed value */ public AbstractTypeMetaData() { } /** * Create a new typed value * * @param value the value */ public AbstractTypeMetaData(String value) { super(value); } /** * Set the type * * @param type the type */ @XmlAttribute(name="class") public void setType(String type) { this.type = type; } public String getType() { return type; } public void initialVisit(MetaDataVisitor visitor) { context = visitor.getControllerContext(); configurator = visitor.getControllerContext().getKernel().getConfigurator(); preparePreinstantiatedLookup(visitor); visitor.initialVisit(this); } /** * Check if we can extract the information about * existing instance - only on property metadata. * * @param visitor underlying visitor */ protected void preparePreinstantiatedLookup(MetaDataVisitor visitor) { Stack visitorNodes = visitor.visitorNodeStack(); // pop it so that we can get to grand parent for more info MetaDataVisitorNode parent = visitorNodes.pop(); try { if (parent instanceof PropertyMetaData) { PropertyMetaData pmd = (PropertyMetaData)parent; if (pmd.isPreInstantiate()) { propertyName = pmd.getName(); Object gp = visitorNodes.peek(); if (gp instanceof BeanMetaData) { BeanMetaData bmd = (BeanMetaData)gp; beanName = bmd.getName(); } } } } finally { visitorNodes.push(parent); } } /** * Check for already existing instances. * * @param expected type * @param cl the classloader * @param expected the expected class * @return existing instance or null otherwise */ protected T preinstantiatedLookup(ClassLoader cl, Class expected) { if (propertyName != null && beanName != null) { Object result = null; try { Controller controller = context.getController(); ControllerContext context = controller.getContext(beanName, ControllerState.INSTANTIATED); if (context != null && context instanceof AttributeDispatchContext) { Object target = context.getTarget(); if (target != null) { BeanInfo beanInfo = configurator.getBeanInfo(target.getClass()); PropertyInfo pi = beanInfo.getProperty(propertyName); if (pi.isReadable()) { result = pi.get(target); } } } } catch (Throwable t) { log.warn("Exception in preinstantiated lookup for: " + beanName + "." + propertyName + ", " + t); } return checkResult(result, expected); } return null; } /** * Check result for class compatibility. * * @param the expected type * @param result the result * @param expected expected class * @return casted result * @throws ClassCastException if result cannot be casted into expected parameter */ protected T checkResult(Object result, Class expected) { if (result != null && expected.isAssignableFrom(result.getClass()) == false) throw new ClassCastException(result.getClass() + " is not a " + expected.getName()); return expected.cast(result); } /** * Create new instance from type field. * Fall back to info parameter if no type field is set. * * @param expected type * @param info the type of reference we are about to set * @param cl the classloader to use * @param expected the expected class * @param explicit is type explicit * @return class instance or null if type is too broad * @throws Throwable on any error */ protected T createInstance(TypeInfo info, ClassLoader cl, Class expected, boolean explicit) throws Throwable { if (info == null || Object.class.getName().equals(info.getName())) return null; if (info instanceof ClassInfo == false) { if (explicit) throw new IllegalArgumentException(info.getName() + " is not a class"); else return null; } if (((ClassInfo) info).isInterface()) { if (explicit) throw new IllegalArgumentException(info.getName() + " is an interface"); else return null; } BeanInfo beanInfo = configurator.getBeanInfo(info); Joinpoint constructor = configurator.getConstructorJoinPoint(beanInfo); Object result = constructor.dispatch(); if (expected.isAssignableFrom(result.getClass()) == false) throw new ClassCastException(result.getClass() + " is not a " + expected.getName()); return expected.cast(result); } /** * Create the class instance * * @param expected type * @param info the request type * @param cl the classloader * @param expected the expected class * @return the class instance * @throws Throwable for any error */ protected T getTypeInstance(TypeInfo info, ClassLoader cl, Class expected) throws Throwable { return getTypeInstance(info, cl, expected, true); } /** * Create the class instance * * @param expected type * @param info the request type * @param cl the classloader * @param expected the expected class * @param preInstantiatedLookup whether to do the preinstantiated lookup * @return the class instance * @throws Throwable for any error */ protected T getTypeInstance(TypeInfo info, ClassLoader cl, Class expected, boolean preInstantiatedLookup) throws Throwable { T result = null; TypeInfo typeInfo = getClassInfo(cl); // we have explicitly set type if (typeInfo != null) result = createInstance(typeInfo, cl, expected, true); if (result == null) { if (preInstantiatedLookup) result = preinstantiatedLookup(cl, expected); // try info param if (result == null) { result = createInstance(info, cl, expected, false); // get default if (result == null) result = expected.cast(getDefaultInstance()); } } return result; } /** * Get the default instance. * * @return the default instance */ protected abstract Object getDefaultInstance(); /** * Set the configurator * * @param configurator the configurator */ @XmlTransient public void setConfigurator(KernelConfigurator configurator) { this.configurator = configurator; } public void toString(JBossStringBuilder buffer) { super.toString(buffer); if (type != null) buffer.append(" type=").append(type); } /** * Get the class info for this type * * @param cl classloader * @return the class info * @throws Throwable for any error */ protected ClassInfo getClassInfo(ClassLoader cl) throws Throwable { return getClassInfo(type, cl); } protected ClassInfo getClassInfo(String classType, ClassLoader cl) throws Throwable { if (classType == null) return null; return configurator.getClassInfo(classType, cl); } /** * Get the type info for this type * * @param cl classloader * @return the type info * @throws Throwable for any error */ protected TypeInfo getTypeInfo(ClassLoader cl) throws Throwable { return getTypeInfo(type, cl); } protected TypeInfo getTypeInfo(String classType, ClassLoader cl) throws Throwable { if (classType == null) return null; return configurator.getTypeInfo(classType, cl); } protected ClassInfo getClass(MetaDataVisitor visitor, String classType) throws Throwable { KernelControllerContext context = visitor.getControllerContext(); ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData()); return getClassInfo(classType, cl); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractSetMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000666310776707200033157 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Collection; import java.util.HashSet; import java.util.Set; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.xb.annotations.JBossXmlChild; import org.jboss.xb.annotations.JBossXmlChildWildcard; import org.jboss.xb.annotations.JBossXmlChildren; import org.jboss.xb.annotations.JBossXmlNoElements; /** * Set metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71794 $ */ @XmlType(name="setType") @JBossXmlNoElements @JBossXmlChildren ({ @JBossXmlChild(name="bean", type=AbstractBeanMetaData.class), @JBossXmlChild(name="array", type=AbstractArrayMetaData.class), @JBossXmlChild(name="collection", type=AbstractCollectionMetaData.class), @JBossXmlChild(name="inject", type=AbstractInjectionValueMetaData.class), @JBossXmlChild(name="list", type=AbstractListMetaData.class), @JBossXmlChild(name="map", type=AbstractMapMetaData.class), @JBossXmlChild(name="null", type=AbstractValueMetaData.class), @JBossXmlChild(name="set", type=AbstractSetMetaData.class), @JBossXmlChild(name="this", type=ThisValueMetaData.class), @JBossXmlChild(name="value", type=StringValueMetaData.class), @JBossXmlChild(name="value-factory", type=AbstractValueFactoryMetaData.class) }) @JBossXmlChildWildcard(wrapper=AbstractValueMetaData.class, property="value") public class AbstractSetMetaData extends AbstractCollectionMetaData implements Set, Serializable { private static final long serialVersionUID = 2L; /** * Create a new set value */ public AbstractSetMetaData() { } public boolean add(MetaDataVisitorNode o) { if (collection.contains(o)) return false; return super.add(o); } public boolean addAll(Collection c) { boolean changed = false; if (c != null && c.size() > 0) { for (MetaDataVisitorNode o : c) { if (collection.contains(o) == false) { if (super.add(o)) changed = true; } } } return changed; } protected Set getDefaultInstance() { return new HashSet(); } public AbstractSetMetaData clone() { return (AbstractSetMetaData)super.clone(); } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractMapMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001655511173362527033161 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.xb.annotations.JBossXmlMapEntry; /** * Map metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 87640 $ */ @XmlType(name="mapType") @JBossXmlMapEntry(name = "entry", type = MapEntry.class) public class AbstractMapMetaData extends AbstractTypeMetaData implements Map, Serializable { private static final long serialVersionUID = 2L; /** The map */ private Map map = new HashMap(); /** The key type */ protected String keyType; /** The value type */ protected String valueType; /** * Create a new map value */ public AbstractMapMetaData() { } /** * Get the key type * * @return the key type */ public String getKeyType() { return keyType; } /** * Set the key type * * @param keyType the key type */ @XmlAttribute(name="keyClass") public void setKeyType(String keyType) { this.keyType = keyType; } /** * Get the value type * * @return the value type */ public String getValueType() { return valueType; } /** * Set the value type * * @param valueType the value type */ @XmlAttribute(name="valueClass") public void setValueType(String valueType) { this.valueType = valueType; } @SuppressWarnings("unchecked") public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { Map result = getTypeInstance(info, cl, getExpectedClass()); TypeInfo keyTypeInfo = getKeyClassInfo(cl); TypeInfo valueTypeInfo = getValueClassInfo(cl); if (map.size() > 0) { boolean first = true; for (Iterator i = map.entrySet().iterator(); i.hasNext();) { Map.Entry entry = (Map.Entry) i.next(); ValueMetaData key = (ValueMetaData) entry.getKey(); ValueMetaData value = (ValueMetaData) entry.getValue(); Object keyValue = key.getValue(keyTypeInfo, cl); Object valueValue = value.getValue(valueTypeInfo, cl); try { result.put(keyValue, valueValue); } catch (UnsupportedOperationException e) { if (first == false) throw e; result = getTypeInstance(info, cl, getExpectedClass(), false); result.put(keyValue, valueValue); } first = false; } } return result; } public void clear() { map.clear(); } public boolean containsKey(Object key) { return map.containsKey(key); } public boolean containsValue(Object value) { return map.containsValue(value); } public Set> entrySet() { return map.entrySet(); } public MetaDataVisitorNode get(Object key) { return map.get(key); } @XmlTransient public boolean isEmpty() { return map.isEmpty(); } public Set keySet() { return map.keySet(); } public MetaDataVisitorNode put(MetaDataVisitorNode key, MetaDataVisitorNode value) { return map.put(key, value); } public void putAll(Map t) { map.putAll(t); } public MetaDataVisitorNode remove(Object key) { return map.remove(key); } public int size() { return map.size(); } public Collection values() { return map.values(); } @XmlTransient public Iterator getChildren() { ArrayList children = new ArrayList(keySet()); children.addAll(values()); return children.iterator(); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { if (keyType != null) { for(MetaDataVisitorNode key : keySet()) { if (previous.equals(key)) { return getClass(visitor, keyType); } } } if (valueType != null) { for(MetaDataVisitorNode v : values()) { if (previous.equals(v)) { return getClass(visitor, valueType); } } } return super.getType(visitor, previous); } /** * Create the default map instance * * @return the class instance */ @XmlTransient protected Object getDefaultInstance() { return new HashMap(); } @SuppressWarnings("unchecked") @XmlTransient protected Class getExpectedClass() { return Map.class; } /** * Get the class info for the key type * * @param cl the classloader * @return the class info * @throws Throwable for any error */ protected ClassInfo getKeyClassInfo(ClassLoader cl) throws Throwable { if (keyType == null) return null; return configurator.getClassInfo(keyType, cl); } /** * Get the class info for the value type * * @param cl the classloader * @return the class info * @throws Throwable for any error */ protected ClassInfo getValueClassInfo(ClassLoader cl) throws Throwable { if (valueType == null) return null; return configurator.getClassInfo(valueType, cl); } public AbstractMapMetaData clone() { AbstractMapMetaData clone = (AbstractMapMetaData)super.clone(); clone.map = CloneUtil.cloneMap(map, MetaDataVisitorNode.class, MetaDataVisitorNode.class); return clone; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/DirectAnnotationMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Di0000644000175000017500000000571211026715504033156 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.lang.annotation.Annotation; import java.util.Iterator; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Metadata for an annotation. * * @author Ales Justin */ public class DirectAnnotationMetaData extends JBossObject implements AnnotationMetaData, Serializable { private static final long serialVersionUID = 1L; private Annotation annotation; public DirectAnnotationMetaData(Annotation annotation) { if (annotation == null) throw new IllegalArgumentException("Null annotation"); this.annotation = annotation; } public Annotation getAnnotationInstance() { return annotation; } public Annotation getAnnotationInstance(ClassLoader cl) { return annotation; } public void initialVisit(MetaDataVisitor visitor) { visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("annotationr=").append(annotation); } public void toShortString(JBossStringBuilder buffer) { buffer.append(annotation); } protected int getHashCode() { return annotation.hashCode(); } public boolean equals(Object object) { if (object == null || object instanceof DirectAnnotationMetaData == false) return false; DirectAnnotationMetaData damd = (DirectAnnotationMetaData)object; return annotation.equals(damd.annotation); } public DirectAnnotationMetaData clone() { return (DirectAnnotationMetaData)super.clone(); } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/CallbackCreatorUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ca0000644000175000017500000001755011301242575033147 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Collection; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.dependency.AttributeInfo; import org.jboss.kernel.plugins.dependency.BasicCollectionCallbackItemFactory; import org.jboss.kernel.plugins.dependency.ClassAttributeCallbackItem; import org.jboss.kernel.plugins.dependency.ClassSingleCallbackItem; import org.jboss.kernel.plugins.dependency.CollectionCallbackItemFactory; import org.jboss.kernel.plugins.dependency.MethodAttributeInfo; import org.jboss.kernel.plugins.dependency.PropertyAttributeInfo; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.reflect.plugins.introspection.ReflectionUtils; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; /** * CallbackItem creator util. * * @author Ales Justin */ public class CallbackCreatorUtil { protected static volatile Logger log; protected static volatile CollectionCallbackItemFactory factory; // layz log protected static Logger getLog() { if (log == null) log = Logger.getLogger(CallbackCreatorUtil.class); return log; } /** * Create collection callback item. * * @param info type info * @param context owner context * @param whenRequired when required state * @param attribute attribute * @param dependentState dependent state * @param cardinality cardinality * @return collection callback item */ @SuppressWarnings({"unchecked", "deprecation"}) private static CallbackItem> createCollectionCallback( TypeInfo info, KernelControllerContext context, AttributeInfo attribute, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { if (info instanceof ClassInfo) { ClassInfo ci = (ClassInfo)info; TypeInfo componentType = ci.getComponentType(); if (componentType == null) throw new IllegalArgumentException("Null component type: " + info); Class clazz = componentType.getType(); if (Object.class.equals(clazz)) throw new IllegalArgumentException("Component type too general - equals Object: " + info); Class> collectionType = (Class) info.getType(); CollectionCallbackItemFactory factory = getCollectionFactory(); return factory.createCollectionCallbackItem(collectionType, clazz, whenRequired, dependentState, cardinality, context, attribute); } else throw new IllegalArgumentException("Unable to determine collection element class type: " + info); } /** * Create callback item from AttrbuteInfo. * * @param context owner context * @param ai attribute info * @param whenRequired when required state * @param dependentState dependent state * @param cardinality cardinality * @return callback item */ @SuppressWarnings({"deprecation"}) public static CallbackItem> createCallback( KernelControllerContext context, AttributeInfo ai, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { if (ai.isValid() == false) throw new IllegalArgumentException("Not a valid attribute info: " + ai); TypeInfo info = ai.getType(); if (info.isCollection()) return createCollectionCallback(info, context, ai, whenRequired, dependentState, cardinality); else if (ai.isProperty()) return new ClassAttributeCallbackItem(info.getType(), whenRequired, dependentState, cardinality, context, ai.getName()); else return new ClassSingleCallbackItem(info.getType(), whenRequired, dependentState, cardinality, context, ai.getName(), info.getName()); } /** * Create callback item from PropertyInfo. * * @param context owner context * @param pi property info * @param whenRequired when required state * @param dependentState dependent state * @param cardinality cardinality * @return callback item */ public static CallbackItem> createCallback( KernelControllerContext context, PropertyInfo pi, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { return createCallback(context, new PropertyAttributeInfo(pi), whenRequired, dependentState, cardinality); } /** * Create callback item from MethodInfo. * * @param context owner context * @param mi method info * @param whenRequired when required state * @param dependentState dependent state * @param cardinality cardinality * @return callback item */ public static CallbackItem> createCallback( KernelControllerContext context, MethodInfo mi, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { return createCallback(context, new MethodAttributeInfo(mi), whenRequired, dependentState, cardinality); } /** * Get the collection callback item factory. * You can use org.jboss.dependency.collectionCallbackItemFactory name * in System properties to override default implementation class. * * @return get the underlying factory */ public static CollectionCallbackItemFactory getCollectionFactory() { if (factory == null) { FactoryLookup lookup = new FactoryLookup(); factory = AccessController.doPrivileged(lookup); } return factory; } // Privileged system property lookup + factory creation private static class FactoryLookup implements PrivilegedAction { public CollectionCallbackItemFactory run() { try { String factoryClassName = System.getProperty("org.jboss.dependency.collectionCallbackItemFactory", BasicCollectionCallbackItemFactory.class.getName()); Object result = ReflectionUtils.newInstance(factoryClassName); return CollectionCallbackItemFactory.class.cast(result); } catch (Throwable t) { getLog().warn("Exception while creating CollectionCallbackItemFactory, using basic one instead.", t); return new BasicCollectionCallbackItemFactory(); } } } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractNamedAliasMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000553511173362527033155 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlTransient; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.util.JBossStringBuilder; /** * Metadata for a named alias. * * @author Ales Justin */ @XmlType(name="namedAliasType") public class AbstractNamedAliasMetaData extends AbstractAliasMetaData implements NamedAliasMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 2L; /** The name */ protected Object name; /** * Create a new named alias meta data */ public AbstractNamedAliasMetaData() { super(); } @XmlTransient public Object getName() { if (name == null) throw new IllegalArgumentException("Name should not be null"); return name; } @XmlAttribute(name = "name", required = true) public void setNameString(String name) { setName(name); } public void setName(Object name) { this.name = name; } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(getName()).append(" "); super.toString(buffer); } protected int getHashCode() { return getName().hashCode() + 7 * super.getHashCode(); } public boolean equals(Object object) { if (object == null || object instanceof AbstractNamedAliasMetaData == false || super.equals(object) == false) return false; AbstractNamedAliasMetaData amd = (AbstractNamedAliasMetaData)object; return getName().equals(amd.getName()); } public AbstractNamedAliasMetaData clone() { return (AbstractNamedAliasMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractDependencyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000001112711301240473033133 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Iterator; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.HashCode; /** * A dependency. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 96562 $ */ @XmlType(name="dependsType") public class AbstractDependencyMetaData extends JBossObject implements DependencyMetaData, Serializable { private static final long serialVersionUID = 1L; /** The dependency, may transient? */ protected Object dependency; /** * Create a new dependency */ public AbstractDependencyMetaData() { } /** * Create a new dependency * * @param dependency the dependency */ public AbstractDependencyMetaData(Object dependency) { this.dependency = dependency; } /** * Set the dependency * * @param dependency the dependency */ @XmlValue public void setDependency(Object dependency) { this.dependency = dependency; flushJBossObjectCache(); } public Object getDependency() { return dependency; } public void initialVisit(MetaDataVisitor visitor) { String name = (String) getDependency(); if (name == null || name.trim().length() == 0) throw new IllegalArgumentException("Null or empty dependency."); KernelControllerContext context = visitor.getControllerContext(); DependencyItem item = new LifecycleDependencyItem(context.getName(), dependency, ControllerState.CREATE); visitor.addDependency(item); item = new LifecycleDependencyItem(context.getName(), dependency, ControllerState.START); visitor.addDependency(item); visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } @XmlTransient public Iterator getChildren() { return null; } public void toString(JBossStringBuilder buffer) { buffer.append("dependency=").append(dependency); } public void toShortString(JBossStringBuilder buffer) { buffer.append(dependency); } public boolean equals(Object obj) { if (obj instanceof AbstractDependencyMetaData == false) return false; return equals(dependency, ((AbstractDependencyMetaData)obj).dependency); } protected int getHashCode() { return HashCode.generate(dependency); } /** * A LifecycleDependencyItem. */ public static class LifecycleDependencyItem extends AbstractDependencyItem { /** * Create a new LifecycleDependencyItem. * * @param name the name * @param dependency the dependency's name * @param state the state */ public LifecycleDependencyItem(Object name, Object dependency, ControllerState state) { super(name, dependency, state, state); } } public AbstractDependencyMetaData clone() { return (AbstractDependencyMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractPropertiesMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000414010776707200033143 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.util.Map; import java.util.Properties; /** * Properties metadata. * * @author Ales Justin */ public class AbstractPropertiesMetaData extends AbstractMapMetaData { private static final long serialVersionUID = 1L; protected Object getDefaultInstance() { return new Properties(); } @SuppressWarnings("unchecked") protected Class getExpectedClass() { return Properties.class; } public String getKeyType() { return String.class.getName(); } public void setKeyType(String keyType) { throw new IllegalArgumentException("Illegal call to set properties key type!"); } public String getValueType() { return String.class.getName(); } public void setValueType(String valueType) { throw new IllegalArgumentException("Illegal call to set properties value type!"); } public AbstractPropertiesMetaData clone() { return (AbstractPropertiesMetaData)super.clone(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/AbstractListMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/plugins/Ab0000644000175000017500000000763310776707200033155 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.plugins; import java.io.Serializable; import java.util.Collection; import java.util.List; import java.util.ListIterator; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.xb.annotations.JBossXmlChild; import org.jboss.xb.annotations.JBossXmlChildWildcard; import org.jboss.xb.annotations.JBossXmlChildren; import org.jboss.xb.annotations.JBossXmlNoElements; /** * List metadata. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 71794 $ */ @XmlType(name="listType") @JBossXmlNoElements @JBossXmlChildren ({ @JBossXmlChild(name="bean", type=AbstractBeanMetaData.class), @JBossXmlChild(name="array", type=AbstractArrayMetaData.class), @JBossXmlChild(name="collection", type=AbstractCollectionMetaData.class), @JBossXmlChild(name="inject", type=AbstractInjectionValueMetaData.class), @JBossXmlChild(name="list", type=AbstractListMetaData.class), @JBossXmlChild(name="map", type=AbstractMapMetaData.class), @JBossXmlChild(name="null", type=AbstractValueMetaData.class), @JBossXmlChild(name="set", type=AbstractSetMetaData.class), @JBossXmlChild(name="this", type=ThisValueMetaData.class), @JBossXmlChild(name="value", type=StringValueMetaData.class), @JBossXmlChild(name="value-factory", type=AbstractValueFactoryMetaData.class) }) @JBossXmlChildWildcard(wrapper=AbstractValueMetaData.class, property="value") public class AbstractListMetaData extends AbstractCollectionMetaData implements List, Serializable { private static final long serialVersionUID = 2L; /** * Create a new list value */ public AbstractListMetaData() { } public void add(int index, MetaDataVisitorNode element) { collection.add(index, element); } public boolean addAll(int index, Collection c) { return collection.addAll(index, c); } public MetaDataVisitorNode get(int index) { return collection.get(index); } public int indexOf(Object o) { return collection.indexOf(o); } public int lastIndexOf(Object o) { return collection.lastIndexOf(o); } public ListIterator listIterator() { return collection.listIterator(); } public ListIterator listIterator(int index) { return collection.listIterator(index); } public MetaDataVisitorNode remove(int index) { return collection.remove(index); } public MetaDataVisitorNode set(int index, MetaDataVisitorNode element) { return collection.set(index, element); } public List subList(int fromIndex, int toIndex) { return collection.subList(fromIndex, toIndex); } public AbstractListMetaData clone() { return (AbstractListMetaData)super.clone(); } }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/0000755000175000017500000000000011620312176032002 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/SupplyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Supply0000644000175000017500000000255110367642015033231 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.util.JBossInterface; /** * Metadata about what a bean demands. * * @author Adrian Brock * @version $Revision: 40781 $ */ public interface SupplyMetaData extends JBossInterface, MetaDataVisitorNode { /** * Get what is supplied * * @return the supply */ Object getSupply(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/NamedAliasMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/NamedA0000644000175000017500000000235310630031724033052 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; /** * Metadata about a named alias element. * * @author Ales Justin */ public interface NamedAliasMetaData extends AliasMetaData { Object getName(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/MetaDataVisitorNode.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/MetaDa0000644000175000017500000000341210776707200033067 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.Iterator; /** * A metadata vistor node. * * @author Adrian Brock * @author Ales Justin */ public interface MetaDataVisitorNode { /** * Visit the node * * @param vistor the visitor */ public void initialVisit(MetaDataVisitor vistor); /** * Revisit the node * * @param vistor the visitor */ public void describeVisit(MetaDataVisitor vistor); /** * Return the child nodes * * @return Iterator or null if there aren't any */ public Iterator getChildren(); /** * Clone the object * * @return a clone of the object */ Object clone(); } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy0000755000175000017500000000000011620312176033222 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy/BindingMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy0000644000175000017500000000301110763032124033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.policy; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Bindings. * * @author Ales Justin */ public interface BindingMetaData { /** * Get the name * * @return binding name */ String getName(); /** * Get the type * * @return binding type */ String getType(); /** * Get the value * * @return binding value */ ValueMetaData getValue(); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy/ScopeMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy0000644000175000017500000000307610564102651033233 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.policy; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Scope definition. * * @author Ales Justin */ public interface ScopeMetaData extends ValueMetaData { /** * Get the scope annotation name * * @return scope annotation */ String getScope(); /** * Get the level * * @return scope level */ String getLevel(); /** * Get the qualifier * * @return qualifier name */ String getQualifier(); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy/PolicyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/policy0000644000175000017500000000365410563036262033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.policy; import java.util.Set; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.JBossInterface; /** * Policy info. * * @author Ales Justin */ public interface PolicyMetaData extends JBossInterface, BeanMetaDataFactory { /** * Get the name * * @return the name */ String getName(); /** * Get the extends * * @return the name */ String getExtends(); /** * Get scope info * * @return the name */ ScopeMetaData getScope(); /** * Get the annotations. * * @return Set. */ Set getAnnotations(); /** * Get the bindings * * @return the name */ Set getBindings(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/AnnotationMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Annota0000644000175000017500000000334410737774537033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.lang.annotation.Annotation; import javax.xml.bind.annotation.XmlTransient; import org.jboss.util.JBossInterface; /** * Metadata about an annotation attribute. * * @author Adrian Brock * @version $Revision: 68640 $ */ public interface AnnotationMetaData extends JBossInterface, MetaDataVisitorNode { /** * Get the annotation using passed in classloader * @param classloader The classloader * @return The annotation instance */ Annotation getAnnotationInstance(ClassLoader classloader); /** * Get the annotation using the thread context classloader * @return The annotation instance */ @XmlTransient Annotation getAnnotationInstance(); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ParameterizedMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Parame0000644000175000017500000000250710551435051033136 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.List; /** * ParameterizedMetaData. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface ParameterizedMetaData { /** * Get the parameters. * * @return List. */ List getParameters(); } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/InstallMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Instal0000644000175000017500000000303410366730626033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.dependency.spi.ControllerState; /** * Metadata about an installation method. * * @author Adrian Brock * @version $Revision: 40727 $ */ public interface InstallMetaData extends LifecycleMetaData { /** * Get the bean name. * * @return the bean name. */ String getBean(); /** * Get the required state of the dependency * * @return the required state or null if it must be in the registry */ ControllerState getDependentState(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ClassLoaderMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ClassL0000644000175000017500000000257010367642015033117 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.util.JBossInterface; /** * Metadata about a classloader. * * @author Adrian Brock * @version $Revision: 40781 $ */ public interface ClassLoaderMetaData extends JBossInterface, MetaDataVisitorNode { /** * Get the classloader * * @return the classloader */ ValueMetaData getClassLoader(); } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builde0000755000175000017500000000000011620312176033167 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/ParameterMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builde0000644000175000017500000000353110755316653033207 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.builder; import org.jboss.beans.metadata.spi.ValueMetaData; /** * ParameterMetaDataBuilder. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface ParameterMetaDataBuilder { /** * Add a parameter * * @param type the type * @param value the value * @return the parameter */ ParameterMetaDataBuilder addParameterMetaData(String type, Object value); /** * Add a parameter * * @param type the type * @param value the value * @return the builder */ ParameterMetaDataBuilder addParameterMetaData(String type, String value); /** * Add a parameter * * @param type the type * @param value the value * @return the builder */ ParameterMetaDataBuilder addParameterMetaData(String type, ValueMetaData value); } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/builde0000644000175000017500000024275411301242575033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.builder; import java.lang.annotation.Annotation; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.api.model.InjectOption; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory; 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.ConstructorMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.kernel.api.dependency.MatcherFactory; /** * The BeanMetaDataBuilder is a class that allows you to construct a {@link BeanMetaData} * programatically.

* Users should first call one of the createBuilder() methods, do some work on * the returned builder and then call getBeanMetaData(). e.g.: *

 * BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("MyBean", "org.acme.Foo");
 * builder.addAnnotation("@org.acme.Marker").addPropertyMetaData("simple", "Simple");
 * ValueMetaData inject = aspectBuilder.createInject("OtherBean");
 * builder.addPropertyMetaData("injected", inject);
 * BeanMetaData bmd = builder.getBeanMetaData();
 * 
* will result in a similar BeanMetaData to deploying the following xml *
 * <bean name="MyBean" class="org.acme.Foo">
 *   <annotation>@org.acme.Marker</annotation>
 *   <property name="simple">Simple</property>
 *   <property name="injected"><inject name="OtherBean"/></property>
 * </bean>
 * 
* * @author Ales Justin * @author Adrian Brock */ public abstract class BeanMetaDataBuilder { /** * Create builder from a bean's class name. * * @param beanClassName bean class name * @return a new BeanMetaDataBuilder */ public static BeanMetaDataBuilder createBuilder(String beanClassName) { return BeanMetaDataBuilderFactory.createBuilder(beanClassName); } /** * Create builder from name and bean's classname. * * @param beanInstanceName bean name * @param beanClassName bean class name * @return a new BeanMetaDataBuilder */ public static BeanMetaDataBuilder createBuilder(String beanInstanceName, String beanClassName) { return BeanMetaDataBuilderFactory.createBuilder(beanInstanceName, beanClassName); } /** * Create builder from an existing BeanMetaData * * @param beanMetaData the bean metadata * @return a new BeanMetaDataBuilder */ public static BeanMetaDataBuilder createBuilder(BeanMetaData beanMetaData) { if (beanMetaData instanceof AbstractBeanMetaData) { return BeanMetaDataBuilderFactory.createBuilder((AbstractBeanMetaData)beanMetaData); } else { throw new IllegalArgumentException("Invalid type of bean metadata: " + beanMetaData); } } /** * Get the constructed bean metadata * * @return the bean metadata */ public abstract BeanMetaData getBeanMetaData(); /** * Get bean factory from underlying bean meta data. * * Note: this one includes all nested beans from * underlying bean metadata. * * @return bean meta data factory */ public abstract BeanMetaDataFactory getBeanMetaDataFactory(); /** * Get underlying bean as BeanMetaDataFactory. * * Note: this method doesn't include nested beans from * underlying bean metadata. * * @return bean meta data factory */ public BeanMetaDataFactory asBeanMetaDataFactory() { return new BeanMetaDataFactory() { public List getBeans() { return Collections.singletonList(getBeanMetaData()); } }; } /** * Set the bean name * * @see BeanMetaData#getName() * @param name the name * @return this builder */ public abstract BeanMetaDataBuilder setName(String name); /** * Set the bean class. * * @see BeanMetaData#getBean() * @param bean the bean class name * @return this builder */ public abstract BeanMetaDataBuilder setBean(String bean); /** * Set the aliases. This overwrites any existing aliases. * * @see BeanMetaData#getAliases() * @param aliases the aliases * @return this builder */ public abstract BeanMetaDataBuilder setAliases(Set aliases); /** * Add related class to the set of related classes. * * @see BeanMetaData#getRelated() * @param className the related class name * @param enabled the enabled * @return this builder */ public abstract BeanMetaDataBuilder addRelatedClass(String className, Object... enabled); /** * Add related class to the set of related classes. * * @see BeanMetaData#getRelated() * @param related the related class * @return this builder */ public abstract BeanMetaDataBuilder addRelatedClass(RelatedClassMetaData related); /** * Set the related classes. This overwrites any existing related classes. * * @see BeanMetaData#getRelated() * @param related the set of related classes * @return this builder */ public abstract BeanMetaDataBuilder setRelated(Set related); /** * Add alias to the set of aliases. * * @see BeanMetaData#getAliases() * @param alias the alias * @return this builder */ public abstract BeanMetaDataBuilder addAlias(Object alias); /** * Set the annotations. This overwrites any exisisting annotations. * * @see BeanMetaData#getAnnotations() * @param annotations the annotations * @return this builder */ public abstract BeanMetaDataBuilder setAnnotations(Set annotations); /** * Add annotation to the set of annotations, with system property replacement. * * @see #addAnnotation(String, boolean) * @see BeanMetaData#getAnnotations() * @param annotation string representation of the annotation, e.g. @org.acme.Marker * @return this builder */ public abstract BeanMetaDataBuilder addAnnotation(String annotation); /** * Add annotation to the set of annotations, with system property replacement. * * @see #addAnnotation(String, boolean) * @see BeanMetaData#getAnnotations() * @param annotation the annotation instance * @return this builder */ public abstract BeanMetaDataBuilder addAnnotation(Annotation annotation); /** * Add annotation to the set of annotations. * * @param annotation string representation of the annotation, e.g. @org.acme.Marker * @param replace whether system property replacement should happen on the values. e.g. if we have * @org.acme.WithProperty("${test.property}") and the value of * -Dtest.property=hello, this becomes @org.acme.WithProperty("hello"). * * @see BeanMetaData#getAnnotations() * @return this builder */ public abstract BeanMetaDataBuilder addAnnotation(String annotation, boolean replace); /** * Set the controller mode to use for the * {@link org.jboss.kernel.spi.dependency.KernelControllerContext} constructed * from the {@link BeanMetaData} created from this builder. * * @see BeanMetaData#getMode() * @param modeString the name of the {@link org.jboss.dependency.spi.ControllerMode} * @return this builder */ public BeanMetaDataBuilder setMode(String modeString) { return setMode(ControllerMode.getInstance(modeString)); } /** * Set the controller mode to use for the * {@link org.jboss.kernel.spi.dependency.KernelControllerContext} constructed * from the {@link BeanMetaData} created from this builder. * * @see BeanMetaData#getMode() * @param mode the mode * @return this builder */ public abstract BeanMetaDataBuilder setMode(ControllerMode mode); /** * Set the bean access mode to use for the bean. * * @see BeanMetaData#getAccessMode() * @param mode the access mode * @return this builder */ public abstract BeanMetaDataBuilder setAccessMode(BeanAccessMode mode); /** * Set the error handling mode to use for the * {@link org.jboss.kernel.spi.dependency.KernelControllerContext} constructed * from the {@link BeanMetaData} created from this builder. * * @see BeanMetaData#getErrorHandlingMode() * @param mode the error handling mode * @return this builder */ public abstract BeanMetaDataBuilder setErrorHandlingMode(ErrorHandlingMode mode); /** * Set the autowire type to be used for the * {@link org.jboss.kernel.spi.dependency.KernelControllerContext} constructed * from the {@link BeanMetaData} created from this builder. * * @see BeanMetaData#getAutowireType() * @param type the autowire type * @return this builder */ public abstract BeanMetaDataBuilder setAutowireType(AutowireType type); /** * Set whether the bean is an autowire candidate * * @see BeanMetaData#isAutowireCandidate() * @param candidate the candidate flag * @return this builder */ public abstract BeanMetaDataBuilder setAutowireCandidate(boolean candidate); /** * Set that we don't want to use the deployment classloader * * @see BeanMetaData#getClassLoader() * @return this builder */ public BeanMetaDataBuilder setNoClassLoader() { return setClassLoader(createNull()); } /** * Set the classloader to be used to load the class for this bean * * @see BeanMetaData#getClassLoader() * @param classLoader the classloader * @return this builder */ public BeanMetaDataBuilder setClassLoader(Object classLoader) { return setClassLoader(createValue(classLoader)); } /** * Set the classloader to be used to load the class for this bean * * @see BeanMetaData#getClassLoader() * @param classLoader a value metadata containing the classloader * @return this builder */ public abstract BeanMetaDataBuilder setClassLoader(ValueMetaData classLoader); /** * Set the classloader to be used to load the class for this bean * * @see BeanMetaData#getClassLoader() * @param classLoader the classloader * @return this builder */ public abstract BeanMetaDataBuilder setClassLoader(ClassLoaderMetaData classLoader); /** * Set the non-static factory bean to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactory() * @param factory the factory * @return this builder */ public BeanMetaDataBuilder setFactory(Object factory) { return setFactory(createValue(factory)); } /** * Set the non-static factory bean to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactory() * @param bean the bean name * @return this builder */ public BeanMetaDataBuilder setFactory(String bean) { return setFactory(bean, null); } /** * Set the non-static factory bean to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactory() * @param bean the bean name * @param property the property name for the factory * @return this builder */ public BeanMetaDataBuilder setFactory(String bean, String property) { return setFactory(createInject(bean, property)); } /** * Set the non-static factory bean to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactory() * @param factory the factory * @return this builder */ public abstract BeanMetaDataBuilder setFactory(ValueMetaData factory); /** * Set the static factory class to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactoryClass() * @param factoryClass the factory class name * @return this builder */ public abstract BeanMetaDataBuilder setFactoryClass(String factoryClass); /** * Set the factory method to use constructing the bean. * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getFactoryMethod() * @param factoryMethod the name of the factory method * @return this builder */ public abstract BeanMetaDataBuilder setFactoryMethod(String factoryMethod); /** * Set the constructor value to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getValue() * @param value the object "constructed" * @return this builder */ public BeanMetaDataBuilder setConstructorValue(Object value) { return setConstructorValue(createValue(value)); } /** * Set the constructor value to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getValue() * @param type the type of the object * @param value the object "constructed" * @return this builder */ public BeanMetaDataBuilder setConstructorValue(String type, String value) { return setConstructorValue(createString(type, value)); } /** * Set the constructor value to use constructing the bean * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getValue() * @param value the object "constructed" * @return this builder */ public abstract BeanMetaDataBuilder setConstructorValue(ValueMetaData value); /** * Add a constructor parameter to use when calling the constructor or a factory method * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getParameters() * @param type the parameter type * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addConstructorParameter(String type, Object value); /** * Add a constructor parameter to use when calling the constructor or a factory method * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getParameters() * @param type the parameter type * @param value String representation of the value * @return this builder */ public abstract BeanMetaDataBuilder addConstructorParameter(String type, String value); /** * Add a constructor parameter to use when calling the constructor or a factory method * * @see BeanMetaData#getConstructor() * @see ConstructorMetaData#getParameters() * @param type the parameter type * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addConstructorParameter(String type, ValueMetaData value); /** * Add a property to the beans set of properties, replace it if it already exists * * @see BeanMetaData#getProperties() * @param name the property name * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Object value); /** * Add a property to the beans set of properties, replace it if it already exists * * @see BeanMetaData#getProperties() * @param name the property name * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, String value); /** * Add a property to the beans set of properties, replace it if it already exists * * @see BeanMetaData#getProperties() * @param name the property name * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, ValueMetaData value); /** * Add a property to the beans set of properties, replace it if it already exists * * @see BeanMetaData#getProperties() * @param name the property name * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Collection value); /** * Add an annotation to a property, with system property replacement * * @see #addPropertyAnnotation(String, String, boolean) * @see BeanMetaData#getProperties() * @see PropertyMetaData#getAnnotations() * @param name the property name * @param annotation the annotation in string format, e.g. @org.acme.Marker * @return this builder */ public abstract BeanMetaDataBuilder addPropertyAnnotation(String name, String annotation); /** * Add an annotation to a property, with system property replacement * * @see #addPropertyAnnotation(String, String, boolean) * @see BeanMetaData#getProperties() * @see PropertyMetaData#getAnnotations() * @param name the property name * @param annotation string representation of the annotation, e.g. @org.acme.Marker * @param replace whether system property replacement should happen on the values. e.g. if we have * @org.acme.WithProperty("${test.property}") and the value of * -Dtest.property=hello, this becomes @org.acme.WithProperty("hello"). * @return this builder */ public abstract BeanMetaDataBuilder addPropertyAnnotation(String name, String annotation, boolean replace); /** * Add a property annotation. * * @see #addPropertyAnnotation(String, String, boolean) * @see BeanMetaData#getProperties() * @see PropertyMetaData#getAnnotations() * @param name the property name * @param annotation the annotation * @return this builder */ public abstract BeanMetaDataBuilder addPropertyAnnotation(String name, Annotation annotation); /** * Add a property to the beans set of properties, replace it if it already exists * * @see BeanMetaData#getProperties() * @param name the property name * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addPropertyMetaData(String name, Map value); /** * Should we ignore default create invocation. * * @see BeanMetaData#getCreate() * @see LifecycleMetaData#isIgnored() * @return this builder */ public abstract BeanMetaDataBuilder ignoreCreate(); /** * Set the create method * * @see BeanMetaData#getCreate() * @see LifecycleMetaData#getMethodName() * @param methodName the method name * @return this builder */ public abstract BeanMetaDataBuilder setCreate(String methodName); /** * Add a parameter to be passed in to the create method * * @see BeanMetaData#getCreate() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addCreateParameter(String type, Object value); /** * Add a parameter to be passed in to the create method * * @see BeanMetaData#getCreate() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value String representation of the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addCreateParameter(String type, String value); /** * Add a parameter to be passed in to the create method * * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addCreateParameter(String type, ValueMetaData value); /** * Should we ignore default start invocation. * * @see BeanMetaData#getStart() * @see LifecycleMetaData#isIgnored() * @return this builder */ public abstract BeanMetaDataBuilder ignoreStart(); /** * Set the start method * * @see BeanMetaData#getStart() * @see LifecycleMetaData#getMethodName() * @param methodName the method name * @return this builder */ public abstract BeanMetaDataBuilder setStart(String methodName); /** * Add a parameter to be passed in to the start method * * @see BeanMetaData#getStart() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addStartParameter(String type, Object value); /** * Add a parameter to be passed in to the start method * * @see BeanMetaData#getStart() * @see LifecycleMetaData#getParameters() * @param type String representation of the parameter type * @param value the value * @return this builder */ public abstract BeanMetaDataBuilder addStartParameter(String type, String value); /** * Add a parameter to be passed in to the start method * * @see BeanMetaData#getStart() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addStartParameter(String type, ValueMetaData value); /** * Should we ignore default stop invocation. * * @see BeanMetaData#getStop() * @see LifecycleMetaData#isIgnored() * @return this builder */ public abstract BeanMetaDataBuilder ignoreStop(); /** * Set the stop method * * @see BeanMetaData#getStop() * @see LifecycleMetaData#getMethodName() * @param methodName the method name * @return this builder */ public abstract BeanMetaDataBuilder setStop(String methodName); /** * Add a parameter to be passed in to the stop method * * @see BeanMetaData#getStop() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addStopParameter(String type, Object value); /** * Add a parameter to be passed in to the stop method * * @see BeanMetaData#getStop() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addStopParameter(String type, String value); /** * Add a parameter to be passed in to the stop method * * @see BeanMetaData#getStop() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addStopParameter(String type, ValueMetaData value); /** * Should we ignore default destroy invocation. * * @See {@link BeanMetaData#getDestroy()} * @see LifecycleMetaData#isIgnored() * @return this builder */ public abstract BeanMetaDataBuilder ignoreDestroy(); /** * Set the destroy method * * @see BeanMetaData#getDestroy() * @see LifecycleMetaData#getMethodName() * @param methodName the method name * @return this builder */ public abstract BeanMetaDataBuilder setDestroy(String methodName); /** * Add a parameter to be passed in to the destroy method * * @see BeanMetaData#getDestroy() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addDestroyParameter(String type, Object value); /** * Add a parameter to be passed in to the destroy method * * @see BeanMetaData#getDestroy() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addDestroyParameter(String type, String value); /** * Add a parameter to be passed in to the destroy method * * @see BeanMetaData#getDestroy() * @see LifecycleMetaData#getParameters() * @param type the parameter type * @param value the parameter value * @return this builder */ public abstract BeanMetaDataBuilder addDestroyParameter(String type, ValueMetaData value); /** * Add a supply * * @param supply the supply * @return this builder */ public BeanMetaDataBuilder addSupply(Object supply) { return addSupply(supply, null); } /** * Add a supply * * @param supply the supply * @param type the supply type * @return this builder */ public abstract BeanMetaDataBuilder addSupply(Object supply, String type); /** * Add a demand using the default value for when the supply is required by the demanding bean * {@link ControllerState#DESCRIBED} and the default value for the state of the supply * (link {@link ControllerState#INSTALLED} * * @see BeanMetaData#getDemands() * @param demand the demand * @return this builder */ public BeanMetaDataBuilder addDemand(Object demand) { return addDemand(demand, (ControllerState) null, null); } /** * Add a demand using the default value for the state of the supply * (link {@link ControllerState#INSTALLED}. * * @see BeanMetaData#getDemands() * @see MatcherFactory * @param demand the demand * @param whenRequired string represenation of the when the demand is required * @param transformer the transformer name as described in {@link MatcherFactory} * @return this builder */ public BeanMetaDataBuilder addDemand(Object demand, String whenRequired, String transformer) { ControllerState whenRequiredState = null; if (whenRequired != null) whenRequiredState = new ControllerState(whenRequired); return addDemand(demand, whenRequiredState, transformer); } /** * Add a demand using the default value for the state of the supply * (link {@link ControllerState#INSTALLED} and the * * @see BeanMetaData#getDemands() * @see MatcherFactory * @param demand the demand * @param whenRequired when the demand is required * @param transformer the transformer name as described in {@link MatcherFactory} * @return this builder */ public BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, String transformer) { return addDemand(demand, whenRequired, null, transformer); } /** * Add a demand * * @see BeanMetaData#getDemands() * @see MatcherFactory * @param demand the demand * @param whenRequired when the demand is required * @param targetState the target state of the supply * @param transformer the transformer name as described in {@link MatcherFactory} * @return this builder */ public abstract BeanMetaDataBuilder addDemand(Object demand, ControllerState whenRequired, ControllerState targetState, String transformer); /** * Add a dependency * * @see BeanMetaData#getDepends() * @param dependency the name of the dependency, i.e. bean name * @return this builder */ public abstract BeanMetaDataBuilder addDependency(Object dependency); /** * Add an install where the install method resides in the bean being built here * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName) { return addInstall(methodName, null); } /** * Add an install where the install method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String type, Object value) { return addInstall(methodName, null, type, value); } /** * Add an install where the install method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param type the parameter type * @param value String representation of the parameter value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String type, String value) { return addInstall(methodName, null, type, value); } /** * Add an install where the install method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String type, ValueMetaData value) { return addInstall(methodName, null, type, value); } /** * Add an install where the install method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String[] types, Object[] values) { return addInstall(methodName, null, types, values); } /** * Add an install where the install method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param types the parameter types * @param values the string representations of the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String[] types, String[] values) { return addInstall(methodName, null, types, values); } /** * Add an install where the install method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String[] types, ValueMetaData[] values) { return addInstall(methodName, null, types, values); } /** * Add an install, where the install method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @return this builder */ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean) { return addInstallWithThis(methodName, bean, null); } /** * Add an install, where the install method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param state the required state of the bean containing the install method * @return this builder */ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state) { return addInstallWithThis(methodName, bean, state, null); } /** * Add an install, where the install method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param state the state of the bean * @param whenRequired the state when to call install * @return this builder */ public BeanMetaDataBuilder addInstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean, state, whenRequired); parameters.addParameterMetaData(null, createThis()); return this; } /** * Add an install where the install method resides in another bean * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean) { addInstallWithParameters(methodName, bean); return this; } /** * Add an install where the install method resides in another bean, * taking a single parameter * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param type the parameter type * @param value the value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, Object value) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an install where the install method resides in another bean, * taking a single parameter * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param type the parameter type * @param value the string representation of the parameter value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, String value) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an install where the install method resides in another bean, * taking a single parameter * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String type, ValueMetaData value) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an install where the install method resides in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, Object[] values) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); for (int i = 0; i < types.length; i++) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an install where the install method resides in in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param types the parameter types * @param values the string representations of the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, String[] values) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); for (int i = 0; i < types.length; i++) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an install where the install method resides in in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addInstall(String methodName, String bean, String[] types, ValueMetaData[] values) { ParameterMetaDataBuilder parameters = addInstallWithParameters(methodName, bean); for (int i = 0; i < types.length; i++) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an install where the install method resides in the bean being built here, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @return the parameter builder */ public ParameterMetaDataBuilder addInstallWithParameters(String methodName) { return addInstallWithParameters(methodName, null); } /** * Add an install where the install method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @return the parameter builder */ public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean) { return addInstallWithParameters(methodName, bean, null); } /** * Add an install where the install method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param state the state of the bean * @return the parameter builder */ public ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state) { return addInstallWithParameters(methodName, bean, state, null); } /** * Add an install where the install method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getInstalls() * @param methodName the name of the method to be called upon install * @param bean the name of the bean containing the method to be called upon install * @param state the state of the bean * @param whenRequired the state when to call install * @return the parameter builder */ public abstract ParameterMetaDataBuilder addInstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired); /** * Add an uninstall where the uninstall method resides in the bean being built here * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName) { return addUninstall(methodName, null); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String type, Object value) { return addUninstall(methodName, null, type, value); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param type the parameter type * @param value String representation of the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String type, String value) { return addUninstall(methodName, null, type, value); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking a single parameter. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String type, ValueMetaData value) { return addUninstall(methodName, null, type, value); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, Object[] values) { return addUninstall(methodName, null, types, values); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param types the parameter types * @param values the string representations of the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, String[] values) { return addUninstall(methodName, null, types, values); } /** * Add an uninstall where the uninstall method resides in the bean being build here, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String[] types, ValueMetaData[] values) { return addUninstall(methodName, null, types, values); } /** * Add an uninstall, where the uninstall method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @return this builder */ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean) { return addUninstallWithThis(methodName, bean, null); } /** * Add an uninstall, where the uninstall method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param state the required state of the bean containing the uninstall method * @return this builder */ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state) { return addUninstallWithThis(methodName, bean, state, null); } /** * Add an uninstall, where the uninstall method resides in another bean, passing in a single * parameter which is the 'this' pointer to the bean being created here * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param state the state of the bean * @param whenRequired the state when to call uninstall * @return this builder */ public BeanMetaDataBuilder addUninstallWithThis(String methodName, String bean, ControllerState state, ControllerState whenRequired) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean, state, whenRequired); parameters.addParameterMetaData(null, createThis()); return this; } /** * Add an uninstall where the uninstall method resides in another bean * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean) { addUninstallWithParameters(methodName, bean); return this; } /** * Add an uninstall where the uninstall method resides in another bean, * taking a single parameter * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, Object value) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an uninstall where the uninstall method resides in another bean, * taking a single parameter * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param type the parameter type * @param value the string representation of the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, String value) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an uninstall where the uninstall method resides in another bean, * taking a single parameter * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param type the parameter type * @param value the parameter value * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String type, ValueMetaData value) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); parameters.addParameterMetaData(type, value); return this; } /** * Add an uninstall where the uninstall method resides in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, Object[] values) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); for (int i = 0; i < types.length; ++i) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an uninstall where the uninstall method resides in in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param types the parameter types * @param values the string representations of the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, String[] values) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); for (int i = 0; i < types.length; ++i) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an uninstall where the uninstall method resides in in another bean, * taking several parameters. The types and values * arrays must have the same lengths, and types[i] is the type of * values[i]. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param types the parameter types * @param values the parameter values * @return this builder */ public BeanMetaDataBuilder addUninstall(String methodName, String bean, String[] types, ValueMetaData[] values) { ParameterMetaDataBuilder parameters = addUninstallWithParameters(methodName, bean); for (int i = 0; i < types.length; ++i) parameters.addParameterMetaData(types[i], values[i]); return this; } /** * Add an uninstall where the uninstall method resides in the bean being built here, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @return the parameter builder */ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName) { return addUninstallWithParameters(methodName, null); } /** * Add an uninstall where the uninstall method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @return the parameter builder */ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean) { return addUninstallWithParameters(methodName, bean, null); } /** * Add an uninstall where the uninstall method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param state the state of the bean * @return the parameter builder */ public ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state) { return addUninstallWithParameters(methodName, bean, state, null); } /** * Add an uninstall where the uninstall method resides in another bean, * returning a parameter builder that can be used to add parameters. * * @see BeanMetaData#getUninstalls() * @param methodName the name of the method to be called upon uninstall * @param bean the name of the bean containing the method to be called upon uninstall * @param state the state of the bean * @param whenRequired the state when to call uninstall * @return the parameter builder */ public abstract ParameterMetaDataBuilder addUninstallWithParameters(String methodName, String bean, ControllerState state, ControllerState whenRequired); /** * Add property install callback. * * @see BeanMetaData#getInstallCallbacks() * @param property the property name * @return this builder */ public BeanMetaDataBuilder addPropertyInstallCallback(String property) { return addPropertyInstallCallback(property, null, null); } /** * Add property install callback. * * @see BeanMetaData#getInstallCallbacks() * @param property the property name * @param whenRequired the when required state * @return this builder */ public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired) { return addPropertyInstallCallback(property, whenRequired, null); } /** * Add property install callback. * * @see BeanMetaData#getInstallCallbacks() * @param property the property name * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addPropertyInstallCallback(String property, Cardinality cardinality) { return addPropertyInstallCallback(property, null, cardinality); } /** * Add property install callback. * * @see BeanMetaData#getInstallCallbacks() * @param property the property name * @param whenRequired the when required state * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addPropertyInstallCallback(String property, ControllerState whenRequired, Cardinality cardinality) { return addPropertyInstallCallback(property, null, whenRequired, null, cardinality); } /** * Add property install callback. * * @see BeanMetaData#getInstallCallbacks() * @param property the property name * @param signature the property signature * @param whenRequired the when required state * @param dependentState the dependant state * @param cardinality the cardinality * @return this builder */ public abstract BeanMetaDataBuilder addPropertyInstallCallback( String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality); /** * Add property uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param property the property name * @return this builder */ public BeanMetaDataBuilder addPropertyUninstallCallback(String property) { return addPropertyUninstallCallback(property, null, null); } /** * Add property uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param property the property name * @param whenRequired the when required state * @return this builder */ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired) { return addPropertyUninstallCallback(property, whenRequired, null); } /** * Add property uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param property the property name * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, Cardinality cardinality) { return addPropertyUninstallCallback(property, null, cardinality); } /** * Add property uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param property the property name * @param whenRequired the when required state * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addPropertyUninstallCallback(String property, ControllerState whenRequired, Cardinality cardinality) { return addPropertyUninstallCallback(property, null, whenRequired, null, cardinality); } /** * Add property uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param property the property name * @param signature the property signature * @param whenRequired the when required state * @param dependentState the dependant state * @param cardinality the cardinality * @return this builder */ public abstract BeanMetaDataBuilder addPropertyUninstallCallback( String property, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality); /** * Add method install callback. * * @see BeanMetaData#getInstallCallbacks() * @param method the method name * @return this builder */ public BeanMetaDataBuilder addMethodInstallCallback(String method) { return addMethodInstallCallback(method, null, null); } /** * Add method install callback. * * @see BeanMetaData#getInstallCallbacks() * @param method the method name * @param whenRequired the when required state * @return this builder */ public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired) { return addMethodInstallCallback(method, whenRequired, null); } /** * Add method install callback. * * @see BeanMetaData#getInstallCallbacks() * @param method the method name * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addMethodInstallCallback(String method, Cardinality cardinality) { return addMethodInstallCallback(method, null, cardinality); } /** * Add method install callback. * * @see BeanMetaData#getInstallCallbacks() * @param method the method name * @param whenRequired the when required state * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addMethodInstallCallback(String method, ControllerState whenRequired, Cardinality cardinality) { return addMethodInstallCallback(method, null, whenRequired, null, cardinality); } /** * Add method install callback. * * @see BeanMetaData#getInstallCallbacks() * @param method the method name * @param signature the method signature * @param whenRequired the when required state * @param dependentState the dependant state * @param cardinality the cardinality * @return this builder */ public abstract BeanMetaDataBuilder addMethodInstallCallback( String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality); /** * Add method uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param method the method name * @return this builder */ public BeanMetaDataBuilder addMethodUninstallCallback(String method) { return addMethodUninstallCallback(method, null, null); } /** * Add method uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param method the method name * @param whenRequired the when required state * @return this builder */ public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired) { return addMethodUninstallCallback(method, whenRequired, null); } /** * Add method uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param method the method name * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addMethodUninstallCallback(String method, Cardinality cardinality) { return addMethodUninstallCallback(method, null, cardinality); } /** * Add method uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param method the method name * @param whenRequired the when required state * @param cardinality the cardinality * @return this builder */ public BeanMetaDataBuilder addMethodUninstallCallback(String method, ControllerState whenRequired, Cardinality cardinality) { return addMethodUninstallCallback(method, null, whenRequired, null, cardinality); } /** * Add method uninstall callback. * * @see BeanMetaData#getUninstallCallbacks() * @param method the method name * @param signature the method signature * @param whenRequired the when required state * @param dependentState the dependant state * @param cardinality the cardinality * @return this builder */ public abstract BeanMetaDataBuilder addMethodUninstallCallback( String method, String signature, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality); /** * Create related class name. * * @see BeanMetaData#getRelated() * @param className the related class name * @param enabled the enabled * @return new related class meta data */ public abstract RelatedClassMetaData createRelated(String className, Object... enabled); /** * Create a null value * * @return the null value */ public abstract ValueMetaData createNull(); /** * Create a this value * * @return the this value */ public abstract ValueMetaData createThis(); /** * Create a value containing an object * * @param value the already constructed value * @return the value */ public abstract ValueMetaData createValue(Object value); /** * Create a value factory * * @param bean the other bean's name * @param method the method's name * @param parameter the parameter * @return the value factory */ public ValueMetaData createValueFactory(Object bean, String method, String parameter) { return createValueFactory(bean, method, createParameter(parameter, String.class.getName())); } /** * Create a value factory * * @param bean the other bean's name * @param method the method's name * @param parameters the parameters * @return the value factory */ public abstract ValueMetaData createValueFactory(Object bean, String method, ParameterMetaData... parameters); /** * Create parameter. * * @param value the value * @return new parameter metadata instance */ public ParameterMetaData createParameter(Object value) { return createParameter(value, null); } /** * Create parameter. * * @param value the value * @param type the type * @return new parameter metadata instance */ public ParameterMetaData createParameter(Object value, String type) { return createParameter(value, type, -1); } /** * Create parameter. * * @param value the value * @param type the type * @param index the index * @return new parameter metadata instance */ public ParameterMetaData createParameter(Object value, String type, int index) { return createParameter(createValue(value), type, index); } /** * Create parameter. * * @param value the value * @return new parameter metadata instance */ public ParameterMetaData createParameter(ValueMetaData value) { return createParameter(value, null); } /** * Create parameter. * * @param value the value * @param type the type * @return new parameter metadata instance */ public ParameterMetaData createParameter(ValueMetaData value, String type) { return createParameter(value, type, -1); } /** * Create parameter. * * @param value the value * @param type the type * @param index the index * @return new parameter metadata instance */ public abstract ParameterMetaData createParameter(ValueMetaData value, String type, int index); /** * Create a string value * * @param type the type to be converted into * @param value the value * @return the string value */ public abstract ValueMetaData createString(String type, String value); /** * Create an injection using a bean as what is being injected, using the default * whenRequired state of {@link ControllerState#CONFIGURED} and the default dependentState of * {@link ControllerState#INSTANTIATED} * * @param bean the name of bean to inject * @return the injection */ public ValueMetaData createInject(Object bean) { return createInject(bean, null, null, null); } /** * Create an injection being able to specify the the property of a bean as what is being injected, using the default * whenRequired state of {@link ControllerState#CONFIGURED} and the default dependentState of * {@link ControllerState#INSTANTIATED} * * @param bean the name of the bean * @param property the name of the property of the bean to inject. If null, the bean itself will be injected * @return the injection */ public ValueMetaData createInject(Object bean, String property) { return createInject(bean, property, null, null); } /** * Create an injection being able to specify the property of a bean as what is being injected * * @param bean the name of the bean * @param property the name of the property of the bean to inject. If null, the bean itself will be injected * @param whenRequired when the injection is required. If null {@link ControllerState#CONFIGURED} is used. * @param dependentState the required state of the injected bean. If null {@link ControllerState#INSTALLED} is used. * @return the injection */ public ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState) { return createInject(bean, property, whenRequired, dependentState, null); } /** * Create an injection being able to specify the property of a bean as what is being injected * * @param bean the name of the bean * @param property the name of the property of the bean to inject. If null, the bean itself will be injected * @param whenRequired when the injection is required. If null {@link ControllerState#CONFIGURED} is used. * @param dependentState the required state of the injected bean. If null {@link ControllerState#INSTALLED} is used. * @param search the search info describing how to search for the injected bean if we have a hierarchy of * {@link org.jboss.dependency.spi.Controller}s * @return the injection */ public abstract ValueMetaData createInject(Object bean, String property, ControllerState whenRequired, ControllerState dependentState, SearchInfo search); /** * Create contextual injection, using the default * whenRequired state of {@link ControllerState#CONFIGURED} and the default dependentState of * {@link ControllerState#INSTANTIATED}. This does not need to specify the name of the bean, * but looks at the target property/parameter type for autowiring * * @see BeanMetaData#isAutowireCandidate() * @return the contextual injection */ public ValueMetaData createContextualInject() { return createContextualInject(null, null); } /** * Create contextual injection. This does not need to specify the name of the bean, * but looks at the target property/parameter type for autowiring * * @see BeanMetaData#isAutowireCandidate() * @param whenRequired when the injection is required. If null {@link ControllerState#CONFIGURED} is used. * @param dependentState the required state of the injected bean. If null {@link ControllerState#INSTALLED} is used. * @return the contextual injection */ public ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState) { return createContextualInject(whenRequired, dependentState, null, null); } /** * Create contextual injection. This does not need to specify the name of the bean, * but looks at the target property/parameter type for autowiring * * @see BeanMetaData#isAutowireCandidate() * @see BeanMetaData#getAutowireType() * @param whenRequired when the injection is required. If null {@link ControllerState#CONFIGURED} is used. * @param dependentState the required state of the injected bean. If null {@link ControllerState#INSTALLED} is used. * @param autowire the autowire type. If null, the type is {@link AutowireType#BY_CLASS} * @param option the inject option * @return the contextual injection */ public ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState, AutowireType autowire, InjectOption option) { return createContextualInject(whenRequired, dependentState, autowire, option, null); } /** * Create contextual injection. This does not need to specify the name of the bean, * but looks at the target property/parameter type for autowiring * * @param whenRequired when the injection is required. If null {@link ControllerState#CONFIGURED} is used. * @param dependentState the required state of the injected bean. If null {@link ControllerState#INSTALLED} is used. * @param autowire the autowire type * @param option the inject option * @param search the search info describing how to search for the injected bean if we have a hierarchy of * {@link org.jboss.dependency.spi.Controller}s * @return the contextual injection */ public abstract ValueMetaData createContextualInject(ControllerState whenRequired, ControllerState dependentState, AutowireType autowire, InjectOption option, SearchInfo search); /** * Inject values from the context of the bean we are creating, using the default * whenRequired state of {@link ControllerState#CONFIGURED} and the default dependentState of * {@link ControllerState#INSTANTIATED}. * * @param fromContext enum specifying what to inject from the {@link org.jboss.kernel.spi.dependency.KernelControllerContext} * @return the from context injection */ public ValueMetaData createFromContextInject(FromContext fromContext) { return createFromContextInject(fromContext, null); } /** * Inject values from the context of another bean, using the default * whenRequired state of {@link ControllerState#CONFIGURED} and the default dependentState of * {@link ControllerState#INSTANTIATED}. * * @param fromContext enum specifying what to inject from the {@link org.jboss.kernel.spi.dependency.KernelControllerContext} * @param contextName the context name * @return the from context injection */ public ValueMetaData createFromContextInject(FromContext fromContext, Object contextName) { return createFromContextInject(fromContext, contextName, null); } /** * Inject values from the context of another bean, using the default * whenRequired state of {@link ControllerState#CONFIGURED} * * @param fromContext enum specifying what to inject from the {@link org.jboss.kernel.spi.dependency.KernelControllerContext} * @param contextName the context name * @param dependentState the state of the injected/other context. If null {@link ControllerState#INSTANTIATED} is used. * @return the from context injection */ public ValueMetaData createFromContextInject(FromContext fromContext, Object contextName, ControllerState dependentState) { return createFromContextInject(fromContext, contextName, dependentState, null); } /** * Inject values from the context of another bean * * @param fromContext enum specifying what to inject from the {@link org.jboss.kernel.spi.dependency.KernelControllerContext} * @param contextName the context name * @param dependentState the state of the injected/other context. If null {@link ControllerState#INSTANTIATED} is used. * @param search the search info describing how to search for the injected bean if we have a hierarchy of * {@link org.jboss.dependency.spi.Controller}s * @return the from context injection */ public abstract ValueMetaData createFromContextInject(FromContext fromContext, Object contextName, ControllerState dependentState, SearchInfo search); /** * Create a new collection. At injection time, if the target property already has a * collection that collection's type will be used. Otherwise, the exact type of the collection * used will be determined by introspecting the target parameter/property. If the target * is an interface java.util.ArrayList will be used by default. * * @return the collection */ public Collection createCollection() { return createCollection(null, null); } /** * Create a new collection, where we can specify the exact type of Collection we would like * * @param collectionType the collection type class name * @param elementType the element type class name * @return the collection */ public abstract Collection createCollection(String collectionType, String elementType); /** * Create a new list. At injection time, if the target property already has a * list that list's type will be used. Otherwise, the exact type of the list * used will be determined by introspecting the target parameter/property. If the target * is an interface java.util.ArrayList will be used by default. * * @return the list */ public List createList() { return createList(null, null); } /** * Create a new list, where we can specify the exact type of List we would like * * @param listType the class name of the List implementation. * @param elementType the element type class name * @return the list */ public abstract List createList(String listType, String elementType); /** * Create a new set. At injection time, if the target property already has a * set that set's type will be used. Otherwise, the exact type of the set * used will be determined by introspecting the target parameter/property. If the target * is an interface java.util.HashSet will be used by default. * * @return the set */ public Set createSet() { return createSet(null, null); } /** * Create a new list, where we can specify the exact type of set we would like * * @param setType the class name of the Set implementation we would like to use * @param elementType the element type class name * @return the set */ public abstract Set createSet(String setType, String elementType); /** * Create a new array. At injection time, if the target property already has a * array that array's type will be used. Otherwise, the exact type of the array * used will be determined by introspecting the target parameter/property. The * default type is java.lang.Object[] * * @return the array */ public List createArray() { return createArray(null, null); } /** * Create a new array, where we can specify the exact type of array we would like * * @param arrayType the array type class name * @param elementType the element type class name * @return the set */ public abstract List createArray(String arrayType, String elementType); /** * Create a new map * * @return the map */ public Map createMap() { return createMap(null, null, null); } /** * Create a new map, where we can specify the exact type of Map we would like * * @param mapType the map type class name * @param keyType the key type class name * @param valueType the value type class name * @return the map */ public abstract Map createMap(String mapType, String keyType, String valueType); } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/LazyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/LazyMe0000644000175000017500000000306510756342051033136 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.Set; /** * Metadata about a lazy bean. * * @author Ales Justin */ public interface LazyMetaData extends BeanMetaData, BeanMetaDataFactory { /** * Get the bean. * * @return the bean */ String getBeanName(); /** * Is class exposed. * * @return true if expose class */ boolean isExposeClass(); /** * Get the intefaces. * * @return the interfaces */ Set getInterfaces(); } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factory/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factor0000755000175000017500000000000011620312176033201 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factory/BeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factor0000644000175000017500000000251210604153706033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.factory; /** * Bean factory interface. * * @author Ales Justin */ public interface BeanFactory { /** * Create bean. * * @return bean * @throws Throwable for any error */ Object createBean() throws Throwable; } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factory/AbstractBeanFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factor0000644000175000017500000001472110772714443033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.factory; import java.util.Map; import java.util.List; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.joinpoint.spi.MethodJoinpoint; import org.jboss.joinpoint.spi.JoinpointException; /** * SPI contract of bean factory we can create from GenericBeanFactoryMetaData. * * @author Ales Justin */ public abstract class AbstractBeanFactory implements BeanFactory { /** The configurator */ protected KernelConfigurator configurator; /** The bean class name */ protected String bean; /** The access mode */ protected BeanAccessMode accessMode; /** The classloader */ protected ClassLoaderMetaData classLoader; /** The constructor metadata */ protected ConstructorMetaData constructor; /** The properties Map */ protected Map properties; /** The create lifecycle method */ protected LifecycleMetaData create; /** The start lifecycle method */ protected LifecycleMetaData start; protected AbstractBeanFactory(KernelConfigurator configurator) { if (configurator == null) throw new IllegalArgumentException("Null configurator"); this.configurator = configurator; } /** * Get the configurator. * * @return the configurator */ protected KernelConfigurator getConfigurator() { return configurator; } /** * Get the bean name * * @return the bean */ public String getBean() { return bean; } /** * Set the bean name * * @param bean the bean name */ public void setBean(String bean) { this.bean = bean; } /** * Get the access mode. * * @return the access mode */ public BeanAccessMode getAccessMode() { return accessMode; } /** * Set the access mode. * * @param accessMode the access mode. */ public void setAccessMode(BeanAccessMode accessMode) { this.accessMode = accessMode; } /** * Get the classLoader. * * @return the classLoader. */ public ClassLoaderMetaData getClassLoader() { return classLoader; } /** * Set the classLoader. * * @param classLoader the classLoader. */ public void setClassLoader(ClassLoaderMetaData classLoader) { this.classLoader = classLoader; } /** * Get the constructor metadata * * @return the contructor metadata */ public ConstructorMetaData getConstructor() { return constructor; } /** * Set the constructor metadata * * @param constructor the constructor metadata */ public void setConstructor(ConstructorMetaData constructor) { this.constructor = constructor; } /** * Get the properties * * @return the properties Map */ public Map getProperties() { return properties; } /** * Set the properties * * @param properties the properties Map */ public void setProperties(Map properties) { this.properties = properties; } /** * Get the create. * * @return the create. */ public LifecycleMetaData getCreate() { return create; } /** * Set the create. * * @param create the create. */ public void setCreate(LifecycleMetaData create) { this.create = create; } /** * Get the start. * * @return the start. */ public LifecycleMetaData getStart() { return start; } /** * Set the start. * * @param start the start. */ public void setStart(LifecycleMetaData start) { this.start = start; } /** * Invoke a lifecycle method * * @param methodName the default method name * @param lifecycle the lifecycle * @param info the bean info * @param cl the classloader * @param target the target * @throws Throwable for any error */ protected void invokeLifecycle(String methodName, LifecycleMetaData lifecycle, BeanInfo info, ClassLoader cl, Object target) throws Throwable { if (lifecycle == null || lifecycle.isIgnored() == false) { String method = methodName; if (lifecycle != null && lifecycle.getMethodName() != null) method = lifecycle.getMethodName(); List parameters = null; if (lifecycle != null) parameters = lifecycle.getParameters(); MethodJoinpoint joinpoint; try { joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true); } catch (JoinpointException ignored) { return; } joinpoint.setTarget(target); joinpoint.dispatch(); } } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factory/PropertyMap.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factor0000644000175000017500000001413511147522315033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.factory; import java.io.Serializable; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Set; import java.util.Stack; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.plugins.TypeProvider; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.RelatedClassMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * PropertyMap. * * @author Adrian Brock * @author Ales Justin */ class PropertyMap extends HashMap implements MetaDataVisitorNode, TypeProvider { /** The serialVersionUID */ private static final long serialVersionUID = -4295725682462294630L; public void initialVisit(MetaDataVisitor visitor) { visitor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } public Iterator getChildren() { return values().iterator(); } public ValueMetaData put(String name, ValueMetaData value) { ValueInfo info = new ValueInfo(name, value); return super.put(name, info); } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { ValueInfo valueInfo = null; for (ValueMetaData value : values()) { ValueInfo vi = ValueInfo.class.cast(value); if (vi == previous) { valueInfo = vi; break; } } if (valueInfo == null) throw new IllegalArgumentException("No matching value (" + previous + ") found: " + values()); KernelControllerContext context = visitor.getControllerContext(); BeanMetaData bmd = context.getBeanMetaData(); Set related = bmd.getRelated(); if (related == null || related.size() != 1) throw new IllegalArgumentException("Invalid information for contextual injection: " + bmd); // TODO - perhaps match which related metadata is the right one RelatedClassMetaData beanClassMetaData = related.iterator().next(); KernelConfigurator configurator = context.getKernel().getConfigurator(); BeanInfo beanInfo = configurator.getBeanInfo(beanClassMetaData.getClassName(), context.getClassLoader()); PropertyInfo pi = beanInfo.getProperty(valueInfo.name); TypeInfo typeInfo = pi.getType(); if (typeInfo.isCollection() || typeInfo.isMap()) { throw new IllegalArgumentException("Cannot handle collection or map: " + valueInfo); } return typeInfo; } private static class ValueInfo extends JBossObject implements ValueMetaData, Serializable, TypeProvider { private static final long serialVersionUID = 1L; private String name; private ValueMetaData value; private ValueInfo(String name, ValueMetaData value) { this.name = name; this.value = value; } public TypeInfo getType(MetaDataVisitor visitor, MetaDataVisitorNode previous) throws Throwable { Stack visitorNodeStack = visitor.visitorNodeStack(); // see AbstractInjectionValueMetaData.describeVisit MetaDataVisitorNode node = visitorNodeStack.pop(); try { if (node instanceof TypeProvider) { TypeProvider typeProvider = (TypeProvider) node; return typeProvider.getType(visitor, this); } else { throw new IllegalArgumentException(TypeProvider.ERROR_MSG); } } finally { visitorNodeStack.push(node); } } public Object getUnderlyingValue() { return value.getUnderlyingValue(); } public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { return value.getValue(info, cl); } public void initialVisit(MetaDataVisitor vistor) { vistor.initialVisit(this); } public void describeVisit(MetaDataVisitor vistor) { vistor.describeVisit(this); } public Iterator getChildren() { return Collections.singleton(value).iterator(); } public void toShortString(JBossStringBuilder buffer) { value.toShortString(buffer); } @Override public int hashCode() { return value.hashCode(); } @Override public boolean equals(Object obj) { return value.equals(obj); } public String toShortString() { return value.toShortString(); } } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factory/GenericBeanFactoryMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/factor0000644000175000017500000004014411147522315033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi.factory; import java.io.Serializable; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractAliasMetaData; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.util.JBossObject; /** * GenericBeanFactoryMetaData. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 59429 $ */ @XmlRootElement(name="beanfactory") @XmlType(name="beanfactoryType", propOrder={"aliases", "annotations", "classLoader", "constructor", "properties", "create", "start", "depends", "demands", "supplies", "installs", "uninstalls", "installCallbacks", "uninstallCallbacks"}) public class GenericBeanFactoryMetaData extends JBossObject implements BeanMetaDataFactory, Serializable { private static final long serialVersionUID = 1L; /** The name */ protected String name; /** The bean class name */ protected String bean; /** The bean factory class name */ protected String factoryClass; /** The access mode */ protected BeanAccessMode accessMode; /** The controller mode */ protected ControllerMode mode; /** The annotations */ protected Set annotations; /** The aliases */ protected Set aliases; /** The classloader */ protected ClassLoaderMetaData classLoader; /** The constructor metadata */ protected ConstructorMetaData constructor; /** The properties Map */ protected Set properties; /** The create lifecycle method */ protected LifecycleMetaData create; /** The start lifecycle method */ protected LifecycleMetaData start; /** The depends */ protected Set depends; /** The demands */ protected Set demands; /** The supplies */ protected Set supplies; /** The installs */ protected List installs; /** The uninstalls */ protected List uninstalls; /** The install callbacks */ protected List installCallbacks; /** The uninstall callbacks */ protected List uninstallCallbacks; public GenericBeanFactoryMetaData() { } public GenericBeanFactoryMetaData(String name, String bean) { this.name = name; this.bean = bean; } /** * Get the name * * @return the name */ public String getName() { return name; } /** * Set the bean name * * @param name the name */ @XmlAttribute public void setName(String name) { this.name = name; } /** * Get the bean class * * @return the bean class */ public String getBean() { return bean; } /** * Set the bean class * * @param bean the bean class */ @XmlAttribute(name="class") public void setBean(String bean) { this.bean = bean; } /** * Get the factory class. * * @return the factory class */ public String getFactoryClass() { return factoryClass; } /** * Set the factory class. * Note: this class param must either extend GenericBeanFactory * or have the same constructor and properties aka 'callbacks'. * * @param factoryClass the factory class */ @XmlAttribute(name="factoryClass") public void setFactoryClass(String factoryClass) { this.factoryClass = factoryClass; } /** * Get the aliases * * @return the aliases */ public Set getAliases() { return aliases; } /** * Set the aliases * * @param aliases the aliases */ @XmlElement(name="alias", type=AbstractAliasMetaData.class) public void setAliases(Set aliases) { this.aliases = aliases; } /** * Get the access mode. * * @return the access mode */ public BeanAccessMode getAccessMode() { return accessMode; } /** * Set the access mode. * * @param accessMode the access mode */ @XmlAttribute(name = "access-mode") public void setAccessMode(BeanAccessMode accessMode) { this.accessMode = accessMode; } /** * Get the mode * * @return the mode */ public ControllerMode getMode() { return mode; } /** * Set the mode * * @param mode the mode */ @XmlAttribute public void setMode(ControllerMode mode) { this.mode = mode; } /** * Get the annotations * * @return the annotations */ public Set getAnnotations() { return annotations; } /** * Set the annotations * * @param annotations the annotations */ @XmlElement(name="annotation", type=AbstractAnnotationMetaData.class) public void setAnnotations(Set annotations) { this.annotations = annotations; } /** * Get the classloader * * @return the classloader */ public ClassLoaderMetaData getClassLoader() { return classLoader; } /** * Set the classloader * * @param classLoader the classloader */ @XmlElement(name="classloader", type=AbstractClassLoaderMetaData.class) public void setClassLoader(ClassLoaderMetaData classLoader) { this.classLoader = classLoader; } /** * Get the constructor * * @return the constructor */ public ConstructorMetaData getConstructor() { return constructor; } /** * Set the constructor * * @param constructor the constructor */ @XmlElement(name="constructor", type=AbstractConstructorMetaData.class) public void setConstructor(ConstructorMetaData constructor) { this.constructor = constructor; } /** * Get the create * * @return the create */ public LifecycleMetaData getCreate() { return create; } /** * Set the create * * @param create the create */ @XmlElement(name="create", type=AbstractLifecycleMetaData.class) public void setCreate(LifecycleMetaData create) { this.create = create; } /** * Get the properties * * @return the properties */ public Set getProperties() { return properties; } /** * Set the properties * * @param properties the properties */ @XmlElement(name="property", type=AbstractPropertyMetaData.class) public void setProperties(Set properties) { this.properties = properties; } /** * Get the start * * @return the start */ public LifecycleMetaData getStart() { return start; } /** * Set the start * * @param start the start */ @XmlElement(name="start", type=AbstractLifecycleMetaData.class) public void setStart(LifecycleMetaData start) { this.start = start; } /** * Get the demans * * @return the demands */ @XmlElement(name="demand", type=AbstractDemandMetaData.class) public Set getDemands() { return demands; } /** * Set the demands * * @param demands the demands */ public void setDemands(Set demands) { this.demands = demands; } /** * Get the dependencies * * @return the dependencies */ public Set getDepends() { return depends; } /** * Set the dependencies * * @param depends the dependencies */ @XmlElement(name="depends", type=AbstractDependencyMetaData.class) public void setDepends(Set depends) { this.depends = depends; } /** * Get the install callbacks * * @return the install callbacks */ public List getInstallCallbacks() { return installCallbacks; } /** * Set the install callbacks * * @param installCallbacks the install callbacks */ @XmlElement(name="incallback", type=InstallCallbackMetaData.class) public void setInstallCallbacks(List installCallbacks) { this.installCallbacks = installCallbacks; } /** * Get the installs * * @return the installs */ public List getInstalls() { return installs; } /** * Set the installs * * @param installs the installs */ @XmlElement(name="install", type=AbstractInstallMetaData.class) public void setInstalls(List installs) { this.installs = installs; } /** * Get the supples * * @return the supplies */ public Set getSupplies() { return supplies; } /** * Set the supplies * * @param supplies the supplies */ @XmlElement(name="supply", type=AbstractSupplyMetaData.class) public void setSupplies(Set supplies) { this.supplies = supplies; } /** * Get the uninstall callbacks * * @return the uninstall callbacks */ public List getUninstallCallbacks() { return uninstallCallbacks; } /** * Set the uninstall callbacks * * @param uninstallCallbacks the uninstall callbacls */ @XmlElement(name="uncallback", type=UninstallCallbackMetaData.class) public void setUninstallCallbacks(List uninstallCallbacks) { this.uninstallCallbacks = uninstallCallbacks; } /** * Get the uninstalls * * @return the uninstalls */ public List getUninstalls() { return uninstalls; } /** * Set the uninstalls * * @param uninstalls the uninstalls */ @XmlElement(name="uninstall", type=AbstractInstallMetaData.class) public void setUninstalls(List uninstalls) { this.uninstalls = uninstalls; } @XmlTransient public List getBeans() { return Collections.singletonList(getBeanMetaData()); } @XmlTransient public BeanMetaData getBeanMetaData() { if (getBean() == null) { ConstructorMetaData constructor = getConstructor(); if (constructor == null) throw new IllegalArgumentException("BeanFactory should have a class attribute or a constructor element."); if (constructor.getFactoryMethod() == null) throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a factoryMethod attribute."); if (constructor.getFactory() == null && constructor.getFactoryClass() == null) throw new IllegalArgumentException("BeanFactory should have a class attribute or the constructor element should have a either a factoryClass attribute or a factory element."); } if (getFactoryClass() == null) setFactoryClass(GenericBeanFactory.class.getName()); AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData(name, getFactoryClass()); beanMetaData.setAnnotations(getAnnotations()); beanMetaData.setDemands(getDemands()); beanMetaData.setDepends(getDepends()); beanMetaData.setSupplies(getSupplies()); beanMetaData.setInstalls(getInstalls()); beanMetaData.setUninstalls(getUninstalls()); beanMetaData.setInstallCallbacks(getInstallCallbacks()); beanMetaData.setUninstallCallbacks(getUninstallCallbacks()); // builder util BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanMetaData); if (aliases != null) { Set theAliases = new HashSet(); for (AliasMetaData alias : aliases) theAliases.add(alias.getAliasValue()); builder.setAliases(theAliases); } builder.setMode(mode); ValueMetaData injectKernelConfigurator = builder.createInject(KernelConstants.KERNEL_CONFIGURATOR_NAME); builder.addConstructorParameter(KernelConfigurator.class.getName(), injectKernelConfigurator); if (bean != null) { builder.addPropertyMetaData("bean", bean); // add bean as related class builder.addRelatedClass(bean); } if (classLoader != null) { builder.setClassLoader(classLoader); builder.addPropertyMetaData("classLoader", builder.createValue(classLoader)); } if (accessMode != null) builder.addPropertyMetaData("accessMode", accessMode); if (constructor != null) builder.addPropertyMetaData("constructor", constructor); if (create != null) builder.addPropertyMetaData("create", create); if (start != null) builder.addPropertyMetaData("start", start); if (properties != null && properties.size() > 0) { PropertyMap propertyMap = new PropertyMap(); for (PropertyMetaData property : properties) { propertyMap.put(property.getName(), property.getValue()); } builder.addPropertyMetaData("properties", propertyMap); } return builder.getBeanMetaData(); } }././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/BeanMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/BeanMe0000644000175000017500000001230011043375327033056 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.List; import java.util.Set; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.beans.metadata.api.model.AutowireType; import org.jboss.beans.info.spi.BeanAccessMode; /** * Metadata about a bean. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 76312 $ */ public interface BeanMetaData extends FeatureMetaData, ValueMetaData { /** * Get the bean. * * @return the bean. */ String getBean(); /** * Get the name * * @return the name */ String getName(); /** * Get the related classes. * * @return the related classes */ Set getRelated(); /** * Set the name * * @param name the name */ void setName(String name); /** * The aliases * * @return the aliases or null if there are no aliases */ Set getAliases(); /** * Get the parent. * * @return the parent */ String getParent(); /** * Is abstract metadata. * * @return is abstract */ boolean isAbstract(); /** * Get the autowire type. * * @return the autowire type */ AutowireType getAutowireType(); /** * Get the mode * * @return the mode */ ControllerMode getMode(); /** * Set the name * * @param mode the mode */ void setMode(ControllerMode mode); /** * Get error handling mode * * @return the error handling mode */ ErrorHandlingMode getErrorHandlingMode(); /** * Get the access mode * * @return the access mode */ BeanAccessMode getAccessMode(); /** * Is this bean is a candidate for * getting injected via contextual matching * or callback resolution. * * @return true (default) if used for autowiring */ boolean isAutowireCandidate(); /** * Get the annotations * @return the bean annotations */ Set getAnnotations(); /** * Set the annotations * * @param annotations the annotations */ void setAnnotations(Set annotations); /** * Get the properties. * * @return List. */ Set getProperties(); /** * Get the bean ClassLoader * * @return the ClassLoader metadata */ ClassLoaderMetaData getClassLoader(); /** * Set the bean ClassLoader * * @param classLoader the ClassLoader metadata */ void setClassLoader(ClassLoaderMetaData classLoader); /** * Get the constructor * * @return the constructor metadata */ ConstructorMetaData getConstructor(); /** * Get the create lifecycle * * @return the create lifecycle */ LifecycleMetaData getCreate(); /** * Get the start lifecycle * * @return the start lifecycle */ LifecycleMetaData getStart(); /** * Get the stop lifecycle * * @return the stop lifecycle */ LifecycleMetaData getStop(); /** * Get the destroy lifecycle * * @return the destroy lifecycle */ LifecycleMetaData getDestroy(); /** * Get what this bean demands. * * @return Set */ Set getDemands(); /** * Get what this bean supplies. * * @return Set */ Set getSupplies(); /** * Get what this bean depends. * * @return Set */ Set getDepends(); /** * Get the installation oeprations. * * @return List */ List getInstalls(); /** * Get the uninstallation operations. * * @return List */ List getUninstalls(); /** * Get the installation oeprations. * * @return List */ List getInstallCallbacks(); /** * Get the uninstallation operations. * * @return List */ List getUninstallCallbacks(); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/RelatedClassMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Relate0000644000175000017500000000326511044026555033152 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.Set; /** * Metadata about a related class. * * @author Ales Justin */ public interface RelatedClassMetaData extends MetaDataVisitorNode { /** * Get the class name. * * @return the class name. */ String getClassName(); /** * Get the explictily enabled processing options. * * @return the enabled processing options */ Set getEnabled(); /** * Get the exact enabled processing option. * * @param exact type * @param type the type we are looking for * @return exact type instance or null if no such match */ T getEnabled(Class type); }././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/packag0000644000175000017500000000147710150404616033162 0ustar twernertwerner

Classes used to deploy beans.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/FeatureMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Featur0000644000175000017500000000300010446736533033160 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.Set; import org.jboss.util.JBossInterface; /** * General MetaData * * @author Adrian Brock * @version $Revision: 45764 $ */ public interface FeatureMetaData extends JBossInterface, MetaDataVisitorNode { /** * Get the descrition. * * @return the description. */ String getDescription(); /** * Get the annotations. * * @return Set. */ Set getAnnotations(); } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/DemandMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Demand0000644000175000017500000000333411147522315033122 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.dependency.spi.ControllerState; import org.jboss.util.JBossInterface; /** * Metadata about what a bean demands. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 84514 $ */ public interface DemandMetaData extends MetaDataVisitorNode, JBossInterface { /** * What is demanded * * @return the demand */ Object getDemand(); /** * Get when the dependency is required * * @return when the dependency is required */ ControllerState getWhenRequired(); /** * Get the target state * * @return the target state */ ControllerState getTargetState(); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/CallbackMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Callba0000644000175000017500000000345310764037353033121 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; /** * Metadata about a callback method. * * @author Ales Justin */ public interface CallbackMetaData extends LifecycleMetaData { /** * Get the cardinality. * * @return cardinality */ Cardinality getCardinality(); /** * Get the property name. * * @return the property name. */ String getProperty(); /** * Get the required state of the dependency * * @return the required state */ ControllerState getDependentState(); /** * Get signature. * * @return method / property parameter signature */ String getSignature(); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/DependencyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Depend0000644000175000017500000000257410367424640033143 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.util.JBossInterface; /** * Metadata about what a bean's dependency. * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface DependencyMetaData extends MetaDataVisitorNode, JBossInterface { /** * What is the dependency * * @return the dependency */ Object getDependency(); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/LifecycleMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Lifecy0000644000175000017500000000351410764027630033151 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.dependency.spi.ControllerState; /** * Metadata about a lifecycle method. * * @author Adrian Brock * @version $Revision: 70501 $ */ public interface LifecycleMetaData extends ParameterizedMetaData, FeatureMetaData { /** * Get the state * * @return the state */ ControllerState getState(); /** * Set the state * * @param state the state */ void setState(ControllerState state); /** * Get the method name. * * @return the method name. */ String getMethodName(); /** * Set the method name * * @param methodName the method name */ void setMethodName(String methodName); /** * Is default ignored. * * @return should we ignore default */ boolean isIgnored(); } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/CachingAnnotationMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Cachin0000644000175000017500000000265111051030332033103 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.lang.annotation.Annotation; /** * CachingAnnotationMetaData. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface CachingAnnotationMetaData extends AnnotationMetaData { /** * Retrieve any cached annotation and flush it * * @return the annotation instance or null if non was constructed */ Annotation removeAnnotation(); } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ValueM0000644000175000017500000000646610763764561033152 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.reflect.spi.TypeInfo; import org.jboss.util.JBossInterface; import org.jboss.xb.annotations.JBossXmlChild; import org.jboss.xb.annotations.JBossXmlGroup; import org.jboss.xb.annotations.JBossXmlGroupText; import org.jboss.xb.annotations.JBossXmlGroupWildcard; /** * Metadata about a value. * * @author Adrian Brock * @version $Revision: 70479 $ */ @JBossXmlGroup ({ @JBossXmlChild(name="array", type=AbstractArrayMetaData.class), @JBossXmlChild(name="collection", type=AbstractCollectionMetaData.class), @JBossXmlChild(name="inject", type=AbstractInjectionValueMetaData.class), @JBossXmlChild(name="list", type=AbstractListMetaData.class), @JBossXmlChild(name="map", type=AbstractMapMetaData.class), @JBossXmlChild(name="null", type=AbstractValueMetaData.class), @JBossXmlChild(name="set", type=AbstractSetMetaData.class), @JBossXmlChild(name="this", type=ThisValueMetaData.class), @JBossXmlChild(name="value", type=StringValueMetaData.class), @JBossXmlChild(name="value-factory", type= AbstractValueFactoryMetaData.class) }) @JBossXmlGroupText(wrapper= StringValueMetaData.class, property="value") @JBossXmlGroupWildcard(wrapper= AbstractValueMetaData.class, property="value") public interface ValueMetaData extends JBossInterface, MetaDataVisitorNode { /** * Get the underlying value * * @return the underlying value */ public Object getUnderlyingValue(); /** * Get the value. * * @param info the type info * @param cl the classloader * @return the value. * @throws Throwable for any error */ Object getValue(TypeInfo info, ClassLoader cl) throws Throwable; } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/AliasMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/AliasM0000644000175000017500000000255410737774537033126 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import javax.xml.bind.annotation.XmlTransient; import org.jboss.util.JBossInterface; /** * Metadata about an alias attribute. * * @author Ales Justin */ public interface AliasMetaData extends JBossInterface, MetaDataVisitorNode { @XmlTransient Object getAliasValue(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ConstructorMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Constr0000644000175000017500000000323610551435051033201 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; /** * Metadata about construction. * * @author Adrian Brock * @version $Revision: 59524 $ */ public interface ConstructorMetaData extends ParameterizedMetaData, FeatureMetaData { /** * Get the value. * * @return the value. */ ValueMetaData getValue(); /** * Get the factory. * * @return the factory. */ ValueMetaData getFactory(); /** * Get the factory class. * * @return the class name of the factory. */ String getFactoryClass(); /** * Get the factory method. * * @return the factory method. */ String getFactoryMethod(); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/PropertyMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Proper0000644000175000017500000000317210642732022033176 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; /** * Metadata about a property. * * @author Adrian Brock * @version $Revision: 63822 $ */ public interface PropertyMetaData extends FeatureMetaData { /** * Get the name. * * @return the name. */ String getName(); /** * Get property type if possible. * * @return class type if set, otherwise null */ String getType(); /** * Get the preinstantiate flag. * * @return the preinstantiate flag */ boolean isPreInstantiate(); /** * Get the value. * * @return the value. */ ValueMetaData getValue(); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ParameterMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/Parame0000644000175000017500000000307710764027630033147 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; /** * Metadata about a parameter. * * @author Adrian Brock * @version $Revision: 70501 $ */ public interface ParameterMetaData extends FeatureMetaData { /** * Get the type. * * @return the type. */ String getType(); /** * Get the value. * * @return the value. */ ValueMetaData getValue(); /** * Get the index * * @return index in list */ int getIndex(); /** * Set the index * * @param index the index */ void setIndex(int index); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/BeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/BeanMe0000644000175000017500000000247210754610307033065 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.List; /** * BeanMetaDataFactory. * * @author Adrian Brock * @version $Revision: 69827 $ */ public interface BeanMetaDataFactory { /** * Get the beans * * @return a List */ public List getBeans(); } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ClassMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/ClassM0000644000175000017500000000242110702533403033104 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import org.jboss.util.JBossInterface; /** * Class/interface metadata. * * @author Ales Justin */ public interface ClassMetaData extends JBossInterface { String getClassName(); } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/MetaDataVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/beans/metadata/spi/MetaDa0000644000175000017500000000526710665060420033072 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.beans.metadata.spi; import java.util.Stack; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * A metadata vistor. * * @author Adrian Brock * @version $Revision: 64920 $ */ public interface MetaDataVisitor { /** * Get the kernel controller context * * @return the context */ KernelControllerContext getControllerContext(); /** * Get the context state * * @return the context state */ ControllerState getContextState(); /** * Set the context state * * @param contextState the context state */ void setContextState(ControllerState contextState); /** * Add a dependency * * @param dependency the dependency */ void addDependency(DependencyItem dependency); /** * Add an install callback * * @param the callback item type * @param callback the callback */ void addInstallCallback(CallbackItem callback); /** * Add an uninstall callback * * @param the callback item type * @param callback the callback */ void addUninstallCallback(CallbackItem callback); /** * Visit the node * * @param node the node */ void initialVisit(MetaDataVisitorNode node); /** * Revisit the node * * @param node the node */ void describeVisit(MetaDataVisitorNode node); /** * Current meta data visited branch * * @return stack of meta data objects in this branch */ Stack visitorNodeStack(); } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/0000755000175000017500000000000011620312171027612 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/0000755000175000017500000000000011620312167030370 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/0000755000175000017500000000000011620312167032506 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/ClassMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Cla0000644000175000017500000000337710775133546033156 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * Match the class type. * * @param the class to match * @author Ales Justin */ public abstract class ClassMatcher extends NonNullMatcher { private Class clazz; protected ClassMatcher(Class clazz) { if (clazz == null) throw new IllegalArgumentException("Null class"); this.clazz = clazz; } protected boolean internalMatch(Object other) { return clazz.isInstance(other) && matchByType(clazz.cast(other)); } /** * Match by type. * * @param other the T para to match * @return true if matched, false otherwise */ protected abstract boolean matchByType(T other); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/NumberMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Num0000644000175000017500000000242610711377006033177 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * Number matcher. * * @author Ales Justin */ public abstract class NumberMatcher extends ClassMatcher { protected NumberMatcher() { super(Number.class); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/StringMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Str0000644000175000017500000000242610711377006033210 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * String matcher. * * @author Ales Justin */ public abstract class StringMatcher extends ClassMatcher { protected StringMatcher() { super(String.class); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/MatcherTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Mat0000644000175000017500000000254410711377006033162 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * Matcher transformer. * * @author Ales Justin */ public interface MatcherTransformer { /** * Transform value param to Matcher instance. * * @param value the value * @return Matcher instance */ Matcher transform(Object value); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/NonNullMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Non0000644000175000017500000000305211003122212033144 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * @author Ales Justin */ public abstract class NonNullMatcher implements Matcher { public boolean match(Object other) { return other != null && internalMatch(other); } public boolean needExactMatch() { return false; } /** * Do internal match. * * @param other the other param to match * @return true if matched, false otherwise */ protected abstract boolean internalMatch(Object other); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/MatcherFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Mat0000644000175000017500000000404210711377006033155 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; import org.jboss.kernel.plugins.dependency.MatcherFactoryBuilder; /** * Matcher factory. * Holding the obvious Matcher implementations. * * @author Ales Justin */ public abstract class MatcherFactory { /** The singleton builder */ private static final MatcherFactoryBuilder builder = new MatcherFactoryBuilder(); /** * Get the matcher factory * * @return the instance */ public static final MatcherFactory getInstance() { return builder.create(); } /** * Add matcher transfomer. * * @param key the key * @param transformer the transfomer */ public abstract void addMatcherTransfomer(String key, MatcherTransformer transformer); /** * Create the Matcher. * * @param transformer the transformer * @param value the value to wrap * @return new Matcher instance */ public abstract Matcher createMatcher(String transformer, Object value); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Matcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Mat0000644000175000017500000000313511003122212033135 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * Matcher. * Match this instance against any object. * * @author Ales Justin */ public interface Matcher { /** * Do we match this object other param. * * @param other the object to match * @return true if we match the other param, false otherwise */ boolean match(Object other); /** * Do we need an exact match. * No match or single match is acceptable. * * @return true if matcher accepts only exact matches */ boolean needExactMatch(); } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/NonNullMatcherTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/api/dependency/Non0000644000175000017500000000321510711377006033167 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.api.dependency; /** * Non null matcher transfomer. * Throws exception if value to transform is null. * * @author Ales Justin */ public abstract class NonNullMatcherTransformer implements MatcherTransformer { public Matcher transform(Object value) { if (value == null) throw new IllegalArgumentException("Null value"); return internalTransform(value); } /** * Transform non null value. * * @param value the value * @return matcher instance */ protected abstract Matcher internalTransform(Object value); } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/Kernel.java0000644000175000017500000002056311216157032031707 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.validation.KernelBeanValidator; /** * The kernel.

* * The kernel is the entry point into the kernel services. * * @author Adrian Brock * @author Les A. Hazlewood * @author Ales Justin * @version $Revision: 90317 $ */ @SuppressWarnings("deprecation") public class Kernel { /** The permission required to access the kernel */ public static final KernelPermission ACCESS = new KernelPermission("access"); /** The permission required to configure the kernel */ public static final KernelPermission CONFIGURE = new KernelPermission("configure"); /** Whether kernel permission checking is active */ private static final boolean enablePermissionChecking; /** The kernel bus */ protected KernelBus bus; /** The kernel config */ protected KernelConfig config; /** The kernel configurator */ protected KernelConfigurator configurator; /** The kernel controller */ protected KernelController controller; /** The kernel event manager */ protected KernelEventManager eventManager; /** The kernel meta data repository */ protected KernelMetaDataRepository metaDataRepository; /** The kernel registry */ protected org.jboss.kernel.spi.registry.KernelRegistry registry; /** The kernel bean validator */ protected KernelBeanValidator validator; static { boolean checkingEnabled = false; try { checkingEnabled = Boolean.getBoolean(KernelPermission.class.getName()); } catch (Throwable ignored) { } enablePermissionChecking = checkingEnabled; } /** * Check whether we can access the kernel * * @throws SecurityException if the you don't have KernelPermission('access') */ public static void checkAccess() { if (enablePermissionChecking) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(ACCESS); } } /** * Check whether we can configure the kernel * * @throws SecurityException if the you don't have KernelPermission('configure') */ public static void checkConfigure() { if (enablePermissionChecking) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(CONFIGURE); } } /** * Get the kernel bus * * @return the kernel bus * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelBus getBus() { checkAccess(); return bus; } /** * Set the kernel bus.

* * @param bus the kernel bus * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setBus(KernelBus bus) { checkConfigure(); this.bus = bus; } /** * Get the kernel config * * @return the kernel config * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelConfig getConfig() { checkAccess(); return config; } /** * Set the kernel config.

* * @param config the kernel config * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setConfig(KernelConfig config) { checkConfigure(); this.config = config; } /** * Get the kernel configurator * * @return the kernel configurator * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelConfigurator getConfigurator() { checkAccess(); return configurator; } /** * Set the kernel configurator.

* * @param configurator the kernel configurator * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setConfigurator(KernelConfigurator configurator) { checkConfigure(); this.configurator = configurator; } /** * Get the kernel controller * * @return the kernel controller * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelController getController() { checkAccess(); return controller; } /** * Set the kernel controller.

* * @param controller the kernel controller * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setController(KernelController controller) { checkConfigure(); this.controller = controller; } /** * Get the event manager * * @return the event manager * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelEventManager getEventManager() { checkAccess(); return eventManager; } /** * Set the event manager. * * @param eventManager the event manager * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setEventManager(KernelEventManager eventManager) { checkConfigure(); this.eventManager = eventManager; } /** * Get the kernel registry * * @return the kernel registry * @throws SecurityException if the you don't have KernelPermission('access') */ public org.jboss.kernel.spi.registry.KernelRegistry getRegistry() { checkAccess(); return registry; } /** * Set the kernel registry.

* * @param registry the kernel registry * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setRegistry(org.jboss.kernel.spi.registry.KernelRegistry registry) { checkConfigure(); this.registry = registry; } /** * Get the Meta Data Repository. * * @return the meta data repository. * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelMetaDataRepository getMetaDataRepository() { checkAccess(); return metaDataRepository; } /** * Set the meta data repository. * * @param metaDataRepository the meta data repository. * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setMetaDataRepository(KernelMetaDataRepository metaDataRepository) { checkConfigure(); this.metaDataRepository = metaDataRepository; } /** * Get the kernel bean validator. * * @return the bean validator * @throws SecurityException if the you don't have KernelPermission('access') */ public KernelBeanValidator getValidator() { checkAccess(); return validator; } /** * Set the bean validator. * * @param validator the bean validator. * @throws SecurityException if the you don't have KernelPermission('configure') */ public void setValidator(KernelBeanValidator validator) { checkConfigure(); this.validator = validator; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/0000755000175000017500000000000011620312167031300 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000755000175000017500000000000011620312163033375 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/package-info.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000346011147522315033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ @JBossXmlAdaptedTypes ({ @JBossXmlAdaptedType(type=Cardinality.class, valueAdapter=CardinalityValueAdapter.class), @JBossXmlAdaptedType(type=ControllerState.class, valueAdapter=ControllerStateValueAdapter.class), @JBossXmlAdaptedType(type=SearchInfo.class, valueAdapter=SearchInfoValueAdapter.class) }) package org.jboss.kernel.plugins.deployment; import org.jboss.beans.metadata.plugins.CardinalityValueAdapter; import org.jboss.beans.metadata.plugins.ControllerStateValueAdapter; import org.jboss.beans.metadata.plugins.SearchInfoValueAdapter; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.xb.annotations.JBossXmlAdaptedType; import org.jboss.xb.annotations.JBossXmlAdaptedTypes; ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployment.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000003420711112747671033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment; import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.beans.metadata.plugins.AbstractAnnotationMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData; import org.jboss.beans.metadata.plugins.AbstractLazyMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.plugins.AbstractNamedAliasMetaData; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.plugins.MutableLifecycleHolder; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.AnnotationMetaData; 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.LifecycleMetaData; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.factory.GenericBeanFactoryMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.managed.api.annotation.ManagementDeployment; import org.jboss.managed.api.annotation.ManagementObject; import org.jboss.managed.api.annotation.ManagementProperties; import org.jboss.managed.api.annotation.ManagementProperty; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlSchema; /** * An abstract kernel deployment. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 81535 $ */ @ManagementDeployment(types={"jboss-beans"}) @ManagementObject(properties = ManagementProperties.EXPLICIT) // TODO - explicitly add props we want to manage @JBossXmlSchema(namespace="urn:jboss:bean-deployer:2.0", elementFormDefault=XmlNsForm.QUALIFIED, replacePropertyRefs=false) @XmlRootElement(name="deployment") @XmlType(name="deploymentType", propOrder={"annotations", "classLoader", "beanFactories", "create", "start", "stop", "destroy", "aliases"}) public class AbstractKernelDeployment extends JBossObject implements KernelDeployment, MutableLifecycleHolder, Serializable { private static final long serialVersionUID = 3l; /** The name of the deployment */ protected String name; /** Whether it is installed */ protected boolean installed; /** The installed contexts */ protected transient List installedContexts = new CopyOnWriteArrayList(); /** Is deployment scoped */ protected Boolean scoped; /** The annotations */ protected Set annotations; /** The beans List */ protected List beanFactories; /** The ClassLoader */ protected ClassLoaderMetaData classLoader; /** default create lifecycle method */ protected LifecycleMetaData create; /** default start lifecycle method */ protected LifecycleMetaData start; /** default stop lifecycle method */ protected LifecycleMetaData stop; /** default destroy lifecycle method */ protected LifecycleMetaData destroy; /** The ControllerMode */ protected ControllerMode mode; /** The aliases */ protected Set aliases; /** * Create a new kernel deployment */ public AbstractKernelDeployment() { } /** * Set the bean factories. * * @deprecated use setBeanFactories * @param beans a List. */ @SuppressWarnings("unchecked") @Deprecated public void setBeans(List beans) { this.beanFactories = beans; flushJBossObjectCache(); } /** * Set the bean factories. * * @param beanFactories a List. */ @ManagementProperty(managed=true) @XmlElements ({ @XmlElement(name="bean", type=AbstractBeanMetaData.class), @XmlElement(name="beanfactory", type=GenericBeanFactoryMetaData.class), @XmlElement(name="lazy", type=AbstractLazyMetaData.class) }) @XmlAnyElement public void setBeanFactories(List beanFactories) { this.beanFactories = beanFactories; flushJBossObjectCache(); } public String getName() { return name; } @XmlAttribute public void setName(String name) { this.name = name; flushJBossObjectCache(); } public boolean isInstalled() { return installed; } public void setInstalled(boolean installed) { this.installed = installed; flushJBossObjectCache(); } public void addInstalledContext(KernelControllerContext context) { installedContexts.add(context); flushJBossObjectCache(); } public List getInstalledContexts() { return installedContexts; } public void removeInstalledContext(KernelControllerContext context) { installedContexts.remove(context); flushJBossObjectCache(); } public List getBeans() { List result = new ArrayList(); // Include the classloader if it is a bean ClassLoaderMetaData classLoaderMetaData = getClassLoader(); if (classLoaderMetaData != null) { ValueMetaData classLoader = classLoaderMetaData.getClassLoader(); if (classLoader instanceof BeanMetaData) { // Hack, if it doesn't have a classloader use the "null" classloader // we don't want it to gain itself as the classloader BeanMetaData classLoaderBean = (BeanMetaData) classLoader; if (classLoaderBean.getClassLoader() == null) classLoaderBean.setClassLoader(new AbstractClassLoaderMetaData(new AbstractValueMetaData())); result.add((BeanMetaData) classLoader); } } List factories = getBeanFactories(); if (factories != null && factories.isEmpty() == false) { for (BeanMetaDataFactory factory : factories) { if (factory == null) throw new IllegalArgumentException("BeanMetaDataFactory cannot be null."); List beans = factory.getBeans(); if (beans != null && beans.isEmpty() == false) { for (BeanMetaData bmd : beans) { if (bmd == null) throw new IllegalArgumentException("Bean meta data cannot be null."); // check annotations if (annotations != null && annotations.isEmpty() == false) { Set annotationsBMD = bmd.getAnnotations(); if (annotationsBMD == null) { annotationsBMD = new HashSet(); bmd.setAnnotations(annotationsBMD); } annotationsBMD.addAll(annotations); } // impl specific if (bmd instanceof AbstractBeanMetaData) { AbstractBeanMetaData bean = (AbstractBeanMetaData)bmd; // set deployment defaults, if not already set per bean if (bean.getCreate() == null && getCreate() != null) { bean.setCreate(getCreate()); } if (bean.getStart() == null && getStart() != null) { bean.setStart(getStart()); } if (bean.getStop() == null && getStop() != null) { bean.setStop(getStop()); } if (bean.getDestroy() == null && getDestroy() != null) { bean.setDestroy(getDestroy()); } // controller mode if (bean.getMode() == null && getMode() != null) { bean.setMode(getMode()); } } // Use any deployment classloader if present and the bean doesn't have one ClassLoaderMetaData beanClassLoader = bmd.getClassLoader(); if (beanClassLoader == null) { ClassLoaderMetaData deploymentClassLoader = getClassLoader(); if (deploymentClassLoader != null) { // If the deployment classloader is a bean, replace it with an injection ValueMetaData classLoader = deploymentClassLoader.getClassLoader(); if (classLoader instanceof BeanMetaData) { classLoader = new AbstractDependencyValueMetaData(((BeanMetaData) classLoader).getName()); beanClassLoader = new AbstractClassLoaderMetaData(classLoader); } else { beanClassLoader = deploymentClassLoader; } bmd.setClassLoader(beanClassLoader); } } } result.addAll(beans); } } } // For backwards compatibility if (result.isEmpty()) return null; return result; } public Boolean getScoped() { return scoped; } @XmlAttribute public void setScoped(Boolean scoped) { this.scoped = scoped; } public Set getAnnotations() { return annotations; } @XmlElement(name="annotation", type=AbstractAnnotationMetaData.class) public void setAnnotations(Set annotations) { this.annotations = annotations; } public List getBeanFactories() { return beanFactories; } public ClassLoaderMetaData getClassLoader() { return classLoader; } /** * Set the classloader * * @param classLoader the classloader metadata */ @XmlElement(name="classloader", type=AbstractClassLoaderMetaData.class) public void setClassLoader(ClassLoaderMetaData classLoader) { this.classLoader = classLoader; } public LifecycleMetaData getCreate() { return create; } @XmlElement(name="create", type=AbstractLifecycleMetaData.class) public void setCreate(LifecycleMetaData create) { create.setState(ControllerState.CREATE); this.create = create; } public LifecycleMetaData getStart() { return start; } @XmlElement(name="start", type=AbstractLifecycleMetaData.class) public void setStart(LifecycleMetaData start) { start.setState(ControllerState.START); this.start = start; } public LifecycleMetaData getStop() { return stop; } @XmlElement(name="stop", type=AbstractLifecycleMetaData.class) public void setStop(LifecycleMetaData stop) { stop.setState(ControllerState.START); this.stop = stop; } public LifecycleMetaData getDestroy() { return destroy; } @XmlElement(name="destroy", type=AbstractLifecycleMetaData.class) public void setDestroy(LifecycleMetaData destroy) { destroy.setState(ControllerState.CREATE); this.destroy = destroy; } public Set getAliases() { return aliases; } @XmlElement(name="alias", type=AbstractNamedAliasMetaData.class) public void setAliases(Set aliases) { this.aliases = aliases; } public ControllerMode getMode() { return mode; } @XmlAttribute public void setMode(ControllerMode mode) { this.mode = mode; } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); buffer.append(" installed=").append(installed); if (classLoader != null) buffer.append(" classLoader=").append(classLoader); if (beanFactories != null) buffer.append(" beanFactories=").append(beanFactories); } public void toShortString(JBossStringBuilder buffer) { buffer.append(name); } private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); installedContexts = new CopyOnWriteArrayList(); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000003205411147522315033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; 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.kernel.spi.deployment.KernelDeployment; import org.jboss.logging.Logger; import org.jboss.util.JBossStringBuilder; /** * An Kernel deployer. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 84514 $ */ public class AbstractKernelDeployer { /** The log */ private static final Logger log = Logger.getLogger(AbstractKernelDeployer.class); /** The kernel */ protected Kernel kernel; /** The controller */ protected KernelController controller; /** The required state */ protected ControllerState requiredState; /** The mode */ protected ControllerMode mode; /** * Create a new kernel deployer * * @param kernel the kernel */ public AbstractKernelDeployer(Kernel kernel) { this(kernel, null, null); } /** * Create a new kernel deployer with mode * * @param kernel the kernel * @param mode the controller mode */ public AbstractKernelDeployer(Kernel kernel, ControllerMode mode) { this(kernel, null, mode); } /** * Create a new kernel deployer * * @param kernel the kernel * @param requiredState the required state * @param mode the controller mode */ public AbstractKernelDeployer(final Kernel kernel, ControllerState requiredState, ControllerMode mode) { if (kernel == null) throw new IllegalArgumentException("Null kernel"); this.kernel = kernel; PrivilegedAction action = new PrivilegedAction() { public Object run() { controller = kernel.getController(); return null; } }; AccessController.doPrivileged(action); this.requiredState = requiredState; this.mode = mode; } /** * Deploy a deployment * * @param deployment the deployment * @throws Throwable for any error */ public void deploy(final KernelDeployment deployment) throws Throwable { if (deployment.isInstalled()) throw new IllegalArgumentException("Already installed " + deployment.getName()); try { deployBeans(controller, deployment); deployment.setInstalled(true); } catch (Throwable t) { undeploy(deployment); throw t; } } /** * Change a deployments state * * @param deployment the deployment * @param state the state * @throws Throwable for any error */ public void change(KernelDeployment deployment, ControllerState state) throws Throwable { if (deployment.isInstalled() == false) throw new IllegalStateException("Not installed " + deployment.getName()); changeBeans(controller, deployment, state); } /** * Undeploy a deployment * * @param deployment the deployment */ public void undeploy(KernelDeployment deployment) { undeployBeans(controller, deployment); deployment.setInstalled(false); } /** * Validate all deployments * * @throws Throwable for any error */ public void validate() throws Throwable { Set notInstalled = controller.getNotInstalled(); internalValidate(notInstalled); } /** * Validate a deployment * * @param deployment the deployment * @throws Throwable for any error */ public void validate(KernelDeployment deployment) throws Throwable { Set notInstalled = new HashSet(deployment.getInstalledContexts()); internalValidate(notInstalled); } /** * Validate a deployment * * @param notInstalled the not installed deployments * @throws Throwable for any error */ protected void internalValidate(Set notInstalled) throws Throwable { if (notInstalled.isEmpty() == false) { for (Iterator i = notInstalled.iterator(); i.hasNext();) { ControllerContext context = i.next(); if (context.getState().equals(context.getRequiredState())) i.remove(); } if (notInstalled.isEmpty() == false) { HashSet errors = new HashSet(); HashSet incomplete = new HashSet(); for (ControllerContext ctx : notInstalled) { if (ctx.getState().equals(ControllerState.ERROR)) errors.add(ctx); else incomplete.add(ctx); } JBossStringBuilder buffer = new JBossStringBuilder(); buffer.append("Incompletely deployed:\n"); if (errors.size() != 0) { buffer.append("\nDEPLOYMENTS IN ERROR:\n"); for (ControllerContext ctx : errors) { buffer.append(String.format(" Deployment \"%s\" is in error due to: %s\n", ctx.getName(), ctx.getError())); } } if (incomplete.size() != 0) { buffer.append("\nDEPLOYMENTS MISSING DEPENDENCIES:\n"); for (ControllerContext ctx : incomplete) { Object name = ctx.getName(); buffer.append(String.format(" Deployment \"%s\" is missing the following dependencies:\n", name)); DependencyInfo dependsInfo = ctx.getDependencyInfo(); Set depends = dependsInfo.getIDependOn(null); for (DependencyItem item : depends) { ControllerState dependentState = item.getDependentState(); if (dependentState == null) dependentState = ControllerState.INSTALLED; ControllerState otherState = null; ControllerContext other = null; Object iDependOn = item.getIDependOn(); if (name.equals(iDependOn) == false) { if (iDependOn != null) { other = controller.getContext(iDependOn, null); if (other != null) otherState = other.getState(); } boolean print = true; if (otherState != null && otherState.equals(ControllerState.ERROR) == false) { ControllerStateModel states = controller.getStates(); if (states.isBeforeState(otherState, dependentState) == false) print = false; } if (print) { buffer.append(String.format(" Dependency \"%s\" (should be in state \"%s\", but is actually %s)\n", iDependOn, dependentState.getStateString(), iDependOn == null ? String.format("unresolved (%s)", item.toHumanReadableString()) : other == null ? "not found" : String.format("in state \"%s\"", otherState.getStateString()))); } } } } } throw new IllegalStateException(buffer.toString()); } } } /** * Deploy the beans in a deployment * * @param controller the controller * @param deployment the deployment * @throws Throwable for any error */ protected void deployBeans(KernelController controller, KernelDeployment deployment) throws Throwable { List beans = deployment.getBeans(); if (beans != null) { for (BeanMetaData metaData : beans) { KernelControllerContext context = deployBean(controller, metaData); deployment.addInstalledContext(context); } } } /** * Deploy a bean * * @param controller the controller * @param bean the bean metadata * @return the KernelControllerContext * @throws Throwable for any error */ protected KernelControllerContext deployBean(KernelController controller, BeanMetaData bean) throws Throwable { KernelControllerContext context = new AbstractKernelControllerContext(null, bean, null); if (requiredState != null) context.setRequiredState(requiredState); if (mode != null) context.setMode(mode); controller.install(context); return context; } /** * Change the beans in a deployment * * @param controller the controller * @param deployment the deployment * @param state the state * @throws Throwable for any error */ protected void changeBeans(KernelController controller, KernelDeployment deployment, ControllerState state) throws Throwable { List contexts = deployment.getInstalledContexts(); if (contexts != null) { for (KernelControllerContext context : contexts) { changeBean(controller, context, state); } } } /** * Change a bean * * @param controller the controller * @param context the context * @param state the state * @throws Throwable for any error */ protected void changeBean(KernelController controller, KernelControllerContext context, ControllerState state) throws Throwable { if (ControllerMode.MANUAL.equals(context.getMode()) && ControllerState.ERROR.equals(context.getState()) == false) controller.change(context, state); } /** * Undeploy the beans in a deployment * * @param controller the controller * @param deployment the deployment */ protected void undeployBeans(KernelController controller, KernelDeployment deployment) { List contexts = deployment.getInstalledContexts(); if (contexts.isEmpty() == false) { for (ListIterator i = contexts.listIterator(contexts.size()); i.hasPrevious();) { KernelControllerContext context = i.previous(); try { undeployBean(controller, context); deployment.removeInstalledContext(context); } catch (Throwable ignored) { log.warn("Ignored error during uninstall of " + context, ignored); } } } } /** * Undeploy a bean * * @param controller the controller * @param context the context of the bean * @throws Throwable for any error */ protected void undeployBean(KernelController controller, KernelControllerContext context) throws Throwable { if (controller.isShutdown() == false) controller.uninstall(context.getName()); else log.debug("Not undeploying " + context.getName() + " the controller is shutdown!"); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/AbstractKernelDeployment10.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000407210763540652033417 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment; import javax.xml.bind.annotation.XmlNsForm; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import org.jboss.managed.api.annotation.ManagementObject; import org.jboss.managed.api.annotation.ManagementProperties; import org.jboss.xb.annotations.JBossXmlSchema; /** * An abstract kernel deployment. * * @author Ales Justin * @author Adrian Brock * @version $Revision: 69895 $ */ @ManagementObject(properties = ManagementProperties.EXPLICIT) // TODO - explicitly add props we want to manage @JBossXmlSchema(namespace="urn:jboss:bean-deployer", elementFormDefault=XmlNsForm.QUALIFIED) @XmlRootElement(name="deployment") @XmlType(name="deploymentType", propOrder={"annotations", "classLoader", "beanFactories"}) public class AbstractKernelDeployment10 extends AbstractKernelDeployment { private static final long serialVersionUID = 3l; /** * Create a new kernel deployment version 1 */ public AbstractKernelDeployment10() { } }././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000153010152731302033375 0ustar twernertwerner

Kernel plugins, an abstract deployment implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/BasicKernelDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000626310756342051033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment; import java.util.List; import java.util.ListIterator; import java.util.concurrent.CopyOnWriteArrayList; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.logging.Logger; /** * BasicKernelDeployer.

* * An extension to the abstract kernel deployer that keeps track * of deployments and adds a simple shutdown method. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class BasicKernelDeployer extends AbstractKernelDeployer { /** The log */ private static final Logger log = Logger.getLogger(BasicKernelDeployer.class); /** The deployments */ protected List deployments = new CopyOnWriteArrayList(); /** * Create a new BasicKernelDeployer. * * @param kernel the kernel */ public BasicKernelDeployer(Kernel kernel) { this(kernel, null); } /** * Create a new BasicKernelDeployer with mode. * * @param kernel the kernel * @param mode the controller mode */ public BasicKernelDeployer(Kernel kernel, ControllerMode mode) { super(kernel, mode); } public void deploy(KernelDeployment deployment) throws Throwable { final boolean trace = log.isTraceEnabled(); if (trace) log.trace("Deploying " + deployment); super.deploy(deployment); deployments.add(deployment); if (trace) log.trace("Deployed " + deployment); } public void undeploy(KernelDeployment deployment) { final boolean trace = log.isTraceEnabled(); if (trace) log.trace("Undeploying " + deployment); deployments.remove(deployment); super.undeploy(deployment); if (trace) log.trace("Undeployed " + deployment); } /** * Shutdown the deployer (undeploys everything) */ public void shutdown() { ListIterator iterator = deployments.listIterator(deployments.size()); while (iterator.hasPrevious()) { KernelDeployment deployment = iterator.previous(); undeploy(deployment); } } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/xml/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000755000175000017500000000000011620312163033375 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/xml/BasicXMLDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000001356410756342051033420 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.io.InputStream; import java.net.URL; import java.util.Collection; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.BasicKernelDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.logging.Logger; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; /** * BasicXMLDeployer. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class BasicXMLDeployer extends BasicKernelDeployer { /** The log */ private static final Logger log = Logger.getLogger(BasicXMLDeployer.class); /** Unmarshaller factory */ private static final UnmarshallerFactory factory = UnmarshallerFactory.newInstance(); /** The resolver */ private static final SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); /** The deployments by url or name */ private Map deploymentsByName = new ConcurrentHashMap(); /** * Create a new XML deployer * * @param kernel the kernel */ public BasicXMLDeployer(Kernel kernel) { this(kernel, null); } /** * Create a new XML deployer with mode. * * @param kernel the kernel * @param mode the controller mode */ public BasicXMLDeployer(Kernel kernel, ControllerMode mode) { super(kernel, mode); } public Collection getDeploymentNames() { return deploymentsByName.keySet(); } public void deploy(KernelDeployment deployment) throws Throwable { super.deploy(deployment); deploymentsByName.put(deployment.getName(), deployment); } public void undeploy(KernelDeployment deployment) { deploymentsByName.remove(deployment.getName()); super.undeploy(deployment); } /** * Undeploy a url * * @param url the url to undeploy * @throws IllegalStateException if the url is unknown */ public void undeploy(final URL url) { if (url == null) throw new IllegalArgumentException("Null url"); undeploy(url.toString()); } /** * Undeploy a name deployment * * @param name the name of the deployment to undeploy * @throws IllegalStateException if the name is unknown */ public void undeploy(final String name) { if (name == null) throw new IllegalArgumentException("Null name"); KernelDeployment deployment = deploymentsByName.remove(name); if (deployment == null) throw new IllegalStateException("Unknown deployment " + name); undeploy(deployment); } /** * Deploy a url * * @param url the url to deploy * @return the kernel deployment * @throws Throwable for any error */ public KernelDeployment deploy(final URL url) throws Throwable { final boolean trace = log.isTraceEnabled(); if (url == null) throw new IllegalArgumentException("Null url"); if (trace) log.trace("Parsing " + url); long start = System.currentTimeMillis(); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver); if (deployment == null) throw new RuntimeException("The xml " + url + " is not well formed!"); deployment.setName(url.toString()); if (trace) { long now = System.currentTimeMillis(); log.trace("Parsing " + url + " took " + (now-start) + " milliseconds"); } deploy(deployment); if (trace) { long now = System.currentTimeMillis(); log.trace("Deploying " + url + " took " + (now-start) + " milliseconds"); } return deployment; } /** * Deploy a stream. We may be deploying XML fragments. * * @param deploymentName the deployment name * @param stream the stream * @return the kernel deployment * @throws Throwable for any error */ public KernelDeployment deploy(String deploymentName, final InputStream stream) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Parsing " + deploymentName); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(stream, resolver); if (deployment == null) throw new RuntimeException("The deployment " + deploymentName + " is not well formed!"); deployment.setName(deploymentName); deploy(deployment); return deployment; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/xml/BeanXMLDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000001113110505734347033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.xml; import java.io.InputStream; import java.net.URL; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.logging.Logger; import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver; /** * An XML deployer. * * @author Adrian Brock * @author Les A. Hazlewood * @author Marc Fleury * @version $Revision: 57133 $ */ public class BeanXMLDeployer extends AbstractKernelDeployer { /** The log */ private static final Logger log = Logger.getLogger(BeanXMLDeployer.class); /** Unmarshaller factory */ private static final UnmarshallerFactory factory = UnmarshallerFactory.newInstance(); /** The resolver */ private static final SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver(); /** * Create a new XML kernel deployer * * @param kernel the kernel * @throws Throwable for any error */ public BeanXMLDeployer(Kernel kernel) throws Throwable { super(kernel); } /** * Deploy a url * * @param url the url to deploy * @return the kernel deployment * @throws Throwable for any error */ public KernelDeployment deploy(final URL url) throws Throwable { final boolean trace = log.isTraceEnabled(); if (url == null) throw new IllegalArgumentException("Null url"); if (trace) log.trace("Parsing " + url); long start = System.currentTimeMillis(); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver); if (deployment == null) throw new RuntimeException("The xml " + url + " is not well formed!"); deployment.setName(url.toString()); long now = System.currentTimeMillis(); log.debug("Parsing " + url + " took " + (now -start) + " milliseconds"); if (trace) log.trace("Deploying " + deployment); deploy(deployment); now = System.currentTimeMillis(); log.debug("Deploying " + url + " took " + (now -start) + " milliseconds"); if (trace) log.trace("Deployed " + deployment.getInstalledContexts()); return deployment; } /** * Deploy a stream. We may be deploying XML fragments. * * @param deploymentName the deployment name * @param stream the stream * @return the kernel deployment * @throws Throwable for any error */ public KernelDeployment deploy(String deploymentName, final InputStream stream) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Parsing " + deploymentName); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(stream, resolver); if (deployment == null) throw new RuntimeException("The deployment " + deploymentName + " is not well formed!"); deployment.setName(deploymentName); if (trace) log.trace("Deploying " + deployment); deploy(deployment); if (trace) log.trace("Deployed " + deployment.getInstalledContexts()); return deployment; } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000755000175000017500000000000011620312163033375 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/VertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000351510756342051033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props; import org.jboss.util.graph.Visitor; /** * Vertex factory. * * @author Ales Justin */ public interface VertexFactory { /** * Create root/deploymenent vertex. * * @return DeploymentVertex instance */ DeploymentVertex rootVertex(); /** * Create simple vertex. * * @param level current level * @param name full name * @return new tree vertex */ TreeVertex createVertex(int level, String name); /** * Create value vertext. * * @param value the text value * @return new value vertex */ TreeVertex valueVertex(String value); /** * Get the visitor. * * @return visitor instance */ Visitor visitor(); } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000755000175000017500000000000011620312163033375 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/AbstractLevelVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000275310716050342033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; /** * Ordered level vertex factory. * * @author Ales Justin */ public abstract class AbstractLevelVertexFactory implements LevelVertexFactory { private int order = 0; protected AbstractLevelVertexFactory() { } protected AbstractLevelVertexFactory(int order) { this.order = order; } public int getOrder() { return order; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/HolderVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000351511262376750033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; /** * Simple holder vertex factory. * * @author Ales Justin */ public class HolderVertexFactory extends AbstractLevelVertexFactory { public HolderVertexFactory() { super(Integer.MAX_VALUE); } public TreeVertex createVertex(String name) { return new HolderVertex(name); } /** * Holder vertex. */ static class HolderVertex extends TreeVertex> { public HolderVertex(String name) { super(name); } public void visit(Vertex parent, Set> children) { } } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BaseDeploymentVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000361510716050342033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.kernel.plugins.deployment.props.DeploymentVertex; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.util.graph.Vertex; /** * Deployment vertex. * * @author Ales Justin */ public class BaseDeploymentVertex extends DeploymentVertex { private AbstractKernelDeployment deployment; public BaseDeploymentVertex() { super("(root)"); } public void visit(Vertex parent, Set> children) { deployment = new AbstractKernelDeployment(); } AbstractKernelDeployment getDeployment() { return deployment; } public KernelDeployment get() { return getDeployment(); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ClassVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000365511262376750033426 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; /** * Class vertex factory. * * @author Ales Justin */ public class ClassVertexFactory extends KeywordLevelVertexFactory { public ClassVertexFactory() { super("(class)"); } protected TreeVertex createVertex(String name, String keyword) { return new ClassVertex(name); } static class ClassVertex extends TreeVertex { public ClassVertex(String name) { super(name); } public void visit(BeanVertexFactory.BeanVertex parent, Set> children) { Vertex value = getNext(this); parent.getBeanMetaData().setBean(value.getName()); } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/PropertyVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000431311262376750033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; /** * Property vertex factory. * * @author Ales Justin */ public class PropertyVertexFactory extends AbstractLevelVertexFactory { public PropertyVertexFactory() { super(Integer.MAX_VALUE); } public TreeVertex createVertex(String name) { return new PropertyVertex(name); } /** * Property vertex. */ static class PropertyVertex extends ValueMetaDataAwareVertex { public PropertyVertex(String name) { super(name); } protected AbstractPropertyMetaData createValueMetaDataAware() { return new AbstractPropertyMetaData(); } public void visit(BeanVertexFactory.BeanVertex parent, Set> children) { delegate.setName(getLastToken()); parent.getBeanMetaData().addProperty(delegate); } } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ComplexValueVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000517210741206717033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; /** * Complex Value vertex. * * @author Ales Justin */ public class ComplexValueVertex extends TreeVertex> { public ComplexValueVertex(String value) { super(value); } public void visit(Vertex parent, Set> children) { if (parent instanceof ValueMetaDataAware) { String[] tokens = getName().split("\\."); if ("(inject)".equals(tokens[0]) == false) throw new IllegalArgumentException("Currently only injection is supported."); ValueMetaData value; if ("autowire".equals(tokens[1])) { value = new AbstractInjectionValueMetaData(); } else { if (tokens.length > 2) { value = new AbstractDependencyValueMetaData(tokens[1], tokens[2]); } else { value = new AbstractDependencyValueMetaData(tokens[1]); } } ValueMetaDataAware valueMetaDataAware = (ValueMetaDataAware)parent; valueMetaDataAware.setValue(value); } } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/KeywordLevelVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000406510756342051033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import org.jboss.kernel.plugins.deployment.props.TreeVertex; /** * Keyword matching level vertex factory. * * @author Ales Justin */ public abstract class KeywordLevelVertexFactory extends AbstractLevelVertexFactory { private String keyword; protected KeywordLevelVertexFactory(String keyword) { if (keyword == null) throw new IllegalArgumentException("Null keyword."); this.keyword = keyword; } public TreeVertex createVertex(String name) { int p = name.lastIndexOf(".") + 1; String keyword = name.substring(p); if (this.keyword.equalsIgnoreCase(keyword) == false) return null; return createVertex(name, keyword); } /** * Create vertex from name and keyword. * * @param name the name * @param keyword the keyword * @return new vertex instance */ protected abstract TreeVertex createVertex(String name, String keyword); } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/LevelVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000417211262376750033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.io.Serializable; import java.util.Comparator; import org.jboss.kernel.plugins.deployment.props.TreeVertex; /** * Level vertex factory. * * @author Ales Justin */ public interface LevelVertexFactory { /** * Create new vertex. * If name doesn't match factory's creation return null. * * @param name the name * @return new vertex instance or null if cannot create vertex from name */ TreeVertex createVertex(String name); /** * Get the order. * * @return the order */ int getOrder(); /** * LevelVertexFactory comparator. */ public static Comparator COMPARATOR = new LevelVertexFactoryComparator(); static class LevelVertexFactoryComparator implements Comparator, Serializable { private static final long serialVersionUID = 1L; public int compare(LevelVertexFactory o1, LevelVertexFactory o2) { return o1.getOrder() - o2.getOrder(); } } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/ValueMetaDataAwareVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000412410716050342033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; /** * Value aware vertex. * * @param exact ValueMetaDataAware type * @param exact parent type * @author Ales Justin */ public abstract class ValueMetaDataAwareVertex> extends TreeVertex implements ValueMetaDataAware { protected U delegate; protected ValueMetaDataAwareVertex(String n) { super(n); delegate = createValueMetaDataAware(); } /** * Create value meta data aware instance. * * @return ValueMetaDataAware instance */ protected abstract U createValueMetaDataAware(); public ValueMetaData getValue() { return delegate.getValue(); } public void setValue(ValueMetaData value) { delegate.setValue(value); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/SimpleValueVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000534610741226416033417 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.plugins.ValueMetaDataAware; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.util.graph.Vertex; /** * Simple value vertex. * Single string value. * * @author Ales Justin */ public class SimpleValueVertex extends TreeVertex> { public SimpleValueVertex(String value) { super(value); } public void visit(Vertex parent, Set> children) { if (parent instanceof ValueMetaDataAware) { StringValueMetaData value = new StringValueMetaData(getName()); Set> parentsChildren = getChildren(parent); for (Vertex vertex : parentsChildren) { if (vertex == this) continue; String name = vertex.getName(); if (name.endsWith("type")) { Vertex next = getNext(vertex); value.setType(next.getName()); } else if (name.endsWith("trim")) { Vertex next = getNext(vertex); value.setTrim(Boolean.parseBoolean(next.getName())); } else if (name.endsWith("replace")) { Vertex next = getNext(vertex); value.setReplace(Boolean.parseBoolean(next.getName())); } } ValueMetaDataAware valueMetaDataAware = (ValueMetaDataAware)parent; valueMetaDataAware.setValue(value); } } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/BeanVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000531411262376750033420 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.Set; import java.util.List; import java.util.ArrayList; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaDataFactory; import org.jboss.util.graph.Vertex; /** * Bean vertex factory. * * @author Ales Justin */ public class BeanVertexFactory extends AbstractLevelVertexFactory { public BeanVertexFactory() { super(Integer.MAX_VALUE); } public TreeVertex createVertex(String name) { return new BeanVertex(name); } /** * Bean vertex. * * @author Ales Justin */ static class BeanVertex extends TreeVertex { private AbstractBeanMetaData beanMetaData; public BeanVertex(String name) { super(name); } public void visit(BaseDeploymentVertex parent, Set> children) { beanMetaData = new AbstractBeanMetaData(); beanMetaData.setName(getName()); AbstractKernelDeployment deployment = parent.getDeployment(); List list = deployment.getBeanFactories(); if (list == null) { list = new ArrayList(); deployment.setBeanFactories(list); } list.add(beanMetaData); } AbstractBeanMetaData getBeanMetaData() { return beanMetaData; } } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/vertex/DefaultVertexFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000755310756342051033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props.vertex; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.TreeSet; import org.jboss.kernel.plugins.deployment.props.DeploymentVertex; import org.jboss.kernel.plugins.deployment.props.TreeVertex; import org.jboss.kernel.plugins.deployment.props.VertexFactory; import org.jboss.logging.Logger; import org.jboss.util.graph.Graph; import org.jboss.util.graph.Vertex; import org.jboss.util.graph.Visitor; /** * Default vertex factory. * * @author Ales Justin */ public class DefaultVertexFactory implements VertexFactory { /** The logger */ protected Logger logger = Logger.getLogger(getClass()); /** The level factories */ protected Map> levelFactories = new HashMap>(); public DefaultVertexFactory() { addLevelFactory(0, new BeanVertexFactory()); addLevelFactory(1, new ClassVertexFactory()); addLevelFactory(1, new PropertyVertexFactory()); addLevelFactory(2, new HolderVertexFactory()); } public void addLevelFactory(int level, LevelVertexFactory factory) { Set factories = levelFactories.get(level); if (factories == null) { factories = new TreeSet(LevelVertexFactory.COMPARATOR); levelFactories.put(level, factories); } factories.add(factory); } public DeploymentVertex rootVertex() { return new BaseDeploymentVertex(); } public TreeVertex createVertex(int level, String name) { Set factories = levelFactories.get(level); if (factories == null) throw new IllegalArgumentException("No matching level factories: " + name + " / " + level); for(LevelVertexFactory factory : factories) { TreeVertex vertex = factory.createVertex(name); if (vertex != null) return vertex; } throw new IllegalArgumentException("No matching level factory: " + name + " / " + level); } /** * Is value complex. * e.g. injection * * @param value * @return true when it is complex */ protected boolean isValueComplex(String value) { return value.contains("."); } public TreeVertex> valueVertex(String value) { if (isValueComplex(value)) return new ComplexValueVertex(value); else return new SimpleValueVertex(value); } public Visitor visitor() { return new Visitor() { public void visit(Graph g, Vertex v) { if (logger.isTraceEnabled()) logger.trace(v); } }; } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/DeploymentVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000271410716050342033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.util.graph.Vertex; /** * Top level deployment vertex. * * @author Ales Justin */ public abstract class DeploymentVertex extends TreeVertex> { protected DeploymentVertex(String name) { super(name); } public abstract KernelDeployment get(); } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/TreeVertex.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000001064210741206717033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.logging.Logger; import org.jboss.util.graph.Edge; import org.jboss.util.graph.Vertex; /** * Tree vertex. * * @param exact vertex type * @author Ales Justin */ public abstract class TreeVertex> extends Vertex { /** The logger */ protected Logger log = Logger.getLogger(getClass()); /** The last token */ private String lastToken; protected TreeVertex(String name) { super(name); } @SuppressWarnings("unchecked") public void visit() { Vertex parent = getParent(this); Set> children = getChildren(this); if (log.isTraceEnabled()) log.trace("Structure visit, parent: " + parent + ", children: " + children); visit((T)parent, children); } /** * Get the last token. * * @return last token string */ protected String getLastToken() { if (lastToken == null) { String fullName = getName(); int p = fullName.lastIndexOf('.') + 1; lastToken = fullName.substring(p); } return lastToken; } /** * Get the parent vertex from vertex param. * * @param vertex the vertex to check * @return parent vertex */ @SuppressWarnings("unchecked") protected static Vertex getParent(Vertex vertex) { List> edges = vertex.getIncomingEdges(); Vertex parent = null; if (edges.isEmpty() == false) { Set> previous = new HashSet>(); for(Edge edge : edges) previous.add(edge.getFrom()); if (previous.size() > 1) throw new IllegalArgumentException("Multiple parents: " + vertex); return previous.iterator().next(); } return parent; } /** * Get children from vertext param. * * @param vertex the vertex to check * @return children vertices */ protected static Set> getChildren(Vertex vertex) { Set> children = new HashSet>(); for(int i = 0; i < vertex.getOutgoingEdgeCount(); i++) { Edge edge = vertex.getOutgoingEdge(i); children.add(edge.getTo()); } return children; } /** * Get previous from vertex param. * * @param vertex the vertex * @return previous vertex */ protected static Vertex getPrevious(Vertex vertex) { return getParent(vertex); } /** * Get the next vertex. * * @param vertex the vertex * @return next vertex */ protected static Vertex getNext(Vertex vertex) { Set> children = getChildren(vertex); if (children.isEmpty()) return null; if (children.size() > 1) throw new IllegalArgumentException("Multiple children: " + vertex); return children.iterator().next(); } /** * Do the visit. * * @param parent the parent vertex * @param children the children vertices */ public abstract void visit(T parent, Set> children); } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/DeploymentBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000000453710716050342033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props; import java.util.Map; import java.util.Properties; import java.util.TreeMap; import org.jboss.kernel.spi.deployment.KernelDeployment; /** * Deployment builder. * * @author Ales Justin */ public class DeploymentBuilder { private PropertiesGraphFactory graphFactory; public DeploymentBuilder(Properties properties) { buildGraph(toMap(properties)); } public DeploymentBuilder(Map properties) { buildGraph(properties); } protected static Map toMap(Properties properties) { if (properties == null) return null; Map map = new TreeMap(); for(Object key : properties.keySet()) { String ks = key.toString(); map.put(ks, properties.getProperty(ks)); } return map; } /** * Build graph. * * @param properties the properties */ protected void buildGraph(Map properties) { graphFactory = new PropertiesGraphFactory(properties); } /** * Build KernelDeployment instance. * * @return KernelDeployment instance */ public KernelDeployment build() { return graphFactory.build(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment/props/PropertiesGraphFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/deployment0000644000175000017500000001103011301242575033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.deployment.props; import java.util.Map; import java.util.Properties; import java.util.TreeMap; import java.util.Map.Entry; import org.jboss.kernel.plugins.deployment.props.vertex.DefaultVertexFactory; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.util.graph.Graph; import org.jboss.util.graph.Vertex; /** * Properties to Graph factory. * * @author Ales Justin */ public class PropertiesGraphFactory { /** The graph */ private Graph graph; /** The root */ private DeploymentVertex root; /** The vertext factory */ private VertexFactory vertexFactory = new DefaultVertexFactory(); public PropertiesGraphFactory(Properties properties) { if (properties == null) throw new IllegalArgumentException("Null properties."); buildGraph(toMap(properties)); } public PropertiesGraphFactory(Map properties) { if (properties == null) throw new IllegalArgumentException("Null properties."); buildGraph(properties); } /** * Build the kernel deployment. * * @return KernelDeployment instance */ public KernelDeployment build() { graph.depthFirstSearch(root, vertexFactory.visitor()); return root.get(); } /** * Transform properties to map. * * @param properties the properties * @return map */ protected static Map toMap(Properties properties) { Map map = new TreeMap(); for (Entry entry : properties.entrySet()) { map.put(entry.getKey().toString(), (String)entry.getValue()); } return map; } /** * Build graph from properties. * * @param properties the properties */ protected void buildGraph(Map properties) { graph = new Graph(); root = vertexFactory.rootVertex(); graph.setRootVertex(root); for(Entry entry : properties.entrySet()) { buildVertices(root, 0, entry.getKey(), entry.getValue(), 0); } } /** * Build vertices from property key and value. * * @param previous previous vertex * @param index current dot index * @param key the property key * @param value the value * @param level current level */ protected void buildVertices(Vertex previous, int index, String key, String value, int level) { int p = key.indexOf('.', index + 1); int end = p > 0 ? p : key.length(); String name = key.substring(0, end); Vertex current = graph.findVertexByName(name); if (current == null) { current = vertexFactory.createVertex(level, name); graph.addVertex(current); } graph.addEdge(previous, current, level); if (p < 0) { Vertex valueVertex = vertexFactory.valueVertex(value); graph.addVertex(valueVertex); graph.addEdge(current, valueVertex, -1); } else buildVertices(current, p, key, value, level + 1); } /** * Set the vertex factory. * * @param vertexFactory the vertex factory */ public void setVertexFactory(VertexFactory vertexFactory) { this.vertexFactory = vertexFactory; } public String toString() { return graph.toString(); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/0000755000175000017500000000000011620312164032542 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/property/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/pro0000755000175000017500000000000011620312164033263 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/property/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/pro0000644000175000017500000000156010150404616033270 0ustar twernertwerner

Kernel plugins, a kernel configuration implementation using system properties.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/property/PropertyKernelConfig.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/pro0000644000175000017500000001603411216157032033273 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.config.property; import java.util.Iterator; import java.util.Properties; import java.util.StringTokenizer; import java.util.TreeSet; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.config.plugins.property.PropertyConfiguration; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; import org.jboss.kernel.plugins.config.AbstractKernelConfig; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.validation.KernelBeanValidator; /** * Kernel configuration using properties. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 90317 $ */ @SuppressWarnings("deprecation") public class PropertyKernelConfig extends AbstractKernelConfig { /** * Create a configuration * * @param properties the properties */ public PropertyKernelConfig(Properties properties) { super(new PropertyConfiguration(properties)); initializeProperties(); } protected Properties getProperties() { PropertyConfiguration config = (PropertyConfiguration) configuration; return config.getProperties(); } protected void initializeProperties() { Properties properties = getProperties(); if (properties.isEmpty() == false && log.isTraceEnabled()) { log.trace("Dumping properties"); TreeSet names = new TreeSet(properties.keySet()); for (Iterator i = names.iterator(); i.hasNext();) { String name = (String) i.next(); log.trace(name + "=" + properties.get(name)); } } } public KernelBus createKernelBus() throws Throwable { return (KernelBus) getImplementation( KernelConstants.KERNEL_BUS_PROPERTY, KernelConstants.KERNEL_BUS_CLASS ); } public KernelConfigurator createKernelConfigurator() throws Throwable { return (KernelConfigurator) getImplementation( KernelConstants.KERNEL_CONFIGURATOR_PROPERTY, KernelConstants.KERNEL_CONFIGURATOR_CLASS ); } public KernelController createKernelController() throws Throwable { return (KernelController) getImplementation( KernelConstants.KERNEL_CONTROLLER_PROPERTY, KernelConstants.KERNEL_CONTROLLER_CLASS ); } public KernelEventManager createKernelEventManager() throws Throwable { return (KernelEventManager) getImplementation( KernelConstants.KERNEL_EVENT_MANAGER_PROPERTY, KernelConstants.KERNEL_EVENT_MANAGER_CLASS ); } public KernelInitializer createKernelInitializer() throws Throwable { return (KernelInitializer) getImplementation( KernelConstants.KERNEL_INITIALIZER_PROPERTY, KernelConstants.KERNEL_INITIALIZER_CLASS ); } public org.jboss.kernel.spi.registry.KernelRegistry createKernelRegistry() throws Throwable { return (org.jboss.kernel.spi.registry.KernelRegistry) getImplementation( KernelConstants.KERNEL_REGISTRY_PROPERTY, KernelConstants.KERNEL_REGISTRY_CLASS ); } public KernelMetaDataRepository createKernelMetaDataRepository() throws Throwable { return (KernelMetaDataRepository) getImplementation( KernelConstants.KERNEL_METADATA_REPOSITORY_PROPERTY, KernelConstants.KERNEL_METADATA_REPOSITORY_CLASS ); } public KernelBeanValidator createKernelBeanValidator() throws Throwable { return (KernelBeanValidator) getImplementation( KernelConstants.KERNEL_BEAN_VALIDATOR_PROPERTY, KernelConstants.KERNEL_BEAN_VALIDATOR_CLASS ); } public DependencyBuilder createDefaultDependencyBuilder() throws Throwable { return (DependencyBuilder) getImplementation( KernelConstants.DEPENDENCY_BUILDER_PROPERTY, KernelConstants.DEPENDENCY_BUILDER_DEFAULT ); } /** * Get the implementation for a type * * @param type the type * @param defaultType the default implementation * @return the implementation object * @throws Throwable for any error */ protected Object getImplementation(String type, String defaultType) throws Throwable { Properties properties = getProperties(); String value = properties.getProperty(type, defaultType); if (log.isTraceEnabled()) log.trace(type + " using property " + value); StringTokenizer tokenizer = new StringTokenizer(value, ":"); ClassNotFoundException error = null; while (tokenizer.hasMoreTokens()) { String className = tokenizer.nextToken(); ClassLoader cl = Configurator.getClassLoader((BeanMetaData) null); try { BeanInfo info = getBeanInfo(className, cl); BeanMetaData metaData = getBeanMetaData(info, className); return Configurator.instantiateAndConfigure(this, info, metaData); } catch (ClassNotFoundException ignored) { log.trace(className + " not found: " + ignored.getMessage()); error = ignored; } } if (error != null) throw error; throw new RuntimeException("Invalid configuration for property " + type + " expected a class name that implements " + type); } /** * Get the bean metadata for the class * * @param info the bean info * @param className the class * @return the metadata * @throws Exception for any error */ protected BeanMetaData getBeanMetaData(BeanInfo info, String className) throws Exception { return null; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/KernelConfigFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/Ker0000644000175000017500000000656710507530165033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.config; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import java.util.Properties; /** * Implementation of the Factory design pattern used in constructing new * instances of {@link KernelConfig KernelConfig} objects based on various * configuration sources. * * @author Les A. Hazlewood * @version $Revision: 57307 $ */ public class KernelConfigFactory { /** * Constructs a new KernelConfig instance based on the System properties. *

If any necessary KernelConfig properties are not found in the System * properties, sensible default implementations for the missing * properties will be used. * @return a new KernelConfig instance based on the * System properties. * @see System#getProperties() * @see #newInstance(Properties) */ public static KernelConfig newInstance() { //for the values not found in the System properties, default values //used are from the KernelConstants interface. See //the PropertyKernelConfig class implementation for more details. return newInstance( System.getProperties() ); } /** * Constructs a new KernelConfig instance based on the specified * Properties. *

If any necessary KernelConfig properties are not found in the given * properties, sensible default implementations for the missing * properties will be used. * @param props the properties to use when creating a new * KernelConfig instance. * @return a new KernelConfig instance based on the specified * Properties * @see PropertyKernelConfig */ public static KernelConfig newInstance( Properties props ) { KernelConfig cfg; try { //for the values not found in the given props, default values //used are from the KernelConstants interface. See //the PropertyKernelConfig class implementation for more details. cfg = new PropertyKernelConfig( props ); } catch ( Throwable t ) { String msg = "Unable to construct a " + PropertyKernelConfig.class.getName() + " instance based on the specified properties."; throw new RuntimeException( msg, t ); } return cfg; } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/AbstractKernelConfig.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/Abs0000644000175000017500000001500610767571152033213 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.config; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.BeanInfoFactory; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.classadapter.spi.ClassAdapterFactory; import org.jboss.config.spi.Configuration; import org.jboss.config.spi.ConfigurationPermission; import org.jboss.joinpoint.spi.JoinpointFactoryBuilder; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.reflect.spi.TypeInfoFactory; /** * Abstract Kernel configuration. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 70935 $ */ public abstract class AbstractKernelConfig extends AbstractKernelObject implements KernelConfig { /** The configuration */ protected Configuration configuration; /** The dependency builder */ private DependencyBuilder dependencyBuilder; /** * Create an abstract kernel configuration * * @param configuration the configuration */ public AbstractKernelConfig(Configuration configuration) { this.configuration = configuration; } public BeanInfo getBeanInfo(String className, ClassLoader cl) throws Throwable { return configuration.getBeanInfo(className, cl); } public BeanInfo getBeanInfo(Class clazz) throws Throwable { return configuration.getBeanInfo(clazz); } public BeanInfo getBeanInfo(TypeInfo typeInfo) throws Throwable { return configuration.getBeanInfo(typeInfo); } public BeanInfo getBeanInfo(String className, ClassLoader cl, BeanAccessMode mode) throws Throwable { return configuration.getBeanInfo(className, cl, mode); } public BeanInfo getBeanInfo(Class clazz, BeanAccessMode mode) throws Throwable { return configuration.getBeanInfo(clazz, mode); } public BeanInfo getBeanInfo(TypeInfo type, BeanAccessMode mode) throws Throwable { return configuration.getBeanInfo(type, mode); } public TypeInfo getTypeInfo(String className, ClassLoader cl) throws Throwable { return configuration.getTypeInfo(className, cl); } public TypeInfo getTypeInfo(Class clazz) throws Throwable { return configuration.getTypeInfo(clazz); } public ClassInfo getClassInfo(String className, ClassLoader cl) throws Throwable { return configuration.getClassInfo(className, cl); } public ClassInfo getClassInfo(Class clazz) throws Throwable { return configuration.getClassInfo(clazz); } /** * Set the beanInfoFactory. * * @param beanInfoFactory the beanInfoFactory. * @throws SecurityException if you don't have the ConfigurationPermission */ public void setBeanInfoFactory(BeanInfoFactory beanInfoFactory) { configuration.setBeanInfoFactory(beanInfoFactory); } /** * Set the classAdapterFactory. * * @param classAdapterFactory the classAdapterFactory. * @throws SecurityException if you don't have the ConfigurationPermission */ public void setClassAdapterFactory(ClassAdapterFactory classAdapterFactory) { configuration.setClassAdapterFactory(classAdapterFactory); } /** * Set the typeInfoFactory. * * @param typeInfoFactory the typeInfoFactory. * @throws SecurityException if you don't have the ConfigurationPermission */ public void setTypeInfoFactory(TypeInfoFactory typeInfoFactory) { configuration.setTypeInfoFactory(typeInfoFactory); } /** * Set the joinpointFactoryBuilder. * * @param joinpointFactoryBuilder the joinpointFactoryBuilder. * @throws SecurityException if you don't have the ConfigurationPermission */ public void setJoinpointFactoryBuilder(JoinpointFactoryBuilder joinpointFactoryBuilder) { configuration.setJoinpointFactoryBuilder(joinpointFactoryBuilder); } /** * Get the dependency builder * * @return the dependency builder */ public DependencyBuilder getDependencyBuilder() { if (dependencyBuilder == null) { try { dependencyBuilder = createDefaultDependencyBuilder(); } catch (RuntimeException e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException("Error creating dependency builder", t); } } return dependencyBuilder; } /** * Set the dependencyBuilder. * * @param dependencyBuilder the dependencyBuilder. * @throws SecurityException if you don't have the ConfigurationPermission */ public void setDependencyBuilder(DependencyBuilder dependencyBuilder) { checkPermissionName("dependencyBuilder"); this.dependencyBuilder = dependencyBuilder; } /** * Create the default dependency builder * * @return the type info factory * @throws Throwable for any error */ protected abstract DependencyBuilder createDefaultDependencyBuilder() throws Throwable; /** * Check a permission * * @param name the name of the permission */ private void checkPermissionName(String name) { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(new ConfigurationPermission(name)); } } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/pac0000644000175000017500000000153310150404616033233 0ustar twernertwerner

Kernel plugins, an abstract configuration implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/Configurator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/Con0000644000175000017500000006106111301242575033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.config; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ClassLoaderMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.joinpoint.plugins.Config; import org.jboss.joinpoint.spi.ConstructorJoinpoint; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.joinpoint.spi.JoinpointException; import org.jboss.joinpoint.spi.JoinpointFactory; import org.jboss.joinpoint.spi.MethodJoinpoint; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ConstructorInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.reflect.spi.TypeInfoFactory; /** * Configuration utilities. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 96564 $ */ public class Configurator extends Config { final static String[] NO_PARAMS = new String[0]; final static Object[] NO_PARAM_VALUES = new Object[0]; /** * Instantiate and configure a bean * * @param config the confg * @param info the bean info * @param metaData the bean metadata * @return the instantiated and configured object * @throws Throwable for any error */ public static Object instantiateAndConfigure(KernelConfig config, BeanInfo info, BeanMetaData metaData) throws Throwable { Object result = instantiate(config, info, metaData); if (metaData != null) configure(result, info, metaData); return result; } /** * Instantiate a bean * * @param config the kernel config * @param info the bean info * @param metaData the bean metadata * @return the instantiated object * @throws Throwable for any error */ public static Object instantiate(KernelConfig config, BeanInfo info, BeanMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Instantiating info=" + info + " metaData=" + metaData); ConstructorMetaData constructor = null; if (metaData != null) constructor = metaData.getConstructor(); Joinpoint joinPoint = getConstructorJoinPoint(config, info, constructor, metaData); return joinPoint.dispatch(); } /** * Get a constructor joinpoint * * @param config the kernel config * @param info the bean info * @param metaData the constructor metadata * @param beanMetaData the bean metadata * @return the joinpoint * @throws Throwable for any error */ public static Joinpoint getConstructorJoinPoint(KernelConfig config, BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData) throws Throwable { return getConstructorJoinPoint(config, info, metaData, beanMetaData, null); } /** * Get a constructor joinpoint * * @param config the kernel config * @param info the bean info * @param metaData the constructor metadata * @param beanMetaData the bean metadata * @param object an opaque object * @return the joinpoint * @throws Throwable for any error */ public static Joinpoint getConstructorJoinPoint(KernelConfig config, BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData, Object object) throws Throwable { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Get constructor joinpoint info=" + info + " constructor=" + metaData); if (config == null) throw new IllegalArgumentException("Null config"); if (metaData != null) { ClassLoader cl = getClassLoader(beanMetaData); ValueMetaData vmd = metaData.getValue(); if (vmd != null) { TypeInfo typeInfo = null; if (info != null) typeInfo = info.getClassInfo(); return new ValueJoinpoint(vmd, typeInfo, cl); } vmd = metaData.getFactory(); if (vmd != null) { // Get the factory Object factory = vmd.getValue(null, cl); // Get the parameters List parameters = metaData.getParameters(); // Describe the factory BeanInfo factoryInfo = config.getBeanInfo(factory.getClass()); // Find the method MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, false, true); joinPoint.setTarget(factory); MethodInfo minfo = joinPoint.getMethodInfo(); // Set the parameters if (minfo != null) { TypeInfo[] pinfos = minfo.getParameterTypes(); Object[] params = getParameters(trace, cl, pinfos, parameters); joinPoint.setArguments(params); } return joinPoint; } String factoryClassName = metaData.getFactoryClass(); if (factoryClassName != null) { // Get the parameters List parameters = metaData.getParameters(); BeanInfo factoryInfo = config.getBeanInfo(factoryClassName, cl); // Find the method MethodJoinpoint joinPoint = findMethod(trace, factoryInfo, cl, metaData.getFactoryMethod(), parameters, true, true); MethodInfo minfo = joinPoint.getMethodInfo(); // Set the parameters if (minfo != null) { TypeInfo[] pinfos = minfo.getParameterTypes(); Object[] params = getParameters(trace, cl, pinfos, parameters); joinPoint.setArguments(params); } return joinPoint; } // Find the constructor ConstructorJoinpoint joinPoint = findConstructor(trace, info, metaData, object); ConstructorInfo cinfo = joinPoint.getConstructorInfo(); // Set the parameters if (cinfo != null) { TypeInfo[] pinfos = cinfo.getParameterTypes(); Object[] params = getParameters(trace, cl, pinfos, metaData.getParameters()); joinPoint.setArguments(params); } return joinPoint; } // Default constructor return findConstructor(trace, info, metaData, object); } /** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the bean metadata * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, BeanMetaData metaData) throws Exception { return findConstructor(trace, info, metaData.getConstructor()); } /** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the constructor metadata * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData) throws Exception { return findConstructor(trace, info, metaData, null); } /** * Find a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the constructor metadata * @param object an opaque object * @return the constructor join point * @throws Exception for any error */ public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData, Object object) throws Exception { ConstructorInfo cinfo = resolveConstructor(trace, info, metaData); JoinpointFactory jpf = info.getJoinpointFactory(); if (object == null) return jpf.getConstructorJoinpoint(cinfo); else return jpf.getConstructorJoinpoint(cinfo, object); } /** * Resolve a constructor * * @param trace whether trace is enabled * @param info the bean info * @param metaData the constructor metadata * @return the constructor info */ public static ConstructorInfo resolveConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData) { if (info == null) throw new IllegalArgumentException("Null bean info"); List params = Collections.emptyList(); if (metaData != null && metaData.getParameters() != null) params = metaData.getParameters(); String[] paramTypes = new String[params.size()]; if (params.isEmpty() == false) { int x = 0; for (Iterator i = params.iterator(); i.hasNext();) { ParameterMetaData pdata = i.next(); paramTypes[x++] = pdata.getType(); } } return findConstructorInfo(info.getClassInfo(), paramTypes); } /** * Configure a bean * * @param object the object to configure * @param info the bean info * @param metaData the bean metadata * @throws Throwable for any error */ public static void configure(Object object, BeanInfo info, BeanMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); if (object == null) throw new IllegalArgumentException("Null object"); if (info == null) throw new IllegalArgumentException("Null bean info"); if (metaData == null) throw new IllegalArgumentException("Null bean metadata"); Set properties = metaData.getProperties(); if (properties != null && properties.isEmpty() == false) { ClassLoader cl = getClassLoader(metaData); for (Iterator i = metaData.getProperties().iterator(); i.hasNext();) { PropertyMetaData property = i.next(); configure(trace, object, info, cl, property); } } } /** * Configure a bean property * * @param object the object to configure * @param info the bean info * @param cl the classloader * @param metaData the property metadata * @throws Throwable for any error */ public static void configure(Object object, BeanInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); configure(trace, object, info, cl, metaData); } /** * Configure a bean property * * @param trace whether trace is enabled * @param object the object to configure * @param info the bean info * @param cl the classloader * @param metaData the property metadata * @throws Throwable for any error */ public static void configure(boolean trace, Object object, BeanInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable { PropertyInfo ainfo = resolveProperty(trace, info, cl, metaData.getName(), metaData.getType()); configure(trace, object, ainfo, cl, metaData); } /** * Configure a bean property * * @param object the object to configure * @param info the property info * @param cl the classloader * @param metaData the property metadata * @throws Throwable for any error */ public static void configure(Object object, PropertyInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); configure(trace, object, info, cl, metaData); } /** * Configure a bean property * * @param trace whether trace is enabled * @param object the object to configure * @param info the property info * @param cl the classloader * @param metaData the property metadata * @throws Throwable for any error */ public static void configure(boolean trace, Object object, PropertyInfo info, ClassLoader cl, PropertyMetaData metaData) throws Throwable { if (trace) log.trace("Configuring info=" + info + " metaData=" + metaData); if (trace) log.trace("Setting property " + info); info.set(object, metaData.getValue().getValue(info.getType(), cl)); } /** * Unconfigure a bean * * @param object the object to unconfigure * @param info the bean info * @param metaData the bean metadata * @throws Throwable for any error */ public static void unconfigure(Object object, BeanInfo info, BeanMetaData metaData) throws Throwable { if (object == null) throw new IllegalArgumentException("Null object"); if (info == null) throw new IllegalArgumentException("Null bean info"); if (metaData == null) throw new IllegalArgumentException("Null bean metadata"); ClassLoader cl = getClassLoader(metaData); Set propertys = metaData.getProperties(); if (propertys != null && propertys.isEmpty() == false) { for (Iterator i = metaData.getProperties().iterator(); i.hasNext();) { PropertyMetaData property = i.next(); unconfigure(object, cl, info, property); } } } /** * Unconfigure a bean property * * @param object the object to unconfigure * @param cl the classloader * @param info the bean info * @param metaData the property metadata * @throws Throwable for any error */ public static void unconfigure(Object object, ClassLoader cl, BeanInfo info, PropertyMetaData metaData) throws Throwable { boolean trace = log.isTraceEnabled(); PropertyInfo ainfo = resolveProperty(trace, info, cl, metaData.getName(), metaData.getType()); unconfigure(trace, object, ainfo, metaData); } /** * UnConfigure a bean property * * @param trace whether trace is enabled * @param object the object to configure * @param info the property info * @param metaData the property metadata * @throws Throwable for any error */ public static void unconfigure(boolean trace, Object object, PropertyInfo info, PropertyMetaData metaData) throws Throwable { if (trace) log.trace("Unconfiguring info=" + info + " metaData=" + metaData); if (trace) log.trace("Unsetting property " + info); info.set(object, null); } /** * Get the property info * * @param trace whether trace is enabled * @param info the bean info * @param name the property name * @return the property info * @throws Throwable for any error */ public static PropertyInfo resolveProperty(boolean trace, BeanInfo info, String name) throws Throwable { return resolveProperty(trace, info, null, name, null); } /** * Get the property info * * @param trace whether trace is enabled * @param info the bean info * @param cl the classloader * @param name the property name * @param type the property type * @return the property info * @throws Throwable for any error */ @SuppressWarnings("deprecation") public static PropertyInfo resolveProperty(boolean trace, BeanInfo info, ClassLoader cl, String name, String type) throws Throwable { if (info == null) throw new IllegalArgumentException("Null bean info"); if (name == null) throw new IllegalArgumentException("Null name"); if (trace) log.trace("Resolving property on bean info=" + info + " name=" + name); if (cl == null) cl = info.getClassInfo().getType().getClassLoader(); PropertyInfo ainfo = info.getProperty(name); ClassInfo classInfo = info.getClassInfo(); TypeInfoFactory tif = classInfo.getTypeInfoFactory(); if (tif == null) throw new IllegalArgumentException("TypeInfoFactory is null: " + classInfo); // check for possible progression String[] typeNames = {type}; TypeInfo[] typeInfos = {ainfo.getType()}; if (equals(typeNames, typeInfos) || isAssignable(tif, cl, typeNames, typeInfos)) { return ainfo; } throw new JoinpointException("Property " + name + " not found for " + info); } /** * Find a method * * @param info the bean info * @param cl the classloader * @param name the method name * @param parameters the parameter metadata * @param isStatic whether the method is static * @param isPublic whether the method is public * @return the method join point * @throws Throwable for any error */ public static MethodJoinpoint findMethod(BeanInfo info, ClassLoader cl, String name, List parameters, boolean isStatic, boolean isPublic) throws Throwable { boolean trace = log.isTraceEnabled(); return findMethod(trace, info, cl, name, parameters, isStatic, isPublic); } /** * Find a method * * @param trace whether trace is enabled * @param info the bean info * @param cl the classloader * @param name the method name * @param parameters the parameter metadata * @param isStatic whether the method is static * @param isPublic whether the method is public * @return the method join point * @throws Throwable for any error */ public static MethodJoinpoint findMethod(boolean trace, BeanInfo info, ClassLoader cl, String name, List parameters, boolean isStatic, boolean isPublic) throws Throwable { if (info == null) throw new IllegalArgumentException("Null bean info"); if (name == null) throw new IllegalArgumentException("Null name"); String[] paramTypes = getParameterTypes(trace, parameters); MethodInfo minfo = findMethodInfo(info.getClassInfo(), name, paramTypes, isStatic, isPublic); JoinpointFactory jpf = info.getJoinpointFactory(); MethodJoinpoint joinPoint = jpf.getMethodJoinpoint(minfo); // Set the parameters if (minfo != null) { TypeInfo[] pinfos = minfo.getParameterTypes(); Object[] params = getParameters(trace, cl, pinfos, parameters); joinPoint.setArguments(params); } return joinPoint; } /** * Get the parameters types * * @param trace whether trace is enabled * @param parameters the parameter metadata * @return an array of parameter types * @throws Throwable for any error */ public static String[] getParameterTypes(boolean trace, List parameters) throws Throwable { if (parameters == null) return NO_PARAMS; String[] paramTypes = new String[parameters.size()]; int x = 0; for (Iterator i = parameters.iterator(); i.hasNext();) { ParameterMetaData pmd = i.next(); paramTypes[x++] = pmd.getType(); } return paramTypes; } /** * Get the parameters types * * @param trace whether trace is enabled * @param parameters the parameter types * @return an array of parameter types * @throws Throwable for any error */ public static String[] getParameterTypes(boolean trace, TypeInfo[] parameters) throws Throwable { if (parameters == null) return NO_PARAMS; String[] paramTypes = new String[parameters.length]; int x = 0; for (int i = 0; i < parameters.length; ++i) paramTypes[x++] = parameters[i].getName(); return paramTypes; } /** * Get the parameters * * @param trace whether trace is enabled * @param cl the classloader * @param pinfos the parameter infos * @param parameters the parameter metadata * @return an array of parameters * @throws Throwable for any error */ public static Object[] getParameters(boolean trace, ClassLoader cl, TypeInfo[] pinfos, List parameters) throws Throwable { if (parameters == null) return NO_PARAM_VALUES; Object[] params = new Object[parameters.size()]; int x = 0; for (Iterator i = parameters.iterator(); i.hasNext();) { ParameterMetaData pdata = i.next(); ValueMetaData vmd = pdata.getValue(); params[x] = vmd.getValue(pinfos[x], cl); x++; } return params; } /** * Get the classloader for some BeanMetaData * * @param metaData the metaData * @return the classloader * @throws Throwable for any error */ public static ClassLoader getClassLoader(BeanMetaData metaData) throws Throwable { ClassLoaderMetaData clmd = null; if (metaData != null) clmd = metaData.getClassLoader(); return getClassLoader(clmd); } /** * Get the classloader for some ClassLoaderMetaData * * @param metaData the metaData * @return the classloader * @throws Throwable for any error */ public static ClassLoader getClassLoader(ClassLoaderMetaData metaData) throws Throwable { ClassLoader tcl = null; ClassLoader cl = null; if (metaData != null) { ValueMetaData clVMD = metaData.getClassLoader(); if (clVMD != null) { tcl = Thread.currentThread().getContextClassLoader(); Object object = clVMD.getValue(null, tcl); if (object != null && object instanceof ClassLoader == false) throw new IllegalArgumentException("Configured object is not a classloader " + metaData); cl = (ClassLoader) object; } } if (cl == null) { return (tcl != null) ? tcl : Thread.currentThread().getContextClassLoader(); } else { return cl; } } /** * Test whether type names can be assigned to type infos * * @param tif the type info factory * @param cl bean classloader * @param typeNames the type names * @param typeInfos the type infos * @return true when they can be assigned * @throws Throwable for any error */ public static boolean isAssignable(TypeInfoFactory tif, ClassLoader cl, String[] typeNames, TypeInfo[] typeInfos) throws Throwable { if (cl == null) return false; if (simpleCheck(typeNames, typeInfos) == false) return false; for (int i = 0; i < typeNames.length; ++i) { if (typeNames[i] != null) { if (typeInfos[i].isAssignableFrom(tif.getTypeInfo(typeNames[i], cl)) == false) { return false; } } } return true; } /** * ValueJoinpoint. */ private static class ValueJoinpoint implements Joinpoint { /** The value metadata */ private ValueMetaData vmd; /** The type info */ private TypeInfo info; /** The classloader */ private ClassLoader cl; /** * Create a new ValueJoinpoint. * * @param vmd the value metadata * @param info the type info * @param cl the classloader */ public ValueJoinpoint(ValueMetaData vmd, TypeInfo info, ClassLoader cl) { this.vmd = vmd; this.info = info; this.cl = cl; } public Object dispatch() throws Throwable { return vmd.getValue(info, cl); } public String toHumanReadableString() { return vmd.toShortString(); } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new Error(e); } } } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/AbstractKernelConfigurator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/config/Abs0000644000175000017500000001167711042323200033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.config; import java.util.List; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.joinpoint.spi.MethodJoinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; /** * Abstract Kernel configurator. * * @author Adrian Brock * @version $Revision: 76224 $ */ public class AbstractKernelConfigurator extends AbstractKernelObject implements KernelConfigurator { /** The kernel config */ protected KernelConfig config; /** * Create an abstract kernel configurator * * @throws Exception for any error */ public AbstractKernelConfigurator() throws Exception { } public BeanInfo getBeanInfo(String className, ClassLoader cl) throws Throwable { return config.getBeanInfo(className, cl); } public BeanInfo getBeanInfo(Class clazz) throws Throwable { return config.getBeanInfo(clazz); } public BeanInfo getBeanInfo(TypeInfo type) throws Throwable { return config.getBeanInfo(type); } public BeanInfo getBeanInfo(String className, ClassLoader cl, BeanAccessMode mode) throws Throwable { return config.getBeanInfo(className, cl, mode); } public BeanInfo getBeanInfo(Class clazz, BeanAccessMode mode) throws Throwable { return config.getBeanInfo(clazz, mode); } public BeanInfo getBeanInfo(TypeInfo type, BeanAccessMode mode) throws Throwable { return config.getBeanInfo(type, mode); } public BeanInfo getBeanInfo(BeanMetaData metaData) throws Throwable { ClassLoader cl = Configurator.getClassLoader(metaData); String className = metaData.getBean(); if (className == null) return null; return getBeanInfo(className, cl, metaData.getAccessMode()); } public TypeInfo getTypeInfo(String className, ClassLoader cl) throws Throwable { return config.getTypeInfo(className, cl); } public TypeInfo getTypeInfo(Class clazz) throws Throwable { return config.getTypeInfo(clazz); } public ClassInfo getClassInfo(String className, ClassLoader cl) throws Throwable { return config.getClassInfo(className, cl); } public ClassInfo getClassInfo(Class clazz) throws Throwable { return config.getClassInfo(clazz); } public Joinpoint getConstructorJoinPoint(BeanInfo info) throws Throwable { return getConstructorJoinPoint(info, null, null); } public Joinpoint getConstructorJoinPoint(BeanMetaData metaData) throws Throwable { BeanInfo info = getBeanInfo(metaData); return getConstructorJoinPoint(info, metaData.getConstructor(), metaData); } public Joinpoint getConstructorJoinPoint(BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData) throws Throwable { return Configurator.getConstructorJoinPoint(config, info, metaData, beanMetaData); } public Joinpoint getConstructorJoinPoint(BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData, Object object) throws Throwable { return Configurator.getConstructorJoinPoint(config, info, metaData, beanMetaData, object); } public MethodJoinpoint getMethodJoinPoint(BeanInfo info, ClassLoader cl, String name, List parameters, boolean isStatic, boolean isPublic) throws Throwable { return Configurator.findMethod(info, cl, name, parameters, isStatic, isPublic); } public void setKernel(Kernel kernel) throws Throwable { super.setKernel(kernel); config = kernel.getConfig(); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/0000755000175000017500000000000011620312163033054 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/AbstractKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/A0000644000175000017500000000445110454712353033174 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; /** * AbstractKernelMetaDataRepository. * * @author Adrian Brock * @version $Revision: 46188 $ */ public abstract class AbstractKernelMetaDataRepository extends AbstractKernelObject implements KernelMetaDataRepository { /** The meta data repository */ private MutableMetaDataRepository metaDataRepository; /** * Create a new AbstractKernelMetaDataRepository. */ public AbstractKernelMetaDataRepository() { } /** * Create a new AbstractKernelMetaDataRepository. * * @param metaDataRepository the meta data repository */ public AbstractKernelMetaDataRepository(MutableMetaDataRepository metaDataRepository) { this.metaDataRepository = metaDataRepository; } public MutableMetaDataRepository getMetaDataRepository() { return metaDataRepository; } /** * Set the metaDataRepository. * * @param metaDataRepository the metaDataRepository. */ public void setMetaDataRepository(MutableMetaDataRepository metaDataRepository) { this.metaDataRepository = metaDataRepository; } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000755000175000017500000000000011620312163033216 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/BasicKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000644000175000017500000000743011047114402033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata.basic; import java.util.List; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.kernel.plugins.metadata.AbstractKernelMetaDataRepository; import org.jboss.metadata.plugins.repository.basic.BasicMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.ScopeKey; /** * BasicKernelMetaDataRepository. * * @author Adrian Brock * @version $Revision: 76842 $ */ public class BasicKernelMetaDataRepository extends AbstractKernelMetaDataRepository { /** * Create a new BasicKernelMetaDataRepository. */ public BasicKernelMetaDataRepository() { super(new BasicMetaDataRepository()); } public MetaData getMetaData(ControllerContext context) { MutableMetaDataRepository repository = getMetaDataRepository(); ScopeKey scope = context.getScopeInfo().getScope(); MetaData metaData = repository.getMetaData(scope); if (metaData == null) { initMetaDataRetrieval(context); metaData = repository.getMetaData(scope); if (metaData == null) throw new IllegalStateException("Error initialising metadata state: " + scope); } return metaData; } public void addMetaData(ControllerContext context) { MutableMetaDataRepository repository = getMetaDataRepository(); ScopeInfo scopeInfo = context.getScopeInfo(); scopeInfo.addMetaData(repository, context); } public void removeMetaData(ControllerContext context) { MutableMetaDataRepository repository = getMetaDataRepository(); ScopeInfo scopeInfo = context.getScopeInfo(); scopeInfo.removeMetaData(repository, context); } public ScopeKey getFullScope(ControllerContext context) { return context.getScopeInfo().getScope(); } public ScopeKey getMutableScope(ControllerContext context) { return context.getScopeInfo().getMutableScope(); } public MetaDataRetrieval createMetaDataRetrieval(ControllerContext context, List retrievals) { return createMetaDataRetrieval(retrievals); } protected MetaDataRetrieval createMetaDataRetrieval(List retrievals) { return null; } /** * Initialise metadata retrieval * * @param context the context * @return the retrieval */ protected MetaDataRetrieval initMetaDataRetrieval(ControllerContext context) { MutableMetaDataRepository repository = getMetaDataRepository(); ScopeInfo scopeInfo = context.getScopeInfo(); return scopeInfo.initMetaDataRetrieval(repository, context); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/CachingBasicKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000644000175000017500000000376311047114402033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata.basic; import java.util.List; import org.jboss.metadata.plugins.cache.CacheFactory; import org.jboss.metadata.plugins.context.CachingMetaDataContext; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; /** * CachingBasicKernelMetaDataRepository. * * @author Ales Justin */ public abstract class CachingBasicKernelMetaDataRepository extends BasicKernelMetaDataRepository { private CacheFactory factory; /** * Create cache factory. * * @return the cache factory */ protected abstract CacheFactory createCacheFactory(); /** * Get cache factory. * * @return the cache factory */ protected CacheFactory getFactory() { if (factory == null) factory = createCacheFactory(); return factory; } @Override protected MetaDataRetrieval createMetaDataRetrieval(List retrievals) { return new CachingMetaDataContext(null, retrievals, getFactory()); } }././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/LRUPolicyCachingBasicKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000644000175000017500000000476511035071204033232 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata.basic; import org.jboss.metadata.plugins.cache.CachePolicyFactory; import org.jboss.metadata.plugins.cache.ConcurrentLRUCachePolicyFactory; /** * LRUPolicyCachingBasicKernelMetaDataRepository. * * @author Ales Justin */ public class LRUPolicyCachingBasicKernelMetaDataRepository extends PolicyCachingBasicKernelMetaDataRepository { private Integer min; private Integer max; public LRUPolicyCachingBasicKernelMetaDataRepository() { } public LRUPolicyCachingBasicKernelMetaDataRepository(Integer min, Integer max) { this.min = min; this.max = max; } protected CachePolicyFactory createCachePolicyFactory() { if (min == null) min = parseInteger(readSystemProperty("LRUPolicyCaching.min", null)); if (max == null) max = parseInteger(readSystemProperty("LRUPolicyCaching.max", null)); if (min == null || max == null) throw new IllegalArgumentException("Missing min (" + min + ") or max (" + max + ")."); log.debug("Creating LRU cache policy, min: " + min + ", max: " + max); return new ConcurrentLRUCachePolicyFactory(min, max); } /** * Set min. * * @param min the min */ public void setMin(Integer min) { this.min = min; } /** * set max. * * @param max the max */ public void setMax(Integer max) { this.max = max; } }././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/PolicyCachingBasicKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000644000175000017500000000525611035066405033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata.basic; import java.security.AccessController; import java.security.PrivilegedAction; import org.jboss.metadata.plugins.cache.CacheFactory; import org.jboss.metadata.plugins.cache.CachePolicyCacheFactory; import org.jboss.metadata.plugins.cache.CachePolicyFactory; /** * PolicyCachingBasicKernelMetaDataRepository. * * @author Ales Justin */ public abstract class PolicyCachingBasicKernelMetaDataRepository extends CachingBasicKernelMetaDataRepository { protected CacheFactory createCacheFactory() { return new CachePolicyCacheFactory(createCachePolicyFactory()); } /** * Create cache policy factory. * * @return the cache policy factory */ protected abstract CachePolicyFactory createCachePolicyFactory(); /** * Read system property. * * @param key the property key * @param defaultValue the default value * @return system property or default value */ protected static String readSystemProperty(final String key, final String defaultValue) { SecurityManager sm = System.getSecurityManager(); if (sm == null) return System.getProperty(key, defaultValue); else return AccessController.doPrivileged(new PrivilegedAction() { public String run() { return System.getProperty(key, defaultValue); } }); } /** * Parse integer. * * @param value the string int value * @return integer value of null */ protected static Integer parseInteger(String value) { if (value == null) return null; return Integer.parseInt(value); } }././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/basic/TimedPolicyCachingBasicKernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/metadata/b0000644000175000017500000000672211035071204033225 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.metadata.basic; import org.jboss.metadata.plugins.cache.CachePolicyFactory; import org.jboss.metadata.plugins.cache.TimedCachePolicyFactory; /** * TimedPolicyCachingBasicKernelMetaDataRepository. * * @author Ales Justin */ public class TimedPolicyCachingBasicKernelMetaDataRepository extends PolicyCachingBasicKernelMetaDataRepository { private Integer defaultLifetime; private Boolean threadSafe; private Integer resolution; public TimedPolicyCachingBasicKernelMetaDataRepository() { } public TimedPolicyCachingBasicKernelMetaDataRepository(Integer defaultLifetime) { this(defaultLifetime, null, null); } public TimedPolicyCachingBasicKernelMetaDataRepository(Integer defaultLifetime, Boolean threadSafe, Integer resolution) { this.defaultLifetime = defaultLifetime; this.threadSafe = threadSafe; this.resolution = resolution; } protected CachePolicyFactory createCachePolicyFactory() { if (defaultLifetime == null) defaultLifetime = parseInteger(readSystemProperty("TimedPolicyCaching.lifetime", null)); if (threadSafe == null) threadSafe = Boolean.valueOf(readSystemProperty("TimedPolicyCaching.threadSafe", Boolean.TRUE.toString())); if (resolution == null) resolution = parseInteger(readSystemProperty("TimedPolicyCaching.resolution", null)); log.debug("Creating timed cache policy, lifetime: " + defaultLifetime + ", threadSafe: " + threadSafe + ", resolution: " + resolution); if (defaultLifetime == null) return new TimedCachePolicyFactory(); else if (resolution != null) return new TimedCachePolicyFactory(defaultLifetime, threadSafe, resolution); else return new TimedCachePolicyFactory(defaultLifetime); } /** * Set default lifetime. * * @param defaultLifetime the default lifetime */ public void setDefaultLifetime(Integer defaultLifetime) { this.defaultLifetime = defaultLifetime; } /** * Set threadsafe flag. * * @param threadSafe the threadsafe flag */ public void setThreadSafe(Boolean threadSafe) { this.threadSafe = threadSafe; } /** * The resollution. * * @param resolution the resolution */ public void setResolution(Integer resolution) { this.resolution = resolution; } }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/0000755000175000017500000000000011620312164033145 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/BeanKernelRegistryEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/B0000644000175000017500000000472410767766613033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Bean Kernel registry entry. * * @author Ales Justin */ public class BeanKernelRegistryEntry extends AbstractKernelRegistryEntry implements InvokeDispatchContext { private BeanInfo beanInfo; public BeanKernelRegistryEntry(Object target, BeanInfo beanInfo) { super(target); if (beanInfo == null) throw new IllegalArgumentException("Null bean info."); this.beanInfo = beanInfo; } public BeanKernelRegistryEntry(Object name, Object target, BeanInfo beanInfo) { super(name, target); this.beanInfo = beanInfo; } public Object get(String name) throws Throwable { return beanInfo.getProperty(target, name); } public void set(String name, Object value) throws Throwable { beanInfo.setProperty(target, name, value); } public Object invoke(String name, Object parameters[], String[] signature) throws Throwable { return beanInfo.invoke(target, name, signature, parameters); } public ClassLoader getClassLoader() throws Throwable { if (target == null) throw new IllegalArgumentException("Cannot get classloader, target is null."); // this already checks for permission return target.getClass().getClassLoader(); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/AbstractKernelBus.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/A0000644000175000017500000000322610701153725033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.registry.KernelBus; /** * Abstract Kernel bus. * * @author Adrian Brock * @author Ales Justin */ public abstract class AbstractKernelBus extends AbstractKernelObject implements KernelBus { /** The controller */ protected KernelController controller; public void setKernel(Kernel kernel) throws Throwable { super.setKernel(kernel); controller = kernel.getController(); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000755000175000017500000000000011620312164033307 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000644000175000017500000000152210150404616033312 0ustar twernertwerner

Kernel plugins, a basic registry implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/BasicKernelRegistry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000644000175000017500000000604711014301412033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry.basic; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.registry.AbstractKernelRegistry; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; /** * Basic Kernel registry. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class BasicKernelRegistry extends AbstractKernelRegistry { /** The default registry factory */ protected BasicKernelRegistryFactory defaultFactory = new BasicKernelRegistryFactory(); /** * Create a new basic registry * * @throws Exception for any error */ public BasicKernelRegistry() throws Exception { addKernelRegistryFactory(defaultFactory); } public void registerEntry(Object name, KernelRegistryEntry entry) { Kernel.checkConfigure(); defaultFactory.registerEntry(name, entry); Object target = entry.getTarget(); if (target != null && target instanceof KernelRegistryPlugin) { KernelRegistryPlugin factory = (KernelRegistryPlugin) target; addKernelRegistryFactory(factory); } if (hasListeners()) { KernelEvent event = createEvent(org.jboss.kernel.spi.registry.KernelRegistry.KERNEL_REGISTRY_REGISTERED, name); fireKernelEvent(event); } } public KernelRegistryEntry unregisterEntry(Object name) { Kernel.checkConfigure(); KernelRegistryEntry entry = defaultFactory.unregisterEntry(name); Object target = entry.getTarget(); if (target != null && target instanceof KernelRegistryPlugin) { KernelRegistryPlugin factory = (KernelRegistryPlugin) target; removeKernelRegistryFactory(factory); } if (hasListeners()) { KernelEvent event = createEvent(org.jboss.kernel.spi.registry.KernelRegistry.KERNEL_REGISTRY_UNREGISTERED, name); fireKernelEvent(event); } return entry; } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/BasicKernelBus.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000644000175000017500000001066511216157032033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry.basic; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.kernel.plugins.registry.AbstractKernelBus; /** * Basic Kernel bus. * * @author Adrian Brock * @author Ales Justin */ public class BasicKernelBus extends AbstractKernelBus { /** * Execute dispatch. * * @param exact context type * @param name the entry name * @param clazz the context class * @param dispatcher the dispatcher * @return dispatcher's result * @throws Throwable for any error */ protected Object execute(Object name, Class clazz, Dispatcher dispatcher) throws Throwable { ControllerContext context = controller.getInstalledContext(name); if (context == null) throw new IllegalArgumentException("No such context: " + name); return execute(context, clazz, dispatcher); } /** * Execute dispatch. * * @param exact context type * @param context the context * @param clazz the context class * @param dispatcher the dispatcher * @return dispatcher's result * @throws Throwable for any error */ protected Object execute(ControllerContext context, Class clazz, Dispatcher dispatcher) throws Throwable { if (clazz.isAssignableFrom(context.getClass()) == false) throw new IllegalArgumentException("Cannot execute " + dispatcher + " on non " + clazz.getSimpleName() + " context: " + context); return dispatcher.dispatch(clazz.cast(context)); } public Object get(Object name, final String getter) throws Throwable { return execute(name, AttributeDispatchContext.class, new Dispatcher() { public Object dispatch(AttributeDispatchContext context) throws Throwable { return context.get(getter); } public String toString() { return "get"; } }); } public void set(Object name, final String setter, final Object value) throws Throwable { execute(name, AttributeDispatchContext.class, new Dispatcher() { public Object dispatch(AttributeDispatchContext context) throws Throwable { context.set(setter, value); return null; } public String toString() { return "set"; } }); } public Object invoke(Object name, final String methodName, final Object parameters[], final String[] signature) throws Throwable { return execute(name, InvokeDispatchContext.class, new Dispatcher() { public Object dispatch(InvokeDispatchContext context) throws Throwable { return context.invoke(methodName, parameters, signature); } public String toString() { return "invoke"; } }); } /** * Simple dispatch on context. * * @param exact context type */ protected interface Dispatcher { /** * Invoke simple dispatcher. * * @param context the context * @throws Throwable for any error * @return dispatch's invocation result */ Object dispatch(T context) throws Throwable; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/LifecycleAwareKernelBus.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000644000175000017500000000553111216157032033317 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry.basic; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.LifecycleDispatchContext; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * A kernel bus that understands lifecycle invocation. * * @author Ales Justin */ public class LifecycleAwareKernelBus extends BasicKernelBus { public Object invoke(Object name, final String methodName, final Object parameters[], final String[] signature) throws Throwable { ControllerContext context = controller.getContext(name, null); if (context == null) throw new IllegalArgumentException("No such context: " + name); if (context instanceof LifecycleDispatchContext) { LifecycleDispatchContext ldc = (LifecycleDispatchContext)context; ControllerState state = ldc.lifecycleInvocation(methodName, parameters, signature); if (state != null) { if (state.equals(context.getState()) == false) controller.change(context, state); return null; } } if (ControllerState.INSTALLED.equals(context.getState())) { return execute(context, InvokeDispatchContext.class, new Dispatcher() { public Object dispatch(InvokeDispatchContext dispatchContext) throws Throwable { return dispatchContext.invoke(methodName, parameters, signature); } @Override public String toString() { return "invoke"; } }); } else { throw new IllegalArgumentException("The invocation is not a lifecycle invocation or context is not fully installed: " + context); } } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/basic/BasicKernelRegistryFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/b0000644000175000017500000000650110540110763033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry.basic; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntryAlreadyRegisteredException; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; import org.jboss.logging.Logger; /** * Basic Kernel registry factory. * * @author Adrian Brock * @version $Revision: 59020 $ */ public class BasicKernelRegistryFactory implements KernelRegistryPlugin { /** The log */ private static final Logger log = Logger.getLogger(BasicKernelRegistryFactory.class); /** The registred entries */ protected Map entries = new ConcurrentHashMap(); /** * Create a new basic registry factory * * @throws Exception for any error */ public BasicKernelRegistryFactory() throws Exception { } public void registerEntry(Object name, KernelRegistryEntry entry) { if (name == null) throw new IllegalArgumentException("Null name"); if (entry == null) throw new IllegalArgumentException("Null entry"); boolean trace = log.isTraceEnabled(); synchronized (entries) { if (entries.containsKey(name)) throw new KernelRegistryEntryAlreadyRegisteredException("Already registered: " + name); entries.put(name, entry); entry.setName(name); } if (trace) log.trace("Registered object: '" + entry + "' with name '" + name + "'"); } public KernelRegistryEntry unregisterEntry(Object name) { if (name == null) throw new IllegalArgumentException("Null name"); boolean trace = log.isTraceEnabled(); KernelRegistryEntry entry; synchronized (entries) { entry = entries.remove(name); if (entry == null) throw new KernelRegistryEntryNotFoundException("Not found: " + name); } if (trace) log.trace("Unregistered name: '" + name + "'"); return entry; } public KernelRegistryEntry getEntry(Object name) { if (name == null) throw new IllegalArgumentException("Null name"); return entries.get(name); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/p0000644000175000017500000000152610150404616033334 0ustar twernertwerner

Kernel plugins, an abstract registry implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/AbstractKernelRegistryEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/A0000644000175000017500000001125110772743225033265 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry; import java.util.Set; import org.jboss.dependency.plugins.AbstractScopeInfo; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; import org.jboss.util.NotImplementedException; /** * Abstract Kernel registry entry. * * @author Adrian Brock * @version $Revision: 71354 $ */ public class AbstractKernelRegistryEntry extends JBossObject implements KernelRegistryEntry { /** The name */ protected Object name; /** The target */ protected Object target; /** * Create an abstract kernel registry entry * * @param target any target object */ public AbstractKernelRegistryEntry(Object target) { this.target = target; } /** * Create an abstract kernel registry entry * * @param name the name * @param target any target object */ public AbstractKernelRegistryEntry(Object name, Object target) { this.name = name; this.target = target; } public Object getName() { return name; } public void setName(Object name) { this.name = name; flushJBossObjectCache(); } public Set getAliases() { return null; } public Object getTarget() { return target; } // @todo SORT THIS OUT, i.e. dependency that doesn't go through controller public Controller getController() { throw new NotImplementedException("getController"); } public DependencyInfo getDependencyInfo() { return null; } public ScopeInfo getScopeInfo() { String className = null; Object target = getTarget(); if (target != null) className = target.getClass().getName(); return new AbstractScopeInfo(getName(), className); } public Throwable getError() { throw new NotImplementedException("getError"); } public ControllerState getState() { return ControllerState.ERROR; } public void setState(ControllerState state) { throw new org.jboss.util.NotImplementedException("setState"); } public ControllerState getRequiredState() { throw new NotImplementedException("getRequiredState"); } public void setRequiredState(ControllerState state) { throw new NotImplementedException("setRequiredState"); } public ControllerMode getMode() { return ControllerMode.MANUAL; } public void setMode(ControllerMode mode) { throw new NotImplementedException("setMode"); } public ErrorHandlingMode getErrorHandlingMode() { return ErrorHandlingMode.DISCARD; } public void install(ControllerState fromState, ControllerState toState) throws Throwable { throw new NotImplementedException("install"); } public void setController(Controller controller) { throw new NotImplementedException("setController"); } public void setError(Throwable error) { throw new NotImplementedException("NYI setError"); } public void uninstall(ControllerState fromState, ControllerState toState) { throw new NotImplementedException("uninstall"); } public void toString(JBossStringBuilder buffer) { buffer.append("target=").append(target); } public void toShortString(JBossStringBuilder buffer) { buffer.append(target); } }././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/AbstractKernelRegistry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/registry/A0000644000175000017500000000665011042110451033250 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.registry; import java.util.List; import java.util.ListIterator; import java.util.concurrent.CopyOnWriteArrayList; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; /** * Abstract Kernel registry. * * @author Adrian Brock * @author Les A. Hazlewood * @author Ales Justin * @version $Revision: 76180 $ */ @SuppressWarnings("deprecation") public abstract class AbstractKernelRegistry extends AbstractKernelObject implements org.jboss.kernel.spi.registry.KernelRegistry { /** The registry factories */ protected List factories = new CopyOnWriteArrayList(); /** * Create an abstract kernel registry * * @throws Exception for any error */ public AbstractKernelRegistry() throws Exception { } /** * Add a kernel registry factory * * @param factory the factory to add */ public void addKernelRegistryFactory(KernelRegistryPlugin factory) { factories.add(factory); if (log.isTraceEnabled()) log.trace("Registry " + this + " added registry factory " + factory); } /** * Remove a kernel registry factory * * @param factory the factory to remove */ public void removeKernelRegistryFactory(KernelRegistryPlugin factory) { factories.remove(factory); if (log.isTraceEnabled()) log.trace("Registry " + this + " removed registry factory " + factory); } public KernelRegistryEntry findEntry(Object name) { for (ListIterator i = factories.listIterator(); i.hasNext();) { KernelRegistryPlugin factory = i.next(); KernelRegistryEntry entry = factory.getEntry(name); if (entry != null) return entry; } return null; } public KernelRegistryEntry getEntry(Object name) { KernelRegistryEntry entry = findEntry(name); if (entry == null) throw new KernelRegistryEntryNotFoundException("Entry not found with name: " + name); return entry; } public boolean containsEntry(Object name) { return findEntry(name) != null; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/util/0000755000175000017500000000000011620312166032254 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/util/KernelLocator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/util/Kerne0000644000175000017500000000404410522427762033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.kernel.plugins.util; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; /** * A simple singleton that provides access to the Kernel the KernelLocator * is associated with. * * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class KernelLocator implements KernelControllerContextAware { private static Kernel kernel; private static final KernelLocatorPermission GET_KERNEL = new KernelLocatorPermission("kernel"); public void setKernelControllerContext(KernelControllerContext context) throws Exception { KernelLocator.kernel = context.getKernel(); } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { KernelLocator.kernel = null; } public static Kernel getKernel() { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(GET_KERNEL); return kernel; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/util/KernelLocatorPermission.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/util/Kerne0000644000175000017500000000461410522427762033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.kernel.plugins.util; import java.security.BasicPermission; /** * This permission represents "trust" in a signer or codebase. * * It contains a target name but no actions list. The targets are * kernel - access the kernel * * - all allowed access * * @author Scott.Stark@jboss.org * @version $Revision: 57306 $ */ public class KernelLocatorPermission extends BasicPermission { /** For serialization */ private static final long serialVersionUID = 1L; /** * Create a new Permission * * @param name the target * @throws IllegalArgumentException for invalid name * @throws NullPointerException for null name */ public KernelLocatorPermission(String name) { this(name, null); } /** * Create a new Permission * * @param name the target * @param actions the actions * @throws IllegalArgumentException for an invalid name or target * @throws NullPointerException for null name */ public KernelLocatorPermission(String name, String actions) { super(name, actions); } /** * @return human readable string. */ public String toString() { StringBuilder buffer = new StringBuilder(64); buffer.append(getClass().getName()).append(":"); buffer.append(" name=").append(getName()); buffer.append(" actions=").append(getActions()); return buffer.toString(); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/package.ht0000644000175000017500000000151510150404616033230 0ustar twernertwerner

Kernel plugins, an abstract implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dispatch/0000755000175000017500000000000011620312163033073 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dispatch/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dispatch/S0000644000175000017500000000465710740501163033236 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dispatch; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * SecurityActions. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class SecurityActions { public static ClassLoader getClassLoader(final InvokeDispatchContext context) throws Throwable { if (System.getSecurityManager() == null) { return context.getClassLoader(); } else { try { return AccessController.doPrivileged(new PrivilegedExceptionAction() { public ClassLoader run() throws Exception { try { return context.getClassLoader(); } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new RuntimeException("Error retrieving classloader", e); } } }); } catch (PrivilegedActionException e) { throw e.getCause(); } } } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dispatch/InvokeDispatchHelper.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dispatch/I0000644000175000017500000000764610740501062033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dispatch; import java.util.List; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.logging.Logger; /** * Helper - reducing duplicated code. * * @author Ales Justin */ public class InvokeDispatchHelper { private static final Logger log = Logger.getLogger(InvokeDispatchHelper.class); /** * Invoke context with params from ParameterMetaData list. * * @param configurator the configurator * @param target the target * @param context the invoke dispatch * @param methodName the method name * @param params the parameters * @return invocation's result * @throws Throwable for any exception */ public static Object invoke( KernelConfigurator configurator, Object target, InvokeDispatchContext context, String methodName, List params) throws Throwable { String[] signature; Object[] parameters; if (params == null || params.isEmpty()) { signature = new String[0]; parameters = new Object[0]; } else { int size = params.size(); signature = Configurator.getParameterTypes(log.isTraceEnabled(), params); // TODO - is this ok for non-POJO targets? ClassLoader classLoader = SecurityActions.getClassLoader(context); if (target != null) { MethodInfo methodInfo = Configurator.findMethodInfo(configurator.getClassInfo(target.getClass()), methodName, signature); parameters = Configurator.getParameters(log.isTraceEnabled(), classLoader, methodInfo.getParameterTypes(), params); // add some more info, if not yet set for(int i = 0; i < size; i++) { if (signature[i] == null) { signature[i] = methodInfo.getParameterTypes()[i].getName(); } } } else { parameters = new Object[size]; for (int i = 0; i < size; i++) { ParameterMetaData pmd = params.get(i); TypeInfo typeInfo = null; if (signature[i] != null) { typeInfo = configurator.getClassInfo(signature[i], classLoader); } // typeInfo might be null, but we can still get value in some cases parameters[i] = pmd.getValue().getValue(typeInfo, classLoader); } } } return context.invoke(methodName, parameters, signature); } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000755000175000017500000000000011620312167033337 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/SearchClassContextDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000433111147522315033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; /** * A search Class context dependencyItem. * * @author Ales Justin */ public class SearchClassContextDependencyItem extends ClassDependencyItem { private SearchInfo search; public SearchClassContextDependencyItem(Object name, Class demandClass, ControllerState whenRequired, ControllerState dependentState, SearchInfo search) { super(name, demandClass, whenRequired, dependentState); if (search == null) throw new IllegalArgumentException("Null search."); this.search = search; } /** * Get controller context. * * @param controller the controller * @return controller context */ protected ControllerContext getControllerContext(Controller controller) { LookupStrategy strategy = search.getStrategy(); return strategy.getContext(controller, getIDependOn(), ControllerState.INSTALLED); } }././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ClassAttributeCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000610310756342051033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.plugins.AttributeCallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Class callback item - class dependency. * * @author Ales Justin */ public class ClassAttributeCallbackItem extends AttributeCallbackItem> { protected Cardinality cardinality; public ClassAttributeCallbackItem(Class name, AttributeDispatchContext owner, String attribute) { super(name, owner, attribute); } public ClassAttributeCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, AttributeDispatchContext owner, String attribute) { super(name, whenRequired, dependentState, owner, attribute); this.cardinality = cardinality; } public void ownerCallback(Controller controller, boolean isInstallPhase) throws Throwable { if (controller instanceof KernelController) { KernelController kc = (KernelController)controller; KernelControllerContext context = kc.getContextByClass(getIDependOn()); if (context != null) { Object target = context.getTarget(); owner.set(getAttributeName(), target); } } else log.info("Controller not KernelController instance, cannot execute owner callback."); } protected DependencyItem createDependencyItem(ControllerContext owner) { if (cardinality != null) return new CallbackDependencyItem(owner.getName(), getIDependOn(), whenRequired, dependentState, cardinality); else return null; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractMetaDataVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001204310665060420033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Iterator; import java.util.Stack; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; /** * AbstractMetaDataVistor. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public abstract class AbstractMetaDataVisitor implements MetaDataVisitor { /** The log */ private static final Logger log = Logger.getLogger(AbstractMetaDataVisitor.class); /** The current context for when the dependencies are required */ protected ControllerState contextState = ControllerState.INSTANTIATED; /* The metadata */ protected BeanMetaData bmd; /** The controller context */ protected KernelControllerContext context; /** * Visited branch stack */ protected Stack visitorNodeStack; protected AbstractMetaDataVisitor(BeanMetaData bmd, KernelControllerContext context) { this.bmd = bmd; this.context = context; this.visitorNodeStack = new Stack(); } public void initialVisit(MetaDataVisitorNode node) { visitorNodeStack.push(node); try { internalInitialVisit(node); } finally { visitorNodeStack.pop(); } } public void describeVisit(MetaDataVisitorNode node) { visitorNodeStack.push(node); try { internalDescribeVisit(node); } finally { visitorNodeStack.pop(); } } protected void internalInitialVisit(MetaDataVisitorNode node) { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Initial visit node " + node); // Visit the children of this node Iterator children = node.getChildren(); if (children != null) { ControllerState restoreState = contextState; while (children.hasNext()) { MetaDataVisitorNode child = children.next(); try { child.initialVisit(this); } finally { contextState = restoreState; } } } } protected void internalDescribeVisit(MetaDataVisitorNode node) { boolean trace = log.isTraceEnabled(); if (trace) log.trace("Describe visit node " + node); // Visit the children of this node Iterator children = node.getChildren(); if (children != null) { ControllerState restoreState = contextState; while (children.hasNext()) { MetaDataVisitorNode child = children.next(); try { child.describeVisit(this); } finally { contextState = restoreState; } } } } public KernelControllerContext getControllerContext() { return context; } public ControllerState getContextState() { return contextState; } public DependencyInfo getDependencyInfo() { return context.getDependencyInfo(); } public void addDependency(DependencyItem dependency) { getDependencyInfo().addIDependOn(dependency); } public void addInstallCallback(CallbackItem callback) { getDependencyInfo().addInstallItem(callback); } public void addUninstallCallback(CallbackItem callback) { getDependencyInfo().addUninstallItem(callback); } public void setContextState(ControllerState contextState) { this.contextState = contextState; } public Stack visitorNodeStack() { return visitorNodeStack; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AnnotationsAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000557110772216276033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter; import org.jboss.kernel.plugins.annotations.BeanAnnotationAdapterFactory; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Handles IoC annotations. * * @author Ales Justin */ public abstract class AnnotationsAction extends InstallsAwareAction { /** * Handle IoC annotations. * * @param context the kernel controller context * @throws Throwable for any error */ protected void applyAnnotations(KernelControllerContext context) throws Throwable { AnnotationMetaDataVisitor annotationsVisitor = new AnnotationMetaDataVisitor(context); annotationsVisitor.before(); try { getBeanAnnotationAdapter().applyAnnotations(annotationsVisitor); } finally { annotationsVisitor.after(); } } /** * Clean IoC annotations. * * @param context the kernel controller context */ protected void cleanAnnotations(KernelControllerContext context) { AnnotationMetaDataVisitor annotationsVisitor = new AnnotationMetaDataVisitor(context); annotationsVisitor.before(); try { getBeanAnnotationAdapter().cleanAnnotations(annotationsVisitor); } catch(Throwable t) { log.debug("Error while cleaning the annotations: " + t); } finally { annotationsVisitor.after(); } } /** * Get bean annotation adapter. * * @return bean annotation adapter */ protected BeanAnnotationAdapter getBeanAnnotationAdapter() { BeanAnnotationAdapterFactory factory = BeanAnnotationAdapterFactory.getInstance(); return factory.getBeanAnnotationAdapter(); } }././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/RegexpMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000345110775133546033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.regex.Pattern; import java.io.Serializable; import org.jboss.kernel.api.dependency.StringMatcher; /** * Regular expression matcher. * * @author Ales Justin */ public class RegexpMatcher extends StringMatcher implements Serializable { private static final long serialVersionUID = 1L; private Pattern pattern; public RegexpMatcher(String regexp) { if (regexp == null) throw new IllegalArgumentException("Null regexp"); pattern = Pattern.compile(regexp); } protected boolean matchByType(String other) { return pattern.matcher(other).matches(); } public String toString() { return pattern.toString(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractAttributeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000335610613653046033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Abstract attribute info. * * @param expected info type * @author Ales Justin */ public abstract class AbstractAttributeInfo extends JBossObject implements AttributeInfo { protected T info; public AbstractAttributeInfo(T info) { if (info == null) throw new IllegalArgumentException("Null info argument!"); this.info = info; } public boolean isValid() { return (getType() != null); } protected void toString(JBossStringBuilder buffer) { buffer.append("info=").append(info); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000640710756342051033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * SecurityActions. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class SecurityActions { static ClassLoader setContextClassLoader(final KernelControllerContext context) throws Throwable { if (System.getSecurityManager() == null) { ClassLoader result = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(context.getClassLoader()); return result; } else { try { return AccessController.doPrivileged(new PrivilegedExceptionAction() { public ClassLoader run() throws Exception { try { ClassLoader result = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(context.getClassLoader()); return result; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable e) { throw new RuntimeException("Error setting context classloader", e); } } }); } catch (PrivilegedActionException e) { throw e.getCause(); } } } static void resetContextClassLoader(final ClassLoader classLoader) { if (System.getSecurityManager() == null) { Thread.currentThread().setContextClassLoader(classLoader); } else { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { Thread.currentThread().setContextClassLoader(classLoader); return null; } }); } } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AttributeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000324610613653046033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.reflect.spi.TypeInfo; /** * PropertyInfo or MethodInfo abstraction. * * @author Ales Justin */ public interface AttributeInfo { /** * Is property. * * @return true for PropertyInfo, false otherwise */ boolean isProperty(); /** * Get the name. * * @return attribute name */ String getName(); /** * Get attribute type. * * @return type info */ TypeInfo getType(); /** * Is valid. * * @return true if valid, false otherwise */ boolean isValid(); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DefaultMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000352611003122212033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.io.Serializable; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.util.JBossObject; /** * Default Matcher. * * @author Ales Justin */ class DefaultMatcher implements Matcher, Serializable { private static final long serialVersionUID = -6608028542574356737L; // Should be serializable if we want to serialize this Matcher instance private Object value; public DefaultMatcher(Object value) { this.value = value; } public boolean match(Object other) { return JBossObject.equals(value, other); } public boolean needExactMatch() { return false; } public String toString() { return value != null ? value.toString() : ""; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AnnotationMetaDataVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000317310665060420033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * AnnotationMetaDataVisitor. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class AnnotationMetaDataVisitor extends AbstractMetaDataVisitor { public AnnotationMetaDataVisitor(KernelControllerContext context) { super(context.getBeanMetaData(), context); } // push bean meta data as first node public void before() { visitorNodeStack.push(bmd); } // remove bean meta data public void after() { visitorNodeStack.pop(); visitorNodeStack = null; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/InstallExistingScopeAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000713211032634675033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataItem; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.ScopeKey; /** * Install into existing scope action. * * It expects scoped controller already to be present * under the right scope key. * * @author Ales Justin */ public class InstallExistingScopeAction extends AbstractScopeAction { public static final InstallExistingScopeAction INSTANCE = new InstallExistingScopeAction(); protected void installAction(ControllerContext context) throws Throwable { ScopeKey scopeKey = getScopeKey(context); if (scopeKey != null) { Controller controller = context.getController(); if (controller instanceof KernelController == false) throw new IllegalArgumentException("Can only handle kernel controller: " + controller); KernelController kernelController = (KernelController)controller; KernelMetaDataRepository repository = kernelController.getKernel().getMetaDataRepository(); MutableMetaDataRepository mmdr = repository.getMetaDataRepository(); MetaDataRetrieval mdr = mmdr.getMetaDataRetrieval(scopeKey); if (mdr == null) throw new IllegalArgumentException("No metadata retrieval for scope: " + scopeKey); MetaDataItem controllerItem = mdr.retrieveMetaData(ScopedKernelController.class); if (controllerItem == null) throw new IllegalArgumentException("Scoped controller should exist: " + scopeKey); ScopedKernelController scopedController = controllerItem.getValue(); scopedController.addScopedControllerContext(context); } } protected void uninstallAction(ControllerContext context) { if (getScopeKey(context) != null) { Controller controller = context.getController(); if (controller instanceof ScopedKernelController == false) throw new IllegalArgumentException("Current controller should be scoped: " + controller); ScopedKernelController scopedController = (ScopedKernelController)controller; scopedController.removeScopedControllerContext(context); } } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CreateDestroyLifecycleAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000431410757136565033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.kernel.spi.dependency.CreateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.dependency.spi.ControllerState; /** * CreateDestroyLifecycleAction. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 69987 $ */ public class CreateDestroyLifecycleAction extends LifecycleAction { protected LifecycleMetaData getInstallLifecycle(BeanMetaData beanMetaData) { return beanMetaData.getCreate(); } public String getDefaultInstallMethod() { return "create"; } protected Class getActionAwareInterface() { return CreateKernelControllerContextAware.class; } protected LifecycleMetaData getUninstallLifecycle(BeanMetaData beanMetaData) { return beanMetaData.getDestroy(); } public String getDefaultUninstallMethod() { return "destroy"; } protected ControllerState getState() { return ControllerState.CREATE; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/MatcherFactoryBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000310310711377006033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.kernel.api.dependency.MatcherFactory; /** * Matcher factory builder. * * TODO this class only creates a singleton fixed implementation for now * @author Ales Justin */ public class MatcherFactoryBuilder { /** The singleton */ private static final MatcherFactory singleton = new DefaultMatcherFactory(); /** * Create the factory * * @return the factory */ public MatcherFactory create() { return singleton; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000002077511216157032033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.AccessControlContext; import java.security.PrivilegedExceptionAction; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.plugins.action.SimpleControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.validation.KernelBeanValidator; import org.jboss.logging.Logger; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.stack.MetaDataStack; /** * KernelControllerContextAction. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 90317 $ */ public class KernelControllerContextAction extends SimpleControllerContextAction { /** * Static log */ private static final Logger staticLog = Logger.getLogger(KernelControllerContextAction.class); /** * The log */ protected Logger log = Logger.getLogger(getClass()); /** * Dispatch a joinpoint * * @param context the context * @param joinpoint the joinpoint * @return the result * @throws Throwable for any error */ static Object dispatchJoinPoint(final KernelControllerContext context, final Joinpoint joinpoint) throws Throwable { ExecutionWrapper wrapper = new JoinpointDispatchWrapper(joinpoint); return dispatchExecutionWrapper(context, wrapper); } /** * Dispatch a wrapper * * @param context the context * @param wrapper the wrapper * @return the result * @throws Throwable for any error */ static Object dispatchExecutionWrapper(final KernelControllerContext context, final ExecutionWrapper wrapper) throws Throwable { BeanMetaData metaData = context.getBeanMetaData(); ClassLoader cl = Configurator.getClassLoader(metaData); AccessControlContext access = null; if (context instanceof AbstractKernelControllerContext) { AbstractKernelControllerContext theContext = (AbstractKernelControllerContext) context; access = theContext.getAccessControlContext(); } KernelController controller = (KernelController) context.getController(); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); MetaData md = repository.getMetaData(context); if (md != null) MetaDataStack.push(md); else staticLog.warn("NO METADATA! for " + context.getName() + " with scope " + context.getScopeInfo().getScope()); try { // Dispatch with the bean class loader if it exists ClassLoader tcl = Thread.currentThread().getContextClassLoader(); try { if (cl != null) Thread.currentThread().setContextClassLoader(cl); return wrapper.execute(access); } finally { Thread.currentThread().setContextClassLoader(tcl); } } finally { if (md != null) MetaDataStack.pop(); } } protected boolean validateContext(ControllerContext context) { return (context instanceof AbstractKernelControllerContext); } protected KernelControllerContext contextCast(ControllerContext context) { return KernelControllerContext.class.cast(context); } public void installAction(KernelControllerContext context) throws Throwable { installActionInternal(context); setKernelControllerContext(context); } /** * Set the context. * * @param context the context * @throws Throwable for any error */ protected void setKernelControllerContext(KernelControllerContext context) throws Throwable { Object target = context.getTarget(); if (target != null) { Class awareInterface = getActionAwareInterface(); // only applying interfaces that explicitly extend KernelControllerContextAware if (awareInterface != null && awareInterface.equals(KernelControllerContextAware.class) == false && awareInterface.isAssignableFrom(target.getClass())) { ((KernelControllerContextAware)target).setKernelControllerContext(context); } } } /** * Execute install action. * * @param context the context * @throws Throwable for any error */ protected void installActionInternal(KernelControllerContext context) throws Throwable { } /** * Get the action aware interface. * * @return the action aware interface */ protected Class getActionAwareInterface() { return null; } public void uninstallAction(KernelControllerContext context) { unsetKernelControllerContext(context); uninstallActionInternal(context); } /** * Execute uninstall action. * * @param context the context */ protected void uninstallActionInternal(KernelControllerContext context) { } /** * Unset the context. * * @param context the context */ protected void unsetKernelControllerContext(KernelControllerContext context) { Object target = context.getTarget(); if (target != null) { Class awareInterface = getActionAwareInterface(); // only applying interfaces that explicitly extend KernelControllerContextAware if (awareInterface != null && awareInterface.equals(KernelControllerContextAware.class) == false && awareInterface.isAssignableFrom(target.getClass())) { try { ((KernelControllerContextAware) target).unsetKernelControllerContext(context); } catch (Exception ignored) { log.debug("Ignored error unsetting context " + context.getName(), ignored); } } } } /** * Joinpoint dispatch execution wrapper. */ private static class JoinpointDispatchWrapper extends ExecutionWrapper { private Joinpoint joinpoint; public JoinpointDispatchWrapper(Joinpoint joinpoint) { if (joinpoint == null) throw new IllegalArgumentException("Null joinpoint"); this.joinpoint = joinpoint; } protected Object execute() throws Throwable { return joinpoint.dispatch(); } protected PrivilegedExceptionAction getAction() { return new DispatchJoinPoint(joinpoint); } } /** * Get bean validator bridge. * * @param context the owner context * @return bean validator bridge instance if exists, null otherwise */ static BeanValidatorBridge getBeanValidatorBridge(KernelControllerContext context) { KernelController controller = (KernelController)context.getController(); if (controller == null) return null; Kernel kernel = controller.getKernel(); KernelBeanValidator validator = kernel.getValidator(); if (validator == null || validator.isDisabled()) return null; return new KernelBeanValidatorBridge(validator); } }././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000003232711216157032033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.AccessControlContext; import java.security.AccessController; import java.security.SecurityPermission; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.AliasMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractDependencyInfo; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.MethodInfo; import org.jboss.util.JBossStringBuilder; /** * Controller context. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 90317 $ */ public class AbstractKernelControllerContext extends AbstractControllerContext implements KernelControllerContext { /** The default actions */ private static final KernelControllerContextActions actions = KernelControllerContextActions.getInstance(); /** The no instantiate actions */ private static final KernelControllerContextActions noInstantiate = KernelControllerContextActions.getNoInstantiate(); /** The get classloader permission */ private static final RuntimePermission GET_CLASSLOADER_PERMISSION = new RuntimePermission("getClassLoader"); /** The access control context permission */ private static final SecurityPermission GET_ACCESS_CONTROL_CONTEXT_PERMISSION = new SecurityPermission("getAccessControlContext"); /** The BeanInfo */ private BeanInfo info; /** The meta data */ private BeanMetaData metaData; /** The access control context */ private AccessControlContext accessContext; /** Did we do a initialVisit */ private boolean isInitialProcessed; /** Did we do a describeVisit */ private boolean isDescribeProcessed; /** * Determine the aliases * * @param metaData the bean meta data * @return the aliases */ private static Set determineAliases(BeanMetaData metaData) { if (metaData == null) return null; // FIXME THIS IS HACK if (metaData instanceof AbstractBeanMetaData) { AbstractBeanMetaData abmd = (AbstractBeanMetaData) metaData; Set aliasMetaDatas = abmd.getAliasMetaData(); if (aliasMetaDatas != null && aliasMetaDatas.isEmpty() == false) { Set aliases = abmd.getAliases(); if (aliases == null) { aliases = new HashSet(); abmd.setAliases(aliases); } for (AliasMetaData aliasMetaData : aliasMetaDatas) aliases.add(aliasMetaData.getAliasValue()); } } return metaData.getAliases(); } /** * Create an abstract controller context * * @param info the bean info * @param metaData the meta data * @param target any target object */ public AbstractKernelControllerContext(BeanInfo info, BeanMetaData metaData, Object target) { super(metaData.getName(), determineAliases(metaData), target == null ? actions : noInstantiate, new AbstractDependencyInfo(), target); this.info = info; this.metaData = metaData; ControllerMode mode = metaData.getMode(); if (mode != null) setMode(mode); ErrorHandlingMode errorHandlingMode = metaData.getErrorHandlingMode(); if (errorHandlingMode != null) setErrorHandlingMode(errorHandlingMode); boolean autowireCandidate = metaData.isAutowireCandidate(); getDependencyInfo().setAutowireCandidate(autowireCandidate); if (System.getSecurityManager() != null) accessContext = AccessController.getContext(); initKernelScopeInfo(); } public Kernel getKernel() { KernelController controller = (KernelController) getController(); if (controller == null) throw new IllegalStateException("Context is not installed in controller"); return controller.getKernel(); } public BeanInfo getBeanInfo() { return info; } /** * Set the bean info * * @param info the bean info */ public void setBeanInfo(BeanInfo info) { this.info = info; infoprocessMetaData(); flushJBossObjectCache(); } public BeanMetaData getBeanMetaData() { return metaData; } public void toString(JBossStringBuilder buffer) { if (metaData != null) buffer.append(" metadata=").append(metaData); super.toString(buffer); } public void setController(Controller controller) { super.setController(controller); preprocessMetaData(); } @Override protected void initScopeInfo() { // nothing } protected void initKernelScopeInfo() { String className = null; Object target = getTarget(); if (target != null) className = target.getClass().getName(); BeanMetaData bmd = getBeanMetaData(); if (bmd != null) { String bean = bmd.getBean(); if (bean != null) className = bean; } setScopeInfo(new KernelScopeInfo(getName(), className, bmd)); } /** * Preprocess the metadata for this context */ protected void preprocessMetaData() { if (metaData == null) return; if (isInitialProcessed) return; PreprocessMetaDataVisitor visitor = new PreprocessMetaDataVisitor(metaData, this); AccessController.doPrivileged(visitor); isInitialProcessed = true; } /** * Preprocess the metadata for this context */ protected void infoprocessMetaData() { if (info == null) { removeClassContextReference(); return; } if (isDescribeProcessed) return; DescribedMetaDataVisitor visitor = new DescribedMetaDataVisitor(metaData, this); AccessController.doPrivileged(visitor); isDescribeProcessed = true; } /** * Get the access control context of the code that created this context.

*

* This will be null when there is no security manager. * * @return any access control context */ public AccessControlContext getAccessControlContext() { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(GET_ACCESS_CONTROL_CONTEXT_PERMISSION); return accessContext; } private void removeClassContextReference() { DependencyInfo dependencyInfo = getDependencyInfo(); if (dependencyInfo != null) { // remove all dependency items that hold class ref Set dependencys = dependencyInfo.getIDependOn(ClassContextDependencyItem.class); dependencys.addAll(dependencyInfo.getIDependOn(CallbackDependencyItem.class)); for (DependencyItem di : dependencys) { // can cast because of getIDepend method impl ClassDependencyItem cdi = (ClassDependencyItem)di; cdi.clear(getController()); } } } protected BeanInfo getInfo() { if (info == null) throw new IllegalArgumentException("Null BeanInfo"); return info; } public Object get(final String name) throws Throwable { return getInfo().getProperty(getTarget(), name); } public void set(final String name, final Object value) throws Throwable { getInfo().setProperty(getTarget(), name, value); } public Object invoke(final String name, final Object[] parameters, final String[] signature) throws Throwable { validateMethodValues(name, signature, parameters); return getInfo().invoke(getTarget(), name, signature, parameters); } // todo - remove or better security public ClassLoader getClassLoader() throws Throwable { SecurityManager sm = System.getSecurityManager(); if (sm != null) sm.checkPermission(GET_CLASSLOADER_PERMISSION); return Configurator.getClassLoader(getBeanMetaData()); } // TODO - not the nicest impl with 4 trys, but what else can we do? public ControllerState lifecycleInvocation(String name, Object[] parameters, String[] signature) throws Throwable { if (useLifecycleState(name, signature, metaData.getCreate(), "create")) { ControllerStateModel model = getController().getStates(); if (model.isAfterState(ControllerState.CREATE, getState())) return ControllerState.CREATE; else return getState(); } if (useLifecycleState(name, signature, metaData.getStart(), "start")) { ControllerStateModel model = getController().getStates(); if (model.isAfterState(ControllerState.START, getState())) return ControllerState.START; else return getState(); } if (useLifecycleState(name, signature, metaData.getStop(), "stop")) { ControllerStateModel model = getController().getStates(); if (model.isBeforeState(ControllerState.CREATE, getState())) return ControllerState.CREATE; else return getState(); } if (useLifecycleState(name, signature, metaData.getDestroy(), "destroy")) { ControllerStateModel model = getController().getStates(); if (model.isBeforeState(ControllerState.CONFIGURED, getState())) return ControllerState.CONFIGURED; else return getState(); } return null; } /** * Get lifecycle state if it matches the parameters. * * @param name the method name * @param signature the signature * @param lmd the lifecycle metadata * @param defaultName the default name * @return true if lifecycle matches, false otherwise */ protected static boolean useLifecycleState(String name, String[] signature, LifecycleMetaData lmd, String defaultName) { if (lmd != null) { String methodName = lmd.getMethodName(); if (name.equals(methodName) || (methodName == null && name.equals(defaultName))) { List params = lmd.getParameters(); if (params != null) { if (signature != null && params.size() == signature.length) { int i = 0; for (ParameterMetaData pmd : params) { String type = pmd.getType(); if (type != null && signature[i] != null && type.equals(signature[i]) == false) return false; // we found a non match i++; } return true; } } else if (signature == null || signature.length == 0) { return true; } } } else if (defaultName.equals(name) && (signature == null || signature.length == 0)) { return true; } return false; } /** * Validate method invocation. * Use jsr303 constraints. * * @param name the method name * @param signature the method signature * @param paramaters the parameter values * @throws Throwable for any error */ protected void validateMethodValues(String name, String[] signature, Object[] paramaters) throws Throwable { BeanValidatorBridge bridge = KernelControllerContextAction.getBeanValidatorBridge(this); if (bridge != null) { MethodInfo methodInfo = Configurator.findMethodInfo(getInfo().getClassInfo(), name, signature); bridge.validateMethodValues(this, getTarget(), methodInfo, paramaters); } } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreInstallAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000002032211262376750033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.lang.annotation.Annotation; import java.lang.ref.WeakReference; import java.util.Collection; import java.util.HashSet; import java.util.Map; import java.util.WeakHashMap; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeFactory; import org.jboss.metadata.spi.scope.ScopeFactoryLookup; import org.jboss.metadata.spi.scope.ScopeKey; /** * PreInstallAction. * * @author Ales Justin */ public class PreInstallAction extends InstallsAwareAction { private Map>, WeakReference>> factories = new WeakHashMap>, WeakReference>>(); /** * Get the scope factory. * * @param clazz the class key * @return scope factory * @throws Throwable for any error */ protected ScopeFactory getScopeFactory(Class> clazz) throws Throwable { ScopeFactory factory = null; WeakReference> weak = factories.get(clazz); if (weak != null) { factory = weak.get(); if (factory != null) return factory; } factory = clazz.newInstance(); factories.put(clazz, new WeakReference>(factory)); return factory; } protected void installActionInternal(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController)context.getController(); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); BeanMetaData metaData = context.getBeanMetaData(); if (metaData.getBean() != null) { BeanInfo info = configurator.getBeanInfo(metaData); context.setBeanInfo(info); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); ClassLoader oldCL = SecurityActions.setContextClassLoader(context); try { repository.addMetaData(context); } finally { SecurityActions.resetContextClassLoader(oldCL); } try { applyScoping(context); } catch (Throwable t) { removeMetaData(context); throw t; } } } @SuppressWarnings("unchecked") protected ScopeKey getInstallScopeKey( KernelControllerContext context, KernelMetaDataRepository repository) throws Throwable { ScopeKey scopeKey = context.getScopeInfo().getInstallScope(); if (scopeKey != null) return scopeKey; MetaData retrieval = repository.getMetaData(context); if (retrieval != null) { Annotation[] annotations = retrieval.getAnnotations(); if (annotations != null && annotations.length > 0) { Collection scopes = new HashSet(); for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(ScopeFactoryLookup.class)) { ScopeFactoryLookup sfl = annotation.annotationType().getAnnotation(ScopeFactoryLookup.class); ScopeFactory scf = getScopeFactory(sfl.value()); Scope scope = scf.create(annotation); scopes.add(scope); } } if (scopes.size() > 0) { return new ScopeKey(scopes); } } } return null; } protected void applyScoping(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController)context.getController(); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); ScopeKey scopeKey = getInstallScopeKey(context, repository); if (scopeKey != null) { scopeKey.freeze(); context.getScopeInfo().setInstallScope(scopeKey); if (controller instanceof AbstractKernelController == false) throw new IllegalArgumentException("Can only handle AbstractKernelController: " + controller); MutableMetaDataRepository mmdr = repository.getMetaDataRepository(); AbstractController abstractController = ScopeHierarchyBuilder.buildControllerHierarchy((AbstractKernelController)controller, mmdr, scopeKey); if (abstractController instanceof ScopedKernelController == false) throw new IllegalArgumentException("Should be ScopedKernelController instance: " + abstractController); ScopedKernelController scopedController = (ScopedKernelController)abstractController; scopedController.addScopedControllerContext(context); } } protected void removeScoping(KernelControllerContext context) throws Throwable { ScopeKey scopeKey = context.getScopeInfo().getInstallScope(); if (scopeKey != null) { KernelController controller = (KernelController)context.getController(); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); // find scoped controller MutableMetaDataRepository mmdr = repository.getMetaDataRepository(); ScopeHierarchyBuilder.cleanControllerHierarchy(mmdr, scopeKey, context); } } protected void uninstallActionInternal(KernelControllerContext context) { try { removeScoping(context); } catch (Throwable ignored) { log.warn("Unexpected error removing scoping: ", ignored); } finally { removeMetaData(context); context.setBeanInfo(null); } } /** * Remove any previously added metadata * * @param context the context */ private void removeMetaData(KernelControllerContext context) { try { KernelController controller = (KernelController)context.getController(); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); repository.removeMetaData(context); } catch (Throwable ignored) { log.warn("Unexpected error removing metadata: ", ignored); } } protected ControllerState getState() { return ControllerState.PRE_INSTALL; } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PreprocessMetaDataVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000352410665060420033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.PrivilegedAction; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * PreprocessMetaDataVisitor. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class PreprocessMetaDataVisitor extends AbstractMetaDataVisitor implements PrivilegedAction { /** * Create a new MetaDataVisitor. * * @param bmd the bean metadata * @param context the controller context */ public PreprocessMetaDataVisitor(BeanMetaData bmd, KernelControllerContext context) { super(bmd, context); } /** * Visit the bean metadata node, this is the starting point */ public Object run() { bmd.initialVisit(this); visitorNodeStack = null; return null; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CollectionCallbackItemFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000531610756342051033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Collection; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Collection callback item factory. * * @author Ales Justin */ public interface CollectionCallbackItemFactory { /** * Create collection callback item for parameter class. * * @param parameterClass actual collection class * @param name demand name * @param context invoke owner * @param attribute the attribute * @return new exact collection callback item */ CollectionCallbackItem> createCollectionCallbackItem( Class> parameterClass, Class name, InvokeDispatchContext context, AttributeInfo attribute); /** * Create collection callback item for parameter class. * * @param parameterClass actual collection class * @param name demand name * @param whenRequired when required state * @param dependentState dependent state * @param cardinality the cardinality * @param context invoke owner * @param attribute the attribute * @return new exact collection callback item */ CollectionCallbackItem> createCollectionCallbackItem( Class> parameterClass, Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelScopeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000003202211301242575033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.lang.annotation.Annotation; import java.util.List; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.AnnotationMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CachingAnnotationMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.dependency.plugins.AbstractScopeInfo; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.metadata.spi.ComponentMutableMetaData; import org.jboss.metadata.spi.loader.MutableMetaDataLoader; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.signature.FieldSignature; import org.jboss.metadata.spi.signature.MethodSignature; import org.jboss.metadata.spi.signature.Signature; import org.jboss.reflect.spi.FieldInfo; import org.jboss.reflect.spi.MethodInfo; /** * KernelScopeInfo. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class KernelScopeInfo extends AbstractScopeInfo { /** The log */ private static final Logger log = Logger.getLogger(KernelScopeInfo.class); /** The bean metadata */ private BeanMetaData beanMetaData; /** * Create a new KernelScopeInfo. * * @param name the name * @param className the class name * @param beanMetaData the bean metadata */ public KernelScopeInfo(Object name, String className, BeanMetaData beanMetaData) { super(name, className); this.beanMetaData = beanMetaData; } @Override @SuppressWarnings("unchecked") public ScopeKey getScope() { // THIS IS A HACK - the scope originally gets initialise with a class name, we fix it to have the class ScopeKey key = super.getScope(); Scope scope = key.getScope(CommonLevels.CLASS); if (scope == null) return key; Object qualifier = scope.getQualifier(); if (qualifier instanceof Class) return key; String className = (String) qualifier; ClassLoader cl; try { cl = Configurator.getClassLoader(beanMetaData); } catch (Throwable t) { throw new RuntimeException("Error getting classloader for " + key, t); } Class clazz; try { clazz = Class.forName(className, false, cl); } catch (ClassNotFoundException e) { throw new RuntimeException("Unable to load class: " + className + " for " + key, e); } key.addScope(new Scope(CommonLevels.CLASS, clazz)); return key; } @Override public void updateMetaData(MutableMetaDataRepository repository, ControllerContext context, MutableMetaDataLoader mutable, boolean add) { if (context instanceof KernelControllerContext == false) return; KernelControllerContext kernelContext = (KernelControllerContext) context; updateClassAnnotations(mutable, kernelContext, add); if (mutable instanceof ComponentMutableMetaData) updatePropertyAnnotations(repository, (ComponentMutableMetaData) mutable, kernelContext, add); else if (add == true) log.warn("Unable to add properties to mutable metadata that does not support components: " + mutable + " for " + context.toShortString()); } /** * Update class annotations * * @param mutable the mutable metadata * @param context the context * @param add true for add, false for remove */ private void updateClassAnnotations(MutableMetaDataLoader mutable, KernelControllerContext context, boolean add) { BeanMetaData beanMetaData = context.getBeanMetaData(); if (beanMetaData != null) { ClassLoader cl; try { cl = Configurator.getClassLoader(beanMetaData); } catch(Throwable t) { throw new RuntimeException("Error getting classloader for " + beanMetaData.getName(), t); } updateAnnotations(cl, mutable, beanMetaData.getAnnotations(), add); } } /** * Update property annotations * * @param repository the repository * @param mutable the mutable * @param context the kernel controller contex * @param add true for add, false for remove */ private void updatePropertyAnnotations(MutableMetaDataRepository repository, ComponentMutableMetaData mutable, KernelControllerContext context, boolean add) { BeanMetaData beanMetaData = context.getBeanMetaData(); if (beanMetaData == null) return; Set properties = beanMetaData.getProperties(); if (properties == null || properties.size() == 0) return; BeanInfo beanInfo = context.getBeanInfo(); if (beanInfo == null) return; ClassLoader cl; try { cl = Configurator.getClassLoader(beanMetaData); } catch(Throwable t) { throw new RuntimeException("Error getting classloader for metadata"); } for (PropertyMetaData property : properties) updatePropertyAnnotations(repository, cl, mutable, context, property, beanInfo, add); } /** * Update property annotations * * @param repository the repository * @param classloader the classloader * @param mutable the mutable * @param context the context * @param propertyMetaData the property * @param beanInfo the bean info * @param add true for add, false for remove */ private void updatePropertyAnnotations(MutableMetaDataRepository repository, ClassLoader classloader, ComponentMutableMetaData mutable, KernelControllerContext context, PropertyMetaData propertyMetaData, BeanInfo beanInfo, boolean add) { Set propertyAnnotations = propertyMetaData.getAnnotations(); if (propertyAnnotations == null || propertyAnnotations.size() == 0) return; PropertyInfo propertyInfo = beanInfo.getProperty(propertyMetaData.getName()); // method annotations MethodInfo methodInfo = propertyInfo.getGetter(); if (methodInfo != null) updateAnnotations(repository, classloader, mutable, context, methodInfo, propertyAnnotations, add); methodInfo = propertyInfo.getSetter(); if (methodInfo != null) updateAnnotations(repository, classloader, mutable, context, methodInfo, propertyAnnotations, add); // field annotations FieldInfo fieldInfo = propertyInfo.getFieldInfo(); if (fieldInfo != null) updateAnnotations(repository, classloader, mutable, context, fieldInfo, propertyAnnotations, add); } /** * Update component annotations * * @param repository the repository * @param classloader the classloader * @param component the component metadata * @param context the context * @param signature the signature * @param scope the scope * @param annotations the annotations * @param add true for add, false for remove */ private void updateAnnotations(MutableMetaDataRepository repository, ClassLoader classloader, ComponentMutableMetaData component, KernelControllerContext context, Signature signature, ScopeKey scope, Set annotations, boolean add) { MetaDataRetrieval retrieval = ((MetaDataRetrieval) component).getComponentMetaDataRetrieval(signature); MutableMetaDataLoader mutable; if (retrieval != null) { mutable = getMutableMetaDataLoader(retrieval); if (mutable == null) { if (add) log.warn("MetaData is not mutable with signature: " + signature + " for " + context.toShortString()); return; } } else if (add) { mutable = initMutableMetaDataRetrieval(repository, context, scope); component.addComponentMetaDataRetrieval(signature, mutable); } else { return; } updateAnnotations(classloader, mutable, annotations, add); } /** * Update annotations for a method * * @param repository the repository * @param classloader the classloader * @param component the mutable metadata * @param context the context * @param methodInfo the method info * @param annotations the annotations * @param add true for add, false for remove */ private void updateAnnotations(MutableMetaDataRepository repository, ClassLoader classloader, ComponentMutableMetaData component, KernelControllerContext context, MethodInfo methodInfo, Set annotations, boolean add) { if (annotations == null || annotations.isEmpty()) return; Signature signature = new MethodSignature(methodInfo); ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, methodInfo.getName()); updateAnnotations(repository, classloader, component, context, signature, scope, annotations, add); } /** * Add annotations for a field * * @param repository the repository * @param classloader the classloader * @param component the mutable metadata * @param context the context * @param fieldInfo the field info * @param annotations the annotations * @param add true for add, false for remove */ private void updateAnnotations(MutableMetaDataRepository repository, ClassLoader classloader, ComponentMutableMetaData component, KernelControllerContext context, FieldInfo fieldInfo, Set annotations, boolean add) { if (annotations == null || annotations.isEmpty()) return; Signature signature = new FieldSignature(fieldInfo); ScopeKey scope = new ScopeKey(CommonLevels.JOINPOINT_OVERRIDE, fieldInfo.getName()); updateAnnotations(repository, classloader, component, context, signature, scope, annotations, add); } /** * Add annotations to a mutable metadata * * @param classloader the classloader * @param mutable the mutable metadata * @param annotations the annotations * @param add true for add, false for remove */ private void updateAnnotations(ClassLoader classloader, MutableMetaDataLoader mutable, Set annotations, boolean add) { if (annotations == null || annotations.size() == 0) return; for (AnnotationMetaData annotation : annotations) { if (add) { Annotation annotationInstance = annotation.getAnnotationInstance(classloader); mutable.addAnnotation(annotationInstance); } else { Annotation annotationInstance = null; if (annotation instanceof CachingAnnotationMetaData) annotationInstance = ((CachingAnnotationMetaData) annotation).removeAnnotation(); if (annotationInstance == null) annotationInstance = annotation.getAnnotationInstance(classloader); // Null means we never constructed it in the first place if (annotationInstance != null) mutable.removeAnnotation(annotationInstance.annotationType()); } } } @Override protected MetaDataRetrieval createMetaDataRetrieval(ControllerContext context, List retrievals) { Controller controller = context.getController(); if (controller instanceof KernelController) { KernelController kernelController = (KernelController) controller; MetaDataRetrieval result = kernelController.getKernel().getMetaDataRepository().createMetaDataRetrieval(context, retrievals); if (result != null) return result; } return super.createMetaDataRetrieval(context, retrievals); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DispatchJoinPoint.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000345410454712313033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.PrivilegedExceptionAction; import org.jboss.joinpoint.spi.Joinpoint; /** * DispatchJoinPoint. * * @author Adrian Brock * @version $Revision: 46187 $ */ class DispatchJoinPoint implements PrivilegedExceptionAction { private Joinpoint joinpoint; public DispatchJoinPoint(Joinpoint joinpoint) { this.joinpoint = joinpoint; } public Object run() throws Exception { try { return joinpoint.dispatch(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractScopeAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000377011032634675033360 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.plugins.action.SimpleControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.metadata.spi.scope.ScopeKey; /** * Abstract scope action. * * @author Ales Justin */ public abstract class AbstractScopeAction extends SimpleControllerContextAction { protected ControllerContext contextCast(ControllerContext context) { return context; } protected boolean validateContext(ControllerContext context) { return true; } /** * Get install scope key. * * @param context the context * @return install scope key */ protected ScopeKey getScopeKey(ControllerContext context) { ScopeInfo scopeInfo = context.getScopeInfo(); if (scopeInfo != null) return scopeInfo.getInstallScope(); return null; } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelBeanValidatorBridge.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000513011216157032033337 0ustar twernertwerner/* * 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.kernel.plugins.dependency; import org.jboss.kernel.spi.validation.KernelBeanValidator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.reflect.spi.MethodInfo; /** * Wrapper around kernel bean validator. * * @author Ales Justin */ public class KernelBeanValidatorBridge implements BeanValidatorBridge { private KernelBeanValidator validator; public KernelBeanValidatorBridge(KernelBeanValidator validator) { if (validator == null) throw new IllegalArgumentException("Null validator"); this.validator = validator; } public void validateConstructorValues(KernelControllerContext context, Joinpoint joinpoint) throws Throwable { validator.validateConstructorValues(context, joinpoint); } public void validateInstance(KernelControllerContext context, Object target) throws Throwable { validator.validateInstance(context, target); } public void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo propertyInfo, Object value) throws Throwable { validator.validatePropertyValue(context, target, propertyInfo, value); } public void validateMethodValues(KernelControllerContext context, Object target, MethodInfo methodInfo, Object[] parameters) throws Throwable { validator.validateMethodValues(context, target, methodInfo, parameters); } } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ListCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000361710756342051033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.List; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * List collection callback item. * * @author Ales Justin */ public class ListCallbackItem extends CollectionCreatorCallbackItem> { public ListCallbackItem(Class name, InvokeDispatchContext owner, AttributeInfo attribute) { super(CollectionCreator.LIST, name, owner, attribute); } public ListCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { super(CollectionCreator.LIST, name, whenRequired, dependentState, cardinality, context, attribute); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CollectionCreatorCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000450310756342051033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Collection; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Collection callback item using CollectionCreator. * * @param expected collection type * @author Ales Justin */ public abstract class CollectionCreatorCallbackItem> extends CollectionCallbackItem { protected CollectionCreator creator; public CollectionCreatorCallbackItem(CollectionCreator creator, Class name, InvokeDispatchContext owner, AttributeInfo attribute) { this(creator, name, null, null, null, owner, attribute); } public CollectionCreatorCallbackItem(CollectionCreator creator, Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { super(name, whenRequired, dependentState, cardinality, context, attribute); if (creator == null) throw new IllegalArgumentException("Null creator!"); this.creator = creator; } protected T getCollectionParameterHolder() { return creator.createCollection(); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CallbackDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001161210772216276033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Set; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.util.HashCode; import org.jboss.util.JBossStringBuilder; /** * A Callback dependencyItem. * * @author Ales Justin */ public class CallbackDependencyItem extends ClassDependencyItem { private Cardinality cardinality; public CallbackDependencyItem(Object name, Class demandClass, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality) { super(name, demandClass, whenRequired, dependentState); if (cardinality == null) throw new IllegalArgumentException("Null cardinality."); this.cardinality = cardinality; } public Cardinality getCardinality() { return cardinality; } protected Set getContexts(Controller controller) { if (controller instanceof KernelController == false) throw new IllegalArgumentException("Controller not KernelController!"); KernelController kernelController = (KernelController)controller; return kernelController.getContexts(getDemandClass(), getDependentState()); } public boolean resolve(Controller controller) { Set contexts = getContexts(controller); int size = contexts != null ? contexts.size() : 0; if (cardinality.isInRange(size)) { setIDependOn(getIDependOn()); if (contexts != null) { for (KernelControllerContext context : contexts) addDependsOnMe(controller, context); } setResolved(true); } else { setResolved(false); } return isResolved(); } public boolean unresolved(Controller controller) { if (getIDependOn() == null) return true; Set contexts = getContexts(controller); // minus one, since this is called when unistalling dependent context int size = contexts != null ? contexts.size() - 1 : 0; return cardinality.isInRange(size) == false; } protected int getHashCode() { int result = HashCode.generate(getName()); result += 3 * HashCode.generate(getIDependOn()); result += 7 * HashCode.generate(getWhenRequired()); result += 11 * HashCode.generate(getDependentState()); result += 19 * HashCode.generate(getCardinality()); return result; } public boolean equals(Object obj) { if (obj instanceof CallbackDependencyItem == false) return false; CallbackDependencyItem cdi = (CallbackDependencyItem)obj; if (isDifferent(getName(), cdi.getName())) return false; if (isDifferent(getIDependOn(), cdi.getIDependOn())) return false; if (isDifferent(getWhenRequired(), cdi.getWhenRequired())) return false; if (isDifferent(getDependentState(), cdi.getDependentState())) return false; if (isDifferent(getCardinality(), cdi.getCardinality())) return false; return true; } protected static boolean isDifferent(Object first, Object second) { if (first == null) return second != null; else return first.equals(second) == false; } @Override public void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" cardinality=" + cardinality); } @Override public String toHumanReadableString() { return "Cardinality usage: '" + cardinality + "' and " + super.toHumanReadableString(); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ScopeHierarchyBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001057011035124716033345 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.metadata.spi.MutableMetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataItem; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; /** * ScopeHierarchyBuilder. * * @author Ales Justin */ public final class ScopeHierarchyBuilder { /** * Create whole hierarchy. * Fill in missing controllers. * * @param top the top controller * @param mmdr the mutable metadata repository * @param scopeKey the current scope key * @return controller for current scope key * @throws Throwable for any error */ public static AbstractController buildControllerHierarchy(AbstractKernelController top, MutableMetaDataRepository mmdr, ScopeKey scopeKey) throws Throwable { if (scopeKey == null) return top; MetaDataRetrieval mdr = mmdr.getMetaDataRetrieval(scopeKey); if (mdr != null) { MetaDataItem mdi = mdr.retrieveMetaData(ScopedKernelController.class); if (mdi != null) return mdi.getValue(); } else { mdr = new MemoryMetaDataLoader(scopeKey); mmdr.addMetaDataRetrieval(mdr); } AbstractController parentController = buildControllerHierarchy(top, mmdr, scopeKey.getParent()); ScopedKernelController scopedKernelController = new ScopedKernelController(top.getKernel(), parentController, scopeKey); ((MutableMetaData)mdr).addMetaData(scopedKernelController, ScopedKernelController.class); return scopedKernelController; } /** * Clean controller hierarchy. * * @param mmdr the mutable metadata repository * @param scopeKey the current scope key * @param context the context to remove */ public static void cleanControllerHierarchy(MutableMetaDataRepository mmdr, ScopeKey scopeKey, ControllerContext context) { if (scopeKey == null) return; MetaDataRetrieval mdr = mmdr.getMetaDataRetrieval(scopeKey); if (mdr == null) { throw new IllegalArgumentException("Expecting MetaDataRetrieval instance in scope: " + scopeKey); } MetaDataItem controllerItem = mdr.retrieveMetaData(ScopedKernelController.class); if (controllerItem == null) { throw new IllegalArgumentException("Expecting ScopedKernelController instance in scope:" + scopeKey); } ScopedKernelController scopedController = controllerItem.getValue(); if (context != null) scopedController.removeScopedControllerContext(context); if (scopedController.isActive() == false) { try { ((MutableMetaData)mdr).removeMetaData(ScopedKernelController.class); if (mdr.isEmpty()) mmdr.removeMetaDataRetrieval(scopeKey); } finally { scopedController.release(); } } cleanControllerHierarchy(mmdr, scopeKey.getParent(), null); } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/MethodAttributeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000347010613653046033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; /** * Method attribute info. * * @author Ales Justin */ public class MethodAttributeInfo extends AbstractAttributeInfo { public MethodAttributeInfo(MethodInfo methodInfo) { super(methodInfo); } public boolean isProperty() { return false; } public String getName() { return info.getName(); } public TypeInfo getType() { TypeInfo[] typeInfos = info.getParameterTypes(); if (typeInfos == null || typeInfos.length != 1) throw new IllegalArgumentException("Null or illegal length parameter types: " + info); return typeInfos[0]; } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/KernelControllerContextActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000771511262376750033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.HashMap; import java.util.Map; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerState; /** * The KernelControllerActions.

* * When there is a security manager and we are using a native context * we switch to our privileges to run the actions and switch back to callout to beans.

* * Otherwise, we just use the caller's privileges. * * @author Adrian Brock * @version $Revision: 94371 $ */ public class KernelControllerContextActions extends AbstractControllerContextActions { /** The single instance */ private static volatile KernelControllerContextActions instance; /** Actions without instantiate */ private static volatile KernelControllerContextActions noInstantiate; /** * Get the instance * * @return the actions */ public static KernelControllerContextActions getInstance() { if (instance == null) { Map actions = new HashMap(); actions.put(ControllerState.PRE_INSTALL, new PreInstallAction()); actions.put(ControllerState.DESCRIBED, new DescribeAction()); actions.put(ControllerState.INSTANTIATED, new InstantiateAction()); actions.put(ControllerState.CONFIGURED, new ConfigureAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); actions.put(ControllerState.INSTALLED, new InstallAction()); instance = new KernelControllerContextActions(actions); } return instance; } /** * Get no instantiate actions * * @return the actions */ public static KernelControllerContextActions getNoInstantiate() { if (noInstantiate == null) { Map actions = new HashMap(); actions.put(ControllerState.PRE_INSTALL, new PreInstallAction()); actions.put(ControllerState.DESCRIBED, new DescribeAction()); actions.put(ControllerState.INSTANTIATED, new AutowireAction()); actions.put(ControllerState.CONFIGURED, new ConfigureAction()); actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction()); actions.put(ControllerState.START, new StartStopLifecycleAction()); actions.put(ControllerState.INSTALLED, new InstallAction()); noInstantiate = new KernelControllerContextActions(actions); } return noInstantiate; } /** * Create a new KernelControllerContextActions. * * @param actions the actions */ protected KernelControllerContextActions(Map actions) { super(actions); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000153010150404616033336 0ustar twernertwerner

Kernel plugins, an abstract dependency implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/JNDIKernelRegistryPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000457110756342051033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Hashtable; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import org.jboss.kernel.plugins.registry.AbstractKernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; /** * JNDI aware KernelRegistryPlugin. * * @author Ales Justin */ public class JNDIKernelRegistryPlugin implements KernelRegistryPlugin { private Hashtable properties; private Context context; public void setProperties(Hashtable properties) { this.properties = properties; } public void create() throws NamingException { if (properties != null) context = new InitialContext(properties); else context = new InitialContext(); } public void destroy() throws NamingException { if (context != null) context.close(); context = null; } public KernelRegistryEntry getEntry(Object name) { try { Object target = context.lookup(name.toString()); if (target != null) return new AbstractKernelRegistryEntry(name, target); } catch (NamingException e) { } return null; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeMetaDataVisitor.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000351010665060420033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.PrivilegedAction; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * DescribedMetaDataVisitor. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class DescribedMetaDataVisitor extends AbstractMetaDataVisitor implements PrivilegedAction { /** * Create a new MetaDataVisitor. * * @param bmd the bean meta data * @param context the context */ public DescribedMetaDataVisitor(BeanMetaData bmd, KernelControllerContext context) { super(bmd, context); } /** * Visit the bean metadata node, this is the starting point */ public Object run() { bmd.describeVisit(this); visitorNodeStack = null; return null; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ClassContextKernelRegistryPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000347010756342051033351 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.dependency.KernelController; /** * Class aware KernelRegistryPlugin. * * @author Ales Justin */ public class ClassContextKernelRegistryPlugin implements KernelRegistryPlugin { private KernelController controller; public ClassContextKernelRegistryPlugin(KernelController controller) { this.controller = controller; } @SuppressWarnings("unchecked") public KernelRegistryEntry getEntry(Object name) { if (name instanceof Class) { return controller.getContextByClass((Class)name); } return null; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AutowireAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000520411014574040033337 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.kernel.spi.dependency.InstantiateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; /** * AutowireAction. * * @author Ales Justin */ public class AutowireAction extends InstallsAwareAction { protected void installActionInternal(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController)context.getController(); DependencyInfo dependencyInfo = context.getDependencyInfo(); if (dependencyInfo != null && dependencyInfo.isAutowireCandidate()) controller.addInstantiatedContext(context); } protected void uninstallActionInternal(KernelControllerContext context) { try { KernelController controller = (KernelController)context.getController(); DependencyInfo dependencyInfo = context.getDependencyInfo(); if (dependencyInfo != null && dependencyInfo.isAutowireCandidate()) controller.removeInstantiatedContext(context); } catch (Throwable ignored) { log.debug("Ignored error unsetting context ", ignored); } } protected ControllerState getState() { return ControllerState.INSTANTIATED; } protected Class getActionAwareInterface() { return InstantiateKernelControllerContextAware.class; } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ClassDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000457010772216276033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.Controller; import org.jboss.util.JBossStringBuilder; /** * A class dependant dependencyItem. * * @author Ales Justin */ public abstract class ClassDependencyItem extends AbstractDependencyItem { public ClassDependencyItem(Object name, Class demandClass, ControllerState whenRequired, ControllerState dependentState) { super(name, demandClass, whenRequired, dependentState); } @SuppressWarnings("unchecked") protected Class getDemandClass() { return (Class)getIDependOn(); } /** * Clear the class reference. * * @param controller the controller */ public void clear(Controller controller) { setIDependOn(null); } public void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" demandClass=").append(getIDependOn()); } public void toShortString(JBossStringBuilder buffer) { buffer.append(getName()).append(" demandsClass ").append(getIDependOn()); } public String toHumanReadableString() { return getIDependOn() + " (NOTE: using autowiring to resolve this dependency)"; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ConfigureAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000772011113340313033336 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * New ConfigureAction. * * @author Ales Justin */ public class ConfigureAction extends AbstractConfigureAction { protected void installActionInternal(KernelControllerContext context) throws Throwable { Object object = context.getTarget(); BeanInfo info = context.getBeanInfo(); BeanMetaData metaData = context.getBeanMetaData(); setAttributes(context, object, info, metaData, false); installKernelControllerContextAware(context); } protected void uninstallActionInternal(KernelControllerContext context) { uninstallKernelControllerContextAware(context); Object object = context.getTarget(); BeanInfo info = context.getBeanInfo(); BeanMetaData metaData = context.getBeanMetaData(); try { setAttributes(context, object, info, metaData, true); } catch (Throwable t) { log.warn("Error unconfiguring bean " + context, t); } } /** * Set attributes/properties. * * @param context the context * @param target the target * @param info the bean info * @param metaData the bean metadata * @param nullify should we nullify attributes/properties * @throws Throwable for any error */ protected void setAttributes(KernelControllerContext context, Object target, BeanInfo info, BeanMetaData metaData, boolean nullify) throws Throwable { Set propertys = metaData.getProperties(); if (propertys != null && propertys.isEmpty() == false) { ClassLoader cl = Configurator.getClassLoader(metaData); for(PropertyMetaData property : propertys) { dispatchSetProperty(context, property, nullify, info, target, cl); } } } /** * Dispatch property set * * @param context the context * @param property the property * @param nullify should we nullify * @param info the bean info * @param target the target * @param cl classloader * @throws Throwable for any error */ protected void dispatchSetProperty(KernelControllerContext context, PropertyMetaData property, boolean nullify, BeanInfo info, Object target, ClassLoader cl) throws Throwable { ExecutionWrapper wrapper = new PropertyDispatchWrapper(context, property, nullify, info, target, cl); try { dispatchExecutionWrapper(context, wrapper); } catch (Throwable t) { if (nullify == false) throw new RuntimeException("Error configuring property: " + property.getName() + " for " + context.getName(), t); else throw t; } } }././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/InstallsAwareAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000002062610757504144033357 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.List; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.dispatch.InvokeDispatchHelper; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Installs/Uninstalls aware action. * * @author Ales Justin */ public abstract class InstallsAwareAction extends KernelControllerContextAction { /** * Get the action's state. * * @return get the action's state */ protected abstract ControllerState getState(); @Override public void installAction(KernelControllerContext context) throws Throwable { installActionInternal(context); doInstalls(context); setKernelControllerContext(context); } /** * Execute the installs. * * @param context the context * @throws Throwable for any error */ protected void doInstalls(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController)context.getController(); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); BeanMetaData metaData = context.getBeanMetaData(); List installs = metaData.getInstalls(); if (installs != null && installs.isEmpty() == false) { int index = 0; try { int size = installs.size(); for (; index < size; index++) { InstallMetaData install = installs.get(index); if (getState().equals(install.getState())) { ControllerContext target = context; if (install.getBean() != null) target = controller.getContext(install.getBean(), install.getDependentState()); if (target instanceof InvokeDispatchContext) { ClassLoader previous = SecurityActions.setContextClassLoader(context); try { InvokeDispatchHelper.invoke( configurator, target.getTarget(), (InvokeDispatchContext)target, install.getMethodName(), install.getParameters() ); } finally { SecurityActions.resetContextClassLoader(previous); } } else { throw new IllegalArgumentException("Cannot install, context " + target + " does not implement InvokeDispatchContext"); } } } } catch (Throwable t) { considerUninstalls(context, index); undoInstallAction(context); throw t; } } } /** * Consider the uninstalls. * * This method is here to be able to override * the behavior after installs failed. * e.g. perhaps only running uninstalls from the index. * * By default we run all uninstalls in the case * at least one install failed. * * @param context the context * @param index current installs index */ protected void considerUninstalls(KernelControllerContext context, int index) { if (index > 0) doUninstalls(context); } /** * Undo the steps from install action * in the case of failed installs. * Usually this is what uninstallActionInternal does. * * @param context the context */ protected void undoInstallAction(KernelControllerContext context) { uninstallActionInternal(context); } @Override public void uninstallAction(KernelControllerContext context) { unsetKernelControllerContext(context); doUninstalls(context); uninstallActionInternal(context); } /** * Execute uninstalls * * @param context the context */ protected void doUninstalls(KernelControllerContext context) { BeanMetaData beanMetaData = context.getBeanMetaData(); List uninstalls = beanMetaData.getUninstalls(); int size = uninstalls != null ? uninstalls.size() : 0; doUninstalls(context, size - 1); } /** * Execute uninstalls from the index. * * Leaving this method here in case * someone wants to use 'symetric' approach * to uninstalling installs. * * @param context the context * @param index the current index */ protected void doUninstalls(KernelControllerContext context, int index) { KernelController controller = (KernelController) context.getController(); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); BeanMetaData metaData = context.getBeanMetaData(); List uninstalls = metaData.getUninstalls(); if (uninstalls != null && uninstalls.isEmpty() == false) { for (int i = index; i >= 0; --i) { InstallMetaData uninstall = uninstalls.get(i); if (getState().equals(uninstall.getState())) { ControllerContext target = context; if (uninstall.getBean() != null) { target = controller.getContext(uninstall.getBean(), uninstall.getDependentState()); if (target == null) { log.warn("Ignoring uninstall action on target in incorrect state " + uninstall.getBean()); continue; } } if (target instanceof InvokeDispatchContext) { ClassLoader previous = null; try { previous = SecurityActions.setContextClassLoader(context); InvokeDispatchHelper.invoke( configurator, target.getTarget(), (InvokeDispatchContext)target, uninstall.getMethodName(), uninstall.getParameters() ); } catch (Throwable t) { log.warn("Ignoring uninstall action on target " + uninstall, t); } finally { if (previous != null) SecurityActions.resetContextClassLoader(previous); } } else { log.warn("Cannot uninstall, context " + target + " does not implement InvokeDispatchContext for " + uninstall.getBean()); } } } } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/BasicCollectionCallbackItemFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000774510756342051033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Basic collection callback item factory. * * @author Ales Justin */ public class BasicCollectionCallbackItemFactory implements CollectionCallbackItemFactory { public CollectionCallbackItem >createCollectionCallbackItem( Class> parameterClass, Class name, InvokeDispatchContext context, AttributeInfo attribute) { return createCollectionCallbackItem(parameterClass, name, null, null, null, context, attribute); } public CollectionCallbackItem> createCollectionCallbackItem( Class> parameterClass, Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { if (parameterClass == null) throw new IllegalArgumentException("Null parameter class!"); if (parameterClass.isAssignableFrom(ArrayList.class)) return new ListCallbackItem(name, whenRequired, dependentState, cardinality, context, attribute); else if (parameterClass.isAssignableFrom(HashSet.class)) return new SetCallbackItem(name, whenRequired, dependentState, cardinality, context, attribute); else if (parameterClass.isAssignableFrom(LinkedList.class)) return new QueueCallbackItem(name, whenRequired, dependentState, cardinality, context, attribute); else return handleAdditionalCollectionClass(parameterClass, name, whenRequired, dependentState, cardinality, context, attribute); } /** * Override for additional handling of * collection callback item creaton via parameter class. * * @param parameterClass actual collection class * @param name demand name * @param whenRequired when required state * @param dependentState dependent state * @param cardinality the cardinality * @param context invoke owner * @param attribute the attribute * @return new exact collection callback item */ protected CollectionCallbackItem> handleAdditionalCollectionClass( Class> parameterClass, Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { throw new IllegalArgumentException("No matching callback impl for parameter type: " + parameterClass); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/QueueCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000362710756342051033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Queue; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Queue collection callback item. * * @author Ales Justin */ public class QueueCallbackItem extends CollectionCreatorCallbackItem> { public QueueCallbackItem(Class name, InvokeDispatchContext owner, AttributeInfo attribute) { super(CollectionCreator.QUEUE, name, owner, attribute); } public QueueCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { super(CollectionCreator.QUEUE, name, whenRequired, dependentState, cardinality, context, attribute); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PropertyDispatchWrapper.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001577211113340313033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.PrivilegedExceptionAction; import java.util.Set; import org.jboss.beans.info.plugins.BeanInfoUtil; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.reflect.spi.PrimitiveInfo; /** * PropertyDispatchWrapper. * * @author Ales Justin */ class PropertyDispatchWrapper extends ExecutionWrapper { private static Logger log = Logger.getLogger(ConfigureAction.class); private KernelControllerContext context; private PropertyMetaData property; private boolean nullify; private BeanInfo beanInfo; private Object target; private ClassLoader cl; public PropertyDispatchWrapper(KernelControllerContext context, PropertyMetaData property, boolean nullify, BeanInfo beanInfo, Object target, ClassLoader cl) { if (context == null) throw new IllegalArgumentException("Null context"); this.context = context; if (property == null) throw new IllegalArgumentException("Null property"); this.property = property; this.nullify = nullify; if (beanInfo == null) throw new IllegalArgumentException("Null bean info"); this.beanInfo = beanInfo; if (target == null) throw new IllegalArgumentException("Null target"); this.target = target; this.cl = cl; } public Object execute() throws Throwable { String name = property.getName(); PropertyInfo propertyInfo = BeanInfoUtil.getPropertyInfo(beanInfo, target, name); TypeInfo propertyTypeInfo = propertyInfo.getType(); TypeInfo typeInfo = propertyTypeInfo; if (typeInfo == null) typeInfo = getTypeInfo(); if (nullify) { if (typeInfo != null) { if (typeInfo.isPrimitive() == false) { try { if (propertyTypeInfo != null) beanInfo.setProperty(target, name, null); else // e.g. NestedPropertyInfo nullifyByMatchingType(propertyInfo.getUpperName(), typeInfo); } catch (Throwable t) { if (log.isTraceEnabled()) log.trace("Ignored for " + target + "." + name, t); } } } else { log.warn("Cannot properly nullify property: " + property + ", beanInfo: " + beanInfo); } } else { ValueMetaData valueMetaData = property.getValue(); Object value = valueMetaData.getValue(typeInfo, cl); validatePropertyValue(context, target, propertyInfo, value); beanInfo.setProperty(target, name, value); } return null; } /** * Try to get type info from property's class. * * @return type info * @throws Throwable for any error */ protected TypeInfo getTypeInfo() throws Throwable { String className = property.getType(); if (className == null) return null; Kernel kernel = context.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); return configurator.getTypeInfo(className, cl); } /** * Nullify by matching type on . * * @param name the property name * @param typeInfo the type info * @throws Throwable for any error */ protected void nullifyByMatchingType(String name, TypeInfo typeInfo) throws Throwable { // TODO - remove this Character.toUpperCase once Reflect is updated String upperName = "set" + Character.toUpperCase(name.charAt(0)); if (name.length() > 1) upperName += name.substring(1); Set methods = beanInfo.getMethods(); for (MethodInfo minfo : methods) { String miName = minfo.getName(); if (upperName.equals(miName)) { TypeInfo returnType = minfo.getReturnType(); TypeInfo[] parameters = minfo.getParameterTypes(); if (parameters.length == 1 && PrimitiveInfo.VOID.equals(returnType) && typeInfo.equals(parameters[0])) { minfo.invoke(target, new Object[]{null}); return; } } } } /** * Validate value injection. * Use jsr303 constraints. * * @param context the owner context * @param target the target * @param pi the property info * @param value the new value * @throws Throwable for any error */ protected void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo pi, Object value) throws Throwable { BeanValidatorBridge bridge = KernelControllerContextAction.getBeanValidatorBridge(context); if (bridge != null) bridge.validatePropertyValue(context, target, pi, value); } protected PrivilegedExceptionAction getAction() { return new PrivilegedExceptionAction() { public Object run() throws Exception { try { return execute(); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } }; } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/BeanValidatorBridge.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000530511014562322033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.MethodInfo; /** * The bridge between jsr303 and our pojo handling. * * @author Ales Justin */ public interface BeanValidatorBridge { /** * Validate constructor values. * * @param context the owner context * @param joinpoint the constructor joinpoint * @throws Throwable for any error */ void validateConstructorValues(KernelControllerContext context, Joinpoint joinpoint) throws Throwable; /** * Validate new instance. * * @param context the owner context * @param target the target * @throws Throwable for any error */ void validateInstance(KernelControllerContext context, Object target) throws Throwable; /** * Validate property value. * * @param context the owner context * @param target the target * @param propertyInfo the property * @param value the new value * @throws Throwable for any error */ void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo propertyInfo, Object value) throws Throwable; /** * Validate method values. * * @param context the owner context * @param target the target * @param methodInfo the method * @param parameters the parameters * @throws Throwable for any error */ void validateMethodValues(KernelControllerContext context, Object target, MethodInfo methodInfo, Object[] parameters) throws Throwable; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/IntervalMatcherTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000555310711377006033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.StringTokenizer; import org.jboss.kernel.api.dependency.NonNullMatcherTransformer; import org.jboss.kernel.api.dependency.Matcher; /** * Interval expression matcher transformer. * * @author Ales Justin */ public class IntervalMatcherTransformer extends NonNullMatcherTransformer { protected Matcher internalTransform(Object value) { String interval = value.toString(); Number floor = null; Number ceiling = null; StringTokenizer st = new StringTokenizer(interval, ",[]()", true); Boolean floorIsGreaterThan = null; Boolean ceilingIsLessThan = null; boolean mid = false; while (st.hasMoreTokens()) { String token = st.nextToken(); if (token.equals("[")) floorIsGreaterThan = false; else if (token.equals("(")) floorIsGreaterThan = true; else if (token.equals("]")) ceilingIsLessThan = false; else if (token.equals(")")) ceilingIsLessThan = true; else if (token.equals(",")) mid = true; else if (token.equals("\"") == false) { if (floor == null) floor = Double.parseDouble(token); else ceiling = Double.parseDouble(token); } } // check for parenthesis if (floorIsGreaterThan == null || ceilingIsLessThan == null) { // non-empty interval usage if (mid) throw new IllegalArgumentException("Missing parenthesis: " + interval); // single value floorIsGreaterThan = false; ceilingIsLessThan = false; } return new IntervalMatcher(floor, ceiling, floorIsGreaterThan, ceilingIsLessThan); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/IntervalMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000722010775133546033356 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.io.Serializable; import org.jboss.kernel.api.dependency.NumberMatcher; /** * Interval matcher. * * @author Ales Justin */ public class IntervalMatcher extends NumberMatcher implements Serializable { private static final long serialVersionUID = 1L; /** * The lower bound of the range */ private Number floor; /** * The upper bound of the range */ private Number ceiling; /** * is the floor a >(true) or >= constraint(false) */ private boolean floorIsGreaterThan; /** * is the ceiling a <(true) or <= constraint(false) */ private boolean ceilingIsLessThan; public IntervalMatcher(Number floor, Number ceiling, boolean floorIsGreaterThan, boolean ceilingIsLessThan) { this.floor = floor; this.ceiling = ceiling; this.floorIsGreaterThan = floorIsGreaterThan; this.ceilingIsLessThan = ceilingIsLessThan; } /** * Compare other value with edge value. * Return default value if edge is null. * * @param other the other * @param edge the edge * @param defaultValue default value * @return -1 if edge greater than other, 1 if other greater than edge, 0 if equal */ protected int compareTo(Number other, Number edge, int defaultValue) { if (edge == null) return defaultValue; double dOther = other.doubleValue(); double dEdge = edge.doubleValue(); return Double.compare(dOther, dEdge); } protected boolean matchByType(Number other) { boolean isInRange = floor == null; if (isInRange == false) { // Test the floor int floorCompare = compareTo(other, floor, 1); if ((floorIsGreaterThan && floorCompare > 0) || (floorIsGreaterThan == false && floorCompare >= 0)) { isInRange = ceiling == null; if (isInRange == false) { // Test the ceiling int ceilingCompare = compareTo(other, ceiling, -1); if ((ceilingIsLessThan && ceilingCompare < 0) || (ceilingIsLessThan == false && ceilingCompare <= 0)) { isInRange = true; } } } } return isInRange; } public String toString() { StringBuilder builder = new StringBuilder(); builder.append(floorIsGreaterThan ? "(" : "["); builder.append(floor).append(",").append(ceiling); builder.append(ceilingIsLessThan ? ")" : "]"); return builder.toString(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/InstantiateAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001207611042323200033333 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.kernel.spi.dependency.InstantiateKernelControllerContextAware; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.metadata.spi.scope.CommonLevels; /** * InstantiateAction. * * @author Adrian Brock * @version $Revision: 76224 $ */ public class InstantiateAction extends AnnotationsAction { @SuppressWarnings("deprecation") protected void installActionInternal(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController) context.getController(); Kernel kernel = controller.getKernel(); KernelMetaDataRepository repository = kernel.getMetaDataRepository(); KernelConfigurator configurator = kernel.getConfigurator(); BeanMetaData metaData = context.getBeanMetaData(); BeanInfo info = context.getBeanInfo(); MetaData repositoryMetaData = repository.getMetaData(context); Joinpoint joinPoint = configurator.getConstructorJoinPoint(info, metaData.getConstructor(), metaData, repositoryMetaData); BeanValidatorBridge bridge = getBeanValidatorBridge(context); if (bridge != null) bridge.validateConstructorValues(context, joinPoint); Object object = dispatchJoinPoint(context, joinPoint); if (object == null) throw new IllegalStateException("Instantiate joinpoint returned a null object: " + joinPoint); if (bridge != null) bridge.validateInstance(context, object); context.setTarget(object); try { if (info == null) { info = configurator.getBeanInfo(object.getClass(), metaData.getAccessMode()); context.setBeanInfo(info); // update class scope with class info repository = kernel.getMetaDataRepository(); // remove old context repository.removeMetaData(context); // create new scope key ScopeInfo scopeInfo = context.getScopeInfo(); ScopeKey scopeKey = new ScopeKey(scopeInfo.getScope().getScopes()); scopeKey.addScope(CommonLevels.CLASS, info.getClassInfo().getType()); scopeInfo.setScope(scopeKey); // re-register repository.addMetaData(context); // handle custom annotations applyAnnotations(context); } DependencyInfo dependencyInfo = context.getDependencyInfo(); if (dependencyInfo != null && dependencyInfo.isAutowireCandidate()) controller.addInstantiatedContext(context); } catch (Throwable t) { uninstall(context); throw t; } } protected void uninstallActionInternal(KernelControllerContext context) { try { KernelController controller = (KernelController)context.getController(); DependencyInfo dependencyInfo = context.getDependencyInfo(); if (dependencyInfo != null && dependencyInfo.isAutowireCandidate()) controller.removeInstantiatedContext(context); } catch (Throwable ignored) { log.debug("Ignored error unsetting context ", ignored); } finally { context.setTarget(null); } } protected ControllerState getState() { return ControllerState.INSTANTIATED; } protected Class getActionAwareInterface() { return InstantiateKernelControllerContextAware.class; } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ExecutionWrapper.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000447511033366141033352 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; /** * Simple execution wrapper * * @author ales.justin@jboss.org */ abstract class ExecutionWrapper { /** * Execute. * * @param access the access controller context * @return execution's value * @throws Throwable for any error */ public Object execute(AccessControlContext access) throws Throwable { if (access == null) { return execute(); } else { PrivilegedExceptionAction action = getAction(); try { return AccessController.doPrivileged(action, access); } catch (PrivilegedActionException e) { throw e.getCause(); } } } /** * Execute w/o access controller context. * * @return execution's value * @throws Throwable for any error */ protected abstract Object execute() throws Throwable; /** * Get the privileged action. * * @return the privileged exception action */ protected abstract PrivilegedExceptionAction getAction(); } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/LifecycleAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000002325110757136565033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.List; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.joinpoint.spi.JoinpointException; import org.jboss.joinpoint.spi.MethodJoinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * LifecycleAction. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 69987 $ */ public abstract class LifecycleAction extends InstallsAwareAction { /** * Create a new AbstractLifecycleAction. */ public LifecycleAction() { } /** * Get install Lifecycle metadata. * * @param beanMetaData the bean meta data * @return install lifecycle metadata */ protected abstract LifecycleMetaData getInstallLifecycle(BeanMetaData beanMetaData); /** * Get uninstall Lifecycle metadata. * * @param beanMetaData the bean meta data * @return uninstall lifecycle metadata */ protected abstract LifecycleMetaData getUninstallLifecycle(BeanMetaData beanMetaData); /** * Get the method name from lifecycle meta data. * * @param lifecycle the lifecycle meta data * @return method name or null if null lifecycle */ protected String getMethod(LifecycleMetaData lifecycle) { if (lifecycle != null) return lifecycle.getMethodName(); return null; } /** * Get the parameters. * * @param lifecycle the lifecycle meta data * @return lifecycle parameters or null if null lifecycle */ protected List getParameters(LifecycleMetaData lifecycle) { if (lifecycle != null) return lifecycle.getParameters(); return null; } /** * Get the install method * * @param beanMetaData bean meta data * @return the method */ protected String getInstallMethod(BeanMetaData beanMetaData) { return getMethod(getInstallLifecycle(beanMetaData)); } /** * Get install default method name * * @return install annotation name */ public abstract String getDefaultInstallMethod(); /** * Get the install parameters * * @param beanMetaData bean meta data * @return the parameters */ protected List getInstallParameters(BeanMetaData beanMetaData) { return getParameters(getInstallLifecycle(beanMetaData)); } /** * Get the uninstall method * * @param beanMetaData bean meta data * @return the method */ protected String getUninstallMethod(BeanMetaData beanMetaData) { return getMethod(getUninstallLifecycle(beanMetaData)); } /** * Get uninstall default method name * * @return install annotation name */ public abstract String getDefaultUninstallMethod(); /** * Get the uninstall parameters * * @param beanMetaData bean meta data * @return the parameters */ protected List getUninstallParameters(BeanMetaData beanMetaData) { return getParameters(getUninstallLifecycle(beanMetaData)); } /** * Is install ignored. * * @param context the context * @return true if ignored found on any metadata */ protected boolean isInstallInvocationIgnored(KernelControllerContext context) { return isInvocationIgnored(getInstallLifecycle(context.getBeanMetaData())); } /** * Is uninstall ignored. * * @param context the context * @return true if ignored found on any metadata */ protected boolean isUninstallInvocationIgnored(KernelControllerContext context) { return isInvocationIgnored(getUninstallLifecycle(context.getBeanMetaData())); } /** * Is invocation ignored. * * @param lifecycle the lifecycle meta data * @return true if ignored set on lifecycle */ protected boolean isInvocationIgnored(LifecycleMetaData lifecycle) { return lifecycle != null && lifecycle.isIgnored(); } protected void installActionInternal(KernelControllerContext context) throws Throwable { boolean trace = log.isTraceEnabled(); if (isInstallInvocationIgnored(context) == false) { KernelController controller = (KernelController)context.getController(); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); Object target = context.getTarget(); BeanInfo info = context.getBeanInfo(); BeanMetaData metaData = context.getBeanMetaData(); String method = getInstallMethod(context); List parameters = getInstallParameters(context); MethodJoinpoint joinpoint; try { ClassLoader cl = Configurator.getClassLoader(metaData); joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true); } catch (JoinpointException ignored) { if (trace) { if (parameters == null) log.trace("No " + method + " method for " + context); else log.trace("No " + method + parameters + " method for " + context); } return; } joinpoint.setTarget(target); dispatchJoinPoint(context, joinpoint); } else if (trace) log.trace("Ignoring " + getDefaultInstallMethod() + " lifecycle invocation."); } protected void uninstallActionInternal(KernelControllerContext context) { boolean trace = log.isTraceEnabled(); if (isUninstallInvocationIgnored(context) == false) { KernelController controller = (KernelController)context.getController(); Kernel kernel = controller.getKernel(); KernelConfigurator configurator = kernel.getConfigurator(); Object target = context.getTarget(); BeanInfo info = context.getBeanInfo(); BeanMetaData metaData = context.getBeanMetaData(); String method = getUninstallMethod(context); List parameters = getUninstallParameters(context); MethodJoinpoint joinpoint; try { ClassLoader cl = Configurator.getClassLoader(metaData); joinpoint = configurator.getMethodJoinPoint(info, cl, method, parameters, false, true); joinpoint.setTarget(target); dispatchJoinPoint(context, joinpoint); } catch (JoinpointException ignored) { if (trace) { if (parameters == null) log.trace("No " + method + " method for " + context); else log.trace("No " + method + parameters + " method for " + context); } } catch (Throwable throwable) { log.warn("Error during " + method + " for " + context.getName(), throwable); } } else if (trace) log.trace("Ignoring " + getDefaultUninstallMethod() + " lifecycle invocation."); } /** * Get the install method * * @param context the context * @return the method */ public String getInstallMethod(KernelControllerContext context) { String installMethod = getInstallMethod(context.getBeanMetaData()); if (installMethod != null) { return installMethod; } return getDefaultInstallMethod(); } /** * Get the install parameters * * @param context the context * @return the parameters */ public List getInstallParameters(KernelControllerContext context) { // todo some parameter support return getInstallParameters(context.getBeanMetaData()); } /** * Get the uninstall method * * @param context the context * @return the method */ public String getUninstallMethod(KernelControllerContext context) { String uninstallMethod = getUninstallMethod(context.getBeanMetaData()); if (uninstallMethod != null) { return uninstallMethod; } return getDefaultUninstallMethod(); } /** * Get the uninstall parameters * * @param context the context * @return the parameters */ public List getUninstallParameters(KernelControllerContext context) { // todo some parameter support return getUninstallParameters(context.getBeanMetaData()); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ScopedKernelController.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000002406111037052010033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Properties; import java.util.Set; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.KernelFactory; import org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventFilter; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; import org.jboss.metadata.spi.scope.ScopeKey; /** * Scoped Kernel controller. * * @author Ales Justin */ public class ScopedKernelController extends AbstractKernelController { protected Kernel parentKernel; public ScopedKernelController(Kernel parentKernel, AbstractController parentController, ScopeKey scopeKey) throws Exception { super(); this.parentKernel = parentKernel; setScopeKey(scopeKey); if (parentKernel.getController() instanceof AbstractController == false) throw new IllegalArgumentException("Underlying controller not AbstractController instance!"); setUnderlyingController((AbstractController)parentKernel.getController()); setParentController(parentController); KernelConfig config = new ScopedKernelConfig(System.getProperties()); kernel = KernelFactory.newInstance(config); getParentController().addController(this); } /** * Is parent controller a kernel controller. * * @return true if parent controller in kernel controller */ private boolean isParentKernelController() { return (getParentController() instanceof KernelController); } /** * Get parent kernel controller. * * Exception is thrown if the underlying controller * is not kernel controller. * * @return kernel controller */ private KernelController getParentKernelController() { if (isParentKernelController() == false) throw new IllegalArgumentException("Illegal call to parent Controller, not of KernelController instance!"); return (KernelController)getParentController(); } // Scoped helper methods void addScopedControllerContext(ControllerContext context) { super.addControllerContext(context); } void removeScopedControllerContext(ControllerContext context) { super.removeControllerContext(context); } /** * Perform release of resources. */ void release() { getParentController().removeController(this); setUnderlyingController(null); setParentController(null); parentKernel = null; } // Controller methods protected Map createAliasActions() { Map map = new HashMap(super.createAliasActions()); map.put(ControllerState.PRE_INSTALL, InstallExistingScopeAction.INSTANCE); return map; } // override, since kernel's contexts are extended with registry plugin public ControllerContext getContextLocally(Object name, ControllerState state) { return super.getContext(name, state); } public ControllerContext getContext(Object name, ControllerState state) { ControllerContext context = super.getContext(name, state); if (context != null) { return context; } return getParentController().getContext(name, state); } public Set getNotInstalled() { Set uninstalled = new HashSet(getParentController().getNotInstalled()); uninstalled.addAll(super.getNotInstalled()); return uninstalled; } protected void install(ControllerContext context, boolean trace) throws Throwable { // we only allow install at top level getParentController().install(context); } // KernelController methods public void fireKernelEvent(KernelEvent event) { if (isParentKernelController()) { getParentKernelController().fireKernelEvent(event); } else { super.fireKernelEvent(event); } } public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { if (isParentKernelController()) { getParentKernelController().registerListener(listener, filter, handback); } else { super.registerListener(listener, filter, handback); } } public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { if (isParentKernelController()) { getParentKernelController().unregisterListener(listener, filter, handback); } else { super.unregisterListener(listener, filter, handback); } } public Set getInstantiatedContexts(Class clazz) { lockRead(); try { Set contexts = new HashSet(); Set currentContexts = super.getInstantiatedContexts(clazz); if (currentContexts != null && currentContexts.size() > 0) { contexts.addAll(currentContexts); } if (isParentKernelController()) { Set parentContexts = getParentKernelController().getInstantiatedContexts(clazz); if (parentContexts != null && parentContexts.size() > 0) { contexts.addAll(parentContexts); } } return contexts.size() > 0 ? contexts : null; } finally{ unlockRead(); } } public Set getContexts(Class clazz, ControllerState state) { lockRead(); try { Set contexts = new HashSet(); Set currentContexts = super.getContexts(clazz, state); if (currentContexts != null && currentContexts.size() > 0) { contexts.addAll(currentContexts); } if (isParentKernelController()) { Set parentContexts = getParentKernelController().getContexts(clazz, state); if (parentContexts != null && parentContexts.size() > 0) { contexts.addAll(parentContexts); } } return contexts.size() > 0 ? contexts : null; } finally{ unlockRead(); } } // org.jboss.kernel.spi.registry.KernelRegistry plugin method public KernelRegistryEntry getEntry(Object name) { KernelRegistryEntry entry = super.getEntry(name); if (entry != null) return entry; if (getParentController() instanceof KernelRegistryPlugin) { return ((KernelRegistryPlugin)getParentController()).getEntry(name); } return null; } // Kernel creation util classes private class ScopedKernelConfig extends PropertyKernelConfig { public ScopedKernelConfig(Properties properties) { super(properties); } public KernelInitializer createKernelInitializer() throws Throwable { return new ScopedKernelInitializer(); } } /** * Scoped Kernel Initializer. * Overriddes the creation of configurator, controller, metadatarepo */ private class ScopedKernelInitializer extends BasicKernelInitializer { public ScopedKernelInitializer() throws Exception { super(); } protected KernelConfigurator createKernelConfigurator(Kernel kernel) throws Throwable { return parentKernel.getConfigurator(); } protected KernelController createKernelController(Kernel kernel) throws Throwable { return ScopedKernelController.this; } protected KernelMetaDataRepository createKernelMetaDataRepository(Kernel kernel) throws Throwable { return parentKernel.getMetaDataRepository(); } } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CollectionCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001253510756342051033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Collection; import java.util.Set; import org.jboss.dependency.plugins.OwnerCallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Collection callback item. * * @param expected collection type * @author Ales Justin */ public abstract class CollectionCallbackItem> extends OwnerCallbackItem, InvokeDispatchContext> { protected Cardinality cardinality; protected AttributeInfo attribute; public CollectionCallbackItem(Class name, InvokeDispatchContext owner, AttributeInfo attribute) { this(name, null, null, null, owner, attribute); } public CollectionCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { super(name, whenRequired, dependentState, attribute != null ? attribute.getName() : null, context); this.attribute = attribute; this.cardinality = cardinality; } /** * Create new collection impl instance - HashSet, ArrayList, ... * * @return new collection impl instance */ protected abstract T getCollectionParameterHolder(); /** * Fill collection impl with existing context targets. * * @param controller the controller * @return collection holder with target beans * @throws Throwable for any error */ protected T fillHolder(Controller controller) throws Throwable { if (controller instanceof KernelController) { T holder = getCollectionParameterHolder(); if (holder == null) throw new IllegalArgumentException("Illegal collection holder, equals null!"); KernelController kernelController = (KernelController)controller; Set contexts = kernelController.getContexts(getIDependOn(), dependentState); if (contexts != null && contexts.isEmpty() == false) { for(ControllerContext context : contexts) { holder.add(context.getTarget()); } } return holder; } else throw new IllegalArgumentException("Cannot execute Collection call back - controller not KernelController instance."); } protected void execute(T holder) throws Throwable { if (attribute.isProperty()) owner.set(getAttributeName(), holder); else owner.invoke(getAttributeName(), new Object[]{holder}, new String[]{attribute.getType().getName()}); } protected DependencyItem createDependencyItem(ControllerContext owner) { if (cardinality != null) return new CallbackDependencyItem(owner.getName(), getIDependOn(), whenRequired, dependentState, cardinality); else return null; } public void ownerCallback(Controller controller, boolean isInstallPhase) throws Throwable { // fill or just push in empty T holder = isInstallPhase ? fillHolder(controller) : getCollectionParameterHolder(); execute(holder); } public void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase) throws Throwable { T holder = fillHolder(controller); if (isInstallPhase == false) removeUninstallingContext(holder, context); execute(holder); addDependency(controller, context, isInstallPhase); } /** * Remove the uninstalling context from holder. * Since the context is about to change state - * not part of callback watched targets. * * Can be overridden for different remove behaviour. * * @param holder collection holder * @param context current context */ protected void removeUninstallingContext(T holder, ControllerContext context) { holder.remove(context.getTarget()); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/InstallScopeAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000712111035124176033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.scope.ScopeKey; /** * Install scope action. * * @author Ales Justin */ public class InstallScopeAction extends AbstractScopeAction { public static final InstallScopeAction INSTANCE = new InstallScopeAction(); protected void installAction(ControllerContext context) throws Throwable { ScopeKey scopeKey = getScopeKey(context); if (scopeKey != null) { Controller controller = context.getController(); if (controller instanceof AbstractKernelController == false) throw new IllegalArgumentException("Can only handle AbstractKernelController: " + controller); AbstractKernelController kernelController = (AbstractKernelController)controller; KernelMetaDataRepository repository = kernelController.getKernel().getMetaDataRepository(); MutableMetaDataRepository mmdr = repository.getMetaDataRepository(); AbstractController abstractController = ScopeHierarchyBuilder.buildControllerHierarchy(kernelController, mmdr, scopeKey); if (abstractController instanceof ScopedKernelController == false) throw new IllegalArgumentException("Should be ScopedKernelController instance: " + abstractController); ScopedKernelController scopedController = (ScopedKernelController)abstractController; scopedController.addScopedControllerContext(context); } } protected void uninstallAction(ControllerContext context) { ScopeKey scopeKey = getScopeKey(context); if (scopeKey != null) { Controller controller = context.getController(); if (controller instanceof KernelController == false) throw new IllegalArgumentException("Can only handle kernel controller: " + controller); KernelController kernelController = (KernelController)controller; KernelMetaDataRepository repository = kernelController.getKernel().getMetaDataRepository(); // find scoped controller MutableMetaDataRepository mmdr = repository.getMetaDataRepository(); ScopeHierarchyBuilder.cleanControllerHierarchy(mmdr, scopeKey, context); } } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/CollectionCreator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000413310615374171033350 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Queue; import java.util.Set; /** * Collection creator. * * @param the collection type */ public interface CollectionCreator> { /** * Create new Collection instance. * * @return collection */ T createCollection(); public CollectionCreator> LIST = new CollectionCreator>() { public List createCollection() { return new ArrayList(); } }; public CollectionCreator> SET = new CollectionCreator>() { public Set createCollection() { return new HashSet(); } }; public CollectionCreator> QUEUE = new CollectionCreator>() { public Queue createCollection() { return new LinkedList(); } }; } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/StartStopLifecycleAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000427110757136565033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.LifecycleMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.kernel.spi.dependency.StartKernelControllerContextAware; import org.jboss.dependency.spi.ControllerState; /** * StartStopLifecycleAction. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 69987 $ */ public class StartStopLifecycleAction extends LifecycleAction { protected LifecycleMetaData getInstallLifecycle(BeanMetaData beanMetaData) { return beanMetaData.getStart(); } public String getDefaultInstallMethod() { return "start"; } protected Class getActionAwareInterface() { return StartKernelControllerContextAware.class; } protected LifecycleMetaData getUninstallLifecycle(BeanMetaData beanMetaData) { return beanMetaData.getStop(); } public String getDefaultUninstallMethod() { return "stop"; } protected ControllerState getState() { return ControllerState.START; } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/RegexpMatcherTransformer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000273610711377006033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.api.dependency.NonNullMatcherTransformer; /** * Regular expression matcher transformer. * * @author Ales Justin */ public class RegexpMatcherTransformer extends NonNullMatcherTransformer { protected Matcher internalTransform(Object value) { return new RegexpMatcher(value.toString()); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ClassSingleCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000746110756342051033355 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Set; import org.jboss.dependency.plugins.SingleCallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Class single dependency item - class dependency. * * @author Ales Justin */ public class ClassSingleCallbackItem extends SingleCallbackItem> { protected Cardinality cardinality; public ClassSingleCallbackItem(Class name, InvokeDispatchContext owner, String method) { super(name, owner, method); } public ClassSingleCallbackItem(Class name, InvokeDispatchContext owner, String method, String signature) { super(name, owner, method, signature); } public ClassSingleCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext owner, String method) { super(name, whenRequired, dependentState, owner, method); } public ClassSingleCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext owner, String method, String signature) { super(name, whenRequired, dependentState, owner, method, signature); this.cardinality = cardinality; } public void ownerCallback(Controller controller, boolean isInstallPhase) throws Throwable { if (controller instanceof KernelController) { KernelController kc = (KernelController)controller; Set contexts = kc.getContexts(getIDependOn(), getDependentState()); if (contexts != null && contexts.isEmpty() == false) { for(KernelControllerContext context : contexts) { Object target = context.getTarget(); if (signature == null) signature = target.getClass().getName(); owner.invoke(getAttributeName(), new Object[]{target}, new String[]{signature}); } } } else log.info("Controller not KernelController instance, cannot execute owner callback."); } protected DependencyItem createDependencyItem(ControllerContext owner) { if (cardinality != null) return new CallbackDependencyItem(owner.getName(), getIDependOn(), whenRequired, dependentState, cardinality); else return null; } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/SetCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000360710756342051033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Set; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; /** * Set collection callback item. * * @author Ales Justin */ public class SetCallbackItem extends CollectionCreatorCallbackItem> { public SetCallbackItem(Class name, InvokeDispatchContext owner, AttributeInfo attribute) { super(CollectionCreator.SET, name, owner, attribute); } public SetCallbackItem(Class name, ControllerState whenRequired, ControllerState dependentState, Cardinality cardinality, InvokeDispatchContext context, AttributeInfo attribute) { super(CollectionCreator.SET, name, whenRequired, dependentState, cardinality, context, attribute); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DefaultMatcherFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000661410711377006033353 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.HashMap; import java.util.Map; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.api.dependency.MatcherFactory; import org.jboss.kernel.api.dependency.MatcherTransformer; import org.jboss.logging.Logger; import org.jboss.reflect.plugins.introspection.ReflectionUtils; /** * Default Matcher factory. * * @author Ales Justin */ public class DefaultMatcherFactory extends MatcherFactory implements MatcherTransformer { /** The log */ protected Logger log = Logger.getLogger(getClass()); /** The matcher transformers map */ private Map transfomers = new HashMap(); public DefaultMatcherFactory() { addMatcherTransfomer("default", this); addMatcherTransfomer("regexp", new RegexpMatcherTransformer()); addMatcherTransfomer("interval", new IntervalMatcherTransformer()); } public void addMatcherTransfomer(String key, MatcherTransformer transformer) { if (key == null && transformer != null) transfomers.put(transformer.getClass().getName(), transformer); if (key != null) { if (transformer == null) transfomers.remove(key); else transfomers.put(key, transformer); } } /** * Create the Matcher. * * @param transformer the transformer * @param value the value to wrap * @return new Matcher instance */ public Matcher createMatcher(String transformer, Object value) { if (value instanceof Matcher) return (Matcher)value; if (transformer == null) transformer = "default"; MatcherTransformer mt = transfomers.get(transformer); if (mt != null) return mt.transform(value); if (log.isTraceEnabled()) log.trace("No matching transfomer key '" + transformer + "', trying to instantiate new."); try { mt = (MatcherTransformer)ReflectionUtils.newInstance(transformer); return mt.transform(value); } catch(Throwable t) { throw new IllegalArgumentException("Cannot create Matcher instance: " + t); } } public Matcher transform(Object value) { return new DefaultMatcher(value); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/PropertyAttributeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000333510767766613033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.reflect.spi.TypeInfo; /** * Property attribute info. * * @author Ales Justin */ public class PropertyAttributeInfo extends AbstractAttributeInfo { public PropertyAttributeInfo(PropertyInfo propertyInfo) { super(propertyInfo); } public boolean isProperty() { return true; } public String getName() { return info.getName(); } public TypeInfo getType() { return info.getType(); } public boolean isValid() { return (info.isWritable() && super.isValid()); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/ClassContextDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000464511147522315033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * A Class context dependencyItem. * * @author Ales Justin */ public class ClassContextDependencyItem extends ClassDependencyItem { public ClassContextDependencyItem(Object name, Class demandClass, ControllerState whenRequired, ControllerState dependentState) { super(name, demandClass, whenRequired, dependentState); } public boolean resolve(Controller controller) { ControllerContext context = getControllerContext(controller); if (context != null) { setIDependOn(context.getName()); addDependsOnMe(controller, context); setResolved(true); } else { setResolved(false); } return isResolved(); } /** * Get controller context. * * @param controller the controller * @return controller context */ protected ControllerContext getControllerContext(Controller controller) { ControllerState state = getDependentState(); if (state == null) { return controller.getInstalledContext(getIDependOn()); } else { return controller.getContext(getIDependOn(), state); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractKernelController.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000003357011374502005033347 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.dependency.plugins.ScopedController; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.api.dependency.Matcher; import org.jboss.kernel.plugins.event.AbstractEventEmitter; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventFilter; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.registry.KernelRegistryPlugin; /** * Abstract Kernel controller. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 104925 $ */ @SuppressWarnings("deprecation") public class AbstractKernelController extends ScopedController implements KernelController, KernelRegistryPlugin { /** The kernel */ protected Kernel kernel; /** The emitter delegate */ protected AbstractEventEmitter emitterDelegate = createEventEmitter(); /** The supplies */ protected Map> suppliers = new ConcurrentHashMap>(); /** The contexts by class Map> */ protected Map, ClassContext> contextsByClass = new ConcurrentHashMap, ClassContext>(); /** * Create an abstract kernel controller * * @throws Exception for any error */ public AbstractKernelController() throws Exception { } protected Map createAliasActions() { Map map = new HashMap(super.createAliasActions()); map.put(ControllerState.PRE_INSTALL, InstallScopeAction.INSTANCE); return map; } /** * Create event emitter. * * @return new abstract event emitter instance */ protected AbstractEventEmitter createEventEmitter() { return new AbstractEventEmitter(); } public KernelControllerContext install(BeanMetaData metaData) throws Throwable { return install(metaData, null); } public KernelControllerContext install(BeanMetaData metaData, Object target) throws Throwable { KernelControllerContext context = new AbstractKernelControllerContext(null, metaData, target); install(context); return context; } @SuppressWarnings("unchecked") public KernelRegistryEntry getEntry(Object name) { List list; if (name instanceof Matcher) list = matchSupplies((Matcher)name); else list = suppliers.get(name); if (list != null && list.isEmpty() == false) return list.get(0); else if (name instanceof Class) return getContextByClass((Class) name); else return null; } /** * Try matching supplies. * * @param matcher the matcher * @return list of context's who have a matching supply */ protected List matchSupplies(Matcher matcher) { List list = null; for(Map.Entry> entry : suppliers.entrySet()) { if (matcher.match(entry.getKey())) { if (matcher.needExactMatch() == false) return entry.getValue(); else { if (list != null) throw new IllegalArgumentException("Matcher " + matcher + " only takes exact match, but found second matching supplier."); else list = entry.getValue(); } } } return list; } public ControllerContext getContext(Object name, ControllerState state) { ControllerContext context = super.getContext(name, state); if (context != null) return context; if (state == null || ControllerState.INSTALLED.equals(state)) { org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); try { return registry.findEntry(name); } catch (Throwable ignored) { } } return null; } public void addSupplies(KernelControllerContext context) { BeanMetaData metaData = context.getBeanMetaData(); Set supplies = metaData.getSupplies(); if (supplies != null) { boolean trace = log.isTraceEnabled(); if (supplies.isEmpty() == false) { lockWrite(); try { for (SupplyMetaData supplied : supplies) { Object supply = supplied.getSupply(); List list = suppliers.get(supply); if (list == null) { list = new CopyOnWriteArrayList(); suppliers.put(supply, list); } list.add(context); if (trace) log.trace("Suppliers of " + supply + ": " + list); } } finally { unlockWrite(); } } } } public void removeSupplies(KernelControllerContext context) { BeanMetaData metaData = context.getBeanMetaData(); Set supplies = metaData.getSupplies(); if (supplies != null) { boolean trace = log.isTraceEnabled(); if (supplies.isEmpty() == false) { lockWrite(); try { for (SupplyMetaData supplied : supplies) { Object supply = supplied.getSupply(); List list = suppliers.get(supply); if (list != null) { list.remove(context); if (list.isEmpty()) suppliers.remove(supply); if (trace) log.trace("Suppliers of " + supply + ": " + list); } } } finally { unlockWrite(); } } } } public Kernel getKernel() { Kernel.checkAccess(); return kernel; } public void setKernel(Kernel kernel) throws Throwable { Kernel.checkConfigure(); this.kernel = kernel; } public void fireKernelEvent(KernelEvent event) { emitterDelegate.fireKernelEvent(event); } public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { emitterDelegate.registerListener(listener, filter, handback); } public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { emitterDelegate.unregisterListener(listener, filter, handback); } /** * Get contexts by class. * This method should be taken with read lock. * * @param clazz the class type * @return contexts by class */ protected Set getContexts(Class clazz) { ClassContext classContext = contextsByClass.get(clazz); if (classContext != null) { if (log.isTraceEnabled()) { log.trace("Marking class " + clazz + " as used."); } classContext.used = true; return classContext.contexts; } return null; } /** * @return all instantiated contexts whose target is instance of this class clazz param */ public Set getInstantiatedContexts(Class clazz) { lockRead(); try { Set contexts = getContexts(clazz); return contexts != null && contexts.isEmpty() == false ? Collections.unmodifiableSet(contexts) : null; } finally { unlockRead(); } } public Set getContexts(Class clazz, ControllerState state) { lockRead(); try { Set contexts = getContexts(clazz); if (contexts != null && contexts.isEmpty() == false) { Set kccs = new HashSet(); for(KernelControllerContext context : contexts) { if (isBeforeState(context.getState(), state) == false) kccs.add(context); } return Collections.unmodifiableSet(kccs); } else return null; } finally { unlockRead(); } } public void addInstantiatedContext(KernelControllerContext context) { prepareToTraverse(context, true); } public void removeInstantiatedContext(KernelControllerContext context) { prepareToTraverse(context, false); } protected void prepareToTraverse(KernelControllerContext context, boolean addition) { lockWrite(); try { Object target = context.getTarget(); if (target != null) { traverseBean(context, target.getClass(), addition, log.isTraceEnabled()); } } finally { unlockWrite(); } } /** * Traverse over target and map it to all its superclasses * and interfaces - using recursion. * * @param context context whose target is instance of clazz * @param clazz current class to map context to * @param addition whether this is an addition * @param trace whether trace is enabled */ protected void traverseBean(KernelControllerContext context, Class clazz, boolean addition, boolean trace) { if (clazz == null || clazz == Object.class) { return; } ClassContext classContext = contextsByClass.get(clazz); if (addition) { if (classContext == null) { classContext = new ClassContext(); classContext.contexts = new HashSet(); contextsByClass.put(clazz, classContext); } else if (classContext.used) { log.debug("Additional matching bean - contextual injection already used for class: " + clazz); } if (trace) { log.trace("Mapping contex " + context + " to class: " + clazz); } classContext.contexts.add(context); } else { if (classContext != null) { if (trace) { log.trace("Removing contex " + context + " to class: " + clazz); } classContext.contexts.remove(context); if (classContext.contexts.isEmpty()) contextsByClass.remove(clazz); } } // traverse superclass traverseBean(context, clazz.getSuperclass(), addition, trace); Class[] interfaces = clazz.getInterfaces(); // traverse interfaces for(Class intface : interfaces) { traverseBean(context, intface, addition, trace); } } private static class ClassContext { private boolean used; private Set contexts; } /** * If zero or multiple instances match class clazz * a warning is issued, but no throwable is thrown * * @return context whose target is instance of this class clazz param or null if zero or multiple such instances */ public KernelControllerContext getContextByClass(Class clazz) { Set contexts = getInstantiatedContexts(clazz); int numberOfMatchingBeans = 0; if (contexts != null) { numberOfMatchingBeans = contexts.size(); } if (log.isTraceEnabled()) { log.trace("Checking for contextual injection, current matches: " + numberOfMatchingBeans + " - " + clazz); } if (numberOfMatchingBeans != 1) { if (numberOfMatchingBeans > 1) { log.warn("Multiple beans match class type [enable trace log for details]: " + clazz); if (log.isTraceEnabled()) { log.trace("Matching contexts: " + contexts); } } return null; } return contexts.iterator().next(); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/InstallAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000650711014301412033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.InstallKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; /** * InstallAction. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class InstallAction extends InstallsAwareAction { protected void installActionInternal(KernelControllerContext context) throws Throwable { KernelController controller = (KernelController) context.getController(); Kernel kernel = controller.getKernel(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); BeanMetaData metaData = context.getBeanMetaData(); Object name = metaData.getName(); registry.registerEntry(name, context); try { controller.addSupplies(context); } catch (Throwable t) { try { registry.unregisterEntry(name); } catch (Throwable x) { log.warn("Ignoring error reversing install, throwing original error " + name, x); } throw t; } } protected Class getActionAwareInterface() { return InstallKernelControllerContextAware.class; } protected void uninstallActionInternal(KernelControllerContext context) { KernelController controller = (KernelController) context.getController(); Kernel kernel = controller.getKernel(); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); Object name = context.getName(); try { controller.removeSupplies(context); } catch (Throwable t) { log.warn("Ignoring removing supplies at uninstall " + name, t); } try { registry.unregisterEntry(name); } catch (Throwable t) { log.warn("Ignoring unregistered entry at uninstall " + name, t); } } protected ControllerState getState() { return ControllerState.INSTALLED; } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/AbstractConfigureAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000000772211034362472033354 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.ConfigureKernelControllerContextAware; import org.jboss.kernel.spi.dependency.CreateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.InstallKernelControllerContextAware; import org.jboss.kernel.spi.dependency.InstantiateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.dependency.KernelControllerContextAware; import org.jboss.kernel.spi.dependency.StartKernelControllerContextAware; /** * AbstractConfigureAction. * * @author Ales Justin */ public abstract class AbstractConfigureAction extends InstallsAwareAction { protected Class getActionAwareInterface() { return ConfigureKernelControllerContextAware.class; } /** * Execute KCCA install. * * @param context the controller context * @throws Throwable for any erroor */ protected void installKernelControllerContextAware(KernelControllerContext context) throws Throwable { Object target = context.getTarget(); if (target != null && isExactlyKernelControllerContextAware(target)) { ((KernelControllerContextAware)target).setKernelControllerContext(context); } } /** * Execute KCCA uninstall. * * @param context the controller context */ protected void uninstallKernelControllerContextAware(KernelControllerContext context) { Object target = context.getTarget(); if (target != null && isExactlyKernelControllerContextAware(target)) { try { ((KernelControllerContextAware)target).unsetKernelControllerContext(context); } catch (Throwable t) { log.debug("Ignored error unsetting context ", t); } } } /** * Is exactly KCCA instance. * @param o the target to test * @return true if exact match */ @SuppressWarnings("deprecation") protected boolean isExactlyKernelControllerContextAware(Object o) { Class clazz = o.getClass(); return KernelControllerContextAware.class.isAssignableFrom(clazz) && (!ConfigureKernelControllerContextAware.class.isAssignableFrom(clazz) && !CreateKernelControllerContextAware.class.isAssignableFrom(clazz) && !org.jboss.kernel.spi.dependency.DescribeKernelControllerContextAware.class.isAssignableFrom(clazz) && !InstallKernelControllerContextAware.class.isAssignableFrom(clazz) && !InstantiateKernelControllerContextAware.class.isAssignableFrom(clazz) && !StartKernelControllerContextAware.class.isAssignableFrom(clazz)); } protected ControllerState getState() { return ControllerState.CONFIGURED; } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency/DescribeAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/dependency0000644000175000017500000001040611301242575033343 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.dependency; import java.util.List; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.kernel.spi.dependency.DependencyBuilderListItem; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.dependency.spi.ControllerState; /** * DescribeAction. * * @author Adrian Brock * @version $Revision: 96564 $ */ public class DescribeAction extends AnnotationsAction { protected void installActionInternal(KernelControllerContext context) throws Throwable { BeanInfo info = context.getBeanInfo(); if (info != null) { KernelController controller = (KernelController)context.getController(); KernelConfig config = controller.getKernel().getConfig(); DependencyBuilder dependencyBuilder = config.getDependencyBuilder(); KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); MetaData md = repository.getMetaData(context); // add custom dependencies (e.g. AOP layer). List dependencies = dependencyBuilder.getDependencies(info, md); if (log.isTraceEnabled()) log.trace("Extra dependencies for " + context.getName() + " " + dependencies); if (dependencies != null && dependencies.isEmpty() == false) { for (DependencyBuilderListItem dependencyItem : dependencies) { dependencyItem.addDependency(context); } } // handle custom annotations applyAnnotations(context); } } protected void uninstallActionInternal(KernelControllerContext context) { BeanInfo info = context.getBeanInfo(); if (info != null) { // handle custom annotations cleanAnnotations(context); KernelController controller = (KernelController)context.getController(); KernelConfig config = controller.getKernel().getConfig(); DependencyBuilder dependencyBuilder; try { dependencyBuilder = config.getDependencyBuilder(); } catch (Throwable e) { log.debug("Error while cleaning the annotations: " + e); return; } KernelMetaDataRepository repository = controller.getKernel().getMetaDataRepository(); MetaData md = repository.getMetaData(context); // add custom dependencies (e.g. AOP layer). List dependencies = dependencyBuilder.getDependencies(info, md); if (log.isTraceEnabled()) log.trace("Unwind extra dependencies for " + context.getName() + " " + dependencies); if (dependencies != null && dependencies.isEmpty() == false) { for (DependencyBuilderListItem dependencyItem : dependencies) { dependencyItem.removeDependency(context); } } } } protected ControllerState getState() { return ControllerState.DESCRIBED; } }././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation0000755000175000017500000000000011620312164033350 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation/AbstractKernelBeanValidator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation0000644000175000017500000000675511216157032033371 0ustar twernertwerner/* * 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.kernel.plugins.validation; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.plugins.dependency.BeanValidatorBridge; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.validation.KernelBeanValidator; import org.jboss.reflect.spi.MethodInfo; /** * Abstract kernel bean validator. * * @author Ales Justin */ public abstract class AbstractKernelBeanValidator extends AbstractKernelObject implements KernelBeanValidator { protected KernelController controller; @Override public void setKernel(Kernel kernel) throws Throwable { super.setKernel(kernel); controller = kernel.getController(); } /** * Get validator bridge delegate as a plain installed bean. * * @return the delegate if exists, or null */ protected BeanValidatorBridge getDelegate() { KernelControllerContext context = controller.getContextByClass(BeanValidatorBridge.class); return context != null ? BeanValidatorBridge.class.cast(context.getTarget()) : null; } public void validateConstructorValues(KernelControllerContext context, Joinpoint joinpoint) throws Throwable { BeanValidatorBridge delegate = getDelegate(); if (delegate != null) delegate.validateConstructorValues(context, joinpoint); } public void validateInstance(KernelControllerContext context, Object target) throws Throwable { BeanValidatorBridge delegate = getDelegate(); if (delegate != null) delegate.validateInstance(context, target); } public void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo propertyInfo, Object value) throws Throwable { BeanValidatorBridge delegate = getDelegate(); if (delegate != null) delegate.validatePropertyValue(context, target, propertyInfo, value); } public void validateMethodValues(KernelControllerContext context, Object target, MethodInfo methodInfo, Object[] parameters) throws Throwable { BeanValidatorBridge delegate = getDelegate(); if (delegate != null) delegate.validateMethodValues(context, target, methodInfo, parameters); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation0000755000175000017500000000000011620312164033350 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation/basic/BasicKernelBeanValidator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/validation0000644000175000017500000000533411262376750033374 0ustar twernertwerner/* * 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.kernel.plugins.validation.basic; import java.security.PrivilegedAction; import java.security.AccessController; import org.jboss.kernel.plugins.validation.AbstractKernelBeanValidator; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.validation.KernelBeanValidator; /** * Basic impl of kernel bean validator. * By default it's disabled. * * @author Ales Justin */ public class BasicKernelBeanValidator extends AbstractKernelBeanValidator { public static final String DISABLED_PROPERTY_KEY = KernelBeanValidator.class.getSimpleName() + ".disabled"; private boolean disabled; @Override public void setKernel(Kernel kernel) throws Throwable { super.setKernel(kernel); // read the disabled flag SecurityManager sm = System.getSecurityManager(); if (sm != null) disabled = AccessController.doPrivileged(new DisabledFlagReader()); else disabled = readDisabledFlag(); } public boolean isDisabled() { return disabled; } /** * Set the disabled flag. * * @param disabled the disabled flag */ public void setDisabled(boolean disabled) { this.disabled = disabled; } /** * Read the disabled flag. * * @return the system property flag read */ protected static boolean readDisabledFlag() { return Boolean.parseBoolean(System.getProperty(DISABLED_PROPERTY_KEY, "true")); } private static class DisabledFlagReader implements PrivilegedAction { public Boolean run() { return readDisabledFlag(); } } } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000755000175000017500000000000011620312166033314 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/basic/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000755000175000017500000000000011620312165033313 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/basic/BasicKernelInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000002014411225116101033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap.basic; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.bootstrap.AbstractKernelInitializer; import org.jboss.kernel.plugins.registry.BeanKernelRegistryEntry; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.registry.KernelRegistryEntry; import org.jboss.kernel.spi.validation.KernelBeanValidator; /** * Bootstrap the kernel. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 90932 $ */ @SuppressWarnings("deprecation") public class BasicKernelInitializer extends AbstractKernelInitializer { /** * Create a new basic kernel factory * * @throws Exception for any error */ public BasicKernelInitializer() throws Exception { } public void initKernel(Kernel kernel) throws Throwable { KernelMetaDataRepository metaDataRepository = createKernelMetaDataRepository(kernel); if (trace) log.trace("Using MetaDataRepository: " + metaDataRepository); metaDataRepository.setKernel(kernel); kernel.setMetaDataRepository(metaDataRepository); org.jboss.kernel.spi.registry.KernelRegistry registry = createKernelRegistry(kernel); if (trace) log.trace("Using Registry: " + registry); registry.setKernel(kernel); kernel.setRegistry(registry); KernelEventManager eventManager = createKernelEventManager(kernel); if (trace) log.trace("Using EventManager: " + eventManager); eventManager.setKernel(kernel); kernel.setEventManager(eventManager); KernelConfigurator configurator = createKernelConfigurator(kernel); if (trace) log.trace("Using Configurator: " + configurator); configurator.setKernel(kernel); kernel.setConfigurator(configurator); KernelController controller = createKernelController(kernel); if (trace) log.trace("Using Controller: " + controller); controller.setKernel(kernel); kernel.setController(controller); KernelBus bus = createKernelBus(kernel); if (trace) log.trace("Using Bus: " + bus); bus.setKernel(kernel); kernel.setBus(bus); KernelBeanValidator validator = createKernelBeanValidator(kernel); if (trace) log.trace("Using Validator: " + validator); validator.setKernel(kernel); kernel.setValidator(validator); // Register everything register(kernel, KernelConstants.KERNEL_CONFIG_NAME, kernel.getConfig()); register(kernel, KernelConstants.KERNEL_INITIALIZER_NAME, this); register(kernel, KernelConstants.KERNEL_NAME, kernel); register(kernel, KernelConstants.KERNEL_REGISTRY_NAME, registry); register(kernel, KernelConstants.KERNEL_EVENT_MANAGER_NAME, eventManager); register(kernel, KernelConstants.KERNEL_BUS_NAME, bus); register(kernel, KernelConstants.KERNEL_CONFIGURATOR_NAME, configurator); register(kernel, KernelConstants.KERNEL_CONTROLLER_NAME, controller); register(kernel, KernelConstants.KERNEL_METADATA_REPOSITORY_NAME, metaDataRepository); register(kernel, KernelConstants.KERNEL_BEAN_VALIDATOR_NAME, validator); } /** * Create the kernel bus * * @param kernel the kernel * @return the kernel bus * @throws Throwable for any error */ protected KernelBus createKernelBus(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelBus(); } /** * Create the configurator * * @param kernel the kernel * @return the configurator * @throws Throwable for any error */ protected KernelConfigurator createKernelConfigurator(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelConfigurator(); } /** * Create the kernel controller * * @param kernel the kernel * @return the kernel controller * @throws Throwable for any error */ protected KernelController createKernelController(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelController(); } /** * Create the kernel event manager * * @param kernel the kernel * @return the kernel event manager * @throws Throwable for any error */ protected KernelEventManager createKernelEventManager(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelEventManager(); } /** * Create the kernel registry * * @param kernel the kernel * @return the kernel registry * @throws Throwable for any error */ protected org.jboss.kernel.spi.registry.KernelRegistry createKernelRegistry(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelRegistry(); } /** * Create the meta data repository * * @param kernel the kernel * @return the meta data repository * @throws Throwable for any error */ protected KernelMetaDataRepository createKernelMetaDataRepository(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelMetaDataRepository(); } /** * Create the bean validator * * @param kernel the kernel * @return the bean validator * @throws Throwable for any error */ protected KernelBeanValidator createKernelBeanValidator(Kernel kernel) throws Throwable { return kernel.getConfig().createKernelBeanValidator(); } /** * Register an object * * @param kernel the kernel * @param name the name * @param object the object * @throws Throwable for any error */ protected void register(Kernel kernel, String name, Object object) throws Throwable { register(kernel, getName(name), object); } /** * Register an object * * @param kernel the kernel * @param name the name * @param object the object * @throws Throwable for any error */ protected void register(Kernel kernel, Object name, Object object) throws Throwable { KernelRegistryEntry entry = createKernelRegistryEntry(kernel, object); org.jboss.kernel.spi.registry.KernelRegistry registry = kernel.getRegistry(); registry.registerEntry(name, entry); } /** * Get the registration name * * @param name the name * @return the registration name * @throws Throwable for any error */ protected Object getName(String name) throws Throwable { return name; } /** * Create a kernel registry entry * * @param kernel the kernel * @param object the object * @return the entry * @throws Throwable for any error */ protected KernelRegistryEntry createKernelRegistryEntry(Kernel kernel, Object object) throws Throwable { KernelConfig config = kernel.getConfig(); BeanInfo info = config.getBeanInfo(object.getClass()); return new BeanKernelRegistryEntry(object, info); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/basic/BasicBootstrap.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000710410756342051033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap.basic; import org.jboss.kernel.plugins.bootstrap.AbstractBootstrap; import org.jboss.kernel.plugins.config.property.PropertyKernelConfig; import org.jboss.kernel.spi.config.KernelConfig; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Properties; /** * Bootstrap the kernel. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 69895 $ */ public class BasicBootstrap extends AbstractBootstrap { /** * Bootstrap the kernel from the command line * * @param args the command line arguments * @throws Exception for any error */ public static void main(String[] args) throws Exception { BasicBootstrap bootstrap = new BasicBootstrap(); bootstrap.run(); } /** * Constructs a new Bootstrap which constructs a Kernel based on * the system properties. */ public BasicBootstrap() { Properties props = getConfigProperties(); if (props == null) props = getSystemProperties(); final PropertyKernelConfig config = new PropertyKernelConfig(props); PrivilegedAction action = new PrivilegedAction() { public Object run() { setConfig(config); return null; } }; AccessController.doPrivileged(action); } /** * Constructs a new Bootstrap which constructs a Kernel based * * @param config the configure * @throws Exception for any error */ public BasicBootstrap(final KernelConfig config) throws Exception { PrivilegedAction action = new PrivilegedAction() { public Object run() { setConfig(config); return null; } }; AccessController.doPrivileged(action); } /** * Load bootstrap specific properties * * @return the bootstrap specific properties */ protected Properties getConfigProperties() { return null; } private Properties getSystemProperties() { if (System.getSecurityManager() == null) return System.getProperties(); else { return AccessController.doPrivileged(GetSystemProperties.instance); } } private static class GetSystemProperties implements PrivilegedAction { private static GetSystemProperties instance = new GetSystemProperties(); public Properties run() { return System.getProperties(); } } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/basic/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000152310150404616033316 0ustar twernertwerner

Kernel plugins, a basic bootstrap implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/basic/KernelConstants.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000001372211216157032033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap.basic; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.kernel.spi.validation.KernelBeanValidator; /** * Constants.

* * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 90317 $ */ @SuppressWarnings("deprecation") public interface KernelConstants { /** The default kernel name */ static final String KERNEL_NAME = "jboss.kernel:service=Kernel"; /** The default kernel bus name */ static final String KERNEL_BUS_NAME = "jboss.kernel:service=KernelBus"; /** The kernel bus property */ static final String KERNEL_BUS_PROPERTY = KernelBus.class.getName(); /** The default kernel bus implementation */ static final String KERNEL_BUS_CLASS = "org.jboss.kernel.plugins.registry.basic.LifecycleAwareKernelBus"; /** The default kernel config name */ static final String KERNEL_CONFIG_NAME = "jboss.kernel:service=KernelConfig"; /** The default kernel configurator name */ static final String KERNEL_CONFIGURATOR_NAME = "jboss.kernel:service=KernelConfigurator"; /** The kernel configurator property */ static final String KERNEL_CONFIGURATOR_PROPERTY = KernelConfigurator.class.getName(); /** The default kernel configurator implementation */ static final String KERNEL_CONFIGURATOR_CLASS = "org.jboss.kernel.plugins.config.AbstractKernelConfigurator"; /** The default kernel controller name */ static final String KERNEL_CONTROLLER_NAME = "jboss.kernel:service=KernelController"; /** The kernel controller property */ static final String KERNEL_CONTROLLER_PROPERTY = KernelController.class.getName(); /** The default kernel controller implementation */ static final String KERNEL_CONTROLLER_CLASS = "org.jboss.kernel.plugins.dependency.AbstractKernelController"; /** The default kernel event manager name */ static final String KERNEL_EVENT_MANAGER_NAME = "jboss.kernel:service=KernelEventManager"; /** The kernel event manager property */ static final String KERNEL_EVENT_MANAGER_PROPERTY = KernelEventManager.class.getName(); /** The default kernel event manager implementation */ static final String KERNEL_EVENT_MANAGER_CLASS = "org.jboss.kernel.plugins.event.AbstractEventManager"; /** The default kernel initializer */ static final String KERNEL_INITIALIZER_NAME = "jboss.kernel:service=KernelInit"; /** The kernel initializer property */ static final String KERNEL_INITIALIZER_PROPERTY = KernelInitializer.class.getName(); /** The default kernel initializer implementation */ static final String KERNEL_INITIALIZER_CLASS = "org.jboss.kernel.plugins.bootstrap.basic.BasicKernelInitializer"; /** The default kernel registry name */ static final String KERNEL_REGISTRY_NAME = "jboss.kernel:service=KernelRegistry"; /** The kernel registry property */ static final String KERNEL_REGISTRY_PROPERTY = org.jboss.kernel.spi.registry.KernelRegistry.class.getName(); /** The default kernel registry implementation */ static final String KERNEL_REGISTRY_CLASS = "org.jboss.kernel.plugins.registry.basic.BasicKernelRegistry"; /** The default meta data repository name */ static final String KERNEL_METADATA_REPOSITORY_NAME = "jboss.kernel:service=MetaDataRepository"; /** The meta data repository property */ static final String KERNEL_METADATA_REPOSITORY_PROPERTY = KernelMetaDataRepository.class.getName(); /** The default meta data repository implementation */ static final String KERNEL_METADATA_REPOSITORY_CLASS = "org.jboss.kernel.plugins.metadata.basic.BasicKernelMetaDataRepository"; /** The kernel bean validator repository name */ static final String KERNEL_BEAN_VALIDATOR_NAME = "jboss.kernel:service=BeanValidator"; /** The kernel bean validator */ static final String KERNEL_BEAN_VALIDATOR_PROPERTY = KernelBeanValidator.class.getName(); /** The default meta data repository implementation */ static final String KERNEL_BEAN_VALIDATOR_CLASS = "org.jboss.kernel.plugins.validation.basic.BasicKernelBeanValidator"; /** The DependencyBuilder repository name */ static final String DEPENDENCY_BUILDER_NAME = "jboss.kernel:service=DependencyBuilder"; /** The DependencyBuilder property name */ static final String DEPENDENCY_BUILDER_PROPERTY = DependencyBuilder.class.getName(); /** The DependencyBuilder default value */ static final String DEPENDENCY_BUILDER_DEFAULT = "org.jboss.aop.microcontainer.integration.AOPDependencyBuilder:org.jboss.kernel.spi.dependency.helpers.AbstractDependencyBuilder"; } ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000152710150404616033322 0ustar twernertwerner

Kernel plugins, an abstract bootstrap implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/standalone/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000755000175000017500000000000011620312166033314 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/standalone/StandaloneBootstrap.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000700710756342051033327 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap.standalone; import java.net.URL; import java.util.Enumeration; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; /** * Standalone Bootstrap of the kernel. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 69895 $ */ public class StandaloneBootstrap extends BasicBootstrap { /** The deployer */ protected BasicXMLDeployer deployer; /** The arguments */ protected String[] args; /** * Bootstrap the kernel from the command line * * @param args the command line arguments * @throws Exception for any error */ public static void main(String[] args) throws Exception { StandaloneBootstrap bootstrap = new StandaloneBootstrap(args); bootstrap.run(); } /** * Create a new bootstrap * * @param args the arguments * @throws Exception for any error */ public StandaloneBootstrap(String[] args) throws Exception { super(); this.args = args; } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BasicXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); ClassLoader cl = Thread.currentThread().getContextClassLoader(); for (Enumeration e = cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = e.nextElement(); deploy(url); } for (Enumeration e = cl.getResources("META-INF/" + StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = e.nextElement(); deploy(url); } // Validate that everything is ok deployer.validate(); } /** * Deploy a url * * @param url the deployment url * @throws Throwable for any error */ protected void deploy(URL url) throws Throwable { deployer.deploy(url); } /** * Undeploy a url * * @param url the deployment url */ protected void undeploy(URL url) { try { deployer.undeploy(url); } catch (Throwable t) { log.warn("Error during undeployment: " + url, t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); deployer.shutdown(); } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/standalone/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000153010153422433033314 0ustar twernertwerner

Kernel plugins, a standalone bootstrap implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/standalone/StandaloneKernelConstants.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000275610331006762033330 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap.standalone; import org.jboss.kernel.plugins.bootstrap.basic.KernelConstants; /** * Constants. * * @author Adrian Brock * @version $Revision: 37459 $ */ public interface StandaloneKernelConstants extends KernelConstants { /** The default deployer name */ static final String KERNEL_DEPLOYER_NAME = "jboss.kernel:service=KernelDeployer"; /** The xml file name */ static final String DEPLOYMENT_XML_NAME = "jboss-beans.xml"; } ././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/AbstractBootstrap.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000615210754404440033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap; import org.jboss.kernel.Kernel; import org.jboss.kernel.KernelFactory; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.config.KernelConfig; /** * Abstract Bootstrap of the kernel. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 69802 $ */ public abstract class AbstractBootstrap extends AbstractKernelObject implements Runnable { /** The kernel configuration */ protected KernelConfig config; /** * Create a new abstract bootstrap */ public AbstractBootstrap() { } /** * Get the kernel configuration * * @return the kernel configuration */ public KernelConfig getConfig() { Kernel.checkAccess(); return config; } /** * Set the kernel configuration * * @param config the kernel configuration */ public void setConfig(KernelConfig config) { Kernel.checkConfigure(); this.config = config; } /** * Returns the Kernel object created during the bootstrap process. * @return the kernel instance created during bootstrap. */ public Kernel getKernel() { return this.kernel; } public void run() { try { bootstrap(); } catch (RuntimeException e) { log.trace("RuntimeException during JBoss Kernel Bootstrap.", e); throw e; } catch (Exception e) { log.trace("Exception during JBoss Kernel Bootstrap.", e); throw new RuntimeException("Exception during Bootstrap", e); } catch (Error e) { log.trace("Error during JBoss Kernel Bootstrap.", e); throw e; } catch (Throwable t) { log.trace("Error during JBoss Kernel Bootstrap.", t); throw new RuntimeException("Error during Bootstrap", t); } } /** * Bootstrap the kernel * * @throws Throwable for any error */ protected void bootstrap() throws Throwable { kernel = KernelFactory.newInstance(config); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/AbstractKernelInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/bootstrap/0000644000175000017500000000320210331006762033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.bootstrap; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.logging.Logger; /** * Abstract kernel factory. * * @author Adrian Brock * @version $Revision: 37459 $ */ public abstract class AbstractKernelInitializer implements KernelInitializer { /** The log */ protected Logger log = Logger.getLogger(getClass()); /** Whether trace is enabled */ protected boolean trace = log.isTraceEnabled(); /** * Create a new abstract kernel factory * * @throws Exception for any error */ public AbstractKernelInitializer() throws Exception { } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000755000175000017500000000000011620312165033371 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ClassFactoryAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000727211014545271033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Factory; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.reflect.spi.ClassInfo; /** * Factory anootation plugin. * * @author Ales Justin */ public class ClassFactoryAnnotationPlugin extends AbstractAdaptersAnnotationPlugin { public ClassFactoryAnnotationPlugin(Set> adapters) { super(Factory.class, adapters); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.TYPE == type; } protected boolean isMetaDataAlreadyPresent(ClassInfo info, Factory annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; } protected List internalApplyAnnotation(ClassInfo info, Factory annotation, BeanMetaData beanMetaData) throws Throwable { AbstractBeanMetaData bean = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); if (isAttributePresent(annotation.factoryClass())) { constructor.setFactoryClass(annotation.factoryClass().getName()); } else { constructor.setFactory(ValueUtil.createValueMetaData(annotation.factory())); } constructor.setFactoryMethod(annotation.factoryMethod()); if (annotation.parameters().length > 0) { List parameters = new ArrayList(); for(Value parameter : annotation.parameters()) { AbstractParameterMetaData apmd = new AbstractParameterMetaData(ValueUtil.createValueMetaData(parameter)); if (isAttributePresent(parameter.type())) apmd.setType(parameter.type().getName()); parameters.add(apmd); } constructor.setParameters(parameters); } bean.setConstructor(constructor); return Collections.singletonList(constructor); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/PropertyAnnotationPluginFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000253411301242575033402 0ustar twernertwerner/* * 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.kernel.plugins.annotations; /** * Match only properties. */ class PropertyAnnotationPluginFilter implements AnnotationPluginFilter { @SuppressWarnings("unchecked") public boolean accept(MetaDataAnnotationPlugin plugin) { return (plugin instanceof PropertyAware); } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ArrayConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000321310674773017033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Array constructor annotation plugin. * * @author Ales Justin */ public class ArrayConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected ArrayConstructorValueAnnotationPlugin() { super(ArrayValue.class); } public ValueMetaData createValueMetaData(ArrayValue annotation) { return ArrayValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/FieldAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000334310770176053033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import org.jboss.reflect.spi.FieldInfo; /** * Field annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class FieldAnnotationPlugin extends InjectableMemberAnnotationPlugin { protected FieldAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.FIELD == type; } protected String getName(FieldInfo info) { return info.getName(); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/FactoryMethodAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000715211006203730033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.List; import java.util.Collections; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.api.annotations.FactoryMethod; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.ParameterInfo; /** * Factory method annotation plugin. * * @author Ales Justin */ public class FactoryMethodAnnotationPlugin extends AbstractMethodParameterAnnotationPlugin { public FactoryMethodAnnotationPlugin(Set> adapters) { super(FactoryMethod.class, adapters); } protected boolean checkAnnotatedInfo(ElementType type) { return ElementType.METHOD == type; } protected boolean isMetaDataAlreadyPresent(MethodInfo info, FactoryMethod annotation, BeanMetaData beanMetaData) { if (info.isPublic() == false || info.isStatic() == false) throw new IllegalArgumentException("Method marked as @FactoryMethod must be public and static"); return beanMetaData.getConstructor() != null; } protected ParameterInfo[] getParameters(MethodInfo info) { return info.getParameters(); } protected List handleParameterlessInfo(MethodInfo info, FactoryMethod annotation, BeanMetaData beanMetaData) { AbstractConstructorMetaData constructorMetaData = createParametrizedMetaData(info, annotation, beanMetaData); setParameterizedMetaData(constructorMetaData, beanMetaData); return Collections.singletonList(constructorMetaData); } protected AbstractConstructorMetaData createParametrizedMetaData(MethodInfo info, FactoryMethod annotation, BeanMetaData beanMetaData) { AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(beanMetaData.getBean()); constructor.setFactoryMethod(info.getName()); return constructor; } protected void setParameterizedMetaData(AbstractConstructorMetaData parameterizedMetaData, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); abmd.setConstructor(parameterizedMetaData); } } ././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/UninstallMethodParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000615311014545271033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.api.annotations.UninstallMethod; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.reflect.spi.MethodInfo; /** * Uninstall method annotation plugin. * * @author Ales Justin */ public class UninstallMethodParameterAnnotationPlugin extends InstallationParameterAnnotationPlugin { public UninstallMethodParameterAnnotationPlugin(Set> adapters) { super(UninstallMethod.class, adapters); } protected List getInstalls(BeanMetaData beanMetaData) { return beanMetaData.getUninstalls(); } protected AbstractInstallMetaData createParametrizedMetaData(MethodInfo info, UninstallMethod annotation) { AbstractInstallMetaData uninstall = new AbstractInstallMetaData(); uninstall.setMethodName(info.getName()); if (isAttributePresent(annotation.whenRequired())) uninstall.setState(new ControllerState(annotation.whenRequired())); if (isAttributePresent(annotation.dependantState())) uninstall.setDependentState(new ControllerState(annotation.dependantState())); return uninstall; } protected void setParameterizedMetaData(AbstractInstallMetaData parameterizedMetaData, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); List uninstalls = beanMetaData.getUninstalls(); if (uninstalls == null) { uninstalls = new ArrayList(); abmd.setUninstalls(uninstalls); } uninstalls.add(parameterizedMetaData); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/StringValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000374311014545271033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.plugins.StringValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; /** * String value annotation plugin. * * @author Ales Justin */ public class StringValueAnnotationPlugin extends PropertyAnnotationPlugin { public static final StringValueAnnotationPlugin INSTANCE = new StringValueAnnotationPlugin(); protected StringValueAnnotationPlugin() { super(StringValue.class); } public ValueMetaData createValueMetaData(StringValue annotation) { StringValueMetaData value = new StringValueMetaData(annotation.value()); if (isAttributePresent(annotation.type())) value.setType(annotation.type().getName()); value.setReplace(annotation.replace()); value.setTrim(annotation.trim()); return value; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ConstructorAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000325710667242231033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import org.jboss.reflect.spi.ConstructorInfo; /** * Abstract constructor annoattion plugin. * * @param annotation type * @author Ales Justin */ public abstract class ConstructorAnnotationPlugin extends AbstractAnnotationPlugin { protected ConstructorAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.CONSTRUCTOR == type; } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000436410777663234033424 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.kernel.plugins.annotations.MetaDataAnnotationPlugin; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; /** * Annotation plugin contract based on MeteDataVistor. * * @param info type * @param annotation type * @author Ales Justin */ public interface AnnotationPlugin extends MetaDataAnnotationPlugin { /** * Apply the check for annotation. * * @param info the info * @param retrieval metadata instance * @param visitor current context visitor * @throws Throwable for any error */ void applyAnnotation(T info, MetaData retrieval, MetaDataVisitor visitor) throws Throwable; /** * Check if the annotation requires cleaning after itself. * * @param info the info * @param retrieval metadata instance * @param visitor current context visitor * @throws Throwable for any error */ void cleanAnnotation(T info, MetaData retrieval, MetaDataVisitor visitor) throws Throwable; } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MethodAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000321610667242231033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import org.jboss.reflect.spi.MethodInfo; /** * Plain method annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class MethodAnnotationPlugin extends AbstractAnnotationPlugin { protected MethodAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.METHOD == type; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000601010764037353033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.Set; import java.util.List; import java.util.ArrayList; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.reflect.spi.AnnotatedInfo; /** * Install callback annotation plugin. * * @param info type * @author Ales Justin */ public abstract class InstallCallbackAnnotationPlugin extends CallbackAnnotationPlugin { protected InstallCallbackAnnotationPlugin() { super(Install.class); } protected Set> getCallbacks(DependencyInfo dependency) { return dependency.getInstallItems(); } protected AbstractCallbackMetaData createCallback(T info, Install annotation) { InstallCallbackMetaData callback = new InstallCallbackMetaData(); callback.setState(new ControllerState(annotation.whenRequired())); callback.setDependentState(new ControllerState(annotation.dependentState())); if (isAttributePresent(annotation.cardinality())) callback.setCardinality(Cardinality.fromString(annotation.cardinality())); applyInfo(callback, info); return callback; } protected List getCallbacks(AbstractBeanMetaData beanMetaData) { List callbacks = beanMetaData.getInstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setInstallCallbacks(callbacks); } return callbacks; } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ListConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000320310674773017033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * List constructor annotation plugin. * * @author Ales Justin */ public class ListConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected ListConstructorValueAnnotationPlugin() { super(ListValue.class); } public ValueMetaData createValueMetaData(ListValue annotation) { return ListValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/NullValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000333011014545271033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.api.annotations.NullValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Null value annotation plugin. * * @author Ales Justin */ public class NullValueAnnotationPlugin extends PropertyAnnotationPlugin { public static final NullValueAnnotationPlugin INSTANCE = new NullValueAnnotationPlugin(); protected NullValueAnnotationPlugin() { super(NullValue.class); } public ValueMetaData createValueMetaData(NullValue annotation) { return new AbstractValueMetaData(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/LifecycleParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001042211006203730033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.List; import java.util.Collections; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.ParameterInfo; /** * Abstract lifecycle annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class LifecycleParameterAnnotationPlugin extends AbstractMethodParameterAnnotationPlugin { protected LifecycleParameterAnnotationPlugin(Class annotation, Set> adapters) { super(annotation, adapters); } protected boolean checkAnnotatedInfo(ElementType type) { return ElementType.METHOD == type; } /** * Is lifecycle metadata present. * * @param beanMetaData the bean metadata * @return true if lifecycle metadata exists */ protected abstract boolean isLifecyclePresent(BeanMetaData beanMetaData); protected AbstractLifecycleMetaData createLifecycleMetaData(String method, C annotation) { AbstractLifecycleMetaData lifecycle = new AbstractLifecycleMetaData(method); applyLifecycleAnnotation(lifecycle, annotation); return lifecycle; } /** * Apply lifecycle annotation. * * @param lifecycle lifecycle metadata * @param annotation the annotation */ protected abstract void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, C annotation); /** * Set lifecycle metadata. * * @param beanMetaData the bean metadata * @param lifecycle the lifecycle metadata */ protected abstract void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle); protected boolean isMetaDataAlreadyPresent(MethodInfo info, C annotation, BeanMetaData beanMetaData) { return isLifecyclePresent(beanMetaData); } protected ParameterInfo[] getParameters(MethodInfo info) { return info.getParameters(); } protected List handleParameterlessInfo(MethodInfo info, C annotation, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); AbstractLifecycleMetaData lifecycle = createLifecycleMetaData(info.getName(), annotation); setLifecycleMetaData(abmd, lifecycle); return Collections.singletonList(lifecycle); } protected AbstractLifecycleMetaData createParametrizedMetaData(MethodInfo info, C annotation) { return createLifecycleMetaData(info.getName(), annotation); } protected void setParameterizedMetaData(AbstractLifecycleMetaData parameterizedMetaData, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); setLifecycleMetaData(abmd, parameterizedMetaData); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractBeanAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000641111002141272033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; /** * Abstract bean annotation handler. * * @author Ales Justin */ public class AbstractBeanAnnotationAdapter extends CommonAnnotationAdapter, MetaDataVisitor> implements BeanAnnotationAdapter { public void applyAnnotations(MetaDataVisitor visitor) throws Throwable { handleAnnotations(visitor, true); } public void cleanAnnotations(MetaDataVisitor visitor) throws Throwable { handleAnnotations(visitor, false); } /** * Handle apply or cleanup of annotations. * * @param visitor the metadata visitor * @param isApplyPhase is this apply phase * @throws Throwable for any error */ protected void handleAnnotations(MetaDataVisitor visitor, boolean isApplyPhase) throws Throwable { if (visitor == null) throw new IllegalArgumentException("Null meta data visitor."); KernelControllerContext context = visitor.getControllerContext(); Kernel kernel = context.getKernel(); KernelMetaDataRepository repository = kernel.getMetaDataRepository(); MetaData retrieval = repository.getMetaData(context); BeanInfo info = context.getBeanInfo(); handleAnnotations(info, retrieval, visitor, isApplyPhase); } @SuppressWarnings("unchecked") protected void applyPlugin(AnnotationPlugin plugin, AnnotatedInfo info, MetaData retrieval, MetaDataVisitor handle) throws Throwable { plugin.applyAnnotation(info, retrieval, handle); } @SuppressWarnings("unchecked") protected void cleanPlugin(AnnotationPlugin plugin, AnnotatedInfo info, MetaData retrieval, MetaDataVisitor handle) throws Throwable { plugin.cleanAnnotation(info, retrieval, handle); } protected Object getName(MetaDataVisitor handle) { return handle.getControllerContext().getName(); } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractMethodParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000416611006203730033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.metadata.spi.signature.MethodParametersSignature; import org.jboss.metadata.spi.signature.Signature; import org.jboss.reflect.spi.MethodInfo; /** * Annotation plugin for handling annotations that take parameters in methods. * * @param annotation type * @param

mutable parametrized type * @author Ales Justin */ public abstract class AbstractMethodParameterAnnotationPlugin extends AbstractParameterAnnotationPlugin { protected AbstractMethodParameterAnnotationPlugin(Class annotation, Set> adapters) { super(annotation, adapters); } protected Signature createParametersSignature(String name, String[] parameters, int index) { return new MethodParametersSignature(name, parameters, index); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/UninstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000603110764037353033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.api.annotations.Uninstall; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.reflect.spi.AnnotatedInfo; /** * Uninstall annotation plugin. * * @param info type * @author Ales Justin */ public abstract class UninstallCallbackAnnotationPlugin extends CallbackAnnotationPlugin { protected UninstallCallbackAnnotationPlugin() { super(Uninstall.class); } protected Set> getCallbacks(DependencyInfo dependency) { return dependency.getUninstallItems(); } protected AbstractCallbackMetaData createCallback(T info, Uninstall annotation) { UninstallCallbackMetaData callback = new UninstallCallbackMetaData(); callback.setState(new ControllerState(annotation.whenRequired())); callback.setDependentState(new ControllerState(annotation.dependentState())); if (isAttributePresent(annotation.cardinality())) callback.setCardinality(Cardinality.fromString(annotation.cardinality())); applyInfo(callback, info); return callback; } protected List getCallbacks(AbstractBeanMetaData beanMetaData) { List callbacks = beanMetaData.getUninstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setUninstallCallbacks(callbacks); } return callbacks; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001702011014351526033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.signature.Signature; import org.jboss.reflect.spi.AnnotatedInfo; import org.jboss.reflect.spi.ParameterInfo; import org.jboss.reflect.spi.TypeInfo; /** * Annotation plugin for handling annotations that take parameters. * * @param info type * @param annotation type * @param

mutable parametrized type * @author Ales Justin */ public abstract class AbstractParameterAnnotationPlugin extends AbstractAdaptersAnnotationPlugin { protected AbstractParameterAnnotationPlugin(Class annotation, Set> adapters) { super(annotation, adapters); } /** * Check additional element type - * apart from Parameter element type. * * @param type the type * @return true if additional type is supported */ protected abstract boolean checkAnnotatedInfo(ElementType type); protected boolean isElementTypeSupported(ElementType type) { return ElementType.PARAMETER == type || checkAnnotatedInfo(type); } /** * Get the parameters infos from type. * * @param info the type * @return array of parameter info */ protected abstract ParameterInfo[] getParameters(T info); /** * Handle info which has zero parameters. * * @param info the info * @param annotation the annotation * @param beanMetaData the bean metadata * @return list of added meta data visitor nodes */ protected abstract List handleParameterlessInfo(T info, C annotation, BeanMetaData beanMetaData); /** * Create new Parametrized metadata. * * @param info the info * @param annotation the annotation * @param beanMetaData the bean metadata * @return new ParameterizedMetaData instance */ protected P createParametrizedMetaData(T info, C annotation, BeanMetaData beanMetaData) { return createParametrizedMetaData(info, annotation); } /** * Create new Parametrized metadata. * * @param info the info * @param annotation the annotation * @return new ParameterizedMetaData instance */ protected P createParametrizedMetaData(T info, C annotation) { return createParametrizedMetaData(info); } /** * Create new Parametrized metadata. * * @param info the info * @return new ParameterizedMetaData instance */ protected P createParametrizedMetaData(T info) { throw new IllegalArgumentException("Should implement one of createParameterizedMetaData methods!"); } /** * Set the ParameterizedMetaData instance. * @param parameterizedMetaData the parameterized metadata * @param beanMetaData the bean metadata */ protected abstract void setParameterizedMetaData(P parameterizedMetaData, BeanMetaData beanMetaData); @SuppressWarnings("unchecked") protected List internalApplyAnnotation(T info, MetaData retrieval, C annotation, BeanMetaData beanMetaData) throws Throwable { boolean trace = log.isTraceEnabled(); ParameterInfo[] parameters = getParameters(info); if (parameters == null || parameters.length == 0) { if (trace) log.trace("Info " + info + " has zero parameters."); return handleParameterlessInfo(info, annotation, beanMetaData); } TypeInfo[] typeInfos = new TypeInfo[parameters.length]; for(int i=0; i < parameters.length; i++) typeInfos[i] = parameters[i].getParameterType(); List pmds = new ArrayList(); for(int i=0; i < parameters.length; i++) { ParameterInfo pi = parameters[i]; Signature pis = createParametersSignature( pi.getName(), Configurator.getParameterTypes(log.isTraceEnabled(), typeInfos), i ); MetaData mdr = retrieval.getComponentMetaData(pis); if (mdr != null) { ValueMetaData value = null; for(Annotation2ValueMetaDataAdapter adapter : adapters) { Annotation adapterAnnotation = mdr.getAnnotation(adapter.getAnnotation()); if (adapterAnnotation != null) { value = adapter.createValueMetaData(pi, adapterAnnotation, value); } } if (value == null) throw new IllegalArgumentException("No such Annotation2ValueMetaData adapter or no annotation on ParameterInfo: " + pi); if (trace) log.trace("Adding new ParameterMetaData for annotation: " + value); pmds.add(new AbstractParameterMetaData(pi.getParameterType().getName(), value)); } else { throw new IllegalArgumentException("MetaData for parameter must exist: " + pi); } } P parameterizedMetaData = createParametrizedMetaData(info, annotation, beanMetaData); setParameterizedMetaData(parameterizedMetaData, beanMetaData); parameterizedMetaData.setParameters(pmds); if (parameterizedMetaData instanceof MetaDataVisitorNode == false) throw new IllegalArgumentException("ParameterizedMetaData not MetaDataVisitor: " + parameterizedMetaData); return Collections.singletonList((MetaDataVisitorNode)parameterizedMetaData); } /** * Create parameters signature. * * @param name the name * @param parameters the parameters * @param index the index * @return new signature */ protected abstract Signature createParametersSignature(String name, String[] parameters, int index); } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractMetaDataAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000456211002141272033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; import org.jboss.kernel.spi.annotations.BeanMetaDataAnnotationAdapter; /** * Abstract metadata annotation handler. * * @author Ales Justin */ public class AbstractMetaDataAnnotationAdapter extends CommonAnnotationAdapter, BeanMetaData> implements BeanMetaDataAnnotationAdapter { public void applyAnnotations(BeanInfo beanInfo, MetaData metaData, BeanMetaData beanMetaData) throws Throwable { handleAnnotations(beanInfo, metaData, beanMetaData, true); } @SuppressWarnings("unchecked") protected void applyPlugin(MetaDataAnnotationPlugin plugin, AnnotatedInfo info, MetaData retrieval, BeanMetaData handle) throws Throwable { plugin.applyAnnotation(info, retrieval, handle); } protected void cleanPlugin(MetaDataAnnotationPlugin plugin, AnnotatedInfo info, MetaData retrieval, BeanMetaData handle) throws Throwable { throw new UnsupportedOperationException("Cleanup is not supported on metadata annotation adapter."); } protected Object getName(BeanMetaData handle) { return handle.getName(); } }././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InjectConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000317210674773017033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Inject constructor annotation plugin. * * @author Ales Justin */ public class InjectConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected InjectConstructorValueAnnotationPlugin() { super(Inject.class); } public ValueMetaData createValueMetaData(Inject annotation) { return InjectAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BeanAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000500511224616616033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.List; import org.jboss.beans.metadata.api.annotations.Bean; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.reflect.spi.ClassInfo; /** * Bean annotation plugin. * * @author Ales Justin */ public class BeanAnnotationPlugin extends ClassAnnotationPlugin { public static final BeanAnnotationPlugin INSTANCE = new BeanAnnotationPlugin(); protected BeanAnnotationPlugin() { super(Bean.class); } protected List internalApplyAnnotation(ClassInfo info, Bean annotation, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); // TODO - add missing attributes if (abmd.getAutowireType() == null) abmd.setAutowireType(annotation.autowireType()); if (abmd.getMode() == null) abmd.setMode(annotation.mode()); if (abmd.getErrorHandlingMode() == null) abmd.setErrorHandlingMode(annotation.errorHandlingMode()); if (abmd.getAccessMode() == null) abmd.setAccessMode(annotation.accessMode()); // we don't put bmd back to be inspected // since the changes we apply *here* don't really // trigger any change in metadata - all enums return null; } }././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MethodAnnotationPluginFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000255311301242575033403 0ustar twernertwerner/* * 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.kernel.plugins.annotations; /** * Match only true method. */ class MethodAnnotationPluginFilter extends PropertyAnnotationPluginFilter { @SuppressWarnings("unchecked") public boolean accept(MetaDataAnnotationPlugin plugin) { // negate return super.accept(plugin) == false; } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ClassAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000321710667242231033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import org.jboss.reflect.spi.ClassInfo; /** * Abstract class/type annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class ClassAnnotationPlugin extends AbstractAnnotationPlugin { protected ClassAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.TYPE == type; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/SetConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000317410674773017033417 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Set constructor annotation plugin. * * @author Ales Justin */ public class SetConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected SetConstructorValueAnnotationPlugin() { super(SetValue.class); } public ValueMetaData createValueMetaData(SetValue annotation) { return SetValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000022700000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/StringValueConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000323610674773017033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * String constructor annotation plugin. * * @author Ales Justin */ public class StringValueConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected StringValueConstructorValueAnnotationPlugin() { super(StringValue.class); } public ValueMetaData createValueMetaData(StringValue annotation) { return StringValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/StartLifecycleAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000427511014545271033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.api.annotations.Start; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Start annotation plugin. * * @author Ales Justin */ public class StartLifecycleAnnotationPlugin extends LifecycleParameterAnnotationPlugin { public StartLifecycleAnnotationPlugin(Set> adapters) { super(Start.class, adapters); } protected boolean isLifecyclePresent(BeanMetaData beanMetaData) { return beanMetaData.getStart() != null; } protected void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, Start annotation) { lifecycle.setIgnored(annotation.ignored()); } protected void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle) { lifecycle.setType("start"); beanMetaData.setStart(lifecycle); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001537410777663234033427 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.List; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; /** * Abstract annotation plugin. * * @param info type * @param annotation type * @author Ales Justin */ public abstract class AbstractAnnotationPlugin extends BaseMetaDataAnnotationPlugin implements AnnotationPlugin { protected AbstractAnnotationPlugin(Class annotation) { super(annotation); } /** * Is meta data already present. * * @param info the info * @param annotation the annotation * @param context the context * @return true if meta data already present */ protected boolean isMetaDataAlreadyPresent(T info, C annotation, KernelControllerContext context) { return isMetaDataAlreadyPresent(info, annotation, context.getBeanMetaData()); } /** * Apply annotation since it's not present. * * @param info the info * @param retrieval the metadata * @param annotation the annotation * @param context the context * @return list of added meta data visitor nodes * @throws Throwable for any error */ protected List internalApplyAnnotation(T info, MetaData retrieval, C annotation, KernelControllerContext context) throws Throwable { return internalApplyAnnotation(info, retrieval, annotation, context.getBeanMetaData()); } /** * Apply annotation since it's not present. * * @param info the info * @param retrieval the metadata * @param annotation the annotation * @param beanMetaData the bean metadata * @return list of added meta data visitor nodes * @throws Throwable for any error */ protected List internalApplyAnnotation(T info, MetaData retrieval, C annotation, BeanMetaData beanMetaData) throws Throwable { return internalApplyAnnotation(info, annotation, beanMetaData); } /** * Covariant override. */ protected List internalApplyAnnotation(T info, C annotation, BeanMetaData beanMetaData) throws Throwable { log.warn("Probably missing annotation apply implementation: " + this); return null; } public final void applyAnnotation(T info, MetaData retrieval, MetaDataVisitor visitor) throws Throwable { boolean trace = log.isTraceEnabled(); if (isCleanupOnly() == false) { Class annotationClass = getAnnotation(); C annotation = retrieval.getAnnotation(annotationClass); if (annotation == null) { if (trace) log.trace("No annotation: " + annotationClass.getName()); return; } if (isMetaDataAlreadyPresent(info, annotation, visitor.getControllerContext())) { if (trace) log.trace("MetaDataAlreadyPresent, ignoring " + annotation); return; } if (trace) log.trace("Applying annotation: " + annotation); List nodes = internalApplyAnnotation(info, retrieval, annotation, visitor.getControllerContext()); if (nodes != null && nodes.isEmpty() == false) { for(MetaDataVisitorNode node : nodes) { node.initialVisit(visitor); node.describeVisit(visitor); } } } else if (trace) log.trace("Annotation " + getAnnotation() + " is @CleanupOnly, nothing to apply on install."); } public void cleanAnnotation(T info, MetaData retrieval, MetaDataVisitor visitor) throws Throwable { boolean trace = log.isTraceEnabled(); if (isCleanup()) { Class annotationClass = getAnnotation(); C annotation = retrieval.getAnnotation(annotationClass); if (annotation == null) { if (trace) log.trace("No annotation: " + annotationClass.getName()); } else { if (trace) log.trace("Cleaning annotation: " + annotation); internalCleanAnnotation(info, retrieval, annotation, visitor.getControllerContext()); } } else if (trace) log.trace("Annotation " + getAnnotation() + " is not a @Cleanup annotation."); } /** * Clean annotation's actions. * * @param info the info * @param retrieval the metadata * @param annotation the annotation * @param context the context * @throws Throwable for any error */ protected void internalCleanAnnotation(T info, MetaData retrieval, C annotation, KernelControllerContext context) throws Throwable { // empty } /** * Check if we require impl detail on BeanMetaData. * * @param beanMetaData the bean metadata * @return abstract bean metadata instance */ protected AbstractBeanMetaData checkIfNotAbstractBeanMetaDataSpecific(BeanMetaData beanMetaData) { if (beanMetaData instanceof AbstractBeanMetaData == false) throw new IllegalArgumentException("Can only handle AbstractBeanMetaData: " + beanMetaData); return AbstractBeanMetaData.class.cast(beanMetaData); } }././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CreateLifecycleAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000431411014545271033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.api.annotations.Create; /** * Create annotation plugin. * * @author Ales Justin */ public class CreateLifecycleAnnotationPlugin extends LifecycleParameterAnnotationPlugin { public CreateLifecycleAnnotationPlugin(Set> adapters) { super(Create.class, adapters); } protected boolean isLifecyclePresent(BeanMetaData beanMetaData) { return beanMetaData.getCreate() != null; } protected void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, Create annotation) { lifecycle.setIgnored(annotation.ignored()); } protected void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle) { lifecycle.setType("create"); beanMetaData.setCreate(lifecycle); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InjectableMemberAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001626011014351526033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.reflect.spi.AnnotatedInfo; import org.jboss.reflect.spi.ParameterInfo; import org.jboss.reflect.spi.TypeInfo; /** * Injectable member annotation plugin. * * @param the annotated info * @param annotation type * @author Ales Justin */ public abstract class InjectableMemberAnnotationPlugin extends AbstractAnnotationPlugin { protected InjectableMemberAnnotationPlugin(Class annotation) { super(annotation); } /** * Get the annotated info name. * * @param info the info * @return info's name */ protected abstract String getName(T info); /** * Find matching property metadata. * * @param info the property info * @param beanMetaData the bean metadata * @return matching property metadata or null */ protected PropertyMetaData findPropertyMetaData(T info, BeanMetaData beanMetaData) { Set properties = beanMetaData.getProperties(); if (properties != null && properties.isEmpty() == false) { for(PropertyMetaData pmd : properties) { if (pmd.getName().equals(getName(info))) return pmd; } } return null; } protected boolean isMetaDataAlreadyPresent(T info, C annotation, BeanMetaData beanMetaData) { PropertyMetaData pmd = findPropertyMetaData(info, beanMetaData); return isMetaDataComplete(pmd); } /** * Is property metadata complete. * * @param pmd the property meta data * @return true if metadata is complete */ protected boolean isMetaDataComplete(PropertyMetaData pmd) { return (pmd != null); } protected List internalApplyAnnotation(T info, C annotation, BeanMetaData beanMetaData) throws Throwable { Set properties = getProperties(beanMetaData); PropertyMetaData property = getPropertyMetaData(info, annotation, beanMetaData); properties.add(property); return Collections.singletonList(property); } /** * Get PropertyMetaData instance. * * @param info the info * @param annotation the annotation * @param beanMetaData the bean metadata * @return get new PropertyMetaData instance */ protected PropertyMetaData getPropertyMetaData(T info, C annotation, BeanMetaData beanMetaData) { return getPropertyMetaData(info, annotation); } /** * Get PropertyMetaData instance. * * @param info the info * @param annotation the annotation * @return get new PropertyMetaData instance */ protected PropertyMetaData getPropertyMetaData(T info, C annotation) { ValueMetaData value = createValueMetaData(info, annotation); if (value == null) throw new IllegalArgumentException("Should not return null value, " + this); return new AbstractPropertyMetaData(getName(info), value); } /** * Get the PropertyMetaData set. * * @param beanMetaData the bean meta data * @return set of existing PropertyMetaData */ protected Set getProperties(BeanMetaData beanMetaData) { Set properties = beanMetaData.getProperties(); if (properties == null) { properties = new HashSet(); AbstractBeanMetaData bean = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); bean.setProperties(properties); } return properties; } /** * Create value meta data. * * @param parameterInfo the parameter ifo * @param annotation the annotation * @param previousValue previous value * @return value meta data */ public ValueMetaData createValueMetaData(ParameterInfo parameterInfo, C annotation, ValueMetaData previousValue) { return createValueMetaData(parameterInfo.getParameterType(), annotation, previousValue); } /** * Create value metadata. * * @param type the type info * @param annotation the annotation * @param previousValue the previous value * @return value metadata instance */ protected ValueMetaData createValueMetaData(TypeInfo type, C annotation, ValueMetaData previousValue) { return createValueMetaData(type, annotation); } /** * Create value metadata. * * @param type the type info * @param annotation the annotation * @return value metadata instance */ protected ValueMetaData createValueMetaData(TypeInfo type, C annotation) { return createValueMetaData(annotation, null); } /** * Create value meta data. * * @param info the info * @param annotation the annotation * @return value metadata */ protected ValueMetaData createValueMetaData(T info, C annotation) { return createValueMetaData(annotation, null); } /** * Create value meta data. * * @param annotation the annotation * @param previousValue previous value * @return value meta data */ protected ValueMetaData createValueMetaData(C annotation, ValueMetaData previousValue) { return createValueMetaData(annotation); } /** * Create value meta data. * * @param annotation the annotation * @return value meta data */ public ValueMetaData createValueMetaData(C annotation) { throw new IllegalArgumentException("Missing createValueMetaData(" + annotation + ") implementation: " + toString()); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ExternalInstallationAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001734110777663234033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.reflect.spi.ClassInfo; /** * Abstract external installation annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class ExternalInstallationAnnotationPlugin extends ClassAnnotationPlugin { protected ExternalInstallationAnnotationPlugin(Class annotation) { super(annotation); } /** * Get existing InstallMetaData list. * * @param beanMetaData the bean metadata * @return list of existing InstallMetaData */ protected abstract List getExistingInstallMetaData(BeanMetaData beanMetaData); /** * Get ExternalInstall array from annotation. * * @param annotation the annotation * @return array of ExternalInstall */ protected abstract ExternalInstall[] getExternalInstalls(C annotation); /** * Create InstallMetaData from array of ExternalInstall. * * @param annotation the annotation * @return list of InstallMetaData */ protected List getInstallMetaData(C annotation) { List installs = new ArrayList(); for(ExternalInstall install : getExternalInstalls(annotation)) { installs.add(createInstallMetaData(install)); } return installs; } /** * Create InstallMetaData from ExternalInstall. * * @param install the existing install * @return new InstallMetaData instance */ protected InstallMetaData createInstallMetaData(ExternalInstall install) { AbstractInstallMetaData installMetaData = new AbstractInstallMetaData(); installMetaData.setBean(install.bean()); installMetaData.setMethodName(install.method()); if (isAttributePresent(install.whenRequired())) installMetaData.setState(new ControllerState(install.whenRequired())); if (isAttributePresent(install.dependantState())) installMetaData.setDependentState(new ControllerState(install.dependantState())); for (Value value : install.parameters()) { List parameters = installMetaData.getParameters(); if (parameters == null) { parameters = new ArrayList(); installMetaData.setParameters(parameters); } AbstractParameterMetaData parameter = new AbstractParameterMetaData(ValueUtil.createValueMetaData(value)); if (isAttributePresent(value.type())) parameter.setType(value.type().getName()); parameters.add(parameter); } return installMetaData; } protected List internalApplyAnnotation(ClassInfo info, C annotation, BeanMetaData beanMetaData) throws Throwable { List existing = getExistingInstallMetaData(beanMetaData); if (existing == null) throw new IllegalArgumentException("Must set empty Set to installs/uninstalls!"); List installs = getInstallMetaData(annotation); if (installs != null && installs.isEmpty() == false) { List nodes = new ArrayList(); for(InstallMetaData install : installs) { boolean doAdd = true; for(InstallMetaData existingInstall : existing) { if (isDifferent(install, existingInstall) == false) { doAdd = false; break; } } if (doAdd) { existing.add(install); nodes.add(install); } } return nodes; } return null; } /** * Compare twi InstallMetaData instances. * * @param first first InstallMetaData instance * @param second second InstallMetaData instance * @return true if instances differ */ protected static boolean isDifferent(InstallMetaData first, InstallMetaData second) { if (notEqual(first.getBean(), second.getBean())) return true; if (notEqual(first.getMethodName(), second.getMethodName())) return true; if (notEqual(first.getState(), second.getState())) return true; if (notEqual(first.getDependentState(), second.getDependentState())) return true; List fstParameters = first.getParameters(); List sndParameters = second.getParameters(); int fstSize = fstParameters != null ? fstParameters.size() : 0; int sndSize = sndParameters != null ? sndParameters.size() : 0; if (fstSize != sndSize) return true; for(int i = 0; i < fstSize; i++) { ParameterMetaData fstParameter = fstParameters.get(i); ParameterMetaData sndParameter = sndParameters.get(i); // types if (notEqual(fstParameter.getType(), sndParameter.getType())) return true; // values ValueMetaData fstValue = fstParameter.getValue(); ValueMetaData sndValue = sndParameter.getValue(); Class fstClass = fstValue != null ? fstValue.getClass() : null; Class sndClass = sndValue != null ? sndValue.getClass() : null; // class guess if (notEqual(fstClass, sndClass)) return true; Object fstObject = fstValue != null ? fstValue.getUnderlyingValue() : null; Object sndObject = sndValue != null ? sndValue.getUnderlyingValue() : null; // underlying value guess - only on both being non-null // e.g. since those who already passed have their underlying value set, // those who didn't, don't have it, but they are the 'same' install // see ThisValueMetaData if ((fstObject != null && sndObject != null) && notEqual(fstObject, sndObject)) return true; } return false; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/DestroyLifecycleAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000432011014545271033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.api.annotations.Destroy; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Destroy annoattion plugin. * * @author Ales Justin */ public class DestroyLifecycleAnnotationPlugin extends LifecycleParameterAnnotationPlugin { public DestroyLifecycleAnnotationPlugin(Set> adapters) { super(Destroy.class, adapters); } protected boolean isLifecyclePresent(BeanMetaData beanMetaData) { return beanMetaData.getDestroy() != null; } protected void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, Destroy annotation) { lifecycle.setIgnored(annotation.ignored()); } protected void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle) { lifecycle.setType("destroy"); beanMetaData.setDestroy(lifecycle); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InjectFieldAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000325010777663234033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Value factory field annotation plugin. * * @author Ales Justin */ public class InjectFieldAnnotationPlugin extends FieldAnnotationPlugin { public static final InjectFieldAnnotationPlugin INSTANCE = new InjectFieldAnnotationPlugin(); protected InjectFieldAnnotationPlugin() { super(Inject.class); } public ValueMetaData createValueMetaData(Inject annotation) { return ValueUtil.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ValueFactoryAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000330211014545271033374 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.ValueFactory; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Value factory annotation plugin. * * @author Ales Justin */ public class ValueFactoryAnnotationPlugin extends PropertyAnnotationPlugin { public static final ValueFactoryAnnotationPlugin INSTANCE = new ValueFactoryAnnotationPlugin(); protected ValueFactoryAnnotationPlugin() { super(ValueFactory.class); } public ValueMetaData createValueMetaData(ValueFactory annotation) { return ValueUtil.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ConstructorParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000601311014545271033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Constructor; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.ConstructorInfo; import org.jboss.reflect.spi.ParameterInfo; /** * Constructor annotation plugin. * * @author Ales Justin */ public class ConstructorParameterAnnotationPlugin extends AbstractConstructorParameterAnnotationPlugin { public ConstructorParameterAnnotationPlugin(Set> adapters) { super(Constructor.class, adapters); } protected boolean checkAnnotatedInfo(ElementType type) { return ElementType.CONSTRUCTOR == type; } protected boolean isMetaDataAlreadyPresent(ConstructorInfo info, Constructor annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; } protected ParameterInfo[] getParameters(ConstructorInfo info) { return info.getParameters(); } protected List handleParameterlessInfo(ConstructorInfo info, Constructor annotation, BeanMetaData beanMetaData) { // do nothing, default will be used return null; } protected AbstractConstructorMetaData createParametrizedMetaData(ConstructorInfo info) { return new AbstractConstructorMetaData(); } protected void setParameterizedMetaData(AbstractConstructorMetaData parameterizedMetaData, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = (AbstractBeanMetaData)beanMetaData; abmd.setConstructor(parameterizedMetaData); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ValueFactoryFieldAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000333010777663234033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.ValueFactory; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Value factory field annotation plugin. * * @author Ales Justin */ public class ValueFactoryFieldAnnotationPlugin extends FieldAnnotationPlugin { public static final ValueFactoryFieldAnnotationPlugin INSTANCE = new ValueFactoryFieldAnnotationPlugin(); protected ValueFactoryFieldAnnotationPlugin() { super(ValueFactory.class); } public ValueMetaData createValueMetaData(ValueFactory annotation) { return ValueUtil.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CollectionConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000326310674773017033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Collection constructor annotation plugin. * * @author Ales Justin */ public class CollectionConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected CollectionConstructorValueAnnotationPlugin() { super(CollectionValue.class); } public ValueMetaData createValueMetaData(CollectionValue annotation) { return CollectionValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/Annotation2ValueMetaDataAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000361311014351526033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.reflect.spi.ParameterInfo; /** * Create ValueMetaData from Annotation. * * @param annotation type * @author Ales Justin */ public interface Annotation2ValueMetaDataAdapter { /** * Get the annotation class we are handling. * * @return the annotation class */ Class getAnnotation(); /** * Create ValueMetaData instance. * * @param parameterInfo the parameter info * @param annotation the annotation instance * @param previousValue previous value * @return new ValueMetaData instance */ ValueMetaData createValueMetaData(ParameterInfo parameterInfo, C annotation, ValueMetaData previousValue); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/PropertyAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000266010667225725033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.metadata.spi.MetaData; /** * Marker interface. * * @author Ales Justin */ public interface PropertyAware { void applyAnnotation(PropertyInfo info, MetaData retrieval, MetaDataVisitor visitor) throws Throwable; } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BaseMetaDataAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001550211040631260033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Target; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Cleanup; import org.jboss.beans.metadata.api.annotations.CleanupOnly; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Annotation plugin based on bean metadata. * * @param info type * @param annotation type * @author Ales Justin */ public abstract class BaseMetaDataAnnotationPlugin extends JBossObject implements MetaDataAnnotationPlugin { private Class annotation; private Set types; private boolean isCleanup; private boolean isCleanupOnly; protected BaseMetaDataAnnotationPlugin(Class annotation) { if (annotation == null) throw new IllegalArgumentException("Null annotation!"); this.annotation = annotation; this.types = new HashSet(); Target target = annotation.getAnnotation(Target.class); if (target != null) { List list = Arrays.asList(target.value()); for(ElementType type : list) { if (isElementTypeSupported(type)) { types.add(type); } } } isCleanupOnly = annotation.isAnnotationPresent(CleanupOnly.class); isCleanup = isCleanupOnly || annotation.isAnnotationPresent(Cleanup.class); } public final void applyAnnotation(T info, MetaData retrieval, BeanMetaData beanMetaData) throws Throwable { boolean trace = log.isTraceEnabled(); if (isCleanupOnly() == false) { Class annotationClass = getAnnotation(); C annotation = retrieval.getAnnotation(annotationClass); if (annotation == null) { if (trace) log.trace("No annotation: " + annotationClass.getName()); return; } if (isMetaDataAlreadyPresent(info, annotation, beanMetaData)) { if (trace) log.trace("MetaDataAlreadyPresent, ignoring " + annotation); return; } if (trace) log.trace("Applying annotation: " + annotation); internalApplyAnnotation(info, retrieval, annotation, beanMetaData); } else if (trace) log.trace("Annotation " + getAnnotation() + " is @CleanupOnly, nothing to apply on install."); } /** * Is meta data already present. * * @param info the info * @param annotation the annotation * @param beanMetaData the bean meta data * @return true if meta data already present */ protected boolean isMetaDataAlreadyPresent(T info, C annotation, BeanMetaData beanMetaData) { return false; } /** * Apply annotation since it's not present. * * @param info the info * @param retrieval the metadata * @param annotation the annotation * @param beanMetaData the bean meta data * @return used to return covariant type * @throws Throwable for any error */ protected Object internalApplyAnnotation(T info, MetaData retrieval, C annotation, BeanMetaData beanMetaData) throws Throwable { return internalApplyAnnotation(info, annotation, beanMetaData); } /** * Apply annotation since it's not present. * * @param info the info * @param annotation the annotation * @param beanMetaData the bean meta data * @return used to return covariant type * @throws Throwable for any error */ protected abstract Object internalApplyAnnotation(T info, C annotation, BeanMetaData beanMetaData) throws Throwable; /** * Is annotation marked as cleanup. * * @return true if cleanup annotation */ protected boolean isCleanup() { return isCleanup; } /** * Is annotation marked as cleanup only. * * @return true if clean up only */ protected boolean isCleanupOnly() { return isCleanupOnly; } /** * Does attribute have value. * Helper method. * * @param value the value * @return true if atribute not null or non-empty */ protected static boolean isAttributePresent(String value) { return ValueUtil.isAttributePresent(value); } /** * Does attribute have value. * Helper method. * * @param value the value * @return true if atribute not void.class */ protected static boolean isAttributePresent(Class value) { return ValueUtil.isAttributePresent(value); } /** * Is type supported by plugin. * * @param type the annotation element type * @return true if element supported */ protected abstract boolean isElementTypeSupported(ElementType type); public Set getSupportedTypes() { return Collections.unmodifiableSet(types); } public Class getAnnotation() { return annotation; } protected void toString(JBossStringBuilder buffer) { buffer.append("@annotation=").append(annotation); buffer.append(", types=").append(types); buffer.append(", cleanup=").append(isCleanup()); buffer.append(", cleanupOnly=").append(isCleanupOnly()); } public void toShortString(JBossStringBuilder buffer) { buffer.append("@annotation=").append(annotation); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/DependsAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000526510777663234033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Depends; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DependencyMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.ClassInfo; /** * Depends annotation plugin. * * @author Ales Justin */ public class DependsAnnotationPlugin extends ClassAnnotationPlugin { public static final DependsAnnotationPlugin INSTANCE = new DependsAnnotationPlugin(); protected DependsAnnotationPlugin() { super(Depends.class); } protected List internalApplyAnnotation(ClassInfo info, Depends annotation, BeanMetaData beanMetaData) { Set dependencies = beanMetaData.getDepends(); if (dependencies == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); dependencies = new HashSet(); abmd.setDepends(dependencies); } List nodes = new ArrayList(); for(String depends : annotation.value()) { AbstractDependencyMetaData dependency = new AbstractDependencyMetaData(depends); if (dependencies.add(dependency)) nodes.add(dependency); } return nodes; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MapConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000317310674773017033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Map constructor annotation plugin. * * @author Ales Justin */ public class MapConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected MapConstructorValueAnnotationPlugin() { super(MapValue.class); } public ValueMetaData createValueMetaData(MapValue annotation) { return MapValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001044010777663234033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.Collections; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.AnnotatedInfo; /** * Callback annotation plugin. * * @param info type * @param annotation type * @author Ales Justin */ public abstract class CallbackAnnotationPlugin extends AbstractAnnotationPlugin { protected CallbackAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.METHOD == type; } protected boolean isMetaDataAlreadyPresent(T info, C annotation, KernelControllerContext context) { DependencyInfo dependency = context.getDependencyInfo(); Set> callbacks = getCallbacks(dependency); if (callbacks != null && callbacks.isEmpty() == false) { for(CallbackItem ci : callbacks) { if (isEqual(info, ci)) return true; } } return false; } /** * Does callback item corespond to info instance. * * @param info the info * @param ci the callback item * @return true if callback matches info */ protected abstract boolean isEqual(T info, CallbackItem ci); /** * Get the callbacks. * * @param dependency the dependency info * @return set of callback items */ protected abstract Set> getCallbacks(DependencyInfo dependency); protected List internalApplyAnnotation(T info, C annotation, BeanMetaData bmd) { AbstractBeanMetaData beanMetaData = checkIfNotAbstractBeanMetaDataSpecific(bmd); List callbacks = getCallbacks(beanMetaData); AbstractCallbackMetaData callback = createCallback(info, annotation); callbacks.add(callback); return Collections.singletonList(callback); } /** * Create new CallbackMetaData instance. * * @param info the info * @param annotation the annotation * @return new CallbackMetaData instance */ protected abstract AbstractCallbackMetaData createCallback(T info, C annotation); /** * Apply additional information. * * @param callback the callback metadata * @param info the info */ protected abstract void applyInfo(AbstractCallbackMetaData callback, T info); /** * Get the callback metadatas. * * @param beanMetaData the bean metadata * @return list of callback metadatas */ protected abstract List getCallbacks(AbstractBeanMetaData beanMetaData); } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MethodUninstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000366210777663234033424 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.reflect.spi.MethodInfo; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.dependency.spi.CallbackItem; /** * Method uninstall annotation plugin. * * @author Ales Justin */ public class MethodUninstallCallbackAnnotationPlugin extends UninstallCallbackAnnotationPlugin { public static final MethodUninstallCallbackAnnotationPlugin INSTANCE = new MethodUninstallCallbackAnnotationPlugin(); protected MethodUninstallCallbackAnnotationPlugin() { super(); } protected boolean isEqual(MethodInfo info, CallbackItem ci) { // todo - param matching return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, MethodInfo info) { callback.setMethodInfo(info); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/StopLifecycleAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000426311014545271033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractLifecycleMetaData; import org.jboss.beans.metadata.api.annotations.Stop; import org.jboss.beans.metadata.spi.BeanMetaData; /** * Stop annotation plugin. * * @author Ales Justin */ public class StopLifecycleAnnotationPlugin extends LifecycleParameterAnnotationPlugin { public StopLifecycleAnnotationPlugin(Set> adapters) { super(Stop.class, adapters); } protected boolean isLifecyclePresent(BeanMetaData beanMetaData) { return beanMetaData.getStop() != null; } protected void applyLifecycleAnnotation(AbstractLifecycleMetaData lifecycle, Stop annotation) { lifecycle.setIgnored(annotation.ignored()); } protected void setLifecycleMetaData(AbstractBeanMetaData beanMetaData, AbstractLifecycleMetaData lifecycle) { lifecycle.setType("stop"); beanMetaData.setStop(lifecycle); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/SetValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000415611014545271033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractSetMetaData; import org.jboss.beans.metadata.api.annotations.SetValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Set value annotation plugin. * * @author Ales Justin */ public class SetValueAnnotationPlugin extends CollectionsAnnotationPlugin { public static final SetValueAnnotationPlugin INSTANCE = new SetValueAnnotationPlugin(); protected SetValueAnnotationPlugin() { super(SetValue.class); } public ValueMetaData createValueMetaData(SetValue annotation) { AbstractSetMetaData set = new AbstractSetMetaData(); if (isAttributePresent(annotation.clazz())) set.setType(annotation.clazz().getName()); if (isAttributePresent(annotation.elementClass())) set.setElementType(annotation.elementClass().getName()); for(Value value : annotation.value()) set.add(createValueMetaData(value)); return set; } } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/SearchPropertyAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000324611050031647033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.Search; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Search value annotation plugin. * * @author Ales Justin */ public class SearchPropertyAnnotationPlugin extends PropertyAnnotationPlugin { public final static SearchPropertyAnnotationPlugin INSTANCE = new SearchPropertyAnnotationPlugin(); protected SearchPropertyAnnotationPlugin() { super(Search.class); } public ValueMetaData createValueMetaData(Search search) { return ValueUtil.createValueMetaData(search); } }././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/PropertyUninstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000374210777663234033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.dependency.spi.CallbackItem; /** * Property uninstall annotation plugin. * * @author Ales Justin */ public class PropertyUninstallCallbackAnnotationPlugin extends UninstallCallbackAnnotationPlugin implements PropertyAware { public static final PropertyUninstallCallbackAnnotationPlugin INSTANCE = new PropertyUninstallCallbackAnnotationPlugin(); protected PropertyUninstallCallbackAnnotationPlugin() { super(); } protected boolean isEqual(PropertyInfo info, CallbackItem ci) { // todo - param matching return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, PropertyInfo info) { callback.setPropertyInfo(info); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ExternalUninstallAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000457110777663234033424 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.api.annotations.ExternalUninstalls; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; /** * External uninstalls annotation plugin. * * @author Ales Justin */ public class ExternalUninstallAnnotationPlugin extends ExternalInstallationAnnotationPlugin { public static final ExternalUninstallAnnotationPlugin INSTANCE = new ExternalUninstallAnnotationPlugin(); protected ExternalUninstallAnnotationPlugin() { super(ExternalUninstalls.class); } protected List getExistingInstallMetaData(BeanMetaData beanMetaData) { List list = beanMetaData.getUninstalls(); if (list == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); list = new ArrayList(); abmd.setUninstalls(list); } return list; } protected ExternalInstall[] getExternalInstalls(ExternalUninstalls annotation) { return annotation.value(); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CollectionValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000434511014545271033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData; import org.jboss.beans.metadata.api.annotations.CollectionValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Collection value annotation plugin. * * @author Ales Justin */ public class CollectionValueAnnotationPlugin extends CollectionsAnnotationPlugin { public static final CollectionValueAnnotationPlugin INSTANCE = new CollectionValueAnnotationPlugin(); protected CollectionValueAnnotationPlugin() { super(CollectionValue.class); } public ValueMetaData createValueMetaData(CollectionValue annotation) { AbstractCollectionMetaData collection = new AbstractCollectionMetaData(); if (isAttributePresent(annotation.clazz())) collection.setType(annotation.clazz().getName()); if (isAttributePresent(annotation.elementClass())) collection.setElementType(annotation.elementClass().getName()); for(Value value : annotation.value()) collection.add(createValueMetaData(value)); return collection; } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ArrayValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000421711014545271033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractArrayMetaData; import org.jboss.beans.metadata.api.annotations.ArrayValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Array value annotation plugin. * * @author Ales Justin */ public class ArrayValueAnnotationPlugin extends CollectionsAnnotationPlugin { public static final ArrayValueAnnotationPlugin INSTANCE = new ArrayValueAnnotationPlugin(); protected ArrayValueAnnotationPlugin() { super(ArrayValue.class); } public ValueMetaData createValueMetaData(ArrayValue annotation) { AbstractArrayMetaData array = new AbstractArrayMetaData(); if (isAttributePresent(annotation.clazz())) array.setType(annotation.clazz().getName()); if (isAttributePresent(annotation.elementClass())) array.setElementType(annotation.elementClass().getName()); for(Value value : annotation.value()) array.add(createValueMetaData(value)); return array; } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/SupplysAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000545110777663234033422 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.Set; import java.util.HashSet; import java.util.List; import java.util.ArrayList; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.api.annotations.Supplys; import org.jboss.beans.metadata.api.annotations.Supply; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.ClassInfo; /** * Supplys annotation plugin. * * @author Ales Justin */ public class SupplysAnnotationPlugin extends ClassAnnotationPlugin { public static final SupplysAnnotationPlugin INSTANCE = new SupplysAnnotationPlugin(); protected SupplysAnnotationPlugin() { super(Supplys.class); } protected List internalApplyAnnotation(ClassInfo info, Supplys annotation, BeanMetaData beanMetaData) { Set supplies = beanMetaData.getSupplies(); if (supplies == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); supplies = new HashSet(); abmd.setSupplies(supplies); } List nodes = new ArrayList(); for(Supply supply : annotation.value()) { AbstractSupplyMetaData asmd = new AbstractSupplyMetaData(supply.value()); if (isAttributePresent(supply.type())) asmd.setType(supply.type().getName()); if (supplies.add(asmd)) nodes.add(asmd); } return nodes; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/PropertyInstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000372610777663234033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.dependency.spi.CallbackItem; /** * Property install annotation plugin. * * @author Ales Justin */ public class PropertyInstallCallbackAnnotationPlugin extends InstallCallbackAnnotationPlugin implements PropertyAware { public static final PropertyInstallCallbackAnnotationPlugin INSTANCE = new PropertyInstallCallbackAnnotationPlugin(); protected PropertyInstallCallbackAnnotationPlugin() { super(); } protected boolean isEqual(PropertyInfo info, CallbackItem ci) { // todo - param matching return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, PropertyInfo info) { callback.setPropertyInfo(info); } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/PropertyAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000354410770176053033412 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import org.jboss.beans.info.spi.PropertyInfo; /** * Abstract property annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class PropertyAnnotationPlugin extends InjectableMemberAnnotationPlugin implements PropertyAware, Annotation2ValueMetaDataAdapter { protected PropertyAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.METHOD == type || ElementType.PARAMETER == type; } protected String getName(PropertyInfo info) { return info.getName(); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CollectionsAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000352110674773017033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Abstract collactions value annotaion plugin. * * @param annotation type * @author Ales Justin */ public abstract class CollectionsAnnotationPlugin extends PropertyAnnotationPlugin { public CollectionsAnnotationPlugin(Class annotation) { super(annotation); } /** * Create ValueMetaData instance. * Helper method. * * @param value the value * @return new ValueMetaData instance */ protected ValueMetaData createValueMetaData(Value value) { return ValueUtil.createValueMetaData(value); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ListValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000417411014545271033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractListMetaData; import org.jboss.beans.metadata.api.annotations.ListValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.spi.ValueMetaData; /** * List value annotation plugin. * * @author Ales Justin */ public class ListValueAnnotationPlugin extends CollectionsAnnotationPlugin { public static final ListValueAnnotationPlugin INSTANCE = new ListValueAnnotationPlugin(); protected ListValueAnnotationPlugin() { super(ListValue.class); } public ValueMetaData createValueMetaData(ListValue annotation) { AbstractListMetaData list = new AbstractListMetaData(); if (isAttributePresent(annotation.clazz())) list.setType(annotation.clazz().getName()); if (isAttributePresent(annotation.elementClass())) list.setElementType(annotation.elementClass().getName()); for(Value value : annotation.value()) list.add(createValueMetaData(value)); return list; } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AnnotationPluginFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000273111301242575033401 0ustar twernertwerner/* * 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.kernel.plugins.annotations; /** * Filter annotation plugins. * * @author Ales Justin */ interface AnnotationPluginFilter { /** * Do we accept the plugin. * * @param plugin the current plugin * @return true if we match the plugin, false otherwise */ @SuppressWarnings("unchecked") boolean accept(MetaDataAnnotationPlugin plugin); } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InjectAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000322011014545271033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Inject value annotation plugin. * * @author Ales Justin */ public class InjectAnnotationPlugin extends PropertyAnnotationPlugin { public final static InjectAnnotationPlugin INSTANCE = new InjectAnnotationPlugin(); protected InjectAnnotationPlugin() { super(Inject.class); } public ValueMetaData createValueMetaData(Inject annotation) { return ValueUtil.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000755000175000017500000000000011620312165033371 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsPropertyInjectionAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000717711003122212033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.annotations.PropertyAnnotationPlugin; /** * Generic annotations injection metadata value creator. * * @author Ales Justin */ public class AnnotationsPropertyInjectionAnnotationPlugin extends PropertyAnnotationPlugin { @SuppressWarnings("unchecked") public AnnotationsPropertyInjectionAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isMetaDataComplete(PropertyMetaData pmd) { if (pmd == null) return false; ValueMetaData value = pmd.getValue(); Object underlyingValue = value.getUnderlyingValue(); return (underlyingValue instanceof AnnotationsMatcher == false); } protected PropertyMetaData getPropertyMetaData(PropertyInfo info, Annotation annotation, BeanMetaData beanMetaData) { PropertyMetaData pmd = findPropertyMetaData(info, beanMetaData); if (pmd != null) { ValueMetaData value = pmd.getValue(); Object underlyingValue = value.getUnderlyingValue(); if (underlyingValue instanceof AnnotationsMatcher == false) throw new IllegalArgumentException("Should not be here: " + toString()); AnnotationsMatcher am = (AnnotationsMatcher)underlyingValue; am.addAnnotation(annotation); } else { ValueMetaData value = createValueMetaData(annotation, null); pmd = new AbstractPropertyMetaData(getName(info), value); } return pmd; } public ValueMetaData createValueMetaData(Annotation annotation, ValueMetaData previousValue) { if (previousValue == null) return new AbstractDependencyValueMetaData(new AnnotationsMatcher(annotation)); Object underlyingValue = previousValue.getUnderlyingValue(); if (underlyingValue instanceof AnnotationsMatcher) { AnnotationsMatcher am = (AnnotationsMatcher)underlyingValue; am.addAnnotation(annotation); } else { log.info("Ignoring custom annotation, previous value is not AnnotationsMatcher: " + previousValue); } return previousValue; } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionValueMetaData.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000556011262376750033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitor; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.TypeInfo; /** * Web beans injection metadata value. * * @author Ales Justin */ public class WBInjectionValueMetaData extends AbstractValueMetaData { /** The serialVersionUID */ private static final long serialVersionUID = 1L; /** * The context */ protected transient KernelControllerContext context; private Class type; private Annotation[] annotations; public WBInjectionValueMetaData(Class type, Annotation[] annotations) { this.type = type; //Defensive copy this.annotations = new Annotation[annotations.length]; System.arraycopy(annotations, 0, this.annotations, 0, annotations.length); } public void initialVisit(MetaDataVisitor visitor) { context = visitor.getControllerContext(); visitor.addDependency(new WBInjectionDependencyItem(context.getName(), visitor.getContextState(), type, annotations)); type = null; // nullify it super.initialVisit(visitor); } @SuppressWarnings("deprecation") public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable { KernelController controller = context.getKernel().getController(); KernelControllerContext result = WBInjectionResolver.resolve(controller, info.getType(), annotations); if (result != null) return result.getTarget(); else throw new IllegalArgumentException("Should not be here, dependency not resolved: " + toString()); } }././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/CompositeKey.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001165111301242575033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; /** * Composite map key with weak part notion. * * @param exact weak part type * @param rest of the composite key * @author Ales Justin * @author Brian Stansberry */ public abstract class CompositeKey { private KeyRef weakPart; private U[] rest; protected CompositeKey(T weakPart, U[] rest) { if (weakPart == null) throw new IllegalArgumentException("Null weak part."); if (rest == null) throw new IllegalArgumentException("Null rest"); this.weakPart = new KeyRef(this, weakPart, getReferenceQueue()); this.rest = rest; } /** * Get the reference queue holding gced references. * * @return the reference queue */ protected abstract ReferenceQueue getReferenceQueue(); /** * Get hash code from weak ref. * If already null return zero. * * @param wr the weak reference * @return wr's value hash code */ @SuppressWarnings("unchecked") protected static int safeWeakHaskHode(WeakReference wr) { Object weak = wr.get(); return weak != null ? weak.hashCode() : 0; } /** * Get weak part hash code. * * @return the weak part hash code */ protected int getWeakPartHashCode() { return safeWeakHaskHode(weakPart); } /** * Get rest hash code. * * @return the rest hash code */ protected int getRestHashCode() { int hash = 0; for (U u : rest) hash += (3 * u.hashCode()); return hash; } public int hashCode() { return getWeakPartHashCode() + getRestHashCode(); } @SuppressWarnings("unchecked") public boolean equals(Object obj) { if (obj instanceof CompositeKey == false) return false; CompositeKey ck = (CompositeKey)obj; T wp = weakPart.get(); T otherWP = ck.weakPart.get(); if (wp == null || otherWP == null) { cleanKeyRefs(); return false; } else if (wp.equals(otherWP) == false) { return false; } if (rest.length != ck.rest.length) return false; for (U u : rest) { boolean match = false; for (U ou : ck.rest) { if (u.equals(ou)) { match = true; break; } } if (match == false) return false; } return true; } /** * Allows optimization; i.e. change to only poll the queue every X invocations. * * @return true if we should clean refs */ protected boolean shouldCleanKeyRefs() { return true; } /** * Poll the reference queue and clear the strong ref to Key from all * reference objects. This allows the Key to get removed from * WeakHashMap. */ @SuppressWarnings("unchecked") private void cleanKeyRefs() { ReferenceQueue queue = getReferenceQueue(); Reference ref; while ((ref = queue.poll()) != null) { ((KeyRef)ref).nullifyKey(); } } /** * KeyRef strong holder. */ private static class KeyRef extends WeakReference { private CompositeKey key; private KeyRef(CompositeKey key, T referent, ReferenceQueue q) { super(referent, q); this.key = key; } @SuppressWarnings("unused") public CompositeKey getKey() { return key; } public void nullifyKey() { this.key = null; } } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsAnnotationPluginFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000453511042111600033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import org.jboss.kernel.plugins.annotations.AnnotationPlugin; /** * Annotations plugin factory. * * @author Ales Justin */ public class AnnotationsAnnotationPluginFactory { /** * Create class plugin. * * @param clazz the annotation class * @return new annotations supply plugin */ @SuppressWarnings("unchecked") public static AnnotationPlugin createClassPlugin(Class clazz) { return new AnnotationsSupplyAnnotationPlugin(clazz); } /** * Create injection plugin. * * @param clazz the annotation class * @return new annotations injection plugin */ @SuppressWarnings("unchecked") public static AnnotationPlugin createPropertyInjectionPlugin(Class clazz) { return new AnnotationsPropertyInjectionAnnotationPlugin(clazz); } /** * Create injection plugin. * * @param clazz the annotation class * @return new annotations injection plugin */ @SuppressWarnings("unchecked") public static AnnotationPlugin createFieldInjectionPlugin(Class clazz) { return new AnnotationsFieldInjectionAnnotationPlugin(clazz); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsFieldInjectionAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000522711003122212033364 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.spi.PropertyMetaData; import org.jboss.kernel.plugins.annotations.FieldAnnotationPlugin; /** * Generic annotations injection metadata value creator. * * @author Ales Justin */ public class AnnotationsFieldInjectionAnnotationPlugin extends FieldAnnotationPlugin { @SuppressWarnings("unchecked") public AnnotationsFieldInjectionAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isMetaDataComplete(PropertyMetaData pmd) { if (pmd == null) return false; ValueMetaData value = pmd.getValue(); Object underlyingValue = value.getUnderlyingValue(); return (underlyingValue instanceof AnnotationsMatcher == false); } public ValueMetaData createValueMetaData(Annotation annotation, ValueMetaData previousValue) { if (previousValue == null) return new AbstractDependencyValueMetaData(new AnnotationsMatcher(annotation)); Object underlyingValue = previousValue.getUnderlyingValue(); if (underlyingValue instanceof AnnotationsMatcher) { AnnotationsMatcher am = (AnnotationsMatcher)underlyingValue; am.addAnnotation(annotation); } else { log.info("Ignoring custom annotation, previous value is not AnnotationsMatcher: " + previousValue); } return previousValue; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsSupply.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000362311003122212033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.io.Serializable; import java.lang.annotation.Annotation; import java.util.HashSet; import java.util.Set; /** * Annotation supply. * * @author Ales Justin */ public class AnnotationsSupply implements Serializable { private static final long serialVersionUID = 1l; private Set annotations = new HashSet(); public AnnotationsSupply(Annotation annotation) { addAnnotation(annotation); } /** * Add the annotation. * * @param annotation the annotation */ public void addAnnotation(Annotation annotation) { annotations.add(annotation); } /** * Get the annotations. * * @return the annotations */ public Set getAnnotations() { return annotations; } }././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000430311014545271033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.annotations.PropertyAnnotationPlugin; import org.jboss.reflect.spi.ParameterInfo; /** * Web beans kind of inject. * * @author Ales Justin */ public class WBInjectAnnotationPlugin extends PropertyAnnotationPlugin { public static final WBInjectAnnotationPlugin INSTANCE = new WBInjectAnnotationPlugin(); protected WBInjectAnnotationPlugin() { super(Inject.class); } @SuppressWarnings("deprecation") protected ValueMetaData createValueMetaData(PropertyInfo info, Inject inject) { return WBInjectionResolver.createValueMetaData(info.getType().getType(), info.getUnderlyingAnnotations()); } @SuppressWarnings("deprecation") public ValueMetaData createValueMetaData(ParameterInfo info, Inject inject, ValueMetaData previousValue) { return WBInjectionResolver.createValueMetaData(info.getParameterType().getType(), info.getUnderlyingAnnotations()); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/CacheKey.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000307311015242556033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import java.lang.ref.ReferenceQueue; /** * Contexts cache key. * * @author Ales Justin */ class CacheKey extends CompositeKey, Annotation> { private static final ReferenceQueue> queue = new ReferenceQueue>(); CacheKey(Class weakPart, Annotation[] rest) { super(weakPart, rest); } protected ReferenceQueue> getReferenceQueue() { return queue; } }././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionResolver.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001343611014562322033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.WeakHashMap; import java.util.List; import java.util.ArrayList; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.logging.Logger; import org.jboss.metadata.spi.MetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.metadata.api.annotations.Inject; /** * Web beans injection resolver. * * @author Ales Justin */ public class WBInjectionResolver { /** The log */ private static final Logger log = Logger.getLogger(WBInjectionResolver.class); /** The cache */ private static final Map> cache = new WeakHashMap>(); /** The excluded annotation */ private static final Set> excludedAnnotations = new HashSet>(); static { addExcludedAnnotation(Inject.class); // exclude jdk annotations addExcludedAnnotation(SuppressWarnings.class); addExcludedAnnotation(Deprecated.class); addExcludedAnnotation(Override.class); } /** * Create wb injection value. * * @param type the matching type * @param underlyingAnnotations underlying annotations * @return injection value metadata */ static ValueMetaData createValueMetaData(Class type, Annotation[] underlyingAnnotations) { List annotations = new ArrayList(); for (Annotation annotation : underlyingAnnotations) { if (excludedAnnotations.contains(annotation.annotationType()) == false) annotations.add(annotation); } return new WBInjectionValueMetaData(type, annotations.toArray(new Annotation[annotations.size()])); } /** * Add excluded annotations. * * @param annotationClass the excluded annotation's class. */ public static void addExcludedAnnotation(Class annotationClass) { excludedAnnotations.add(annotationClass); } /** * Find matching controller context. * * @param controller the kernel controller * @param type the matching type * @param annotations the filter annotations * @return single matching context or null if none or multiple */ public static KernelControllerContext resolve(KernelController controller, Class type, Annotation[] annotations) { if (controller == null) throw new IllegalArgumentException("Null controller"); if (type == null) throw new IllegalArgumentException("Null type"); if (annotations == null) annotations = new Annotation[]{}; Set contexts = controller.getContexts(type, ControllerState.INSTALLED); if (contexts != null && contexts.isEmpty() == false) { CacheKey key = new CacheKey(type, annotations); Map cachedResults = cache.get(key); if (cachedResults == null) { cachedResults = new WeakHashMap(); cache.put(key, cachedResults); } Set matchingContexts = new HashSet(); for(KernelControllerContext context : contexts) { Boolean match = cachedResults.get(context); if (match == null) { match = true; MetaData metaData = context.getScopeInfo().getMetaData(); for(Annotation annotation : annotations) { Annotation mdAnnotation = metaData.getAnnotation(annotation.annotationType()); if (mdAnnotation == null || annotation.equals(mdAnnotation) == false) { match = false; break; } } } if (match) matchingContexts.add(context); cachedResults.put(context, match); } int size = matchingContexts.size(); if (size == 0) return null; else if (size > 1) { if (log.isTraceEnabled()) log.trace("Too many matching contexts: " + matchingContexts); return null; } else return matchingContexts.iterator().next(); } else { return null; } } }././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsSupplyAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000730411003122212033362 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.SupplyMetaData; import org.jboss.kernel.plugins.annotations.ClassAnnotationPlugin; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.ClassInfo; /** * Generic annotations supply metadata value creator. * * @author Ales Justin */ public class AnnotationsSupplyAnnotationPlugin extends ClassAnnotationPlugin { @SuppressWarnings("unchecked") public AnnotationsSupplyAnnotationPlugin(Class annotation) { super(annotation); } /** * Find the annotations supply. * * @param supplies the supplies * @return matcher supply or null if not found */ protected AnnotationsSupply findAnnotationsSupply(Set supplies) { for(SupplyMetaData smd : supplies) { final Object supply = smd.getSupply(); if (supply instanceof AnnotationsSupply) { return (AnnotationsSupply) supply; } } return null; } protected List internalApplyAnnotation(ClassInfo info, MetaData retrieval, Annotation annotation, BeanMetaData beanMetaData) throws Throwable { Set supplies = beanMetaData.getSupplies(); if (supplies == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); supplies = new HashSet(); abmd.setSupplies(supplies); return applyAnnotationsSupply(annotation, supplies); } AnnotationsSupply as = findAnnotationsSupply(supplies); if (as == null) return applyAnnotationsSupply(annotation, supplies); else { as.addAnnotation(annotation); return null; } } /** * Apply annotations supply. * * @param annotation the annotation * @param supplies the supplies * @return new supply */ protected List applyAnnotationsSupply(Annotation annotation, Set supplies) { SupplyMetaData supply = new AbstractSupplyMetaData(new AnnotationsSupply(annotation)); supplies.add(supply); return Collections.singletonList(supply); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/AnnotationsMatcher.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000460311003122212033361 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.io.Serializable; import java.lang.annotation.Annotation; import java.util.HashSet; import java.util.Set; import org.jboss.kernel.api.dependency.ClassMatcher; /** * Annotations matcher. * * @author Ales Justin */ public class AnnotationsMatcher extends ClassMatcher implements Serializable { private static final long serialVersionUID = 1l; private Set annotations = new HashSet(); private int size; public AnnotationsMatcher(Annotation annotation) { super(AnnotationsSupply.class); addAnnotation(annotation); } /** * Add the annotation. * * @param annotation the annotation */ public void addAnnotation(Annotation annotation) { annotations.add(annotation); size = annotations.size(); } protected boolean matchByType(AnnotationsSupply other) { Set otherAnnotations = other.getAnnotations(); if (otherAnnotations.size() >= size) { otherAnnotations = new HashSet(otherAnnotations); otherAnnotations.retainAll(annotations); return (otherAnnotations.size() == size); } return false; } public boolean needExactMatch() { return true; } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectionDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000465611262376750033422 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import java.lang.annotation.Annotation; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.plugins.dependency.ClassDependencyItem; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Web beans injection dependency item. * * @author Ales Justin */ public class WBInjectionDependencyItem extends ClassDependencyItem { private Annotation[] annotations; public WBInjectionDependencyItem(Object name, ControllerState whenRequired, Class type, Annotation[] annotations) { super(name, type, whenRequired, ControllerState.INSTALLED); //Defensive copy this.annotations = new Annotation[annotations.length]; System.arraycopy(annotations, 0, this.annotations, 0, annotations.length); } public boolean resolve(Controller controller) { if (controller instanceof KernelController == false) throw new IllegalArgumentException("Can only handle kernel controller: " + controller); KernelController kernelController = (KernelController)controller; KernelControllerContext context = WBInjectionResolver.resolve(kernelController, getDemandClass(), annotations); setResolved(context != null); return isResolved(); } }././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/wb/WBInjectFieldAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000357611014545271033411 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations.wb; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.plugins.annotations.FieldAnnotationPlugin; import org.jboss.reflect.spi.FieldInfo; /** * Web beans kind of inject. * * @author Ales Justin */ public class WBInjectFieldAnnotationPlugin extends FieldAnnotationPlugin { public static final WBInjectFieldAnnotationPlugin INSTANCE = new WBInjectFieldAnnotationPlugin(); protected WBInjectFieldAnnotationPlugin() { super(Inject.class); } @SuppressWarnings("deprecation") protected ValueMetaData createValueMetaData(FieldInfo info, Inject inject) { return WBInjectionResolver.createValueMetaData(info.getType().getType(), info.getUnderlyingAnnotations()); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MapValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000443611014545271033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractMapMetaData; import org.jboss.beans.metadata.api.annotations.MapValue; import org.jboss.beans.metadata.api.annotations.EntryValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Map value annotation plugin. * * @author Ales Justin */ public class MapValueAnnotationPlugin extends CollectionsAnnotationPlugin { public static final MapValueAnnotationPlugin INSTANCE = new MapValueAnnotationPlugin(); protected MapValueAnnotationPlugin() { super(MapValue.class); } public ValueMetaData createValueMetaData(MapValue annotation) { AbstractMapMetaData map = new AbstractMapMetaData(); if (isAttributePresent(annotation.clazz())) map.setType(annotation.clazz().getName()); if (isAttributePresent(annotation.keyClass())) map.setKeyType(annotation.keyClass().getName()); if (isAttributePresent(annotation.valueClass())) map.setValueType(annotation.valueClass().getName()); for(EntryValue entry : annotation.value()) { map.put(createValueMetaData(entry.key()), createValueMetaData(entry.value())); } return map; } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InstallFieldCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000702510777663234033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.ElementType; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Install; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.InstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.reflect.spi.FieldInfo; /** * Install field callback annotation plugin. * * @author Ales Justin */ public class InstallFieldCallbackAnnotationPlugin extends CallbackAnnotationPlugin { public static final InstallFieldCallbackAnnotationPlugin INSTANCE = new InstallFieldCallbackAnnotationPlugin(); protected InstallFieldCallbackAnnotationPlugin() { super(Install.class); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.FIELD == type; } protected boolean isEqual(FieldInfo info, CallbackItem ci) { return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, FieldInfo info) { callback.setProperty(info.getName()); } protected Set> getCallbacks(DependencyInfo dependency) { return dependency.getInstallItems(); } protected AbstractCallbackMetaData createCallback(FieldInfo info, Install annotation) { InstallCallbackMetaData callback = new InstallCallbackMetaData(); callback.setState(new ControllerState(annotation.whenRequired())); callback.setDependentState(new ControllerState(annotation.dependentState())); if (isAttributePresent(annotation.cardinality())) callback.setCardinality(Cardinality.fromString(annotation.cardinality())); applyInfo(callback, info); return callback; } protected List getCallbacks(AbstractBeanMetaData beanMetaData) { List callbacks = beanMetaData.getInstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setInstallCallbacks(callbacks); } return callbacks; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ThisValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000332111014545271033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.ThisValueMetaData; import org.jboss.beans.metadata.api.annotations.ThisValue; import org.jboss.beans.metadata.spi.ValueMetaData; /** * This value annotation plugin. * * @author Ales Justin */ public class ThisValueAnnotationPlugin extends PropertyAnnotationPlugin { public static final ThisValueAnnotationPlugin INSTANCE = new ThisValueAnnotationPlugin(); protected ThisValueAnnotationPlugin() { super(ThisValue.class); } public ValueMetaData createValueMetaData(ThisValue annotation) { return new ThisValueMetaData(); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanMetaDataAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001324711262376750033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; /** * Basic bean metadata annotation handler. * * @author Ales Justin */ public class BasicBeanMetaDataAnnotationAdapter extends AbstractMetaDataAnnotationAdapter { public static final BasicBeanMetaDataAnnotationAdapter INSTANCE = new BasicBeanMetaDataAnnotationAdapter(); /** The parameter annotation adapters */ private Set> adapters; protected BasicBeanMetaDataAnnotationAdapter() { // -- adapters adapters = new CopyOnWriteArraySet>(); // class addAnnotationPlugin(BeanAnnotationPlugin.INSTANCE); addAnnotationPlugin(AliasMetaDataAnnotationPlugin.INSTANCE); addAnnotationPlugin(DemandsAnnotationPlugin.INSTANCE); addAnnotationPlugin(DependsAnnotationPlugin.INSTANCE); addAnnotationPlugin(SupplysAnnotationPlugin.INSTANCE); addAnnotationPlugin(new ClassFactoryAnnotationPlugin(adapters)); addAnnotationPlugin(ExternalInstallAnnotationPlugin.INSTANCE); addAnnotationPlugin(ExternalUninstallAnnotationPlugin.INSTANCE); // constructor addAnnotationPlugin(new ConstructorParameterAnnotationPlugin(adapters)); // property addAnnotationPlugin(InjectAnnotationPlugin.INSTANCE); addAnnotationPlugin(StringValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ValueFactoryAnnotationPlugin.INSTANCE); addAnnotationPlugin(ThisValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(NullValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(JavaBeanValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(CollectionValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ListValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(SetValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ArrayValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(MapValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(PropertyInstallCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(PropertyUninstallCallbackAnnotationPlugin.INSTANCE); // method addAnnotationPlugin(new FactoryMethodAnnotationPlugin(adapters)); addAnnotationPlugin(new CreateLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new StartLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new StopLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new DestroyLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(MethodInstallCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(MethodUninstallCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(new InstallMethodParameterAnnotationPlugin(adapters)); addAnnotationPlugin(new UninstallMethodParameterAnnotationPlugin(adapters)); // field addAnnotationPlugin(InjectFieldAnnotationPlugin.INSTANCE); addAnnotationPlugin(ValueFactoryFieldAnnotationPlugin.INSTANCE); addAnnotationPlugin(InstallFieldCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(UninstallFieldCallbackAnnotationPlugin.INSTANCE); } @SuppressWarnings("unchecked") public void addAnnotationPlugin(AnnotationPlugin plugin) { super.addAnnotationPlugin(plugin); if (plugin instanceof Annotation2ValueMetaDataAdapter) addAnnotation2ValueMetaDataAdapter((Annotation2ValueMetaDataAdapter)plugin); } @SuppressWarnings("unchecked") public void removeAnnotationPlugin(AnnotationPlugin plugin) { if (plugin instanceof Annotation2ValueMetaDataAdapter) removeAnnotation2ValueMetaDataAdapter((Annotation2ValueMetaDataAdapter)plugin); super.removeAnnotationPlugin(plugin); } /** * Add Annotation2ValueMetaDataAdapter adapter. * * @param adapter the Annotation2ValueMetaDataAdapter adapter */ public void addAnnotation2ValueMetaDataAdapter(Annotation2ValueMetaDataAdapter adapter) { if (adapter == null) throw new IllegalArgumentException("Null Annotation2ValueMetaDataAdapter"); adapters.add(adapter); } /** * Remove Annotation2ValueMetaDataAdapter adapter. * * @param adapter the Annotation2ValueMetaDataAdapter adapter */ public void removeAnnotation2ValueMetaDataAdapter(Annotation2ValueMetaDataAdapter adapter) { if (adapter != null) adapters.remove(adapter); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BeanAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000321110726773120033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.spi.MetaDataVisitor; /** * Annotations adapter contract. * * @author Ales Justin */ public interface BeanAnnotationAdapter { /** * Apply the annotations. * * @param visitor the visitor * @throws Throwable for any error */ void applyAnnotations(MetaDataVisitor visitor) throws Throwable; /** * Clean the annotations. * * @param visitor the visitor * @throws Throwable for any error */ void cleanAnnotations(MetaDataVisitor visitor) throws Throwable; } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ExternalInstallAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000454110777663234033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.List; import java.util.ArrayList; import org.jboss.beans.metadata.api.annotations.ExternalInstalls; import org.jboss.beans.metadata.api.annotations.ExternalInstall; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; /** * ExternalInstalls annotation plugin. * * @author Ales Justin */ public class ExternalInstallAnnotationPlugin extends ExternalInstallationAnnotationPlugin { public static final ExternalInstallAnnotationPlugin INSTANCE = new ExternalInstallAnnotationPlugin(); protected ExternalInstallAnnotationPlugin() { super(ExternalInstalls.class); } protected List getExistingInstallMetaData(BeanMetaData beanMetaData) { List list = beanMetaData.getInstalls(); if (list == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); list = new ArrayList(); abmd.setInstalls(list); } return list; } protected ExternalInstall[] getExternalInstalls(ExternalInstalls annotation) { return annotation.value(); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BeanAnnotationAdapterFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000610411007405034033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.security.AccessController; import java.security.PrivilegedAction; import org.jboss.logging.Logger; import org.jboss.reflect.plugins.introspection.ReflectionUtils; /** * BeanAnnotationAdapter factory. * * @author Ales Justin */ public class BeanAnnotationAdapterFactory { private static Logger log = Logger.getLogger(BeanAnnotationAdapterFactory.class); private static final BeanAnnotationAdapterFactory factory = new BeanAnnotationAdapterFactory(); private String adapterClassName; private BeanAnnotationAdapter adapter; private BeanAnnotationAdapterFactory() { } public static BeanAnnotationAdapterFactory getInstance() { return factory; } public void setAdapterClassName(String adapterClassName) { this.adapterClassName = adapterClassName; } /** * Get the BeanAnnotationAdapter instance. * @return the BeanAnnotationAdapter instance */ public BeanAnnotationAdapter getBeanAnnotationAdapter() { if (adapter == null) adapter = AccessController.doPrivileged(new AdapterLookup()); return adapter; } private class AdapterLookup implements PrivilegedAction { public BeanAnnotationAdapter run() { try { String adapterClass = System.getProperty("org.jboss.kernel.plugins.annotations.BeanAnnotationAdapter", adapterClassName); if (adapterClass != null) { if (log.isTraceEnabled()) log.trace("Instantiating bean annotation adapter: " + adapterClass); Object result = ReflectionUtils.newInstance(adapterClass); return BeanAnnotationAdapter.class.cast(result); } } catch (Throwable t) { log.warn("Exception while creating bean annotation adapter instance: " + t); } return BasicBeanAnnotationAdapter.INSTANCE; } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AliasesAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000642711032355267033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.Controller; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.ClassInfo; import org.jboss.util.StringPropertyReplacer; /** * Aliases annotation plugin. * * @author Ales Justin */ public class AliasesAnnotationPlugin extends ClassAnnotationPlugin { public static final AliasesAnnotationPlugin INSTANCE = new AliasesAnnotationPlugin(); protected AliasesAnnotationPlugin() { super(Aliases.class); } protected List internalApplyAnnotation(ClassInfo info, MetaData retrieval, Aliases annotation, KernelControllerContext context) throws Throwable { BeanMetaData beanMetaData = context.getBeanMetaData(); Set aliases = beanMetaData.getAliases(); Controller controller = context.getController(); for(String alias : annotation.value()) { // check for ${property} if (annotation.replace()) alias = StringPropertyReplacer.replaceProperties(alias); if (aliases == null || aliases.contains(alias) == false) { controller.addAlias(alias, beanMetaData.getName()); } } // no metadata added return null; } protected void internalCleanAnnotation(ClassInfo info, MetaData retrieval, Aliases annotation, KernelControllerContext context) throws Throwable { BeanMetaData beanMetaData = context.getBeanMetaData(); Set aliases = beanMetaData.getAliases(); Controller controller = context.getController(); for(String alias : annotation.value()) { // check for ${property} if (annotation.replace()) alias = StringPropertyReplacer.replaceProperties(alias); if (aliases == null || aliases.contains(alias) == false) { controller.removeAlias(alias); } } } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001434311262376750033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; /** * Basic bean annotation handler. * * @author Ales Justin */ public class BasicBeanAnnotationAdapter extends AbstractBeanAnnotationAdapter { public static final BasicBeanAnnotationAdapter INSTANCE = new BasicBeanAnnotationAdapter(); /** The parameter annotation adapters */ private Set> adapters; protected BasicBeanAnnotationAdapter() { // -- adapters adapters = new CopyOnWriteArraySet>(); // -- plugins // class addAnnotationPlugin(BeanAnnotationPlugin.INSTANCE); addAnnotationPlugin(AliasesAnnotationPlugin.INSTANCE); addAnnotationPlugin(DemandsAnnotationPlugin.INSTANCE); addAnnotationPlugin(DependsAnnotationPlugin.INSTANCE); addAnnotationPlugin(SupplysAnnotationPlugin.INSTANCE); addAnnotationPlugin(new ClassFactoryAnnotationPlugin(adapters)); addAnnotationPlugin(ExternalInstallAnnotationPlugin.INSTANCE); addAnnotationPlugin(ExternalUninstallAnnotationPlugin.INSTANCE); /* addAnnotationPlugin(new InjectConstructorValueAnnotationPlugin()); addAnnotationPlugin(new StringValueConstructorValueAnnotationPlugin()); addAnnotationPlugin(new ValueFactoryConstructorValueAnnotationPlugin()); addAnnotationPlugin(new CollectionConstructorValueAnnotationPlugin()); addAnnotationPlugin(new ListConstructorValueAnnotationPlugin()); addAnnotationPlugin(new SetConstructorValueAnnotationPlugin()); addAnnotationPlugin(new ArrayConstructorValueAnnotationPlugin()); addAnnotationPlugin(new MapConstructorValueAnnotationPlugin()); */ // constructor addAnnotationPlugin(new ConstructorParameterAnnotationPlugin(adapters)); // property addAnnotationPlugin(InjectAnnotationPlugin.INSTANCE); addAnnotationPlugin(StringValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ValueFactoryAnnotationPlugin.INSTANCE); addAnnotationPlugin(ThisValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(NullValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(JavaBeanValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(CollectionValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ListValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(SetValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(ArrayValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(MapValueAnnotationPlugin.INSTANCE); addAnnotationPlugin(PropertyInstallCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(PropertyUninstallCallbackAnnotationPlugin.INSTANCE); // method addAnnotationPlugin(new FactoryMethodAnnotationPlugin(adapters)); addAnnotationPlugin(new CreateLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new StartLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new StopLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new DestroyLifecycleAnnotationPlugin(adapters)); addAnnotationPlugin(new MethodInstallCallbackAnnotationPlugin()); addAnnotationPlugin(new MethodUninstallCallbackAnnotationPlugin()); addAnnotationPlugin(new InstallMethodParameterAnnotationPlugin(adapters)); addAnnotationPlugin(new UninstallMethodParameterAnnotationPlugin(adapters)); // field addAnnotationPlugin(InjectFieldAnnotationPlugin.INSTANCE); addAnnotationPlugin(ValueFactoryFieldAnnotationPlugin.INSTANCE); addAnnotationPlugin(InstallFieldCallbackAnnotationPlugin.INSTANCE); addAnnotationPlugin(UninstallFieldCallbackAnnotationPlugin.INSTANCE); } @SuppressWarnings("unchecked") public void addAnnotationPlugin(AnnotationPlugin plugin) { super.addAnnotationPlugin(plugin); if (plugin instanceof Annotation2ValueMetaDataAdapter) addAnnotation2ValueMetaDataAdapter((Annotation2ValueMetaDataAdapter)plugin); } @SuppressWarnings("unchecked") public void removeAnnotationPlugin(AnnotationPlugin plugin) { if (plugin instanceof Annotation2ValueMetaDataAdapter) removeAnnotation2ValueMetaDataAdapter((Annotation2ValueMetaDataAdapter)plugin); super.removeAnnotationPlugin(plugin); } /** * Add Annotation2ValueMetaDataAdapter adapter. * * @param adapter the Annotation2ValueMetaDataAdapter adapter */ public void addAnnotation2ValueMetaDataAdapter(Annotation2ValueMetaDataAdapter adapter) { if (adapter == null) throw new IllegalArgumentException("Null Annotation2ValueMetaDataAdapter"); adapters.add(adapter); } /** * Remove Annotation2ValueMetaDataAdapter adapter. * * @param adapter the Annotation2ValueMetaDataAdapter adapter */ public void removeAnnotation2ValueMetaDataAdapter(Annotation2ValueMetaDataAdapter adapter) { if (adapter != null) adapters.remove(adapter); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AliasMetaDataAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000465310777663234033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.List; import java.util.Set; import java.util.HashSet; import java.util.Arrays; import org.jboss.beans.metadata.api.annotations.Aliases; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.ClassInfo; /** * Aliases annotation plugin. * * @author Ales Justin */ public class AliasMetaDataAnnotationPlugin extends ClassAnnotationPlugin { public static final AliasMetaDataAnnotationPlugin INSTANCE = new AliasMetaDataAnnotationPlugin(); protected AliasMetaDataAnnotationPlugin() { super(Aliases.class); } protected List internalApplyAnnotation(ClassInfo info, Aliases annotation, BeanMetaData beanMetaData) throws Throwable { String[] strings = annotation.value(); if (strings != null && strings.length > 0) { Set aliases = beanMetaData.getAliases(); if (aliases == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); aliases = new HashSet(); abmd.setAliases(aliases); } aliases.addAll(Arrays.asList(strings)); } return null; } }././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/JavaBeanValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000544011014545271033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.security.AccessController; import java.security.PrivilegedAction; import org.jboss.beans.metadata.plugins.AbstractValueMetaData; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.config.plugins.property.PropertyConfiguration; import org.jboss.config.spi.Configuration; /** * JavaBean value annotation plugin. * * @author Ales Justin */ public class JavaBeanValueAnnotationPlugin extends PropertyAnnotationPlugin { public static final JavaBeanValueAnnotationPlugin INSTANCE = new JavaBeanValueAnnotationPlugin(); /** The configuration */ private static Configuration configuration; static { // get Configuration instance configuration = AccessController.doPrivileged(new PrivilegedAction() { public Configuration run() { return new PropertyConfiguration(); } }); } protected JavaBeanValueAnnotationPlugin() { super(JavaBeanValue.class); } public ValueMetaData createValueMetaData(JavaBeanValue annotation) { Class className = annotation.value(); if (isAttributePresent(className) == false) throw new IllegalArgumentException("Javabean class must be set: " + annotation); try { BeanInfo beanInfo = configuration.getBeanInfo(className.getName(), null); return new AbstractValueMetaData(beanInfo.newInstance()); } catch (Throwable t) { throw new IllegalArgumentException("Exception while creating javabean: " + t); } } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/CommonAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000003663711216404370033413 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.beans.metadata.api.annotations.MCAnnotations; import org.jboss.logging.Logger; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.signature.ConstructorSignature; import org.jboss.metadata.spi.signature.DeclaredMethodSignature; import org.jboss.metadata.spi.signature.FieldSignature; import org.jboss.metadata.spi.signature.Signature; import org.jboss.reflect.spi.AnnotatedInfo; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ConstructorInfo; import org.jboss.reflect.spi.FieldInfo; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.reflect.spi.TypeInfoFactory; /** * Common bean annotation handler. * * @param exact annotation plugin type * @param exact handle type * @author Ales Justin */ public abstract class CommonAnnotationAdapter, U> { /** The log */ protected Logger log = Logger.getLogger(getClass()); /** The annotation plugins */ private final Map> pluginsMap = new HashMap>(); /** The property annotation plugin filter */ private static final AnnotationPluginFilter PROPERTY_FILTER = new PropertyAnnotationPluginFilter(); /** The method annotation plugin filter */ private static final AnnotationPluginFilter METHOD_FILTER = new MethodAnnotationPluginFilter(); /** * Add the annotation plugin. * Breaks down the plugin usage into * different ElementType support collections. * * @param plugin the annotation plugin */ public void addAnnotationPlugin(T plugin) { if (plugin == null) throw new IllegalArgumentException("Null plugin."); Class annotation = plugin.getAnnotation(); if (annotation == null) throw new IllegalArgumentException("Null annotation class: " + plugin); if (annotation.getAnnotation(Target.class) == null) log.warn("Annotation " + annotation + " missing @Target annotation!"); if (annotation.getAnnotation(Retention.class) == null) log.warn("Annotation " + annotation + " missing @Retention annotation!"); Set supported = plugin.getSupportedTypes(); if (supported == null || supported.isEmpty()) throw new IllegalArgumentException("Null or empty support types: " + plugin); synchronized (pluginsMap) { for (ElementType type : supported) { Set plugins = pluginsMap.get(type); if (plugins == null) { plugins = new HashSet(); pluginsMap.put(type, plugins); } plugins.add(plugin); } } } /** * Remove the plugin. * * @param plugin the annotation plugin */ public void removeAnnotationPlugin(T plugin) { if (plugin == null) return; Set supported = plugin.getSupportedTypes(); if (supported == null || supported.isEmpty()) throw new IllegalArgumentException("Null or empty support types: " + plugin); synchronized (pluginsMap) { for (ElementType type : supported) { Set plugins = pluginsMap.get(type); if (plugins != null) { plugins.remove(plugin); if (plugins.isEmpty()) pluginsMap.remove(type); } } } } /** * Apply plugin. * * @param plugin the plugin * @param info the bean info * @param retrieval the metadata * @param handle the handle * @throws Throwable for any error */ protected abstract void applyPlugin(T plugin, AnnotatedInfo info, MetaData retrieval, U handle) throws Throwable; /** * Clean plugin. * * @param plugin the plugin * @param info the bean info * @param retrieval the metadata * @param handle the handle * @throws Throwable for any error */ protected abstract void cleanPlugin(T plugin, AnnotatedInfo info, MetaData retrieval, U handle) throws Throwable; /** * Get the name from handle. * * @param handle the handle * @return handle's name */ protected abstract Object getName(U handle); /** * Get plugins. * * @param type the element type to match * @param filter possible plugins filter * @param annotationClasses possible annotations * @return iterable matching plugins */ protected Iterable getPlugins(ElementType type, AnnotationPluginFilter filter, Collection> annotationClasses) { Set plugins; synchronized (pluginsMap) { plugins = pluginsMap.get(type); } if (plugins == null || plugins.isEmpty()) return Collections.emptySet(); if (filter != null) { List result = new ArrayList(); for (T plugin : plugins) { if (filter.accept(plugin) && (annotationClasses == null || annotationClasses.contains(plugin.getAnnotation()))) { result.add(plugin); } } return result; } else if (annotationClasses != null) { List result = new ArrayList(); for (T plugin : plugins) { if (annotationClasses.contains(plugin.getAnnotation())) { result.add(plugin); } } return result; } else { return plugins; } } /** * Handle apply or cleanup of annotations. * * @param info the bean info * @param retrieval the metadata * @param handle the handle to use in a plugin * @param isApplyPhase is this apply phase * @throws Throwable for any error */ protected void handleAnnotations(BeanInfo info, MetaData retrieval, U handle, boolean isApplyPhase) throws Throwable { if (info == null) throw new IllegalArgumentException("Null bean info."); if (retrieval == null) throw new IllegalArgumentException("Null metadata."); if (handle == null) throw new IllegalArgumentException("Null handle."); boolean trace = log.isTraceEnabled(); if (trace) log.trace(getName(handle) + " apply annotations"); // limit the annotations MCAnnotations annotations = retrieval.getAnnotation(MCAnnotations.class); if (annotations != null && (annotations.ignore() || annotations.value().length == 0)) { if (trace) log.trace("Ignoring annotations lookup: " + annotations); return; } Collection> annotationClasses = (annotations != null ? Arrays.asList(annotations.value()) : null); // class ClassInfo classInfo = info.getClassInfo(); for(T plugin : getPlugins(ElementType.TYPE, null, annotationClasses)) { if (isApplyPhase) applyPlugin(plugin, classInfo, retrieval, handle); else cleanPlugin(plugin, classInfo, retrieval, handle); } // constructors Set constructors = info.getConstructors(); if (constructors != null && constructors.isEmpty() == false) { for(ConstructorInfo ci : constructors) { Signature cis = new ConstructorSignature(ci); MetaData cmdr = retrieval.getComponentMetaData(cis); if (cmdr != null) { for(T plugin : getPlugins(ElementType.CONSTRUCTOR, null, annotationClasses)) { if (isApplyPhase) applyPlugin(plugin, ci, cmdr, handle); else cleanPlugin(plugin, ci, cmdr, handle); } } else if (trace) log.trace("No annotations for " + ci); } } else if (trace) log.trace("No constructors"); // properties Set visitedMethods = new HashSet(); Set properties = info.getProperties(); if (properties != null && properties.isEmpty() == false) { for(PropertyInfo pi : properties) { FieldInfo field = pi.getFieldInfo(); if (field != null) { Signature sis = new FieldSignature(field); MetaData cmdr = retrieval.getComponentMetaData(sis); if (cmdr != null) { for(T plugin : getPlugins(ElementType.FIELD, null, annotationClasses)) { if (isApplyPhase) applyPlugin(plugin, field, cmdr, handle); else cleanPlugin(plugin, field, cmdr, handle); } } else if (trace) log.trace("No annotations for field " + field.getName()); } // apply setter and getter as well - if they exist handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getSetter(), "setter", annotationClasses); handleMethod(retrieval, handle, isApplyPhase, trace, visitedMethods, pi, pi.getGetter(), "getter", annotationClasses); } } else if (trace) log.trace("No properties"); // get Object's class info - it's cached so it shouldn't take much TypeInfoFactory tif = classInfo.getTypeInfoFactory(); TypeInfo objectTI = tif.getTypeInfo(Object.class); // method plugins Iterable methodPlugins = null; // methods Set methods = info.getMethods(); if (methods != null && methods.isEmpty() == false) { for(MethodInfo mi : methods) { ClassInfo declaringCI = mi.getDeclaringClass(); // direct == check is OK if (declaringCI != objectTI && visitedMethods.contains(mi) == false) { Signature mis = new DeclaredMethodSignature(mi); MetaData cmdr = retrieval.getComponentMetaData(mis); if (cmdr != null) { if (methodPlugins == null) methodPlugins = getPlugins(ElementType.METHOD, METHOD_FILTER, annotationClasses); for(T plugin : methodPlugins) { if (isApplyPhase) applyPlugin(plugin, mi, cmdr, handle); else cleanPlugin(plugin, mi, cmdr, handle); } } else if (trace) log.trace("No annotations for " + mi); } } } else if (trace) log.trace("No methods"); // static methods MethodInfo[] staticMethods = getStaticMethods(classInfo); if (staticMethods != null && staticMethods.length != 0) { for(MethodInfo smi : staticMethods) { if (smi.isStatic() && smi.isPublic()) { Signature mis = new DeclaredMethodSignature(smi); MetaData cmdr = retrieval.getComponentMetaData(mis); if (cmdr != null) { if (methodPlugins == null) methodPlugins = getPlugins(ElementType.METHOD, METHOD_FILTER, annotationClasses); for(T plugin : methodPlugins) { if (isApplyPhase) applyPlugin(plugin, smi, cmdr, handle); else cleanPlugin(plugin, smi, cmdr, handle); } } else if (trace) log.trace("No annotations for " + smi); } } } else if (trace) log.trace("No static methods"); // fields - if accessible - are already handled with propertys } /** * Handle setter or getter on property. * * @param retrieval the metadata * @param handle the handle * @param isApplyPhase is apply phase * @param trace is trace enabled * @param visitedMethods visited methods * @param pi the property info * @param method the method info * @param type method type * @param annotationClasses the possible annotation classes * @throws Throwable for any error */ protected void handleMethod( MetaData retrieval, U handle, boolean isApplyPhase, boolean trace, Set visitedMethods, PropertyInfo pi, MethodInfo method, String type, Collection> annotationClasses) throws Throwable { if (method == null) return; visitedMethods.add(method); Signature sis = new DeclaredMethodSignature(method); MetaData cmdr = retrieval.getComponentMetaData(sis); if (cmdr != null) { for(T plugin : getPlugins(ElementType.METHOD, PROPERTY_FILTER, annotationClasses)) { if (isApplyPhase) applyPlugin(plugin, pi, cmdr, handle); else cleanPlugin(plugin, pi, cmdr, handle); } } else if (trace) log.trace("No annotations for " + type + ": " + pi.getName()); } /** * Get the static methods of class info. * * @param classInfo the class info * @return the static methods */ protected MethodInfo[] getStaticMethods(ClassInfo classInfo) { return classInfo.getDeclaredMethods(); } }././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InstallationParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001104311006203730033365 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.List; import java.util.Collections; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.reflect.spi.MethodInfo; import org.jboss.reflect.spi.ParameterInfo; import org.jboss.reflect.spi.TypeInfo; import org.jboss.kernel.plugins.config.Configurator; /** * Abstract installation annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class InstallationParameterAnnotationPlugin extends AbstractMethodParameterAnnotationPlugin { protected InstallationParameterAnnotationPlugin(Class annotation, Set> adapters) { super(annotation, adapters); } protected boolean checkAnnotatedInfo(ElementType type) { return ElementType.METHOD == type; } protected boolean isMetaDataAlreadyPresent(MethodInfo info, C annotation, BeanMetaData beanMetaData) { List installs = getInstalls(beanMetaData); if (installs != null && installs.isEmpty() == false) { for(InstallMetaData install : installs) { // cannot compare when bean is set if (install.getBean() != null) continue; if (install.getMethodName().equals(info.getName())) { List parameters = install.getParameters(); ParameterInfo[] parameterInfos = info.getParameters(); if (parameters == null && parameterInfos != null && parameterInfos.length == 0) return true; if (parameters != null && parameters.size() == 0 && parameterInfos == null) return true; if (parameters != null && parameterInfos != null && parameters.size() == parameterInfos.length) { int n = parameters.size(); String[] typeNames = new String[n]; TypeInfo[] typeInfos = new TypeInfo[n]; for(int i = 0; i < n; i++) { typeNames[i] = parameters.get(i).getType(); typeInfos[i] = parameterInfos[i].getParameterType(); } return Configurator.equals(typeNames, typeInfos); } } } } return false; } /** * Get the list of InstallMetaData from bean metadata. * * @param beanMetaData the bean metadata * @return list of InstallMetaData */ protected abstract List getInstalls(BeanMetaData beanMetaData); protected ParameterInfo[] getParameters(MethodInfo info) { return info.getParameters(); } protected List handleParameterlessInfo(MethodInfo info, C annotation, BeanMetaData beanMetaData) { AbstractInstallMetaData parametrizedMetaData = createParametrizedMetaData(info, annotation); setParameterizedMetaData(parametrizedMetaData, beanMetaData); return Collections.singletonList(parametrizedMetaData); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ValueUtil.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000002326611147522315033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.ArrayList; import java.util.List; import org.jboss.beans.metadata.api.annotations.Inject; import org.jboss.beans.metadata.api.annotations.JavaBeanValue; import org.jboss.beans.metadata.api.annotations.NullValue; import org.jboss.beans.metadata.api.annotations.Parameter; import org.jboss.beans.metadata.api.annotations.Search; import org.jboss.beans.metadata.api.annotations.StringValue; import org.jboss.beans.metadata.api.annotations.ThisValue; import org.jboss.beans.metadata.api.annotations.Value; import org.jboss.beans.metadata.api.annotations.ValueFactory; import org.jboss.beans.metadata.api.model.FromContext; import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData; import org.jboss.beans.metadata.plugins.AbstractParameterMetaData; import org.jboss.beans.metadata.plugins.AbstractSearchValueMetaData; import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.SearchInfo; /** * Simple util class. * * @author Ales Justin */ final class ValueUtil { /** * Does value already exist. * * @param value the value to check */ private static void checkValueMetaData(ValueMetaData value) { if (value != null) throw new IllegalArgumentException("@Value/@Parameter annotation has too many values set!"); } /** * Is attribute present. * * @param value the attribute value * @return true if not null and not-empty */ static boolean isAttributePresent(String value) { return value != null && value.length() > 0; } /** * Is attribute present. * * @param value the attribute value * @return true if not void.class */ static boolean isAttributePresent(Class value) { return value != null && (void.class.equals(value) == false); } /** * Create value meta data from @Value annotation. * * @param value the @Value annotation * @return new ValueMetaData instance */ static ValueMetaData createValueMetaData(Value value) { ValueMetaData vmd = null; StringValue string = value.string(); if (isAttributePresent(string.value())) { vmd = StringValueAnnotationPlugin.INSTANCE.createValueMetaData(string); } Inject inject = value.inject(); if (inject.valid()) { checkValueMetaData(vmd); vmd = InjectAnnotationPlugin.INSTANCE.createValueMetaData(inject); } ValueFactory vf = value.valueFactory(); if (isAttributePresent(vf.bean())) { checkValueMetaData(vmd); vmd = ValueFactoryAnnotationPlugin.INSTANCE.createValueMetaData(vf); } ThisValue thisValue = value.thisValue(); if (thisValue.valid()) { checkValueMetaData(vmd); vmd = ThisValueAnnotationPlugin.INSTANCE.createValueMetaData(thisValue); } NullValue nullValue = value.nullValue(); if (nullValue.valid()) { checkValueMetaData(vmd); vmd = NullValueAnnotationPlugin.INSTANCE.createValueMetaData(nullValue); } JavaBeanValue javabean = value.javabean(); if (isAttributePresent(javabean.value())) { checkValueMetaData(vmd); vmd = JavaBeanValueAnnotationPlugin.INSTANCE.createValueMetaData(javabean); } if (vmd == null) throw new IllegalArgumentException("No value set on @Value annotation!"); return vmd; } /** * Create value meta data from @Parameter annotation. * * @param parameter the @Parameter annotation * @return new ValueMetaData instance */ static ValueMetaData createValueMetaData(Parameter parameter) { ValueMetaData vmd = null; StringValue string = parameter.string(); if (isAttributePresent(string.value())) { vmd = StringValueAnnotationPlugin.INSTANCE.createValueMetaData(string); } Inject inject = parameter.inject(); if (inject.valid()) { checkValueMetaData(vmd); vmd = InjectAnnotationPlugin.INSTANCE.createValueMetaData(inject); } ThisValue thisValue = parameter.thisValue(); if (thisValue.valid()) { checkValueMetaData(vmd); vmd = ThisValueAnnotationPlugin.INSTANCE.createValueMetaData(thisValue); } NullValue nullValue = parameter.nullValue(); if (nullValue.valid()) { checkValueMetaData(vmd); vmd = NullValueAnnotationPlugin.INSTANCE.createValueMetaData(nullValue); } JavaBeanValue javabean = parameter.javabean(); if (isAttributePresent(javabean.value())) { checkValueMetaData(vmd); vmd = JavaBeanValueAnnotationPlugin.INSTANCE.createValueMetaData(javabean); } if (vmd == null) throw new IllegalArgumentException("No value set on @Value annotation!"); return vmd; } /** * Create injection value meta data. * * @param annotation the annotation * @return injection value meta data */ static ValueMetaData createValueMetaData(Inject annotation) { AbstractInjectionValueMetaData injection = new AbstractInjectionValueMetaData(); if (isAttributePresent(annotation.bean())) injection.setValue(annotation.bean()); if (isAttributePresent(annotation.property())) injection.setProperty(annotation.property()); if (isAttributePresent(annotation.dependentState())) injection.setDependentState(new ControllerState(annotation.dependentState())); if (isAttributePresent(annotation.whenRequired())) injection.setWhenRequiredState(new ControllerState(annotation.whenRequired())); if (isAttributePresent(annotation.search())) injection.setSearch(org.jboss.dependency.plugins.graph.Search.getInstance(annotation.search())); injection.setInjectionOption(annotation.option()); injection.setInjectionType(annotation.type()); if (FromContext.NOOP.equals(annotation.fromContext()) == false) injection.setFromContext(annotation.fromContext()); return injection; } /** * Create value factory value meta data. * * @param annotation the annotation * @return value factory meta data */ static ValueMetaData createValueMetaData(ValueFactory annotation) { AbstractValueFactoryMetaData factory = new AbstractValueFactoryMetaData(annotation.bean(), annotation.method()); if (isAttributePresent(annotation.defaultValue())) factory.setDefaultValue(annotation.defaultValue()); List parameters = new ArrayList(); if (isAttributePresent(annotation.parameter())) parameters.add(new AbstractParameterMetaData(String.class.getName(), annotation.parameter())); if (annotation.parameters().length > 0) { if (parameters.size() > 0) throw new IllegalArgumentException("Cannot set both parameter and parameters!"); for(Parameter parameter : annotation.parameters()) { AbstractParameterMetaData apmd = new AbstractParameterMetaData(createValueMetaData(parameter)); if (isAttributePresent(parameter.type())) apmd.setType(parameter.type().getName()); parameters.add(apmd); } } factory.setParameters(parameters); factory.setDependentState(new ControllerState(annotation.dependantState())); factory.setWhenRequiredState(new ControllerState(annotation.whenRequiredState())); return factory; } /** * Create search value meta data. * * @param annotation the annotation * @return search meta data */ @SuppressWarnings("deprecation") static ValueMetaData createValueMetaData(Search annotation) { String searchType = annotation.type(); SearchInfo type = org.jboss.dependency.plugins.graph.Search.getInstance(searchType); ControllerState state = null; if (isAttributePresent(annotation.dependentState())) state = new ControllerState(annotation.dependentState()); String property = null; if (isAttributePresent(annotation.property())) property = annotation.property(); return new AbstractSearchValueMetaData( annotation.bean(), state, type, property ); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ValueFactoryConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000325410674773017033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.api.annotations.ValueFactory; import org.jboss.beans.metadata.spi.ValueMetaData; /** * Value factory constructor annotation plugin. * * @author Ales Justin */ public class ValueFactoryConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin { protected ValueFactoryConstructorValueAnnotationPlugin() { super(ValueFactory.class); } public ValueMetaData createValueMetaData(ValueFactory annotation) { return ValueFactoryAnnotationPlugin.INSTANCE.createValueMetaData(annotation); } } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/DemandsAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000565210777663234033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Demand; import org.jboss.beans.metadata.api.annotations.Demands; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractDemandMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.DemandMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.dependency.spi.ControllerState; import org.jboss.reflect.spi.ClassInfo; /** * Demands annotation plugin. * * @author Ales Justin */ public class DemandsAnnotationPlugin extends ClassAnnotationPlugin { public static final DemandsAnnotationPlugin INSTANCE = new DemandsAnnotationPlugin(); protected DemandsAnnotationPlugin() { super(Demands.class); } protected List internalApplyAnnotation(ClassInfo info, Demands annotation, BeanMetaData beanMetaData) { Set demands = beanMetaData.getDemands(); if (demands == null) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); demands = new HashSet(); abmd.setDemands(demands); } List nodes = new ArrayList(); for(Demand demand : annotation.value()) { AbstractDemandMetaData admd = new AbstractDemandMetaData(demand.value()); admd.setWhenRequired(new ControllerState(demand.whenRequired())); if (isAttributePresent(demand.transformer())) admd.setTransformer(demand.transformer()); if (demands.add(admd)) nodes.add(admd); } return nodes; } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/InstallMethodParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000610211014545271033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.List; import java.util.ArrayList; import java.util.Set; import org.jboss.beans.metadata.plugins.AbstractInstallMetaData; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.api.annotations.InstallMethod; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.InstallMetaData; import org.jboss.reflect.spi.MethodInfo; import org.jboss.dependency.spi.ControllerState; /** * Install method annotation plugin. * * @author Ales Justin */ public class InstallMethodParameterAnnotationPlugin extends InstallationParameterAnnotationPlugin { public InstallMethodParameterAnnotationPlugin(Set> adapters) { super(InstallMethod.class, adapters); } protected List getInstalls(BeanMetaData beanMetaData) { return beanMetaData.getInstalls(); } protected AbstractInstallMetaData createParametrizedMetaData(MethodInfo info, InstallMethod annotation) { AbstractInstallMetaData install = new AbstractInstallMetaData(); install.setMethodName(info.getName()); if (isAttributePresent(annotation.whenRequired())) install.setState(new ControllerState(annotation.whenRequired())); if (isAttributePresent(annotation.dependantState())) install.setDependentState(new ControllerState(annotation.dependantState())); return install; } protected void setParameterizedMetaData(AbstractInstallMetaData parameterizedMetaData, BeanMetaData beanMetaData) { AbstractBeanMetaData abmd = checkIfNotAbstractBeanMetaDataSpecific(beanMetaData); List installs = beanMetaData.getInstalls(); if (installs == null) { installs = new ArrayList(); abmd.setInstalls(installs); } installs.add(parameterizedMetaData); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/UninstallFieldCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000706310777663234033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.ElementType; import java.util.ArrayList; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.api.annotations.Uninstall; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.beans.metadata.plugins.UninstallCallbackMetaData; import org.jboss.beans.metadata.spi.CallbackMetaData; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Cardinality; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.reflect.spi.FieldInfo; /** * Uninstall field callback annotation plugin. * * @author Ales Justin */ public class UninstallFieldCallbackAnnotationPlugin extends CallbackAnnotationPlugin { public static final UninstallFieldCallbackAnnotationPlugin INSTANCE = new UninstallFieldCallbackAnnotationPlugin(); protected UninstallFieldCallbackAnnotationPlugin() { super(Uninstall.class); } protected boolean isElementTypeSupported(ElementType type) { return ElementType.FIELD == type; } protected boolean isEqual(FieldInfo info, CallbackItem ci) { return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, FieldInfo info) { callback.setProperty(info.getName()); } protected Set> getCallbacks(DependencyInfo dependency) { return dependency.getUninstallItems(); } protected AbstractCallbackMetaData createCallback(FieldInfo info, Uninstall annotation) { UninstallCallbackMetaData callback = new UninstallCallbackMetaData(); callback.setState(new ControllerState(annotation.whenRequired())); callback.setDependentState(new ControllerState(annotation.dependentState())); if (isAttributePresent(annotation.cardinality())) callback.setCardinality(Cardinality.fromString(annotation.cardinality())); applyInfo(callback, info); return callback; } protected List getCallbacks(AbstractBeanMetaData beanMetaData) { List callbacks = beanMetaData.getUninstallCallbacks(); if (callbacks == null) { callbacks = new ArrayList(); beanMetaData.setUninstallCallbacks(callbacks); } return callbacks; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MethodInstallCallbackAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000364610777663234033426 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import org.jboss.beans.metadata.plugins.AbstractCallbackMetaData; import org.jboss.reflect.spi.MethodInfo; import org.jboss.dependency.spi.CallbackItem; /** * Method install annotation plugin. * * @author Ales Justin */ public class MethodInstallCallbackAnnotationPlugin extends InstallCallbackAnnotationPlugin { public static final MethodInstallCallbackAnnotationPlugin INSTANCE = new MethodInstallCallbackAnnotationPlugin(); protected MethodInstallCallbackAnnotationPlugin() { super(); } protected boolean isEqual(MethodInfo info, CallbackItem ci) { // todo - param matching return info.getName().equals(ci.getAttributeName()); } protected void applyInfo(AbstractCallbackMetaData callback, MethodInfo info) { callback.setMethodInfo(info); } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractAdaptersAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000355211003122212033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.reflect.spi.AnnotatedInfo; /** * Adapters holder annotation plugin. * * @param info type * @param annotation type * @author Ales Justin */ public abstract class AbstractAdaptersAnnotationPlugin extends AbstractAnnotationPlugin { protected Set> adapters; protected AbstractAdaptersAnnotationPlugin(Class annotation, Set> adapters) { super(annotation); if (adapters == null) throw new IllegalArgumentException("Null annotation adapters."); this.adapters = adapters; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/ConstructorValueAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000001050611014351526033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.List; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.MetaDataVisitorNode; import org.jboss.beans.metadata.spi.ValueMetaData; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.ParameterInfo; import org.jboss.reflect.spi.TypeInfo; /** * Constructor value annotation plugin. * * @param annotation type * @author Ales Justin */ public abstract class ConstructorValueAnnotationPlugin extends ClassAnnotationPlugin implements Annotation2ValueMetaDataAdapter { protected ConstructorValueAnnotationPlugin(Class annotation) { super(annotation); } protected boolean isMetaDataAlreadyPresent(ClassInfo info, C annotation, BeanMetaData beanMetaData) { return beanMetaData.getConstructor() != null; } protected List internalApplyAnnotation(ClassInfo info, MetaData retrieval, C annotation, KernelControllerContext context) throws Throwable { BeanMetaData bmd = context.getBeanMetaData(); AbstractBeanMetaData beanMetaData = checkIfNotAbstractBeanMetaDataSpecific(bmd); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setValue(createValueMetaData(annotation)); beanMetaData.setConstructor(constructor); // reset, if present beanMetaData.setBean(null); context.setBeanInfo(null); return Collections.singletonList(constructor); } public ValueMetaData createValueMetaData(ParameterInfo parameterInfo, C annotation, ValueMetaData previousValue) { return createValueMetaData(parameterInfo.getParameterType(), annotation, previousValue); } /** * Create value metadata. * * @param type the type info * @param annotation the annotation * @param previousValue the previous value * @return value metadata instance */ public ValueMetaData createValueMetaData(TypeInfo type, C annotation, ValueMetaData previousValue) { return createValueMetaData(type, annotation); } /** * Create value metadata. * * @param type the type info * @param annotation the annotation * @return value metadata instance */ public ValueMetaData createValueMetaData(TypeInfo type, C annotation) { return createValueMetaData(annotation, null); } /** * Create value metadata. * * @param annotation the annotation * @param previousValue the previous value * @return value metadata instance */ public ValueMetaData createValueMetaData(C annotation, ValueMetaData previousValue) { return createValueMetaData(annotation); } /** * Create the value metadata from annotation. * * @param annotation the annotation * @return new value metadata */ protected abstract ValueMetaData createValueMetaData(C annotation); } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/AbstractConstructorParameterAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000422311006203730033367 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.util.Set; import org.jboss.beans.metadata.plugins.builder.MutableParameterizedMetaData; import org.jboss.metadata.spi.signature.ConstructorParametersSignature; import org.jboss.metadata.spi.signature.Signature; import org.jboss.reflect.spi.ConstructorInfo; /** * Annotation plugin for handling annotations that take parameters in constructors. * * @param annotation type * @param

mutable parametrized type * @author Ales Justin */ public abstract class AbstractConstructorParameterAnnotationPlugin extends AbstractParameterAnnotationPlugin { protected AbstractConstructorParameterAnnotationPlugin(Class annotation, Set> adapters) { super(annotation, adapters); } protected Signature createParametersSignature(String name, String[] parameters, int index) { return new ConstructorParametersSignature(index, parameters); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotations/MetaDataAnnotationPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/annotation0000644000175000017500000000426211002141272033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.annotations; import java.lang.annotation.Annotation; import java.lang.annotation.ElementType; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.metadata.spi.MetaData; import org.jboss.reflect.spi.AnnotatedInfo; /** * Annotation plugin based on bean metadata. * * @param the annotated info * @param the annotation type * @author Ales Justin */ public interface MetaDataAnnotationPlugin { /** * Get the annotation class we are handling. * * @return annotation class */ Class getAnnotation(); /** * Get all supported types. * * @return set of supported types */ Set getSupportedTypes(); /** * Apply annotations to bean metadata. * * @param info the annotated info we are checking * @param retrieval the metadata retrieval * @param beanMetaData the bean metadata * @throws Throwable for any error */ void applyAnnotation(T info, MetaData retrieval, BeanMetaData beanMetaData) throws Throwable; } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/0000755000175000017500000000000011620312163032253 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JavassistLazyInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/Javas0000644000175000017500000001031411262376750033257 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.lazy; import java.lang.reflect.Method; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Set; import javassist.util.proxy.MethodFilter; import javassist.util.proxy.MethodHandler; import javassist.util.proxy.ProxyFactory; import javassist.util.proxy.ProxyObject; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.registry.KernelBus; /** * Javassist lazy initializer. * * @author Ales Justin */ public class JavassistLazyInitializer extends AbstractLazyInitializer { @SuppressWarnings("deprecation") public Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { KernelControllerContext context = getKernelControllerContext(kernel, bean); BeanMetaData bmd = context.getBeanMetaData(); KernelConfigurator configurator = kernel.getConfigurator(); ClassLoader cl = Configurator.getClassLoader(bmd); Class beanClass = getBeanClass(context, configurator, cl); ProxyFactory factory = new ProxyFactory(); factory.setFilter(FINALIZE_FILTER); if (exposeClass) { factory.setSuperclass(beanClass); } if (interfaces != null && interfaces.size() > 0) { factory.setInterfaces(getClasses(configurator, interfaces, cl)); } Class proxyClass = getProxyClass(factory); ProxyObject proxy = (ProxyObject)proxyClass.newInstance(); proxy.setHandler(new LazyHandler(bean, kernel.getBus(), beanClass)); return proxy; } protected Class getProxyClass(ProxyFactory factory) { SecurityManager sm = System.getSecurityManager(); if (sm == null) return factory.createClass(); else return AccessController.doPrivileged(new ClassCreator(factory)); } private static final MethodFilter FINALIZE_FILTER = new MethodFilter() { public boolean isHandled(Method m) { // skip finalize methods return !("finalize".equals(m.getName()) && m.getParameterTypes().length == 0); } }; /** * Lazy method handler. */ public class LazyHandler extends AbstractInvokeHandler implements MethodHandler { public LazyHandler(String bean, KernelBus bus, Class proxyClass) { super(bean, bus, proxyClass); } public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable { return executeInvoke(self, thisMethod, args); } } /** * Privileged class creator. */ protected static class ClassCreator implements PrivilegedAction> { private ProxyFactory factory; public ClassCreator(ProxyFactory factory) { this.factory = factory; } public Class run() { return factory.createClass(); } } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/AbstractLazyInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/Abstr0000644000175000017500000002335411202036647033266 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.lazy; import java.lang.reflect.Method; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.lazy.LazyInitializer; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.metadata.spi.MetaData; import org.jboss.util.JBossStringBuilder; /** * Abstract lazy initializer. * * @author Ales Justin */ public abstract class AbstractLazyInitializer implements LazyInitializer { /** * Abstract invoke handler. */ protected abstract class AbstractInvokeHandler { private String bean; private KernelBus bus; private Class proxyClass; private AtomicBoolean onDemandInitialized = new AtomicBoolean(false); protected AbstractInvokeHandler(String bean, KernelBus bus, Class proxyClass) { if (bean == null) throw new IllegalArgumentException("Null bean name."); this.bean = bean; if (bus == null) throw new IllegalArgumentException("Null Kernel bus."); this.bus = bus; this.proxyClass = proxyClass; } /** * Excute invoke. * * @param proxy the proxy * @param method the method * @param args the arguments * @return result * @throws Throwable for any error */ protected Object executeInvoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); if ("hashCode".equals(methodName)) return System.identityHashCode(proxy); if ("getClass".equalsIgnoreCase(methodName)) return proxyClass; if ("equals".equals(methodName)) return proxy == args[0]; if ("toString".equals(methodName)) return bean + "Proxy"; if (onDemandInitialized.getAndSet(true) == false) { Kernel kernel = bus.getKernel(); KernelController controller = kernel.getController(); ControllerContext context = controller.getContext(bean, null); if (context == null) throw new IllegalArgumentException("No such context: " + bean); if (ControllerState.INSTALLED.equals(context.getState()) == false) { ControllerMode mode = context.getMode(); if (ControllerMode.ON_DEMAND.equals(mode) || ControllerMode.MANUAL.equals(mode)) { controller.change(context, ControllerState.INSTALLED); } } if (ControllerState.INSTALLED.equals(context.getState()) == false) throw new IllegalArgumentException("Bean " + bean + " cannot be fully installed: " + context); } if (isGetter(method)) { return bus.get(bean, getLowerPropertyName(methodName)); } else if (isSetter(method)) { bus.set(bean, getLowerPropertyName(methodName), args[0]); return null; } else { int length = args != null ? args.length : 0; return bus.invoke(bean, methodName, args, new String[length]); } } } /** * Is getter. * * @param minfo method * @return true if metod is getter */ protected static boolean isGetter(Method minfo) { String name = minfo.getName(); Class returnType = minfo.getReturnType(); Class[] parameters = minfo.getParameterTypes(); if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is"))) { // isBoolean() is not a getter for java.lang.Boolean if (name.startsWith("is") && Boolean.TYPE.equals(returnType) == false) return false; if (parameters.length == 0 && Void.TYPE.equals(returnType) == false) return true; } return false; } /** * Is setter. * * @param minfo method * @return true if method is setter */ protected static boolean isSetter(Method minfo) { String name = minfo.getName(); Class returnType = minfo.getReturnType(); Class[] parameters = minfo.getParameterTypes(); if ((name.length() > 3 && name.startsWith("set"))) { if (parameters.length == 1 && Void.TYPE.equals(returnType)) return true; } return false; } /** * Get lower property name. * * @param name the name * @return lower case property name */ protected static String getLowerPropertyName(String name) { int start = name.startsWith("is") ? 2 : 3; name = name.substring(start); // If the second character is upper case then we don't make // the first character lower case if (name.length() > 1) { if (Character.isUpperCase(name.charAt(1))) return name; } JBossStringBuilder buffer = new JBossStringBuilder(name.length()); buffer.append(Character.toLowerCase(name.charAt(0))); if (name.length() > 1) buffer.append(name.substring(1)); return buffer.toString(); } /** * Get kernel controller context. * * @param kernel the kernel * @param bean bean name * @return kernel controller context * @throws IllegalArgumentException if context not found or not KernelControllerContext */ protected KernelControllerContext getKernelControllerContext(Kernel kernel, String bean) { Controller controller = kernel.getController(); ControllerContext context = controller.getContext(bean, null); if (context == null) throw new IllegalArgumentException("Should not be here, dependency failed, no such context: " + bean); if (context instanceof KernelControllerContext == false) throw new IllegalArgumentException("Context not KernelControllerContext: " + context); return KernelControllerContext.class.cast(context); } /** * Gte bean's class. * * @param context the kernel controller context * @param configurator the configurator * @param cl the classloader * @return bean's class * @throws Throwable for any error */ protected Class getBeanClass(KernelControllerContext context, KernelConfigurator configurator, ClassLoader cl) throws Throwable { BeanMetaData bmd = context.getBeanMetaData(); Class beanClass = null; String beanClassName = bmd.getBean(); if (beanClassName != null) beanClass = configurator.getClassInfo(beanClassName, cl).getType(); else if (context.getBeanInfo() != null) beanClass = context.getBeanInfo().getClassInfo().getType(); if (beanClass == null) throw new IllegalArgumentException("Not enough info to get bean class: " + context); return beanClass; } /** * Get bean info. * * @param kernel the kernel * @param bean the bean name * @return bean info instance * @deprecated not used any more */ @Deprecated protected BeanInfo getBeanInfo(Kernel kernel, String bean) { KernelControllerContext context = getKernelControllerContext(kernel, bean); return context.getBeanInfo(); } /** * Get classes from class names. * * @param configurator the configurator * @param classNames the class names * @param cl classloader * @return array of classes * @throws Throwable for any error */ @SuppressWarnings("deprecation") protected static Class[] getClasses(KernelConfigurator configurator, Set classNames, ClassLoader cl) throws Throwable { Class[] classes = new Class[classNames.size()]; int i = 0; for (String className : classNames) { classes[i] = configurator.getClassInfo(className, cl).getType(); } return classes; } public Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces, MetaData metaData) throws Throwable { return initializeProxy(kernel, bean, exposeClass, interfaces); } } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JDKLazyInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/lazy/JDKLa0000644000175000017500000000601411201770651033071 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.lazy; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.config.Configurator; import org.jboss.kernel.spi.config.KernelConfigurator; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.registry.KernelBus; /** * Java JDK lazy initializer. * * @author Ales Justin */ public class JDKLazyInitializer extends AbstractLazyInitializer { @SuppressWarnings("deprecation") public Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { if (exposeClass) throw new IllegalArgumentException("Cannot expose class via JDK LazyInitializer."); if (interfaces == null || interfaces.isEmpty()) throw new IllegalArgumentException("Null interfaces."); KernelControllerContext context = getKernelControllerContext(kernel, bean); BeanMetaData bmd = context.getBeanMetaData(); KernelConfigurator configurator = kernel.getConfigurator(); ClassLoader cl = Configurator.getClassLoader(bmd); Class beanClass = getBeanClass(context, configurator, cl); LazyHandler lazyHandler = new LazyHandler(bean, kernel.getBus(), beanClass); return Proxy.newProxyInstance(getClass().getClassLoader(), getClasses(configurator, interfaces, cl), lazyHandler); } /** * Lazy invocation handler. */ public class LazyHandler extends AbstractInvokeHandler implements InvocationHandler { public LazyHandler(String bean, KernelBus bus, Class proxyClass) { super(bean, bus, proxyClass); } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { return executeInvoke(proxy, method, args); } } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/AbstractKernelObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/AbstractKe0000644000175000017500000000336210701153725033254 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.event.AbstractEventEmitter; import org.jboss.kernel.spi.KernelObject; import org.jboss.logging.Logger; /** * Abstract Bootstrap of the kernel. * * @author Adrian Brock * @version $Revision: 65835 $ */ public abstract class AbstractKernelObject extends AbstractEventEmitter implements KernelObject { /** The log */ protected Logger log = Logger.getLogger(getClass()); /** The kernel */ protected Kernel kernel; public Kernel getKernel() { Kernel.checkAccess(); return kernel; } public void setKernel(Kernel kernel) throws Throwable { Kernel.checkConfigure(); this.kernel = kernel; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/0000755000175000017500000000000011620312163032415 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/AbstractEventManager.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/Abst0000644000175000017500000000551111014301412033223 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.event; import org.jboss.kernel.Kernel; import org.jboss.kernel.plugins.AbstractKernelObject; import org.jboss.kernel.spi.event.KernelEventEmitter; import org.jboss.kernel.spi.event.KernelEventFilter; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.registry.KernelRegistryEntry; /** * Abstract Event manager. * * @author Adrian Brock * @version $Revision: 73492 $ */ @SuppressWarnings("deprecation") public class AbstractEventManager extends AbstractKernelObject implements KernelEventManager { /** The registry */ protected org.jboss.kernel.spi.registry.KernelRegistry registry; /** * Create a new abstract kernel manager * * @throws Throwable for any error */ public AbstractEventManager() throws Throwable { } public void setKernel(Kernel kernel) throws Throwable { super.setKernel(kernel); registry = kernel.getRegistry(); } public void registerListener(Object name, KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { getEmitter(name).registerListener(listener, filter, handback); } public void unregisterListener(Object name, KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { getEmitter(name).unregisterListener(listener, filter, handback); } protected KernelEventEmitter getEmitter(Object name) throws Throwable { KernelRegistryEntry entry = registry.getEntry(name); Object object = entry.getTarget(); if (object == null || object instanceof KernelEventEmitter == false) throw new ClassCastException(name + " is not a " + KernelEventEmitter.class.getName()); return (KernelEventEmitter) object; } } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/pack0000644000175000017500000000152310150404616033261 0ustar twernertwerner

Kernel plugins, an abstract event implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/AbstractEvent.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/Abst0000644000175000017500000000537510367424640033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.event; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Abstract Event. * * @author Adrian Brock * @version $Revision: 40756 $ */ public class AbstractEvent extends JBossObject implements KernelEvent { /** The source */ protected Object source; /** The type */ protected String type; /** The sequence */ protected long sequence; /** The timestamp */ protected long timestamp; /** The context */ protected Object context; /** * Create a new abstract event * * @param source the source * @param type the type * @param sequence the sequeunce * @param timestamp the timestamp * @param context the context */ public AbstractEvent(Object source, String type, long sequence, long timestamp, Object context) { this.source = source; this.type = type; this.sequence = sequence; this.timestamp = timestamp; this.context = context; } public Object getContext() { return context; } public long getSequence() { return sequence; } public Object getSource() { return source; } public long getTimestamp() { return timestamp; } public String getType() { return type; } public void toString(JBossStringBuilder buffer) { buffer.append("source=").append(source); buffer.append(" type=").append(type); buffer.append(" seq=").append(sequence); buffer.append(" time=").append(timestamp); buffer.append(" context=").append(context); } public void toShortString(JBossStringBuilder buffer) { buffer.append(type); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/AbstractEventEmitter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/plugins/event/Abst0000644000175000017500000001672310756342051033252 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.plugins.event; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import org.jboss.kernel.spi.event.KernelEvent; import org.jboss.kernel.spi.event.KernelEventEmitter; import org.jboss.kernel.spi.event.KernelEventFilter; import org.jboss.kernel.spi.event.KernelEventListener; import org.jboss.logging.Logger; /** * Abstract Event emitter. * * @author Adrian Brock * @version $Revision: 69895 $ */ public class AbstractEventEmitter implements KernelEventEmitter { /** The log */ private static final Logger log = Logger.getLogger(AbstractEventEmitter.class); /** Used to represent a null parameter */ protected static final Object NULL = new Object(); /** Used to represent a null filter */ protected static final KernelEventFilter NULL_FILTER = new KernelEventFilter() { public boolean wantEvent(KernelEvent event, Object handback) { return false; } }; /** The registry Map>>*/ protected Map>> eventListenerRegistry = new ConcurrentHashMap>>(); /** The sequence number of this emitter */ private long emitterSequence = 0; /** * Do we have listeners * * @return true when there are listeners */ public boolean hasListeners() { return eventListenerRegistry.isEmpty() == false; } /** * Make a new event * * @param type the event type * @param context the context * @return the event */ public KernelEvent createEvent(String type, Object context) { return new AbstractEvent(this, type, nextEmitterSequence(), System.currentTimeMillis(), context); } public void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { KernelEventFilter filterObject = filter == null ? NULL_FILTER : filter; Object handbackObject = handback == null ? NULL : handback; synchronized (eventListenerRegistry) { Map> handbacks = eventListenerRegistry.get(filterObject); if (handbacks == null) { handbacks = new ConcurrentHashMap>(); eventListenerRegistry.put(filterObject, handbacks); } List listeners = handbacks.get(handbackObject); if (listeners == null) { listeners = new CopyOnWriteArrayList(); handbacks.put(handbackObject, listeners); } listeners.add(listener); if (log.isTraceEnabled()) log.trace("Registered listener: " + listener + " with filter=" + filter + " handback=" + handback + " on object " + this); } } public void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable { KernelEventFilter filterObject = filter == null ? NULL_FILTER : filter; Object handbackObject = handback == null ? NULL : handback; synchronized (eventListenerRegistry) { Map> handbacks = eventListenerRegistry.get(filterObject); if (handbacks != null) { List listeners = handbacks.get(handbackObject); if (listeners != null && listeners.remove(listener)) { if (log.isTraceEnabled()) log.trace("Unregistered listener: " + listener + " with filter=" + filter + " handback=" + handback + " on object " + this); return; } } } throw new IllegalStateException("Listener not registered."); } public void fireKernelEvent(KernelEvent event) { if (log.isTraceEnabled()) log.trace("Firing event: " + event + " on object " + this); if (eventListenerRegistry.isEmpty() == false) { for (Iterator>>> i = eventListenerRegistry.entrySet().iterator(); i.hasNext();) { Map.Entry>> registryEntry = i.next(); Map> handbacks = registryEntry.getValue(); if (handbacks != null) { KernelEventFilter filter = null; Object filterObject = registryEntry.getKey(); if (filterObject != NULL_FILTER) filter = (KernelEventFilter) filterObject; for (Iterator>> j = handbacks.entrySet().iterator(); j.hasNext();) { Map.Entry> handbackEntry = j.next(); List listeners = handbackEntry.getValue(); if (listeners != null) { Object handback = handbackEntry.getKey(); if (handback == NULL) handback = null; for (ListIterator k = listeners.listIterator(); k.hasNext();) { KernelEventListener listener = k.next(); try { if (filter == null || filter.wantEvent(event, handback)) fireKernelEvent(listener, event, handback); } catch (Throwable t) { log.debug("Ignored unhandled throwable: ", t); } } } } } } } } /** * Fire a kernel event to a single listener * * @param listener the listener * @param event the event * @param handback the handback object */ protected void fireKernelEvent(KernelEventListener listener, KernelEvent event, Object handback) { listener.onEvent(event, handback); } /** * Get the next emitter sequence * * @return the next emitter sequence */ protected long nextEmitterSequence() { synchronized (eventListenerRegistry) { return emitterSequence++; } } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/KernelPermission.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/KernelPermission.j0000644000175000017500000001475111262376750033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel; import java.io.IOException; import java.io.ObjectInputStream; import java.security.BasicPermission; import java.security.Permission; import java.security.PermissionCollection; import java.util.Enumeration; import java.util.HashSet; import java.util.Iterator; /** * This permission represents "trust" in a signer or codebase. * * It contains a target name but no actions list. The targets are *
    *
  • access - access the kernel configuration *
  • configure - configure the kernel - implies access *
  • * - all *
* * @author adrian@jboss.com * @version $Revision: 94371 $ */ public class KernelPermission extends BasicPermission { /** For serialization */ private static final long serialVersionUID = 5661980843569388590L; /** Whether we have all names */ private transient boolean allNames; /** * Create a new Permission * * @param name the target * @throws IllegalArgumentException for invalid name * @throws NullPointerException for null name */ public KernelPermission(String name) { this(name, null); } /** * Create a new Permission * * @param name the target * @param actions the actions * @throws IllegalArgumentException for an invalid name or target * @throws NullPointerException for null name */ public KernelPermission(String name, String actions) { super(name, actions); init(name, actions); } /** * @return human readable string. */ public String toString() { StringBuffer buffer = new StringBuffer(100); buffer.append(getClass().getName()).append(":"); buffer.append(" name=").append(getName()); buffer.append(" actions=").append(getActions()); return buffer.toString(); } /** * Checks if this KernelPermission object "implies" the specified * permission. More specifically, this method returns true if: * p is an instance of KernelPermission, * p's target names are a subset of this object's target names * * The configure permission implies the access permission. * * @param p the permission * @return true when the permission is implied */ public boolean implies(Permission p) { if( (p instanceof KernelPermission) == false) return false; boolean implies = (allNames == true); if( implies == false ) { String n0 = getName(); String n1 = p.getName(); implies = n0.equals(n1); if( implies == false ) { // Check for a configure != access implies = (n0.equals("configure") && n1.equals("access")); } } return implies; } /** * Must override to handle the configure implies access relationship. * * @return the permission collection */ public PermissionCollection newPermissionCollection() { return new KernelPermissionCollection(); } private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { ois.defaultReadObject(); init(getName(), getActions()); } /** * Construct a new KernelPermission for a given name * * @param name the name of the permission to grant * @param actions unused * @exception NullPointerException if the name is null * @exception IllegalArgumentException if the name is not * or one of the * allowed names or a comma-separated list of the allowed names, or if * actions is a non-null non-empty string. */ private void init(String name, String actions) { if( name == null ) throw new NullPointerException("name cannot be null"); if( actions != null && actions.length() > 0 ) throw new IllegalArgumentException("actions must be null or empty"); if (name.equals("*") == false && name.equals("access") == false && name.equals("configure") == false) throw new IllegalArgumentException("Unknown name: " + name); allNames = name.equals("*"); } /** * A KernelPermissionCollection. */ static class KernelPermissionCollection extends PermissionCollection { /** The serialVersionUID */ private static final long serialVersionUID = 3256442516797665329L; /** The permissions */ private HashSet permissions = new HashSet(); /** Whether we have all permissions */ private boolean hasAll; public void add(Permission p) { if (isReadOnly()) throw new SecurityException("Collection is read-only"); if (p instanceof KernelPermission) permissions.add(p); if (p.getName().equals("configure")) permissions.add(new KernelPermission("access")); else if (p.getName().equals("*")) hasAll = true; } public boolean implies(Permission p) { boolean implies = false; if (p instanceof KernelPermission) { implies = hasAll; if (implies == false) implies = permissions.contains(p); } return implies; } public Enumeration elements() { final Iterator iter = permissions.iterator(); return new Enumeration() { public boolean hasMoreElements() { return iter.hasNext(); } public Permission nextElement() { return iter.next(); } }; } } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/0000755000175000017500000000000011620312171030405 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/deployment/0000755000175000017500000000000011620312170032564 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/deployment/KernelDeployment.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/deployment/Ker0000644000175000017500000001003010675604533033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.deployment; import java.util.List; import java.util.Set; import org.jboss.beans.metadata.spi.AnnotationMetaData; 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.LifecycleMetaData; import org.jboss.beans.metadata.spi.NamedAliasMetaData; import org.jboss.dependency.spi.ControllerMode; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.util.JBossInterface; /** * A kernel deployment. * * @author Adrian Brock * @version $Revision: 65569 $ */ public interface KernelDeployment extends JBossInterface { /** * Get the name of the deployment * * @return the name */ String getName(); /** * Set the name of the deployment * * @param name the name */ void setName(String name); /** * Whether the deployment is installed * * @return true when installed */ boolean isInstalled(); /** * Set the intalled state * * @param installed true when installed */ void setInstalled(boolean installed); /** * Is deployment scoped * * @return true if scoped, false if isolated, null by default */ Boolean getScoped(); /** * Get the deployment annotations. * * @return the annotations */ Set getAnnotations(); /** * Get the classloader for this deployment * * @return the classloader */ ClassLoaderMetaData getClassLoader(); /** * Get the default create lifecycle * * @return the create lifecycle */ LifecycleMetaData getCreate(); /** * Get the default start lifecycle * * @return the start lifecycle */ LifecycleMetaData getStart(); /** * Get the default stop lifecycle * * @return the stop lifecycle */ LifecycleMetaData getStop(); /** * Get the default destroy lifecycle * * @return the destroy lifecycle */ LifecycleMetaData getDestroy(); /** * Get named aliases. * * @return the aliases */ Set getAliases(); /** * Get the ControllerMode. * * @return mode */ ControllerMode getMode(); /** * Get the beans in the deployment * * @return List */ List getBeans(); /** * Get the bean factories in the deployment * * @return List */ List getBeanFactories(); /** * Get the installed contexts * * @return the installed contexts */ List getInstalledContexts(); /** * Add an installed context * * @param context the context to add */ void addInstalledContext(KernelControllerContext context); /** * Remove an installed context * * @param context the context to add */ void removeInstalledContext(KernelControllerContext context); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/deployment/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/deployment/pac0000644000175000017500000000151410152731302033254 0ustar twernertwerner

Classes used to define deployment plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/0000755000175000017500000000000011620312170031651 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/KernelConfigurator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/KernelC0000644000175000017500000001425511042323200033120 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.config; import java.util.List; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.beans.metadata.spi.ConstructorMetaData; import org.jboss.beans.metadata.spi.ParameterMetaData; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.joinpoint.spi.MethodJoinpoint; import org.jboss.kernel.spi.KernelObject; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; /** * A configurator.

* * The configurator is a utility class used by the controller * to create and configure beans. * * @author Adrian Brock * @version $Revision: 76224 $ */ public interface KernelConfigurator extends KernelObject { /** * Get the BeanInfo * * @param className the class name * @param cl the classloader * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(String className, ClassLoader cl) throws Throwable; /** * Get the BeanInfo * * @param clazz the class * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(Class clazz) throws Throwable; /** * Get the BeanInfo * * @param type the type info * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(TypeInfo type) throws Throwable; /** * Get the BeanInfo * * @param className the class name * @param cl the classloader * @param mode the access mode * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(String className, ClassLoader cl, BeanAccessMode mode) throws Throwable; /** * Get the BeanInfo * * @param clazz the class * @return the bean info * @param mode the access mode * @throws Throwable for any error */ BeanInfo getBeanInfo(Class clazz, BeanAccessMode mode) throws Throwable; /** * Get the BeanInfo * * @param type the type info * @param mode the access mode * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(TypeInfo type, BeanAccessMode mode) throws Throwable; /** * Get the BeanInfo for some metadata * * @param metaData the metadata * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(BeanMetaData metaData) throws Throwable; /** * Get the type info for a class * * @param className the class name * @param cl the classloader * @return the type info * @throws Throwable for any error */ TypeInfo getTypeInfo(String className, ClassLoader cl) throws Throwable; /** * Get the type info for a class * * @param clazz the class * @return the type info * @throws Throwable for any error */ TypeInfo getTypeInfo(Class clazz) throws Throwable; /** * Get the class info for a class * * @param className the class name * @param cl the classloader * @return the class info * @throws Throwable for any error */ ClassInfo getClassInfo(String className, ClassLoader cl) throws Throwable; /** * Get the class info for a class * * @param clazz the class * @return the class info * @throws Throwable for any error */ ClassInfo getClassInfo(Class clazz) throws Throwable; /** * Get a constructor join point * * @param info the bean info * @return the join point * @throws Throwable for any error */ Joinpoint getConstructorJoinPoint(BeanInfo info) throws Throwable; /** * Get a constructor join point * * @param metaData the bean metadata * @return the join point * @throws Throwable for any error */ Joinpoint getConstructorJoinPoint(BeanMetaData metaData) throws Throwable; /** * Get a constructor join point * * @param info the bean info * @param metaData the constructor metadata * @param beanMetaData the bean metadata * @return the join point * @throws Throwable for any error */ Joinpoint getConstructorJoinPoint(BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData) throws Throwable; /** * Get a constructor join point * * @param info the bean info * @param metaData the constructor metadata * @param beanMetaData the bean metadata * @param object an opaque object * @return the join point * @throws Throwable for any error */ Joinpoint getConstructorJoinPoint(BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData, Object object) throws Throwable; /** * Get a method joinpoint * * @param info the bean info * @param cl the classloader * @param name the method name * @param parameters the parameter metadata * @param isStatic whether the method is static * @param isPublic whether the method is public * @return the method join point * @throws Throwable for any error */ MethodJoinpoint getMethodJoinPoint(BeanInfo info, ClassLoader cl, String name, List parameters, boolean isStatic, boolean isPublic) throws Throwable; } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/KernelConfig.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/KernelC0000644000175000017500000001410011216157032033120 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.config; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.kernel.spi.KernelObject; import org.jboss.kernel.spi.validation.KernelBeanValidator; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.event.KernelEventManager; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.reflect.spi.ClassInfo; import org.jboss.reflect.spi.TypeInfo; /** * Kernel Configuration.

* * Provides kernel configuration options. * * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 90317 $ */ @SuppressWarnings("deprecation") public interface KernelConfig extends KernelObject { /** * Get the bean info * * @param className the class name * @param cl the classloader * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(String className, ClassLoader cl) throws Throwable; /** * Get the bean info * * @param clazz the class * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(Class clazz) throws Throwable; /** * Get the bean info * * @param type the type info * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(TypeInfo type) throws Throwable; /** * Get the bean info * * @param className the class name * @param cl the classloader * @param mode the access mode * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(String className, ClassLoader cl, BeanAccessMode mode) throws Throwable; /** * Get the bean info * * @param clazz the class * @param mode the access mode * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(Class clazz, BeanAccessMode mode) throws Throwable; /** * Get the bean info * * @param type the type info * @param mode the access mode * @return the bean info * @throws Throwable for any error */ BeanInfo getBeanInfo(TypeInfo type, BeanAccessMode mode) throws Throwable; /** * Get the type info for a class * * @param className the class name * @param cl the classloader * @return the type info * @throws Throwable for any error */ TypeInfo getTypeInfo(String className, ClassLoader cl) throws Throwable; /** * Get the type info for a class * * @param clazz the class * @return the type info * @throws Throwable for any error */ TypeInfo getTypeInfo(Class clazz) throws Throwable; /** * Get the class info for a class * * @param className the class name * @param cl the classloader * @return the class info * @throws Throwable for any error */ ClassInfo getClassInfo(String className, ClassLoader cl) throws Throwable; /** * Get the class info for a class * * @param clazz the class * @return the class info * @throws Throwable for any error */ ClassInfo getClassInfo(Class clazz) throws Throwable; /** * Create a kernel bus * * @return the kernel bus * @throws Throwable for any error */ KernelBus createKernelBus() throws Throwable; /** * Create a kernel configurator * * @return the kernel configurator * @throws Throwable for any error */ KernelConfigurator createKernelConfigurator() throws Throwable; /** * Create a kernel controller * * @return the kernel controller * @throws Throwable for any error */ KernelController createKernelController() throws Throwable; /** * Create a kernel event manager * * @return the kernel event manager * @throws Throwable for any error */ KernelEventManager createKernelEventManager() throws Throwable; /** * Create a kernel initializer * * @return the kernel initializer * @throws Throwable for any error */ KernelInitializer createKernelInitializer() throws Throwable; /** * Create a kernel registry * * @return the kernel registry * @throws Throwable for any error */ org.jboss.kernel.spi.registry.KernelRegistry createKernelRegistry() throws Throwable; /** * Create a meta data repository * * @return the meta data repository * @throws Throwable for any error */ KernelMetaDataRepository createKernelMetaDataRepository() throws Throwable; /** * Create kernel bean validator. * * @return the kernel bean validator * @throws Throwable for any error */ KernelBeanValidator createKernelBeanValidator() throws Throwable; /** * Get the dependency builder * * @return the dependency builder * @throws Throwable for any error */ DependencyBuilder getDependencyBuilder() throws Throwable; } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/config/package0000644000175000017500000000151710150404616033177 0ustar twernertwerner

Classes used to define configuration plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/metadata/0000755000175000017500000000000011620312170032164 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/metadata/KernelMetaDataRepository.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/metadata/Kerne0000644000175000017500000000535611047114402033165 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.metadata; import java.util.List; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.KernelObject; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.ScopeKey; /** * KernelMetaDataRepository. * * @author Adrian Brock * @version $Revision: 76842 $ */ public interface KernelMetaDataRepository extends KernelObject { /** * Get the meta data repository * * @return the meta data repository */ MutableMetaDataRepository getMetaDataRepository(); /** * Get MetaData * * @param context the context * @return the metadata */ MetaData getMetaData(ControllerContext context); /** * Add metadata to the bean. * * @param context the context */ void addMetaData(ControllerContext context); /** * Remove any previously added metadata * * @param context the context */ void removeMetaData(ControllerContext context); /** * Get the default scope for a context * * @param context the context * @return the default scope */ ScopeKey getFullScope(ControllerContext context); /** * Get the mutable scope for a context * * @param context the context * @return the default scope */ ScopeKey getMutableScope(ControllerContext context); /** * Create a metadata retrieval * * @param context the controller context * @param retrievals the retrievals * @return the metadata context */ MetaDataRetrieval createMetaDataRetrieval(ControllerContext context, List retrievals); } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/0000755000175000017500000000000011620312170032254 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelRegistry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000652511042110263033250 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; import org.jboss.kernel.spi.KernelObject; /** * A registry.

* * The registry is responsible for keeping track of named * beans so they can be invoked over the bus and used in dependencies.

* * @author Adrian Brock * @author Les A. Hazlewood * @version $Revision: 76179 $ * @deprecated use the KernelBus for ad hoc invocations, and injection / Controller for anything else */ @Deprecated public interface KernelRegistry extends KernelObject { /** Event type for registered event */ public static final String KERNEL_REGISTRY_REGISTERED = "KERNEL_REGISTRY_REGISTERED"; /** Event type for modified event */ public static final String KERNEL_REGISTRY_MODIFIED = "KERNEL_REGISTRY_MODIFIED"; /** Event type for unregistered event */ public static final String KERNEL_REGISTRY_UNREGISTERED = "KERNEL_REGISTRY_UNREGISTERED"; /** * Find a registration * * @param name the name of the object * @return the registration * @throws IllegalArgumentException for a null name */ KernelRegistryEntry findEntry(Object name); /** * Get a registration * * @param name the name of the object * @return the registration * @throws IllegalArgumentException for a null name * @throws KernelRegistryEntryNotFoundException when not found */ KernelRegistryEntry getEntry(Object name); /** * Register an object * * @param name the name of the object * @param entry the registration * @throws IllegalArgumentException for a null name or object * @throws IllegalStateException when the name is already registered */ void registerEntry(Object name, KernelRegistryEntry entry); /** * Unregister an object * * @param name the name of the object * @return the unregistered entry * @throws IllegalArgumentException for a null name * @throws IllegalStateException when the name is not registered */ KernelRegistryEntry unregisterEntry(Object name); /** * Returns whether or not there exists a KernelRegistryEntry with the * given name. * @param name name of the KernelRegistryEntry * @return true if there exists a KernelRegistryEntry with the given name, * false otherwise. */ boolean containsEntry(Object name); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelBus.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000441310674761467033276 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; import org.jboss.kernel.spi.KernelObject; /** * A bus.

* * The bus allows detatched invocations on named components in * the registry. * * @author Adrian Brock * @version $Revision: 65533 $ */ public interface KernelBus extends KernelObject { /** * Getter property / attribute * * @param name entry name * @param getter property / attribute name * @return target's property / attribute instance * @throws Throwable for any error */ Object get(Object name, String getter) throws Throwable; /** * Setter property / attribute * * @param name entry name * @param setter property / attribute name * @param value set target's property / attribute instance * @throws Throwable for any error */ void set(Object name, String setter, Object value) throws Throwable; /** * Invoke method / operation * * @param name entry name * @param methodName method name * @param parameters parameter values * @param signature method's parameter types / signatures * @return inovocation's return object * @throws Throwable for any error */ Object invoke(Object name, String methodName, Object[] parameters, String[] signature) throws Throwable; } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/packa0000644000175000017500000000151210150404616033261 0ustar twernertwerner

Classes used to define registry plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelRegistryPlugin.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000260710331006762033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; /** * A registry plugin. * * @author Adrian Brock * @version $Revision: 37459 $ */ public interface KernelRegistryPlugin { /** * Get a registration * * @param name the name of the object * @return the registration * @throws IllegalArgumentException for a null name */ KernelRegistryEntry getEntry(Object name); } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelRegistryEntryNotFoundException.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000306410367424640033263 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; /** * Thrown when an invocation context does not exist * * @author Adrian Brock * @version $Revision: 40756 $ */ public class KernelRegistryEntryNotFoundException extends RuntimeException { /** The serialVersionUID */ private static final long serialVersionUID = 3257567295684358200L; /** * Create a new invocation context not found exception * * @param description the description */ public KernelRegistryEntryNotFoundException(String description) { super(description); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelRegistryEntry.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000262110630037661033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; import org.jboss.dependency.spi.ControllerContext; import org.jboss.util.JBossInterface; /** * A registry entry * * @author Adrian Brock * @version $Revision: 63306 $ */ public interface KernelRegistryEntry extends JBossInterface, ControllerContext { /** * Set the name * * @param name the name */ void setName(Object name); } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/KernelRegistryEntryAlreadyRegisteredException.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/registry/Kerne0000644000175000017500000000310610367424640033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.registry; /** * Thrown when an invocation context does not exist * * @author Adrian Brock * @version $Revision: 40756 $ */ public class KernelRegistryEntryAlreadyRegisteredException extends RuntimeException { /** The serialVersionUID */ private static final long serialVersionUID = 4123384315506866231L; /** * Create a new invocation context not found exception * * @param description the description */ public KernelRegistryEntryAlreadyRegisteredException(String description) { super(description); } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/package.html0000644000175000017500000000151010150404616032666 0ustar twernertwerner

Classes used to define kernel plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/0000755000175000017500000000000011620312171032523 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/ConfigureKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Con0000644000175000017500000000251110543762251033177 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * A Configure KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * * @author Ales Justin */ public interface ConfigureKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/StartKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Sta0000644000175000017500000000250110543762251033206 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * A Start KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * * @author Ales Justin */ public interface StartKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/CreateKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Cre0000644000175000017500000000250310543762251033172 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * A Create KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * * @author Ales Justin */ public interface CreateKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/KernelControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Ker0000644000175000017500000000400411216157032033171 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.dispatch.LifecycleDispatchContext; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.registry.KernelRegistryEntry; /** * Information about dependencies and state. * * @author Adrian Brock * @version $Revision: 90317 $ */ public interface KernelControllerContext extends KernelRegistryEntry, LifecycleDispatchContext { /** * Get the kernel * * @return the kernel */ Kernel getKernel(); /** * Get the BeanInfo * * @return the bean info */ BeanInfo getBeanInfo(); /** * Set the bean info * * @param info the bean info */ void setBeanInfo(BeanInfo info); /** * Get the metadata * * @return the bean metadata */ BeanMetaData getBeanMetaData(); /** * Set the target * * @param target the target */ void setTarget(Object target); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/pac0000644000175000017500000000151410150404616033215 0ustar twernertwerner

Classes used to define dependency plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/InstantiateKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Ins0000644000175000017500000000251610543762251033216 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * An Instantiate KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * * @author Ales Justin */ public interface InstantiateKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/InstallKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Ins0000644000175000017500000000250610543762251033215 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * An Install KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * * @author Ales Justin */ public interface InstallKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/KernelController.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Ker0000644000175000017500000000711510665060420033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; import java.util.Set; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.spi.KernelObject; /** * A controller.

* * The controller is the core component for keeping track * of beans to make sure the configuration and lifecycle are * done in the correct order including dependencies and * classloading considerations. * * @author Adrian Brock * @version $Revision: 64920 $ */ public interface KernelController extends KernelObject, Controller { /** * Install a context * * @param metaData the metaData * @return the context * @throws Throwable for any error */ KernelControllerContext install(BeanMetaData metaData) throws Throwable; /** * Install a context * * @param metaData the metaData * @param target the target object * @return the context * @throws Throwable for any error */ KernelControllerContext install(BeanMetaData metaData, Object target) throws Throwable; /** * Add supplies * * @param context the context */ void addSupplies(KernelControllerContext context); /** * Remove supplies * * @param context the context */ void removeSupplies(KernelControllerContext context); /** * Get all instantiated contexts of a type * * @param clazz the type * @return the contexts */ Set getInstantiatedContexts(Class clazz); /** * Get all contexts of a type which are at least in state. * * @param clazz the type * @param state the required state * @return the contexts */ Set getContexts(Class clazz, ControllerState state); /** * If zero or multiple instances match class clazz * a warning is issued, but no throwable is thrown * * @param clazz the type * @return context whose target is instance of this class clazz param or null if zero or multiple such instances */ KernelControllerContext getContextByClass(Class clazz); /** * Add instantiated context into contextsByClass map * look at all target's superclasses and interfaces * * @param context the context */ void addInstantiatedContext(KernelControllerContext context); /** * Remove instantiated context from contextsByClass map * look at all target's superclasses and interfaces * * @param context the context */ void removeInstantiatedContext(KernelControllerContext context); } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/DependencyBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Dep0000644000175000017500000000302710763225372033175 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; import java.util.List; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.metadata.spi.MetaData; /** * DependencyBuilder. * * @author Adrian Brock * @version $Revision: 69888 $ */ public interface DependencyBuilder { /** * Get the dependencies for this instance * * @param beanInfo the bean info * @param metaData the metadata * @return the dependencies */ List getDependencies(BeanInfo beanInfo, MetaData metaData); } ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/KernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Ker0000644000175000017500000000467710331006762033211 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * A KernelControllerContextAware. * * @author Adrian Brock * @version $Revision: 37459 $ */ public interface KernelControllerContextAware { /** * Set the controller context.

* * This is invoked after construction with the controller context.

* * WARNING: This protocol is subject to change with the classadapter implementation. * * @todo integrate better with aop and instance classadapter such that * describe can process this without the instance actually existing. * Use case: creating jmx/jsr77 hollow proxy for on-demand beans before they are instantiated. * @param context the context * @throws Exception for any error */ void setKernelControllerContext(KernelControllerContext context) throws Exception; /** * Unset the controller context.

* * This is before uninstallation with null.

* * WARNING: This protocol is subject to change with the classadapter implementation. * * @todo integrate better with aop and instance classadapter such that * describe can process this without the instance actually existing. * Use case: creating jmx/jsr77 hollow proxy for on-demand beans before they are instantiated. * @param context the context * @throws Exception for any error */ void unsetKernelControllerContext(KernelControllerContext context) throws Exception; } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/DependencyBuilderListItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Dep0000644000175000017500000000304710763553123033175 0ustar twernertwerner/* * 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.kernel.spi.dependency; /** * DependencyBuilderListItem. * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface DependencyBuilderListItem { /** * Add the dependency. * * @param ctx the kernel controller context */ void addDependency(KernelControllerContext ctx); /** * Remove the dependency * * @param ctx the kernel controller context */ void removeDependency(KernelControllerContext ctx); } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/DescribeKernelControllerContextAware.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/Des0000644000175000017500000000262110546700501033166 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency; /** * A Describe KernelControllerContextAware. * @see org.jboss.kernel.plugins.dependency.KernelControllerContextAction * @deprecated at the describe state there is no target yet instantiated * * @author Ales Justin */ public interface DescribeKernelControllerContextAware extends KernelControllerContextAware { } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/helpers/libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/hel0000755000175000017500000000000011620312170033213 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/helpers/AbstractDependencyBuilder.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/hel0000644000175000017500000000310310763237673033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency.helpers; import java.util.List; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.kernel.spi.dependency.DependencyBuilder; import org.jboss.kernel.spi.dependency.DependencyBuilderListItem; import org.jboss.metadata.spi.MetaData; /** * AbstractDependencyBuilder. * * @author Adrian Brock * @version $Revision: 70362 $ */ public class AbstractDependencyBuilder implements DependencyBuilder { public List getDependencies(BeanInfo beanInfo, MetaData metaData) { return null; } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/helpers/UnmodifiableKernelControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/dependency/hel0000644000175000017500000000666511216157032033237 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.dependency.helpers; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.helpers.UnmodifiableBeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.dependency.spi.helpers.UnmodifiableControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * Unmodifiable instance. * * @author Ales Justin */ public class UnmodifiableKernelControllerContext extends UnmodifiableControllerContext implements KernelControllerContext { public UnmodifiableKernelControllerContext(KernelControllerContext delegate) { super(delegate); } protected KernelControllerContext getDelegate() { return KernelControllerContext.class.cast(super.getDelegate()); } public Kernel getKernel() { return getDelegate().getKernel(); } public BeanInfo getBeanInfo() { BeanInfo beanInfo = getDelegate().getBeanInfo(); return beanInfo != null ? new UnmodifiableBeanInfo(beanInfo) : null; } public void setBeanInfo(BeanInfo info) { throw new UnsupportedOperationException("Cannot execute set on unmodifiable wrapper."); } public BeanMetaData getBeanMetaData() { return getDelegate().getBeanMetaData(); } public void setTarget(Object target) { throw new UnsupportedOperationException("Cannot execute set on unmodifiable wrapper."); } public void setName(Object name) { throw new UnsupportedOperationException("Cannot execute set on unmodifiable wrapper."); } public Object invoke(String name, Object parameters[], String[] signature) throws Throwable { throw new UnsupportedOperationException("Cannot execute invoke on unmodifiable wrapper."); } public ClassLoader getClassLoader() throws Throwable { return getDelegate().getClassLoader(); } public Object get(String name) throws Throwable { return getDelegate().get(name); } public void set(String name, Object value) throws Throwable { throw new UnsupportedOperationException("Cannot execute set on unmodifiable wrapper."); } public ControllerState lifecycleInvocation(String name, Object[] parameters, String[] signature) throws Throwable { return null; } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/validation/0000755000175000017500000000000011620312170032536 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/validation/KernelBeanValidator.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/validation/Ker0000644000175000017500000000564411216157032033220 0ustar twernertwerner/* * 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.kernel.spi.validation; import org.jboss.beans.info.spi.PropertyInfo; import org.jboss.joinpoint.spi.Joinpoint; import org.jboss.kernel.spi.KernelObject; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.reflect.spi.MethodInfo; /** * The bridge between jsr303 and our pojo handling. * * @author Ales Justin */ public interface KernelBeanValidator extends KernelObject { /** * Is the validator disabled. * * @return is the validator disabled */ boolean isDisabled(); /** * Validate constructor values. * * @param context the owner context * @param joinpoint the constructor joinpoint * @throws Throwable for any error */ void validateConstructorValues(KernelControllerContext context, Joinpoint joinpoint) throws Throwable; /** * Validate new instance. * * @param context the owner context * @param target the target * @throws Throwable for any error */ void validateInstance(KernelControllerContext context, Object target) throws Throwable; /** * Validate property value. * * @param context the owner context * @param target the target * @param propertyInfo the property * @param value the new value * @throws Throwable for any error */ void validatePropertyValue(KernelControllerContext context, Object target, PropertyInfo propertyInfo, Object value) throws Throwable; /** * Validate method values. * * @param context the owner context * @param target the target * @param methodInfo the method * @param parameters the parameters * @throws Throwable for any error */ void validateMethodValues(KernelControllerContext context, Object target, MethodInfo methodInfo, Object[] parameters) throws Throwable; } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/bootstrap/0000755000175000017500000000000011620312170032421 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/bootstrap/KernelInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/bootstrap/Kern0000644000175000017500000000262110367424640033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.bootstrap; import org.jboss.kernel.Kernel; /** * Kernel Factory.

* * Initialises a kernel. * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelInitializer { /** * Initialise a kernel * * @param kernel the kernel * @throws Throwable for any error */ void initKernel(Kernel kernel) throws Throwable; } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/bootstrap/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/bootstrap/pack0000644000175000017500000000151310150404616033266 0ustar twernertwerner

Classes used to define bootstrap plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/annotations/0000755000175000017500000000000011620312170032741 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/annotations/AnnotationToBeanMetaDataFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/annotations/An0000644000175000017500000002146610777663234033261 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.annotations; import java.security.AccessController; import java.security.PrivilegedAction; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.info.spi.BeanAccessMode; import org.jboss.beans.metadata.plugins.AbstractBeanMetaData; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.config.plugins.property.PropertyConfiguration; import org.jboss.config.spi.Configuration; import org.jboss.kernel.plugins.annotations.BasicBeanMetaDataAnnotationAdapter; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader; /** * Annotation to bean metadata factory. * * @author Ales Justin */ public class AnnotationToBeanMetaDataFactory { /** The configuration */ private static Configuration configuration; static { // get Configuration instance configuration = AccessController.doPrivileged(new PrivilegedAction() { public Configuration run() { return new PropertyConfiguration(); } }); } /** * Create bean metadata for class. * * @param beanClass the bean class * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData createBeanMetaData(Class beanClass) throws Throwable { return fillBeanMetaData(beanClass, null); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param mode the bean access mode * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData createBeanMetaData(Class beanClass, BeanAccessMode mode) throws Throwable { return fillBeanMetaData(beanClass, mode, null); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param metaData predefined metadata * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData createBeanMetaData(Class beanClass, MetaData metaData) throws Throwable { return fillBeanMetaData(beanClass, metaData, null, null); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData createBeanMetaData(Class beanClass, BeanMetaDataAnnotationAdapter adapter) throws Throwable { return fillBeanMetaData(beanClass, null, adapter); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param mode the bean access mode * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData createBeanMetaData(Class beanClass, BeanAccessMode mode, BeanMetaDataAnnotationAdapter adapter) throws Throwable { return fillBeanMetaData(beanClass, mode, null, null, adapter); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param existingMetaData the existing bean metadata * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, BeanMetaData existingMetaData) throws Throwable { return fillBeanMetaData(beanClass, existingMetaData, null); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param mode the bean access mode * @param existingMetaData the existing bean metadata * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, BeanAccessMode mode, BeanMetaData existingMetaData) throws Throwable { return fillBeanMetaData(beanClass, mode, null, existingMetaData, null); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param existingMetaData the existing bean metadata * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, BeanMetaData existingMetaData, BeanMetaDataAnnotationAdapter adapter) throws Throwable { return fillBeanMetaData(beanClass, null, null, existingMetaData, adapter); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param mode the bean access mode * @param existingMetaData the existing bean metadata * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, BeanAccessMode mode, BeanMetaData existingMetaData, BeanMetaDataAnnotationAdapter adapter) throws Throwable { return fillBeanMetaData(beanClass, mode, null, existingMetaData, adapter); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param metaData predefined metadata * @param existingMetaData the existing bean metadata * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, MetaData metaData, BeanMetaData existingMetaData, BeanMetaDataAnnotationAdapter adapter) throws Throwable { return fillBeanMetaData(beanClass, null, metaData, existingMetaData, adapter); } /** * Create bean metadata for class. * * @param beanClass the bean class * @param mode the bean access mode * @param metaData predefined metadata * @param existingMetaData the existing bean metadata * @param adapter bean metadata adapter * @return bean metadata * @throws Throwable for any error */ public static BeanMetaData fillBeanMetaData(Class beanClass, BeanAccessMode mode, MetaData metaData, BeanMetaData existingMetaData, BeanMetaDataAnnotationAdapter adapter) throws Throwable { if (beanClass == null) throw new IllegalArgumentException("Null bean class"); if (mode == null) mode = BeanAccessMode.STANDARD; if (metaData == null) { MetaDataRetrieval retrieval = new AnnotatedElementMetaDataLoader(beanClass); metaData = new MetaDataRetrievalToMetaDataBridge(retrieval); } if (existingMetaData == null) { AbstractBeanMetaData abmd = new AbstractBeanMetaData(); abmd.setBean(beanClass.getName()); abmd.setAccessMode(mode); existingMetaData = abmd; } else { BeanAccessMode bam = existingMetaData.getAccessMode(); if (bam == null) { if (existingMetaData instanceof AbstractBeanMetaData == false) throw new IllegalArgumentException("Can only apply BeanAccessMode to AbstractBeanMetaData: " + existingMetaData); AbstractBeanMetaData abmd = AbstractBeanMetaData.class.cast(existingMetaData); abmd.setAccessMode(mode); } else if (bam != mode) throw new IllegalArgumentException("Different bean access modes: " + bam + " != " + mode); } if (adapter == null) adapter = BasicBeanMetaDataAnnotationAdapter.INSTANCE; BeanInfo beanInfo = configuration.getBeanInfo(beanClass, mode); adapter.applyAnnotations(beanInfo, metaData, existingMetaData); return existingMetaData; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/annotations/BeanMetaDataAnnotationAdapter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/annotations/Be0000644000175000017500000000326710777663234033250 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.annotations; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.beans.metadata.spi.BeanMetaData; import org.jboss.metadata.spi.MetaData; /** * Annotations adapter contract based on metadata. * * @author Ales Justin */ public interface BeanMetaDataAnnotationAdapter { /** * Apply the annotations on bean metadata. * * @param beanInfo the bean info * @param metaData the metadata * @param beanMetaData the bean meta data * @throws Throwable for any error */ void applyAnnotations(BeanInfo beanInfo, MetaData metaData, BeanMetaData beanMetaData) throws Throwable; }libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/lazy/0000755000175000017500000000000011620312170031363 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxyFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyProxy0000644000175000017500000001063011262376750033307 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.lazy; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import org.jboss.beans.info.spi.BeanInfo; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.config.KernelConfigurator; /** * Create lazy proxy of a bean. * * @author Ales Justin */ public class LazyProxyFactory { private static volatile LazyInitializer initializer; private static Map initializerMap; static { initializerMap = new LinkedHashMap(); // test class name, actual LazyInitializer implementation initializerMap.put("javassist.util.proxy.ProxyObject", "org.jboss.kernel.plugins.lazy.JavassistLazyInitializer"); initializerMap.put("org.jboss.aop.proxy.container.AOPProxyFactoryParameters", "org.jboss.aop.microcontainer.lazy.JBossAOPLazyInitializer"); initializerMap.put("java.lang.reflect.Proxy", "org.jboss.kernel.plugins.lazy.JDKLazyInitializer"); } /** * Get the LazyInitializater instance. * * @param configurator the configurator * @return initializer instance */ protected static LazyInitializer getInitializer(KernelConfigurator configurator) { if (initializer == null) { for(Map.Entry entry : initializerMap.entrySet()) { if (testLibExists(entry.getKey())) { initializer = createInitializer(configurator, entry.getValue()); if (initializer != null) break; } } } if (initializer == null) throw new IllegalArgumentException("Cannot initialize LazyInitializater, check classpath for missing classes."); return initializer; } /** * Check if test class exists. * * @param className class name to test * @return true if test successful, false otherwise */ protected static boolean testLibExists(String className) { try { return Class.forName(className) != null; } catch (ClassNotFoundException e) { return false; } } /** * Create initializer instance. * * @param configurator the configurator * @param initializerClassName initializer class name * @return initializer instance or null if we fail */ protected static LazyInitializer createInitializer(KernelConfigurator configurator, String initializerClassName) { try { BeanInfo beanInfo = configurator.getBeanInfo(initializerClassName, LazyInitializer.class.getClassLoader()); Object result = beanInfo.newInstance(); return LazyInitializer.class.cast(result); } catch (Throwable ignored) { } return null; } /** * Create lazy proxy. * * @param kernel the kernel * @param bean the bean to wrap * @param exposeClass do we expose full class * @param interfaces interfaces to expose * @return the proxy * @throws Throwable for any error */ public static Object getProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable { LazyInitializer lazyInitializer = getInitializer(kernel.getConfigurator()); return lazyInitializer.initializeProxy(kernel, bean, exposeClass, interfaces); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyInitializer.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/lazy/LazyIniti0000644000175000017500000000417111042323200033217 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.lazy; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.metadata.spi.MetaData; /** * Lazy initializer. * * @author Ales Justin */ public interface LazyInitializer { /** * Initialize lazy proxy with no metadata. * * @param kernel the kernel * @param bean the bean to wrap * @param exposeClass do we expose full class * @param interfaces interfaces to expose * @return the proxy * @throws Throwable for any error */ Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces) throws Throwable; /** * Initialize lazy proxy. * * @param kernel the kernel * @param bean the bean to wrap * @param exposeClass do we expose full class * @param interfaces interfaces to expose * @param metaData the metaData * @return the proxy * @throws Throwable for any error */ Object initializeProxy(Kernel kernel, String bean, boolean exposeClass, Set interfaces, MetaData metaData) throws Throwable; } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/KernelObject.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/KernelObject.j0000644000175000017500000000314610367424640033147 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.event.KernelEventEmitter; /** * A kernel object.

* * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelObject extends KernelEventEmitter { /** * Get the kernel * * @return the kernel */ Kernel getKernel(); /** * Set the kernel.

* * @param kernel the kernel * @throws Throwable for any error * @throws SecurityException if the you don't have KernelPermission('configure') */ void setKernel(Kernel kernel) throws Throwable; } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/0000755000175000017500000000000011620312170031525 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEventListener.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEv0000644000175000017500000000252610367424640033205 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.event; /** * A listener * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelEventListener { /** * Invoked when an event is fired * * @param event the event * @param handback the handback object */ void onEvent(KernelEvent event, Object handback); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEventManager.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEv0000644000175000017500000000402410367424640033200 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.event; import org.jboss.kernel.spi.KernelObject; /** * An event manager.

* * The event manager co-ordinates events. * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelEventManager extends KernelObject { /** * Register a listener * * @param name the name of the object to register on * @param listener the listener * @param filter the filter * @param handback the handback object * @throws Throwable for any error */ void registerListener(Object name, KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable; /** * Unregister a listener * * @param name the name of the object to register on * @param listener the listener * @param filter the filter * @param handback the handback object * @throws Throwable for any error */ void unregisterListener(Object name, KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable; } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEventFilter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEv0000644000175000017500000000260410367424640033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.event; /** * A filter * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelEventFilter { /** * Invoked when an event occurs * * @param event the event * @param handback the handback * @return true to fire the event, false otherwise */ boolean wantEvent(KernelEvent event, Object handback); } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEvent.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEv0000644000175000017500000000317110367424640033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.event; /** * A listener * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelEvent { /** * Get the source of the event * * @return the source */ Object getSource(); /** * Get the event type * * @return the type */ String getType(); /** * Get the sequence * * @return the sequence */ long getSequence(); /** * Get the timestamp * * @return the timestamp */ long getTimestamp(); /** * Get the context * * @return the context */ Object getContext(); } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/package.0000644000175000017500000000150710150404616033130 0ustar twernertwerner

Classes used to define event plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEventEmitter.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/spi/event/KernelEv0000644000175000017500000000361210367424640033202 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel.spi.event; /** * An event emitter * * @author Adrian Brock * @version $Revision: 40756 $ */ public interface KernelEventEmitter { /** * Register a listener * * @param listener the listener * @param filter the filter * @param handback the handback object * @throws Throwable for any error */ void registerListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable; /** * Unregister a listener * * @param listener the listener * @param filter the filter * @param handback the handback object * @throws Throwable for any error */ void unregisterListener(KernelEventListener listener, KernelEventFilter filter, Object handback) throws Throwable; /** * Fire an event * * @param event the event */ void fireKernelEvent(KernelEvent event); } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/package.html0000644000175000017500000000150110150404616032073 0ustar twernertwerner

The core Kernel implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/KernelFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/kernel/src/main/java/org/jboss/kernel/KernelFactory.java0000644000175000017500000001564110331006762033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.kernel; import org.jboss.kernel.spi.bootstrap.KernelInitializer; import org.jboss.kernel.spi.config.KernelConfig; import org.jboss.logging.Logger; /** * A KernelFactory is an implementation of the Factory * design pattern that can construct new instances of {@link Kernel Kernel} * objects. * *

If no KernelConfig is given to the KernelFactory, * the KernelFactory will attempt to construct a * KernelConfig object by using System properties * (i.e. System.getProperties()). * * @author Les A. Hazlewood * @version $Revision: 37459 $ */ public class KernelFactory { /** The singleton factory */ private static final KernelFactory singleton = new KernelFactory(); /** The logger */ protected final Logger log = Logger.getLogger(getClass()); /** * No public construction */ private KernelFactory() { } /** * Returns a new instance of a Kernel based on the specified * KernelConfig parameter. * * @param cfg the configuration used to construct a new * Kernel object. * @return a new Kernel instance constructed according to the * specified configuration. */ public static Kernel newInstance(KernelConfig cfg) { return singleton.assembleNewKernel(cfg); } /** * Instantiates, configures, and initializes a new Kernel * instance according to the specified KernelConfig parameter. * * @param cfg the KernelConfig that will be used in constructing a new * Kernel. * @return a newly constructed Kernel object configured according to the * specified KernelConfig parameter. * @throws RuntimeException */ protected Kernel assembleNewKernel(KernelConfig cfg) throws RuntimeException { long begin = 0; long end = 0; log.debug("Starting JBoss Kernel construction..."); begin = System.currentTimeMillis(); //local caching for easy reference: boolean trace = log.isTraceEnabled(); if (trace) log.trace("Using KernelConfig: " + cfg); Kernel kernel = createKernel(); if (trace) log.trace("Using Kernel: " + kernel); KernelInitializer initializer = createKernelInitializer(cfg); if (trace) log.trace("Using KernelInitializer: " + initializer); configureKernel(kernel, cfg); if (trace) log.trace("Configured kernel from KernelConfig"); initializeKernel(kernel, initializer); if (trace) log.trace("Kernel instance initialzed"); end = System.currentTimeMillis(); log.debug("Completed JBoss Kernel construction. Duration: " + (end - begin) + " milliseconds"); return kernel; } /** * Constructs and returns a new, unconfigured, uninitialized * Kernel instance. Configuration and initialization will be * done explicitly in the construction process via the * {@link #configureKernel(Kernel, KernelConfig) configureKernel} and * {@link #initializeKernel(Kernel, KernelInitializer) initializeKernel} * methods, respectively. * * @return An unconfigured, uninitialized Kernel instance. */ protected Kernel createKernel() { return new Kernel(); } /** * Constructs a KernelInitializer based on the * specified KernelConfig parameter. This initializer * is used in the * {@link #initializeKernel(Kernel, KernelInitializer) initializeKernel} * method during Kernel construction. * * @param config the configuration with which to construct a new * KernelInitializer instance. * @return a new KernelInitializer instance based on the * specified KernelConfig. * @throws RuntimeException if the config object * cannot properly construct a new KernelInitializer */ protected KernelInitializer createKernelInitializer(KernelConfig config) { try { return config.createKernelInitializer(); } catch (Throwable t) { String msg = "Unable to create a KernelInitializer based on the " + "specified KernelConfig"; throw new RuntimeException(msg, t); } } /** * Configures the specified Kernel according to the specified * KernelConfig parameter. * * @param kernel a new, unconfigured Kernel instance. * @param cfg the KernelConfig to use to configure the * specified Kernel parameter. * @throws RuntimeException if the KernelConfig cannot be * updated with the Kernel object. */ protected void configureKernel(Kernel kernel, KernelConfig cfg) { kernel.setConfig(cfg); try { cfg.setKernel(kernel); } catch (Throwable t) { String msg = "Unable to update the KernelConfig with the specified Kernel"; throw new RuntimeException(msg, t); } } /** * Initializes the specified Kernel according to the specified * KernelInitializer parameter. * * @param kernel a new, uninitialized Kernel instance. * @param initializer the KernelInitializer to use to * initialize the specified Kernel parameter. * @throws RuntimeException if the KernelInitializer cannot * initialize the given Kernel parameter. */ protected void initializeKernel(Kernel kernel, KernelInitializer initializer) { try { initializer.initKernel(kernel); } catch (Throwable t) { String msg = "Unable to properly initialize the Kernel"; throw new RuntimeException(msg, t); } } } libjboss-microcontainer-java-2.0.10.GA.orig/kernel/.settings/0000755000175000017500000000000011620312176023712 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/.settings/org.eclipse.jdt.core.prefs0000644000175000017500000000032010674774740030710 0ustar twernertwerner#Fri Sep 21 17:48:33 BST 2007 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/0000755000175000017500000000000011620312176022724 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/release/0000755000175000017500000000000011620312176024344 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/release/readme.txt0000644000175000017500000000214510365415436026354 0ustar twernertwernerJBoss Microcontainer -------------------- This is the standalone build of the JBoss Microcontainer. Copyright --------- See copyright.txt in the root directory of the release and lgpl.txt in docs/licenses. Installation ------------ First you need download JBoss Microcontainer release from http://www.jboss.com/downloads/index">http://www.jboss.com/downloads/index Unpack the archive which will give you a microcontainer-x.y.z directory with the following subfolders: docs/api - javadocs for the microcontainer docs/gettingstarted - the getting started documentation docs/licences - the licenses for the software examples - the examples explained in the getting started docs lib - the libraries required to run the microcontainer Requirements ------------ You will also need a JDK of version 1.4.x+ and a copy of Apache Ant 1.6+ If you want to run the examples inside JBossAS, you will need to download JBoss-4.0.3 or later from http://www.jboss.com/products/jbossas/downloads Release Notes ------------- The release notes and project information can be found here: http://jira.jboss.com/jira/browse/JBMICROCONT libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/release/copyright.txt0000644000175000017500000001400110365415436027121 0ustar twernertwernerThe JBoss(R)* Microcontainer is Copyright 2003-2006 JBoss Inc., and individual contributors, and is licensed under the LGPL. A summary of the individual contributors in reverse chronilogical order is given below. Any omission should be sent to scott.stark@jboss.org. CVS Login(s) Name ------------------------------------------------------------------------------- adrian,ejort Adrian Brock aloubyansky,loubyansky Alex Loubyansky asaldhana,osdchicago Anil Saldhana csuconic,clebert Clebert Suconic kkhan,kabkhan Kabir Khan ovidiu,ovidiuf Ovidiu Feodorov starksm,stark Scott M Stark tdiesler Thomas Diesler timfox Tim Fox bstansberry Brian Stansberry jgreene,nihility Jason Greene rloehr Ruel Loehr reverbel Francisco Reverbel dimitris Dimitris Andreadis alesj Ales Justin bdecoste Bill DeCoste bill,patriot1burke Bill Burke telrod Tom Elrod schrouf Ulf Schroeter rrajasekaran Rajesh Rajasekaran genman Elias Ross clin Chi Lin ssilvert Stan Silvert peterj Peter Johnson rcampbell,recampbell Ryan Cambell acoliver,acoliver2 Andy Oliver walkerrl49 Bob Walker bwang,bwang00 Ben Wang pilhuhn Heiko W. Rupp jerrygauth Jerry Gauthier ltexier Luc Texier jchang Jack Chang nrichards,orb Norman Richards remm Remy Maucherat nrocher,noelrocher Noel Rocher ccrouch Charles Crouch sacha,slaboure Sacha Labourey bela,belaan Bela Ban jmoran Jim Moran gavin,oneovthafew Gavin King msurtani Manik Surtani sebersole,steveebersole Steve Ebersole smarlow Scott Marlow hbarlas Haroon Barlas rawb Robert Stryker flaviarnn Flavia Rainone cazzius Claudio Vesco russo,royrusso Roy Russo theute Thomas Heute andd,dimitris Dimitris Andreadis mnf999,fleury Marc Fleury aveitas Algirdas Veitas deb Deborah Hooker karan_malhi Karan Singh pharaohh Les A. Hazlewood ricardoarguello Ricardo Arguello rauschuber Chris Rauschuber jhaynie Jeff Haynie vietj,cooperfbi Julien Viet richarzk Klaus Richarz chussenet Claude Hussenet aclute Andrew Clute juntao Juntao Yuan kevconner Kevin Conner mlavergn Marc Lavergne triathlon98 Joachim Van der Auwera ivelin Ivelin Atanasoff Ivanov kimptoc,kimptonc Chris Kimpton marshall_law,mculpepper Marshall Culpepper tpeuss Thomas Peuss essington Jason Essington posselt Dietmar Posselt juhalindfors,juha Juha Lindfors lqd Christian Riege scoy Stephen Coy cgjung Christoph Georg Jung rnjn5 Neil Dattani luke_t,negaton Luke Taylor sreich Stefan Reich thomasra Thomas Roka-Aardal mikefinn Mike Finn d_jencks David Jencks jules_gosnell Jules Gosnell dsundstrom Dain Sundstrom gregwilkins Greg Wilkins janb Jan Bartel eli201 Eli Tilevich harald_gliebe Harald Gliebe mnewcomb Michael Newcomb andygodwin Andy Godwin chirino,hiram Hiram Chirino user57 Jason Dillon nphelps Nathan W. Phelps sasp Spyridon Samothrakis igorfie Igor Fedorenko jboynes Jeremy Boynes kbirch Kevin Birch yanikc Yanik Crepeau alindsey Aaron Lindsey mclaugs Scott McLaughlin austinchau Austin Chau binaryfeed Jeffrey Wescott pra Peter Antman jcooley James Cooley gropi Tobias Frech mattmunz Matthew Munz stormy_sky,schaefera Andreas Schaefer peter_f Peter Fagerlund sparre,osh Ole Husgaard bartmann Michael Bartmann lsanders Larry Sanderson thesitesman Seth Sites azakkerman Anatoly Akkerman sgturner Greg Turner fbrier Frederick N. Brier biorn_steedom,simone Simone Bordet yarrumretep Peter M. Murray peterbraswell Peter Braswell jwalters Jay Walters danch Dan Christopherson fhanik Filip Hanik squirest Trevor Squires olegnitz,oleg Oleg Nitz neales Neale Swinnerton mikesr Mike Swainston-Rainford dbudworth David Budworth weave Brian Weaver vharcq Vincent Harcq dmaplesden David Maplesden boissier Guillaume Boissiere plevart Peter Levart thedug Doug Ferguson lepe,lennart Lennart Petersson charles_chan Charles Chan pkendall Paul Kendall vlada Vladimir Blagojevic rickardoberg,oberg Rickard Öberg jayeshpk Jayesh Parayali deerwood Georg Rehfeld tobyallsopp,allsopp Toby Allsopp kvvinaymenon KV Vinay Menon docodan Daniel OConnor stacycurl Stacy Curl phox Fulco Muriglio dmcnair Dewayne McNair vladimir Vladimir Ivanovic joel Joel Phillips ------------------------------------------------------------------------------- * JBoss is a registered trademark of JBoss Inc. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/0000755000175000017500000000000011620312176024662 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/build.xml0000644000175000017500000000104510150404616026501 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/0000755000175000017500000000000011620312176025264 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/0000755000175000017500000000000011620312176026734 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/dependency.xml0000644000175000017500000000173510303657704031610 0ustar twernertwerner Bean Dependency - wiring beans together The POJO controller extends the dependency controller to provide a specific lifecycle for POJOs. KernelController - wiring beans The POJO controller defines the following state operations for describe: determines the dependencies from the bean metadata instantiate: invokes the constructor or factory configure: configures the bean create: invokes any "create()" method start: invokes any "start()" method install: registers the bean with the registry KernelController - demand and supply The POJO controller acts as a Registry plugin to handle demand and supply. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/introduction.xml0000644000175000017500000000141710303657704032210 0ustar twernertwerner Introduction to the JBoss Microcontainer The JBoss Microcontainer provides an environment to configure and manage POJOs (plain old java objects). It is designed to reproduce the existing JBoss JMX Microkernel but targetted at POJO environments. As such it can be used standalone outside the JBoss Application Server. This initial release provides a set of features to support POJO deployment in JBoss-4.0.3+ and the bootstrap of services used by the standalone EJB3 distribution. This document takes you through the design of the microcontainer including design decisions and future directions. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/registry.xml0000644000175000017500000000245110303657704031336 0ustar twernertwerner Registering Objects The registry is used to register objects against logical names. Beans can either be registered directly with the registry or KernelRegistryPlugins can be registered to supply objects from other registries, e.g. JNDI. KernelRegistry - retrieving named objects The kernel registry is used to register and retrieve objects against a logical name. When the object registered is an instance of KernelRegistryPlugin it will be asked for an entry if it is not directly registered with the registry. The registry factories are asked in turn in the order they were registered. KernelRegistryPlugin - helpers for the registry A registry factory allows other registry domains (such as JMX or JNDI) to be inserted into the kernel registry. To insert a registry factory into the registry, simply register it like any other object. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/bootstrap.xml0000644000175000017500000000201010303657704031472 0ustar twernertwerner Bootstrapping the Kernel The bootstrap provides a simple mechanism for bootstrapping the microcontainer. Bootstrap - bootstrapping This bootstrap creates and configures the microcontainer. This involves creating a KernelConfig from which the KernelFactory can be instantiated using the KernelInstantiator. Config - bootstrap configuration This KernelConfig provides the mechanism to configure the bootstrap including how the core kernel services are instantiated and configured. KernelFactory - kernel instantiation The KernelFactory is responsible for initializing and configuring the kernel services using information provided by the KernelConfig. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/dependencyinfo.xml0000644000175000017500000000047510303657704032464 0ustar twernertwerner Dependency Info - describing dependencies WARNING: The dependency controller is subject to change without notice. It is currently under developement as issues with the integration of the JMX microkernel and microcontainer are resolved. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/events.xml0000644000175000017500000000345210303657704030774 0ustar twernertwerner Events - notifications from the microcontainer and services The event subsystem allows services to produce and consume events. Event - event abstraction The Event class is intended to abstract the different event mechanisms used by different software. EventEmitter - producting events Event emitters produce events and send them to their registered listeners. Listeners can be registered with a filter to filter the events they are interested in before they are sent. EventListener - consuming events Event listeners consume events from emitters. EventFilter - filtering events A filter allows events to filtered before they are sent. This is can be more efficient than filtering the event in the listener. EventManager - named listening The event manager allows emitters and listeners to be more detached from each other. Instead of direct registration, the names of the objects in the registry are used. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/reflection.xml0000644000175000017500000000425310303657704031622 0ustar twernertwerner Reflection Model WARNING: The reflection model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The reflection model provides an abstraction over java.lang.reflect. It exists in the container module in package org.jboss.reflect.

Aims
Cache Reflection can be a bottleneck unless the information is cached. This package provides a single stop cache for reflection data rather than repeating this behaviour throughout JBoss.
Abstraction It is anticapted that the reflection model can be improved in different circumstances or environments. This module aims to be the one place where those issues are resolved.
Hide implementation Under AOP, classes can change their characteristics usually through some sort of bytecode manipulation. This module aims to "hide" some of these details from routines that "don't care" about these implementation details.
Issues
Java5 Complete the support for annotations and generics.
Lazy Cache Improve the lazy cache implementation. Details should only be retrieved when accessed.
AOP It is still an open issue whether this implementation can be used by AOP or whether the ClassAdapter is a better place.
Javassist The current implementation just uses simple reflection. Javassist can proably provide a better implementation including supporting annotations before java5?
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/kernel.xml0000644000175000017500000000333410150404616030737 0ustar twernertwerner The Core Kernel Kernel provides access to the kernel services. Kernel - getting access to kernel services The static method Kernel getKernel() provides access to the kernel for the current context. The context is determined by the KernelManager. The services provided by the kernel are: The invocation bus. The kernel configuration. The bean configurator. The kernel controller. The event manager. The registry. KernelManager - controlling context The kernel manager decides which kernel is relevent for the given context. e.g. it could use a singleton kernel or it could provide a different kernel based on classloading domain. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/joinpoint.xml0000644000175000017500000000362510303657704031503 0ustar twernertwerner Joinpoint - Accessing a Bean WARNING: The joinpoint model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The joinpoint model provides a mechanism to access class operations in a standard way.
Aims
Stanardize reflection operations There are many places that use reflection within JBoss. The joinpoint provides a mechansim to deal with reflection dispatching without having worry about all the standard error handling, etc.
Overridding Definition The joinpoint allows the mechanism of dispatch to be overridden either through configuration or implementation. Examples would be not using get/set to define a property either because it is a different method name or it should use direct field access.
Issues
javabean versus object Much of the javabean abstraction has moved the BeanInfo model, it is questionable whether the ability to override on a plain object is still required.
Alternative implementations One use of this abstraction would be to precompile reflection objects using javassist for use in environments where dynamic reflection is not supported.
AOP Another potential other use is to "optimize away" reflection when already dispatching requests through AOP.
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/metadata.xml0000644000175000017500000000430410364714076031250 0ustar twernertwerner Decribing Beans The BeanMetaData provides configuration used to deploy beans. This is similar to the -service.xml files in JBoss4. BeanMetaData - deploying a single bean The BeanMetaData provides top level information and access to the more detailed information about the bean deployment. ClassLoaderMetaData - configuring a classloader The classloader metadata is used to configure the classloader for an individual bean or a whole deployment. PropertyMetaData - configuring properties The property metadata is used to configure individual bean property with values. ParameterMetaData - configuring values passed to constructors or methods The parameter metadata is used to pass values to constructors and methods. SupplyMetaData - specifying the bean supplies a demand The supply metadata is used to define what the bean supplies. DemandMetaData - specifying the bean demands a dependency The demand metadata is used to define what the bean demands. ValueMetaData - configuring values The value metadata is used to define values. DependencyValueMetaData - defining named dependencies An extension to the value metadata that treats the underlying value as the name of an entry in the Registry and returns the registry's registered object when asked for the value. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/deployment.xml0000644000175000017500000000102410303657704031641 0ustar twernertwerner Bean Deployment - deploying beans The bean deployer provides routines for deploying beans. Abstract deployer The abstract deployer provides the basic processing for deploying multiple beans together. BeanXMLDeployer The xml deployer adds extra routines for parsing <deployment/>s from xml. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/configuration.xml0000644000175000017500000000102310150404616032317 0ustar twernertwerner Bean Configuration - instantiating and configuring beans The kernel configurator provides a service to instantiate and configure beans. KernelConfigurator - configuring beans This service is used by the Controller once it knows the dependencies have been satisfied. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/dependencycontroller.xmllibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/dependencycontroller.xm0000644000175000017500000000052410303657704033533 0ustar twernertwerner Dependency Controller WARNING: The dependency controller is subject to change without notice. It is currently under developement as issues with the integration of the JMX microkernel and microcontainer are resolved. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/beaninfo.xml0000644000175000017500000000303510303657704031246 0ustar twernertwerner Describing a Bean The BeanInfo provides a description of a POJO. This information allows the microcontainer to know what can be done with the bean. This is similar to the BeanInfo provided by the java.beans package but some java environments like J2ME do not include this package because it has dependencies on AWT. BeanInfoFactory - retrieveing bean descriptions The BeanInfoFactory is used to create BeanInfos for a given class. BeanInfo getBeanInfo(String className) The default implementation is the IntrospectionBeanInfoFactory which uses reflection. BeanInfo - information about a bean The BeanInfo provides top level information and access to the more detailed information about the bean. PropertyInfo - information about a property The PropertyInfo describes an property, i.e. something that follows the Type getX(); void setX(Type x) javabean pattern. EventInfo - information about an event The EventInfo describes an event. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/classadapter.xml0000644000175000017500000000307610303657704032140 0ustar twernertwerner ClassAdapter WARNING: The classadapter model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The class adapter abstraction provides a mechanism to override a class or a specific instance of a class in a given context.
Aims
AOP Integration The main of the classadapter is to provide an integration point for AOP and the microcontainer. It represents a class instance before it is constructed or maybe even before the class has been deployed. AOP can override the joinpoints to add extra work during construction.
Overridding annotations The microcontainer allows annotations to be overridden on a specific bean deployment. These are passed to AOP.
Obtaining AOP dependencies The microcontainer uses the classadapter to learn what cross-cutting AOP dependencies are required before any attempt is made to construct the object.
Issues
AOP Integration The AOP integration is currently being finalized as part of AOP2.0
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/modules/bus.xml0000644000175000017500000000126610303657704030262 0ustar twernertwerner The Invocation Bus The invocation bus provides detyped, named access to the objects in the registry. Bus - invoking objects by name The invocation bus provides Detyped invocations - the beans operations can be invoked by name using Named endpoints - the target bean is specified by a name registered in the registry libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/master.xml0000644000175000017500000000502110367420071027300 0ustar twernertwerner ]> JBoss Microcontainer Reference A Reference for Developers 1.0.2 Target Audience This reference is aimed at microcontainer developers. It aims at describing how the microcontainer is constructed, the design decisions made and how to extend or develop it. Preface Commercial development support, production support and training for the JBoss Microcontainer is available through JBoss Inc. The JBoss Microcontainer is a project of the JEMS product suite. Authors: Adrian Brock - JBoss Microcontainer Project Lead and Chief Scientist of JBoss Inc. &introduction; &reflection; &joinpoint; &classadapter; &dependencycontroller; &dependencyinfo; &bootstrap; ®istry; &bus; &beaninfo; &metadata; &configuration; &dependency; &deployment; &events; libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/images/0000755000175000017500000000000011620312176026531 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/reference/en/images/empty.dir0000644000175000017500000000000010154345354030362 0ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/0000755000175000017500000000000011620312176025754 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/build.xml0000644000175000017500000000107010303657704027601 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/0000755000175000017500000000000011620312176026356 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/0000755000175000017500000000000011620312176030026 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/packaging.xml0000644000175000017500000000321210427557361032505 0ustar twernertwerner Packaging We had a brief discussion on the .beans archive in . In this chapter, we will go into more depth on the packaging topic. As we will see later in , the packaging is more of a convention rather than a requirement. The convention is recommended since it allows "deployments" to be used both standalone and inside JBoss AS. The basic structure of microcontainer deployment is a .beans file (see below). The .beans can also be unpacked in a directory structure that looks the jar file. It contains a META-INF/jboss-beans.xml to describe what you want it to do. The contents of this xml file are described in . Finally, the .beans archive contains the classes and any resources just like any other jar file. example.beans/ example.beans/META-INF/jboss-beans.xml example.beans/com/acme/SomeClass.class If you want to include a .beans file in an .ear deployment, you will need to reference in META-INF/jboss-app.xml. <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd" > <jboss-app> <module><service>example.beans</service></module> </jboss-app> libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/conclusion.xml0000644000175000017500000000110010312570030032704 0ustar twernertwerner Conclusion The microcontainer is a powerful replacement for the JBoss's JMX microcontainer. It brings the loosely coupled configuration environment of JBoss to POJO environments, adding more control and extra features. Both inside and outside the JBoss Application Server. Going forward these additional features will allow even more advances, including aspectized deployment, on demand services, versioned deployments, etc. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/introduction.xml0000644000175000017500000000765210427557361033316 0ustar twernertwerner Introduction to the JBoss Microcontainer The JBoss Microcontainer provides an environment to configure and manage POJOs (plain old java objects). It is designed to reproduce the existing JBoss JMX Microkernel but targetted at POJO environments. As such it can be used standalone outside the JBoss Application Server. At its core, the JBoss Microcontainer is a generic "dependency injection" framework. It's primary function is to instantiate objects, figure out their dependencies (e.g., object A must be instantiated before object B), and then manage the relationship between those objects (e.g., object A is a property of object B). With the JBoss Microcontainer, you can build applications or shared services using simple POJOs. The JBoss Microcontainer is responsible for assembling the POJOs together according to an externally defined XML configuration file. It decouples the components in an application and makes the application easy to unit-test. The JBoss Microcontainer is a big object factory that manages objects. In this sense, it is similar to existing dependency injection frameworks such as the Spring framework and HiveMind framework. However, JBoss Microcontainer also has several important new features that set it apart from existing frameworks. JBoss Microcontainer supports life cycles for POJO components. It gives you fine-grained control over exactly how the objects are created, instantiated, and destroyed. JBoss Microcontainer manages dependencies between objects. For instance, you can declare that object A must be instantiated before object B can be created. JBoss Microcontainer integrates with the JBoss AOP (Aspect Oriented Programming) framework. In the JBoss Microcontainer configuration file, you can easily wire aspects as services to POJOs. JBoss Microcontainer is embedded in JBoss AS 4.0.3 and above. It is the ideal choice if you need to develop shared services in JBoss AS. Of course, you can also run JBoss Microcontainer outside of the JBoss AS. For instance, you can run it in a Java SE (e.g., Swing) application or in the Tomcat servlet container. So, JBoss Microcontainer primarily targets three types of developers. Framework developers can use JBoss Microcontainer to assemble custom server frameworks. For instance, the JBoss embeddable EJB3 framework is based on the Microcontainer. JBoss application developers can develop POJO services that nicely integrate into the server and can be shared across applications. Application developers can write lightweight applications that makes use of services from a variety of sources (e.g., transaction service from JBoss, persistence service from Hibernate, and HTTP service from Tomcat). A typical JBoss Microcontainer application or service include a set of POJOs that complete business tasks, as well as an XML configuration file called META-INF/jboss-beans.xml on the class path. The jboss-beans.cml file tells the JBoss Microcontianer how to assemble those POJOs together. For deployment, you can JAR the POJO classes, as well as the META-INF/jboss-beans.xml file together in a .beans archive file (see ). This document takes you through some example deployments into JBoss-4.0.3+ explaining how to configure POJOs and link them together through injection. Later it shows how to do the same thing outside the application server. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/standalone.xml0000644000175000017500000001152510427557361032717 0ustar twernertwerner Standalone In , we briefly discussed how to run a microcontainer application by loading the StandaloneBootstrap class, which in turn wraps the BasicBootstrap and BeanXMLDeployer utility classes. In this chapter, we will look into the source code of StandaloneBootstrap and see exactly how it works. While the StandaloneBootstrap class is sufficient for most use case scenarios, you do not have to use it. You can trivially write your own class that uses the BasicBootstrap and BeanXMLDeployer. package org.jboss.kernel.plugins.bootstrap.standalone; import java.net.URL; import java.util.Enumeration; import java.util.List; import java.util.ListIterator; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.util.collection.CollectionsFactory; public class StandaloneBootstrap extends BasicBootstrap { /** The deployer */ protected BeanXMLDeployer deployer; /** The deployments */ protected List deployments = CollectionsFactory.createCopyOnWriteList(); /** The arguments */ protected String[] args; /** * Bootstrap the kernel from the command line * * @param args the command line arguments * @throws Exception for any error */ public static void main(String[] args) throws Exception { StandaloneBootstrap bootstrap = new StandaloneBootstrap(args); bootstrap.run(); } /** * Create a new bootstrap */ public StandaloneBootstrap(String[] args) throws Exception { super(); this.args = args; } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BeanXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); ClassLoader cl = Thread.currentThread().getContextClassLoader(); for (Enumeration e = cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } for (Enumeration e = cl.getResources("META-INF/" + StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } // Validate that everything is ok deployer.validate(); } /** * Deploy a url */ protected void deploy(URL url) throws Throwable { log.debug("Deploying " + url); KernelDeployment deployment = deployer.deploy(url); deployments.add(deployment); log.debug("Deployed " + url); } /** * Undeploy a deployment */ protected void undeploy(KernelDeployment deployment) { log.debug("Undeploying " + deployment.getName()); deployments.remove(deployment); try { deployer.undeploy(deployment); log.debug("Undeployed " + deployment.getName()); } catch (Throwable t) { log.warn("Error during undeployment: " + deployment.getName(), t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); ListIterator iterator = deployments.listIterator(deployments.size()); while (iterator.hasPrevious()) { KernelDeployment deployment = (KernelDeployment) iterator.previous(); undeploy(deployment); } } } } One way to use this class in your own applications would be: import org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap public MyMainClass { public static void main(String[] args) throws Exception { StandaloneBootstrap.main(args); // Your stuff here... } } So what does the standalone bootstrap do? First it does the plain bootstrap to get the "kernel" ready. You can think of this a sophisticated form of ServerLocator implementation. It then creates a BeanXMLDeployer for deploying XML files. Next it adds a shutdown hook, such that deployments are correctly "undeployed" in reverse order to their deployment. Finally, it scans the classpath for META-INF/jboss-beans.xml and deploys every instance of that file it finds to populate the "kernel". You can of course choose not to use this helper class and instead implement your own processing rules. libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/installation.xml0000644000175000017500000000240210427557361033262 0ustar twernertwerner Download and Installation First you need download JBoss Microcontainer release from http://www.jboss.com/downloads/index Unpack the archive which will give you a microcontainer-x.y.z directory with the following subfolders: docs/api - javadocs for the microcontainer docs/gettingstarted - this getting started documentation docs/licences - the licenses for the software examples - the examples explained in the next chapter lib - the libraries required to run the microcontainer You will also need a JDK of version 1.4.x+ and a copy of Apache Ant 1.6+ If you want to run the examples inside JBoss AS, you will need to download JBoss-4.0.3 or later http://www.jboss.com/products/jbossas/downloads libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/basics.xml0000644000175000017500000006402010515722466032027 0ustar twernertwerner Basic Configuration and Usage The microcontainer's main purpose is to allow external configuration of POJOs. As we have seen in , the POJOs in a microcontainer applications are nothing special. The key element that drives the application is the jboss-beans.xml configuration file. So, in this chapter, we will look at the some of the common configurations in jboss-beans.xml.
Deployment The deployment element acts as a container for many beans that are deployed together. <?xml version="1.0" encoding="UTF-8"?> <!-- Deployment holds beans --> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd" xmlns="urn:jboss:bean-deployer"> <!-- bean part of the deployment --> <bean .../> <!-- bean part of the deployment --> <bean .../> </deployment>
Bean The bean element is the main deployment component. It describes a single managed object in the runtime. <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd" xmlns="urn:jboss:bean-deployer"> <bean name="Simple" class="org.jboss.example.microcontainer.simple.SimpleBean"/> </deployment> The example above from the simple example uses the default constructor of SimpleBean to create a new POJO. new org.jboss.example.microcontainer.simple.SimpleBean(); It is given the name "Simple" such that it can be referenced elsewhere.
Construction The example above uses the default constructor. What if you don't want to use some other constructor. The simplest mechanism just matches the number of parameters in the constructor. The example below is from the constructor example. public class ConstructorBean { ... ... public ConstructorBean(int integer) { ... ... } The jboss-beans.xml element for creating the POJO using the above constructor is as follows. <bean name="Integer" class="org.jboss.example.microcontainer.constructor.ConstructorBean"> <constructor> <parameter>4</parameter> </constructor> </bean> The microcontainer would just use the following to create the Integer named component. new ConstructorBean (4); Sometimes there are two constructors with the same number of parameters. In this case, you must specify the types to resolve the ambiguity. public class ConstructorBean { public ConstructorBean(String string, int integer) {} public ConstructorBean(String string, long long) {} } The following configuration creates a managed bean instance named StringLong using the second constructor listed above. <bean name="StringLong" class="org.jboss.example.microcontainer.constructor.ConstructorBean"> <constructor> <parameter>a string</parameter> <parameter class="long">10</parameter> </constructor> </bean> Behind the scene, the microcontainer invokes: new ConstructorBean (new String("a string"), (long) 10); Note that you only have to be explicit enough to resolve the ambiguity.
Factories Not all classes have public constructors. It is often good practice to use factories when you to have a choice of implementation for an interface. The microcontainer includes support for the several different types of factory. The simplest case is a static factory class with a static factory method like the following from the factory example. public class StaticFactory { public static FactoryCreatedBean createBean() { return new FactoryCreatedBean("StaticFactory.createBean()"); } } The bean configuration tells the microcontainer to the use the StaticFactory.createBean() static method to create an instance of FactoryCreatedBean. <bean name="StaticFactoryCreatedBean" class="org.jboss.example.microcontainer.factory.FactoryCreatedBean"> <constructor factoryMethod="createBean" factoryClass="org.jboss.example.microcontainer.factory.StaticFactory"/> </bean> Of course, the factory class itself does not have to be static. The microcontainer can create a non-static factory itself as a managed object, and then use this factory object to create other bean objects. For instance, the factory example contains a singleton factory class example. public class SingletonFactory { private static SingletonFactory singleton; public synchronized static SingletonFactory getInstance() { if (singleton == null) singleton = new SingletonFactory(); return singleton; } public FactoryCreatedBean createBean() { return new FactoryCreatedBean("SingletonFactory.createBean()"); } private SingletonFactory() { System.out.println("SingletonFactory()"); } } In the following configuration, we first create an instance of the SingletonFactory class under the name "SingletonFactory" using the SingletonFactory.getInstance() static method. Then, we use this factory object to create a FactoryCreatedBean instance under the name SingletonFactoryCreatedBean. <bean name="SingletonFactory" class="org.jboss.example.microcontainer.factory.SingletonFactory"> <constructor factoryMethod="getInstance" factoryClass="org.jboss.example.microcontainer.factory.SingletonFactory"/> </bean> <bean name="SingletonFactoryCreatedBean" class="org.jboss.example.microcontainer.factory.FactoryCreatedBean"> <constructor factoryMethod="createBean"> <factory bean="SingletonFactory"/> </constructor> </bean> Like the constructor method we mentioned before, the factory method can also take call parameters via the nested parameter element.
Properties It is possible to create all objects using factories and constructors, however many people use the JavaBean or MBean convention where an object is constructed using a default constructor and then configured using properties or attributes (i.e., setter methods). The following class from the properties example is a JavaBean style POJO. public class PropertiesBean { public PropertiesBean() { System.out.println("PropertiesBean()"); } public void setTitle(String title) { System.out.println("setTitle: " + title); } public void setSubTitle(String subTitle) { System.out.println("setSubTitle: " + subTitle); } public void setLink(URL url) { System.out.println("setLink: " + url); } public void setNumber(Number number) { System.out.println("setNumber: " + number + " type=" + number.getClass().getName()); } } The configuration creates the PropertiesBean instance and then use the setter methods to set its properties. <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="title">JBoss Microcontainer property example</property> <property name="subTitle"><null/></property> <property name="link">http://www.jboss.org</property> <property name="number" class="java.lang.Long">4</property> </bean> Here we use the string representation of various objects, including the null value. They will be discussed in more detail in the next section.
String Values Now, you probably noticed that we use string values to represent all kinds of objects in the parameter element for the constructors or factory methods, and in the property element for JavaBean properties. In the most generic case, a JavaBean PropertyEditor can be used to convert a string to a specific type. JBoss already provides a large number of property editors for standard types. Please see the example below for the POJO class, the configuration, and the resultant microcontainer action. import java.beans.PropertyEditorSupport; public class URLEditor extends PropertyEditorSupport{ public void setAsText(final String text){ setValue(new URL(text)); } } public class Example{ public URL getLink() {} public void setLink(URL url) {} } <bean name="Name1" class=com.acme.Example"> <property name="link">http://acme.com/index.html</property> </bean> Example example = new com.acme.Example(); PropertyEditor editor = PropertyEditorManager.findEditor(URL.class); editor.setAsText("http://acme.com/index.html"); example.setLink((URL)editor.getValue()); Often the property takes an interface or abstract class, but you want to pass a specific implementation or a subclass. That is easy. Just specify the implementation class in the property.class attribute as show below. public class Example{ public Number getNumber() {} public void setNumber(Number number) {} } <bean name="Name1" class=com.acme.Example"> <property name="number" class="java.lang.Long">4</property> </bean> Example example = new com.acme.Example(); example.setNumber(new Long(4)); There is also a more long-winded form of value that we will see later when configuring collections. public class Example{ public Number getNumber() {} public void setNumber(Number number) {} } <bean name="Name1" class=com.acme.Example"> <property name="number"><value class="java.lang.Long">4</value></property> </bean> Example example = new com.acme.Example(); example.setNumber(new Long(4)); Finally, the null value is trivial, <null/>. But, it needs to differentiated from the string "null". Please see the example below for the usage. public class Example{ public String getTitle() {} public void setTitle(String string) {} } <!-- Wrong --> <bean name="Name1" class=com.acme.Example"> <property name="title">null</property> </bean> Example example = new com.acme.Example(); example.setTitle(new String("null")); <!-- Correct --> <bean name="Name1" class="com.acme.Example"> <property name="title"><null/></property> </bean> Example example = new com.acme.Example(); example.setTitle(null);
Injections Objects by themself are not very useful. They need to be linked together to form more complicated data structures. We have already seen one form of an injection when using factory instances above. Injections can be used anywhere a string value is used. All the examples that we have previously seen with strings could also be done with injections. The injection example shows how dependency injection works in JBoss Microcontainer. The InjectionBean class has a host property, which is the java.net.URL type. We will inject an URL object into the bean via the microcontainer. public class InjectionBean { String name; public InjectionBean(String name) { this.name = name; System.out.println("InjectionBean() " + this); } public String toString() { return name; } public void setHost(String host) { System.out.println("setHost: " + host + " on " + this); } public void setOther(InjectionBean other) { System.out.println("setOther: " + other + " on " + this); } } The microcontainer creates the URL object first, and then passes the URL object as a property into the InjectionBean1 object when it is instantiated. <bean name="URL" class="java.net.URL"> <constructor> <parameter>http://www.jboss.org/index.html</parameter> </constructor> </bean> <bean name="InjectionBean1" class="org.jboss.example.microcontainer.injection.InjectionBean"> <constructor> <parameter>InjectionBean1</parameter> </constructor> <property name="host"><inject bean="URL" property="host"/></property> </bean> The order of the bean elements does not matter. The microcontainer orders the beans into the correct order. For instance, in the above example, the URL object is always created before the InjectionBean1 object since the latter is dependent on the former. But that leaves the problem of how to resolve circular dependencies. These can be resolved by specifying when you want the injection to occur. In the example below we say once Circular1 is "Instantiated" (constructed) it is ok to configure it on Circular2. Normally, injections wait for the referenced bean to reach the state "Installed" (see later on life cycles). <bean name="Circular1" class="org.jboss.example.microcontainer.injection.InjectionBean"> <constructor> <parameter>Circular1</parameter> </constructor> <property name="other"><inject bean="Circular2"/></property> </bean> <bean name="Circular2" class="org.jboss.example.microcontainer.injection.InjectionBean"> <constructor> <parameter>Circular2</parameter> </constructor> <property name="other"> <inject bean="Circular1" state="Instantiated"/> </property> </bean> Here is the order the microcontainer instantiates those objects. InjectionBean Circular1 = new InjectionBean (); InjectionBean Circular2 = new InjectionBean (); Circular1.setOther(Circular2); // don't wait for a fully configured Circular1 Circular2.setOther(Circular1); // Complete the confguration of Circular2
Collections The collection, list, set and array elements are used to enclose collection of values to pass to the bean components as properties or constructor (factory method) parameters. The default types are: collection: java.util.ArrayList list: java.util.ArrayList set: java.util.HashSet array: java.lang.Object[] They all take the same form. So, only list is shown here in those examples. You just need to nest value elements inside the collection element to specify the contents of the collection. Please note that a "elementClass" attribute is required on the collection element, unless you specify explicit types on all the values. Below is a sample configuration from the collections example. It sets a List with two elements of mixed types to the ObjectPrinter.print property on the PrintList named object. <bean name="PrintList" class="org.jboss.example.microcontainer.collections.ObjectPrinter"> <constructor><parameter>List</parameter></constructor> <property name="print"> <list elementClass="java.lang.String"> <value>Value of type elementClass</value> <value class="java.lang.Integer">4</value> </list> </property> </bean> It is also possible to use a List as an element inside another List. Here is an example. <bean name="Name1" class="com.acme.Example"> <property name="list"> <list class="java.util.LinkedList" elementClass="java.lang.String"> <value>A string</value> <!-- uses elementClass --> <value class="java.lang.URL">http://acme.com/index.html</value> <!-- a URL --> <value><inject bean="SomeBean"/></value> <!-- inject some other bean --> <value> <!-- a list inside a list --> <list elementClass="java.lang.String"> <value>Another string</value> </list> </value> </list> </property> </bean> Below is what happens inside the microcontainer. Example example = new com.acme.Example(); List list = new LinkedList(); list.add(new String("A string")); list.add(new URL("http://acme.com/index.html")); list.add(someBean); List subList = new ArrayList(); subList.add(new String("Another string")); list.add(subList); element.setList(list); The other type of collection is a map which also covers Properties and Hashtables. The default is java.util.HashMap. The entry element inside the map differentiates each key and value pair. For maps there are two default types for the elements: the keyClass and valueClass. Below is a map sample from the collections example. <bean name="PrintMap" class="org.jboss.example.microcontainer.collections.ObjectPrinter"> <constructor><parameter>Map</parameter></constructor> <property name="print"> <map keyClass="java.lang.String" valueClass="java.lang.String"> <entry> <key>Key1 of type keyClass</key> <value>Value1 of type valueClass</value> </entry> <entry> <key>Key2 of type keyClass</key> <value class="java.lang.Integer">4</value> </entry> <entry> <key class="java.lang.Long">4</key> <value>Value of type valueClass</value> </entry> </map> </property> </bean>
Lifecycle Anybody familiar with the JBoss JMX microkernel will know about the lifecycle. The microcontainer extends the lifecycle concept to the managed POJOs. A POJO can have the following lifecycle states. Not Installed: The POJO has not been described or has been uninstalled. Described: The POJO's bean description has been examined and dependencies determined. Instantiated: All the dependencies have been resolved to construct the bean, these include, the class exists, the constructor parameter injections can be resolved, any factory can be resolved. Configured: All the property injections can be resolved, this includes all the dependencies in any collections. Create: All the dependent beans have been "created", this includes any injections passed to the create method. Start: All the dependent beans have been "started", this includes any injections passed to the start method. Installed: The lifecycle is complete. *** ERROR ***: Some unexpected error occured, usually due to misconfiguration. At each stage of the lifecycle, the corresponding method in the bean class is automatically called by the microcontainer, so that you can programatically control how the objects behave throughout its lifecycle. For instance, the start() method in the bean class is called when the bean enters the Start state. Below is the LifecycleBean class from the lifecycle example. public class LifecycleBean { String name; public LifecycleBean(String name) { this.name = name; System.out.println("LifecycleBean() " + this); } public void create() { System.out.println("create: " + this); } public void start() { System.out.println("start: " + this); } public void stop() { System.out.println("stop: " + this); } public void destroy() { System.out.println("destroy: " + this); } public String toString() { return name; } } The depends element allows two beans to perform two phase startup processing like the JMX microkernel. <bean name="Lifecycle1" class="org.jboss.example.microcontainer.lifecycle.LifecycleBean"> <constructor> <parameter>Lifecycle1</parameter> </constructor> <depends>Lifecycle2</depends> </bean> <bean name="Lifecycle2" class="org.jboss.example.microcontainer.lifecycle.LifecycleBean"> <constructor> <parameter>Lifecycle2</parameter> </constructor> </bean> The microcontainer resolves the dependency and starts both beans in the appropriate order. Below is the console output when you run the lifecycle example. It shows when various lifecycle methods are called when the bean enters those states. run: [java] LifecycleBean() Lifecycle1 [java] LifecycleBean() Lifecycle2 [java] create: Lifecycle2 [java] create: Lifecycle1 [java] start: Lifecycle2 [java] start: Lifecycle1 [java] stop: Lifecycle1 [java] stop: Lifecycle2 [java] destroy: Lifecycle1 [java] destroy: Lifecycle2 The create(), start(), stop() and destroy() methods can be overridden with parameters passed to them. Below is an example on how to override the create() method via the jboss-beans.xml configuration file. public class Example{ public void initialize(Object someObject) {} } <bean name="Name1" class="com.acme.Example"> <create method="initialize"> <parameter><inject bean="SomeBean"/></parameter> </create> </bean>
Installation As of 2.0.0, you can provide generic install/uninstall actions. Allowing you to dynamically setup repositories. Note the use of this to pass yourself as a parameter. If you exlude the bean name on the action, the operation is performed on yourself. <bean name="Name1" class="java.util.Timer"/> <bean name="Name2" ...> <install bean="Name1" method="schedule"> <parameter><this/></parameter> <parameter>100</parameter> <parameter>10000</parameter> </install> <uninstall method="cancel"/> </bean> // Install Name1 = new Timer(); Name2 = ...; Name1.schedule(Name2, 100, 10000); // Uninstall name2.cancel();
ClassLoader The Microcontainer supports configuration of the classloader at either the deployment or bean level. The classloader element has three alternatives. // deployment level - applies to all beans in the deployment <deployment> <classloader><inject bean="ClassLoaderName"/></classloader> // bean level <bean name="Name2" ...> <classloader><inject bean="ClassLoaderName"/></classloader> </bean> // bean level will use any deployment level classloader <bean name="Name2" ...> </bean> // bean level as null to not use any deployment level classloader <bean name="Name2" ...> <classloader><null/></classloader> </bean>
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/modules/examples.xml0000644000175000017500000002123510427557361032404 0ustar twernertwerner Examples
A Simple Example The best way to learn the MicroContainer is through examples. The Microcontainer distribution is bundled with several examples, which we will discuss in later this guide. In this section, let's first have a look at the simple example. It shows the structure of a simple MicroContainer application and how to run the application in both standalone and JBoss AS environments. The simple example is located in the examples/simple directory of the Microcontainer distribution. It contains a single class under the src/main directory. public class SimpleBean { public SimpleBean() { System.out.println("SimpleBean() constructor"); } } The SimpleBean object prints to the system console when it is instantiated via the default constructor. Now, we need to use the Microcontainer to instantiate a SimpleBean POJO. We do this by invoking the Microcontainer with the src/resources/META-INF/jboss-beans.xml configuration file. <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd" xmlns="urn:jboss:bean-deployer"> <bean name="Simple" class="org.jboss.example.microcontainer.simple.SimpleBean"/> </deployment> This configuration file tells the Microcontainer to create an instance of the SimpleBean POJO and manage it under the name Simple. When other objects in the application need to access this SimpleBean instance, they can simply ask for the Simple object from the Microcontainer API. Essentially, we just created a SimpleBean singleton instance here. When we run this application, we are expected to see the "SimpleBean() constructor" printout from the console when the Microcontainer creates the Simple object.
Build and Package the Application To build, package, and run the simple application, we can simply execute the ant command in the examples/simple directory. It runs the build.xml script, which further invokes the examples/build-common.xml script. The compile and dist tasks in the build script builds the application. <target name="compile"> <mkdir dir="build"/> <javac destdir="build" debug="on" deprecation="on" optimize="on" classpathref="compile.classpath"> <src path="src"/> </javac> </target> <target name="dist" depends="compile"> <copy todir="build"> <fileset dir="src/resources"/> </copy> <mkdir dir="dist"/> <jar jarfile="dist/${ant.project.name}.beans" basedir="build"/> </target> The compile task compiles the Java source files into class files under the build directory. Then, the dist task packages the class files and the META-INF/jboss-beans.xml file together in a JAR file named example-simple.beans in the dist directory. Note that the .beans extension is important if you need to run the application inside the JBoss AS. For more on Microcontainer application packaging, please refer to . In the next two sections, let's discuss how to run the .beans application both as a standalone Java SE application and as a service in the JBoss AS.
Run the Application in Standalone Mode The run task in the build.xml script loads the Microcontainer with the example-simple.beans JAR file on the classpath. The Microcontainer then scans for the META-INF/jboss-beans.xml file on the classpath and creates / manages objects according to the configuration. <target name="run" depends="dist"> <java classname="org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap" fork="true"> <classpath refid="run.classpath"/> </java> </target> <path id="run.classpath"> <fileset dir="dist"> <include name="*.beans"/> </fileset> <fileset dir="${jboss.micro.home}/lib"> <include name="*.jar"/> </fileset> </path> The StandaloneBootstrap class is a utility class to load the Microcontainer as a standalone application in the Java SE environment. We will discuss more about it in . As expected, the Microcontainer instantiates the SimpleBean POJO and the message is successfully printed from the constructor. run: [java] SimpleBean() constructor BUILD SUCCESSFUL Total time: 12 seconds
Run the Application as a JBoss Service To run the application as a shared JBoss service, you first need to change the jboss.home property in the examples/build.properties file and point it to your local JBoss installation. Then, you run ant deploy to copy the example-simple.beans file into the deploy directory of your JBoss instance. If the server is already running, the .beans file is automatically deployed and you will see the SimpleBean constructor message printed out in the console window. If the server is not running, you will see the message confirming the creation of the Simple object when you start up the server the next time. To remove the .beans package from the server, just run ant undeploy in the example directory.
Other Bundled Examples Besides the simple example, the Microcontainer distribution bundles other examples to illustrate various aspects of the framework. We will cover those examples in more detail in . Each example is in a subfolder under the examples/ directory with the following structure: readme.txt - a short description of the example including the expected output build.xml - the ant build script src/resources/META-INF/jboss-beans.xml - the MicroContainer configuration for the example src/main - the java source for the example Here is a list of those examples. simple: a simple example to make sure you have everything working constructor: simple constructor configuration factory: construction using factories properties: property configuration injection: referencing other beans collections: creating collections lifecycle: the create/start/stop/destroy lifecycle locator: implementing the locator pattern with the Microcontainer The JBoss Microcontainer uses any logging mechanism supported by org.jboss.logging. e.g. if you want to use log4j, add log4j.jar and a directory containing either a log4j.properties or log4j.xml to the classpath. The default distribution uses the "null" logging implementation, which is why the examples all use System.out.println(). This just skims the surface of the MicroContainer, showing the most common usecases. Other more complicated examples can be found in the tests (available from cvs).
libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/master.xml0000644000175000017500000000327410427557361030414 0ustar twernertwerner ]> Getting Started with the JBoss Microcontainer A Guide for POJO Developers 1.0.2 Target Audience This guide is aimed at developers who want to use the Microcontainer to assemble their own applications or use it to develop shared services in the JBoss Application Server. Preface Commercial development support, production support and training for the JBoss Microcontainer is available through JBoss Inc. The JBoss Microcontainer is a project of the JEMS product suite. Authors: Adrian Brock - JBoss Microcontainer Project Lead and Chief Scientist of JBoss Inc. &introduction; &installation; &examples; &basics; &packaging; &standalone; &conclusion; libjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/images/0000755000175000017500000000000011620312176027623 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/docs/gettingstarted/en/images/empty.dir0000644000175000017500000000000010303657704031455 0ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/kernel/.project0000644000175000017500000000102611301257231023436 0ustar twernertwerner jboss-kernel JBoss Microcontainer Kernel jboss-dependency org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature libjboss-microcontainer-java-2.0.10.GA.orig/dependency/0000755000175000017500000000000011620312224022624 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/.classpath0000644000175000017500000000064611301257231024617 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/dependency/pom.xml0000644000175000017500000000571511375173343024167 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.10.GA 4.0.0 jboss-dependency jar JBoss Microcontainer Dependency http://www.jboss.com/products/jbossmc JBoss Microcontainer Dependency scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.10.GA/dependency scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.10.GA/dependency scm:svn:https://svn.jboss.org/repos/jbossas/projects/microcontainer/tags/2.0.10.GA/dependency maven-assembly-plugin src/assembly/spi.xml src/assembly/plugins.xml org.apache.maven.plugins maven-surefire-plugin **/AbstractDependencyTest* **/TestControllerContext* **/TestDelegate* true org.jboss jbossxb org.jboss jboss-reflect org.jboss jboss-mdr org.jboss.logging jboss-logging-spi org.jboss jboss-common-core org.jboss.logging jboss-logging-log4j test org.jboss.test jboss-test test junit junit test libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/0000755000175000017500000000000011620312223023412 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/0000755000175000017500000000000011620312222024370 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/0000755000175000017500000000000011620312222025311 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/0000755000175000017500000000000011620312222026100 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/0000755000175000017500000000000011620312222027220 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/0000755000175000017500000000000011620312222030177 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/DependencyAllTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/DependencyAllTes0000644000175000017500000000313710331006762033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test; import org.jboss.test.dependency.controller.test.ControllerTestSuite; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Dependency All Test Suite. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class DependencyAllTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Dependency All Tests"); suite.addTest(ControllerTestSuite.suite()); return suite; } } libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/0000755000175000017500000000000011620312222032315 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000755000175000017500000000000011620312223033364 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000755000175000017500000000000011620312223033364 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/BasicControllerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001011410331006762033371 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A BasicControllerTestCase. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class BasicControllerTestCase extends AbstractDependencyTest { public static Test suite() { return suite(BasicControllerTestCase.class); } public BasicControllerTestCase(String name) { super(name); } public void testInstall() throws Throwable { TestDelegate delegate = new TestDelegate("InstallTest"); assertInstall(delegate); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } public void testUninstall() throws Throwable { TestDelegate delegate = new TestDelegate("UninstallTest"); ControllerContext context = assertInstall(delegate); assertUninstall(context); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(9, delegate.createUninstallOrder); assertEquals(10, delegate.configureUninstallOrder); assertEquals(11, delegate.instantiateUninstallOrder); assertEquals(12, delegate.describeUninstallOrder); } public void testReinstall() throws Throwable { TestDelegate delegate = new TestDelegate("ReinstallTest"); ControllerContext context = assertInstall(delegate); assertUninstall(context); assertInstall(delegate); assertEquals(13, delegate.describeInstallOrder); assertEquals(14, delegate.instantiateInstallOrder); assertEquals(15, delegate.configureInstallOrder); assertEquals(16, delegate.createInstallOrder); assertEquals(17, delegate.startInstallOrder); assertEquals(18, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(9, delegate.createUninstallOrder); assertEquals(10, delegate.configureUninstallOrder); assertEquals(11, delegate.instantiateUninstallOrder); assertEquals(12, delegate.describeUninstallOrder); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/AliasUnitTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001215210644676121033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import javax.management.ObjectName; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.plugins.AbstractDependencyItem; /** * AliasUnitTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class AliasUnitTestCase extends AbstractDependencyTest { public static Test suite() { return suite(AliasUnitTestCase.class); } public AliasUnitTestCase(String name) { super(name); } public void testSimpleAlias() throws Throwable { ControllerContext original = assertCreateInstall("Name1", "Alias1"); try { ControllerContext ctx = assertContext("Alias1", ControllerState.INSTALLED); assertEquals("Name1", ctx.getName()); } finally { try { assertUninstall(original); } finally { assertNoContext("Alias1"); } } } public void testAliasAlreadyInstalled() throws Throwable { ControllerContext alreadyDone = assertCreateInstall("AlreadyDone"); try { ControllerContext broken = createControllerContext("Name1", "AlreadyDone"); try { install(broken); } catch (Throwable t) { checkThrowable(IllegalStateException.class, t); } assertNoContext("Name1"); ControllerContext notAlias = assertContext("AlreadyDone", ControllerState.INSTALLED); assertEquals("AlreadyDone", notAlias.getName()); } finally { assertUninstall(alreadyDone); } assertCreateInstall("Name1", "AlreadyDone"); } public void testJMXasName() throws Throwable { String name = "test:name=ZName,attrib=Foo"; ObjectName jmxName = ObjectName.getInstance(name); String canonical = jmxName.getCanonicalName(); ControllerContext original = assertCreateInstall(name); try { ControllerContext ctx = assertContext(canonical, ControllerState.INSTALLED); assertEquals(name, ctx.getName()); } finally { try { assertUninstall(original); } finally { assertNoContext(canonical); } } } public void testJMXasAlias() throws Throwable { String alias = "test:name=ZName,attrib=Foo"; ObjectName jmxName = ObjectName.getInstance(alias); String canonical = jmxName.getCanonicalName(); ControllerContext original = assertCreateInstall("Test1", alias); try { ControllerContext ctx = assertContext(canonical, ControllerState.INSTALLED); assertEquals("Test1", ctx.getName()); } finally { try { assertUninstall(original); } finally { assertNoContext(canonical); } } } public void testJMXasDependency() throws Throwable { String alias = "test:name=ZName,attrib=Foo"; ObjectName jmxName = ObjectName.getInstance(alias); String canonical = jmxName.getCanonicalName(); // add original with dependency ControllerContext original = createControllerContext("Test1"); DependencyInfo info = original.getDependencyInfo(); info.addIDependOn(new AbstractDependencyItem("Test1", alias, ControllerState.CONFIGURED, null)); assertInstall(original, ControllerState.INSTANTIATED); try { // create dependency resolver ControllerContext dependant = assertCreateInstall(canonical); try { assertContext("Test1", ControllerState.INSTALLED); } finally { try { assertUninstall(dependant); } finally { assertNoContext(canonical); } } } finally { assertUninstall(original); } } } ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/RecursiveResolutionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000562611301276771033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.util.Collections; import java.util.Map; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.test.dependency.controller.support.RecursiveDependencyItem; /** * RecursiveResolutionTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class RecursiveResolutionTestCase extends AbstractDependencyTest { public static Test suite() { return suite(RecursiveResolutionTestCase.class); } public RecursiveResolutionTestCase(String name) { super(name); } public void testRecursiveResolve() throws Throwable { Map actionsMap = Collections.emptyMap(); ControllerContextActions actions = new AbstractControllerContextActions(actionsMap); ControllerContext ctx1 = new AbstractControllerContext("1", actions); ctx1.setMode(ControllerMode.MANUAL); assertInstall(ctx1, ControllerState.NOT_INSTALLED); ControllerContext ctx2 = new AbstractControllerContext("2", actions); ctx2.setMode(ControllerMode.MANUAL); DependencyInfo ctx2dependencies = ctx2.getDependencyInfo(); ctx2dependencies.addIDependOn(new RecursiveDependencyItem("2", "1", ControllerState.INSTALLED, ControllerState.INSTALLED)); assertInstall(ctx2, ControllerState.NOT_INSTALLED); assertChange(ctx2, ControllerState.INSTALLED); assertContext(ctx1, ControllerState.INSTALLED); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/CrossContextDependencyBadObjectName2TestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003105010604476342033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.OtherDelegate; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A CrossContext Dependency BadObjectName TestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class CrossContextDependencyBadObjectName2TestCase extends AbstractDependencyTest { public static Test suite() { return suite(CrossContextDependencyBadObjectName2TestCase.class); } public CrossContextDependencyBadObjectName2TestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyWrongOrder() throws Throwable { OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.PRE_INSTALL); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("test:a=1,b=2", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.PRE_INSTALL); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); assertInstall(delegate1); assertEquals(37, delegate1.describeInstallOrder); assertEquals(38, delegate1.instantiateInstallOrder); assertEquals(39, delegate1.configureInstallOrder); assertEquals(40, delegate1.createInstallOrder); assertEquals(41, delegate1.startInstallOrder); assertEquals(42, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(43, delegate2.describeInstallOrder); assertEquals(44, delegate2.instantiateInstallOrder); assertEquals(45, delegate2.configureInstallOrder); assertEquals(46, delegate2.createInstallOrder); assertEquals(47, delegate2.startInstallOrder); assertEquals(48, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { return new TestDelegate("test:b=2,a=1"); } protected OtherDelegate getDelegate2() { OtherDelegate result = new OtherDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "test:a=1,b=2", ControllerState.DESCRIBED, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/CrossContextDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003073210565031075033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.OtherDelegate; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A CrossContext DependencyTestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class CrossContextDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(CrossContextDependencyTestCase.class); } public CrossContextDependencyTestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyWrongOrder() throws Throwable { OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.PRE_INSTALL); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("Name1", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.PRE_INSTALL); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); assertInstall(delegate1); assertEquals(37, delegate1.describeInstallOrder); assertEquals(38, delegate1.instantiateInstallOrder); assertEquals(39, delegate1.configureInstallOrder); assertEquals(40, delegate1.createInstallOrder); assertEquals(41, delegate1.startInstallOrder); assertEquals(42, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(43, delegate2.describeInstallOrder); assertEquals(44, delegate2.instantiateInstallOrder); assertEquals(45, delegate2.configureInstallOrder); assertEquals(46, delegate2.createInstallOrder); assertEquals(47, delegate2.startInstallOrder); assertEquals(48, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { return new TestDelegate("Name1"); } protected OtherDelegate getDelegate2() { OtherDelegate result = new OtherDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "Name1", ControllerState.DESCRIBED, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/OnDemandDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003542711216157032033407 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A OnDemandDependencyTestCase. * * @author Adrian Brock * @version $Revision: 90317 $ */ public class OnDemandDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(OnDemandDependencyTestCase.class); } public OnDemandDependencyTestCase(String name) { super(name); } public void testOnDemandDependencyOnDemandFirst() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1, ControllerState.DESCRIBED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(-1, delegate1.instantiateInstallOrder); assertEquals(-1, delegate1.configureInstallOrder); assertEquals(-1, delegate1.createInstallOrder); assertEquals(-1, delegate1.startInstallOrder); assertEquals(-1, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(2, delegate2.describeInstallOrder); assertEquals(3, delegate2.instantiateInstallOrder); assertEquals(4, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertContext(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); } public void testOnDemandDependencyOnDemandSecond() throws Throwable { TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.CONFIGURED); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertChange(context2, ControllerState.INSTALLED, ControllerState.CONFIGURED); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(4, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2, ControllerState.INSTALLED); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testChangeDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1, ControllerState.DESCRIBED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(-1, delegate1.instantiateInstallOrder); assertEquals(-1, delegate1.configureInstallOrder); assertEquals(-1, delegate1.createInstallOrder); assertEquals(-1, delegate1.startInstallOrder); assertEquals(-1, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(2, delegate2.describeInstallOrder); assertEquals(3, delegate2.instantiateInstallOrder); assertEquals(4, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertContext(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertUninstall(context2); assertEquals(2, delegate2.describeInstallOrder); assertEquals(3, delegate2.instantiateInstallOrder); assertEquals(4, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("Name1", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(28, delegate1.installUninstallOrder); assertEquals(29, delegate1.startUninstallOrder); assertEquals(30, delegate1.createUninstallOrder); assertEquals(31, delegate1.configureUninstallOrder); assertEquals(32, delegate1.instantiateUninstallOrder); assertEquals(33, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.CONFIGURED); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); context1 = assertInstall(delegate1); assertEquals(34, delegate1.describeInstallOrder); assertEquals(35, delegate1.instantiateInstallOrder); assertEquals(36, delegate1.configureInstallOrder); assertEquals(37, delegate1.createInstallOrder); assertEquals(38, delegate1.startInstallOrder); assertEquals(39, delegate1.installInstallOrder); assertEquals(28, delegate1.installUninstallOrder); assertEquals(29, delegate1.startUninstallOrder); assertEquals(30, delegate1.createUninstallOrder); assertEquals(31, delegate1.configureUninstallOrder); assertEquals(32, delegate1.instantiateUninstallOrder); assertEquals(33, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(40, delegate2.createInstallOrder); assertEquals(41, delegate2.startInstallOrder); assertEquals(42, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { TestDelegate result = new TestDelegate("Name1"); result.setMode(ControllerMode.ON_DEMAND); return result; } protected TestDelegate getDelegate2() { TestDelegate result = new TestDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "Name1", ControllerState.CREATE, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/SelfDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000421711245212504033376 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A BasicDependencyTestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class SelfDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(SelfDependencyTestCase.class); } public SelfDependencyTestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate = new TestDelegate("Self"); ControllerContext context = assertInstall(delegate); DependencyItem dependency = new AbstractDependencyItem("Self", "Self", ControllerState.DESCRIBED, ControllerState.INSTALLED); delegate.addDependency(dependency); dependency.resolve(controller); assertUninstall(context); assertNull(context.getError()); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ShutdownControllerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000502310776707200033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.util.Set; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; /** * @author Ales Justin */ public class ShutdownControllerTestCase extends AbstractDependencyTest { public ShutdownControllerTestCase(String name) { super(name); } public static Test suite() { return suite(ShutdownControllerTestCase.class); } protected void validateEmptyContexts() { ControllerStateModel states = controller.getStates(); for(ControllerState state : states) { Set contexts = controller.getContextsByState(state); if (contexts != null) assertEmpty(contexts); } } public void testSimpleShutdown() throws Throwable { ControllerContext c1 = createControllerContext("test1", "alias1"); ControllerContext c2 = createControllerContext("test2", "alias2"); controller.install(c1); controller.install(c2); assertFalse(controller.isShutdown()); ControllerContext i1 = controller.getInstalledContext("test1"); assertContext(i1); ControllerContext i2 = controller.getInstalledContext("test2"); assertContext(i2); controller.shutdown(); assertTrue(controller.isShutdown()); validateEmptyContexts(); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/AbstractDependencyTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001452011173121305033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.util.HashSet; import java.util.Set; import java.util.Arrays; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; import org.jboss.test.dependency.controller.support.MockControllerContextActions; import org.jboss.test.dependency.controller.support.Ordering; import org.jboss.test.dependency.controller.support.OtherControllerContext; import org.jboss.test.dependency.controller.support.OtherDelegate; import org.jboss.test.dependency.controller.support.TestControllerContext; import org.jboss.test.dependency.controller.support.TestDelegate; /** * An abstract controller test. * * @author Adrian Brock * @version $Revision: 87586 $ */ public class AbstractDependencyTest extends AbstractTestCaseWithSetup { protected Controller controller; public AbstractDependencyTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); controller = new AbstractController(); Ordering.resetOrder(); //enableTrace("org.jboss.dependency"); } protected ControllerContext assertInstall(TestDelegate delegate) throws Throwable { return assertInstall(delegate, ControllerState.INSTALLED); } protected ControllerContext assertInstall(TestDelegate delegate, ControllerState expected) throws Throwable { TestControllerContext context = new TestControllerContext(delegate); assertInstall(context, expected); return context; } protected ControllerContext assertInstall(OtherDelegate delegate) throws Throwable { return assertInstall(delegate, ControllerState.INSTALLED); } protected ControllerContext assertInstall(OtherDelegate delegate, ControllerState expected) throws Throwable { OtherControllerContext context = new OtherControllerContext(delegate); assertInstall(context, expected); return context; } protected void install(ControllerContext context) throws Throwable { controller.install(context); } protected void uninstall(ControllerContext context) throws Throwable { controller.uninstall(context.getName()); } protected ControllerStateModel getStateModel() { return controller.getStates(); } protected void assertInstall(ControllerContext context, ControllerState expected) throws Throwable { controller.install(context); assertContext(context, expected); } protected void assertChange(ControllerContext context, ControllerState expected) throws Throwable { assertChange(context, expected, expected); } protected void assertChange(ControllerContext context, ControllerState required, ControllerState expected) throws Throwable { controller.change(context, required); assertContext(context, expected); } protected ControllerContext assertContext(String name, ControllerState expected) throws Throwable { ControllerContext context = controller.getContext(name, expected); assertEquals(expected, context.getState()); return context; } protected void assertContext(ControllerContext context) throws Throwable { assertContext(context, ControllerState.INSTALLED); } protected void assertContext(ControllerContext context, ControllerState expected) throws Throwable { assertEquals(expected, context.getState()); } protected void assertNoContext(ControllerContext context) throws Throwable { assertContext(context, ControllerState.ERROR); } protected void assertNoContext(Object name) throws Throwable { assertNull(controller.getContext(name, null)); } protected void assertUninstall(ControllerContext context) throws Throwable { controller.uninstall(context.getName()); assertEquals(ControllerState.ERROR, context.getState()); } protected Set createAliases(Object... aliases) { if (aliases == null) return null; HashSet result = new HashSet(aliases.length); result.addAll(Arrays.asList(aliases)); return result; } protected ControllerContext createControllerContext(Object name, Object... aliases) { AbstractControllerContext result = new AbstractControllerContext(name, new MockControllerContextActions()); result.setAliases(createAliases(aliases)); return result; } protected ControllerContext assertCreateInstall(Object name, Object... aliases) throws Throwable { ControllerContext context = createControllerContext(name, aliases); assertInstall(context, ControllerState.INSTALLED); return context; } /** * Default setup with security manager enabled * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AbstractTestDelegate delegate = new AbstractTestDelegate(clazz); delegate.enableSecurity = true; return delegate; } } ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/StateConsistencyUnitTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001006410604153706033401 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.util.HashMap; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; /** * StateConsistencyUnitTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class StateConsistencyUnitTestCase extends AbstractDependencyTest { public int FOREGROUND = 0; public int BACKGROUND = 1; public static Test suite() { return suite(StateConsistencyUnitTestCase.class); } public StateConsistencyUnitTestCase(String name) { super(name); } public void testConsistency() throws Throwable { final StateConsistencyControllerContext ctx = new StateConsistencyControllerContext("test"); assertInstall(ctx, ControllerState.NOT_INSTALLED); Thread thread = new Thread(new Runnable() { public void run() { try { assertChange(ctx, ControllerState.PRE_INSTALL); } catch (Throwable t) { } } }); thread.start(); ctx.doWait(FOREGROUND); assertChange(ctx, ControllerState.NOT_INSTALLED); ctx.doSet(FOREGROUND); thread.join(); } public class StateConsistencyControllerContext extends AbstractControllerContext { private int waiter = FOREGROUND; public StateConsistencyControllerContext(Object name) { super(name, new AbstractControllerContextActions(new HashMap())); setMode(ControllerMode.MANUAL); } public void install(ControllerState fromState, ControllerState toState) throws Throwable { super.install(fromState, toState); if (toState.equals(ControllerState.NOT_INSTALLED)) return; doSetAndWait(BACKGROUND); } public void doSetAndWait(int waiter) { synchronized(this) { this.waiter = waiter; notifyAll(); while (this.waiter == waiter) { try { wait(); break; } catch (InterruptedException ignored) { } } } } public void doWait(int waiter) { synchronized(this) { while (this.waiter == waiter) { try { wait(); break; } catch (InterruptedException ignored) { } } } } public void doSet(int waiter) { synchronized(this) { this.waiter = waiter; notifyAll(); } } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ChangeDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000004655210331006762033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A ChangeDependencyTestCase. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ChangeDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(ChangeDependencyTestCase.class); } public ChangeDependencyTestCase(String name) { super(name); } public void testChangeDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate1.describeInstallOrder); assertEquals(-1, delegate1.instantiateInstallOrder); assertEquals(-1, delegate1.configureInstallOrder); assertEquals(-1, delegate1.createInstallOrder); assertEquals(-1, delegate1.startInstallOrder); assertEquals(-1, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertChange(context1, ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertChange(context2, ControllerState.INSTALLED); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testChangeDependencyWrongOrder() throws Throwable { TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertChange(context2, ControllerState.INSTALLED, ControllerState.CONFIGURED); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate1.describeInstallOrder); assertEquals(-1, delegate1.instantiateInstallOrder); assertEquals(-1, delegate1.configureInstallOrder); assertEquals(-1, delegate1.createInstallOrder); assertEquals(-1, delegate1.startInstallOrder); assertEquals(-1, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2, ControllerState.CONFIGURED); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertChange(context1, ControllerState.INSTALLED); assertEquals(4, delegate1.describeInstallOrder); assertEquals(5, delegate1.instantiateInstallOrder); assertEquals(6, delegate1.configureInstallOrder); assertEquals(7, delegate1.createInstallOrder); assertEquals(8, delegate1.startInstallOrder); assertEquals(9, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(1, delegate2.describeInstallOrder); assertEquals(2, delegate2.instantiateInstallOrder); assertEquals(3, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testChangeDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate1.describeInstallOrder); assertEquals(-1, delegate1.instantiateInstallOrder); assertEquals(-1, delegate1.configureInstallOrder); assertEquals(-1, delegate1.createInstallOrder); assertEquals(-1, delegate1.startInstallOrder); assertEquals(-1, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertChange(context1, ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertChange(context2, ControllerState.INSTALLED); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("Name1", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2, ControllerState.NOT_INSTALLED); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertChange(context2, ControllerState.INSTALLED); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(28, delegate1.installUninstallOrder); assertEquals(29, delegate1.startUninstallOrder); assertEquals(30, delegate1.createUninstallOrder); assertEquals(31, delegate1.configureUninstallOrder); assertEquals(32, delegate1.instantiateUninstallOrder); assertEquals(33, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.CONFIGURED); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); context1 = assertInstall(delegate1, ControllerState.NOT_INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(28, delegate1.installUninstallOrder); assertEquals(29, delegate1.startUninstallOrder); assertEquals(30, delegate1.createUninstallOrder); assertEquals(31, delegate1.configureUninstallOrder); assertEquals(32, delegate1.instantiateUninstallOrder); assertEquals(33, delegate1.describeUninstallOrder); assertChange(context1, ControllerState.INSTALLED); assertEquals(34, delegate1.describeInstallOrder); assertEquals(35, delegate1.instantiateInstallOrder); assertEquals(36, delegate1.configureInstallOrder); assertEquals(37, delegate1.createInstallOrder); assertEquals(38, delegate1.startInstallOrder); assertEquals(39, delegate1.installInstallOrder); assertEquals(28, delegate1.installUninstallOrder); assertEquals(29, delegate1.startUninstallOrder); assertEquals(30, delegate1.createUninstallOrder); assertEquals(31, delegate1.configureUninstallOrder); assertEquals(32, delegate1.instantiateUninstallOrder); assertEquals(33, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(40, delegate2.createInstallOrder); assertEquals(41, delegate2.startInstallOrder); assertEquals(42, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { TestDelegate result = new TestDelegate("Name1"); result.setMode(ControllerMode.MANUAL); return result; } protected TestDelegate getDelegate2() { TestDelegate result = new TestDelegate("Name2"); result.setMode(ControllerMode.MANUAL); result.addDependency(new AbstractDependencyItem("Name2", "Name1", ControllerState.CREATE, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/DisabledControllerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001163710331006762033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A DisabledControllerTestCase. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class DisabledControllerTestCase extends AbstractDependencyTest { public static Test suite() { return suite(DisabledControllerTestCase.class); } public DisabledControllerTestCase(String name) { super(name); } public void testDisabledInstall() throws Throwable { TestDelegate delegate = new TestDelegate("DisabledInstallTest"); delegate.setMode(ControllerMode.DISABLED); ControllerContext context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate.describeInstallOrder); assertEquals(-1, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.INSTALLED, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate.describeInstallOrder); assertEquals(-1, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } public void testDisabledUnInstall() throws Throwable { TestDelegate delegate = new TestDelegate("DisabledInstallTest"); delegate.setMode(ControllerMode.DISABLED); ControllerContext context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate.describeInstallOrder); assertEquals(-1, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertUninstall(context); assertEquals(-1, delegate.describeInstallOrder); assertEquals(-1, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ErrorControllerActionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000777110464415571033421 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.ErrorControllerContext; import org.jboss.test.dependency.controller.support.ErrorDelegate; /** * ErrorControllerActionTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class ErrorControllerActionTestCase extends AbstractDependencyTest { public static Test suite() { return suite(ErrorControllerActionTestCase.class); } public ErrorControllerActionTestCase(String name) { super(name); } public void testFailInDescribe() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_DESCRIBE); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.DESCRIBED, ControllerState.ERROR); assertUninstall(context); } public void testFailInInstantiate() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_INSTANTIATE); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.INSTANTIATED, ControllerState.ERROR); assertUninstall(context); } public void testFailInConfigure() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_CONFIGURE); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.CONFIGURED, ControllerState.ERROR); assertUninstall(context); } public void testFailInCreate() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_CREATE); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.CREATE, ControllerState.ERROR); assertUninstall(context); } public void testFailInStart() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_START); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.START, ControllerState.ERROR); assertUninstall(context); } public void testFailInInstall() throws Throwable { ErrorDelegate delegate = new ErrorDelegate("test", ErrorDelegate.FAIL_IN_INSTALL); ErrorControllerContext context = new ErrorControllerContext(delegate); assertInstall(context, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.INSTALLED, ControllerState.ERROR); assertUninstall(context); } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ManualControllerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000004200311216157032033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A ManualControllerTestCase. * * @author Adrian Brock * @version $Revision: 90317 $ */ public class ManualControllerTestCase extends AbstractDependencyTest { public static Test suite() { return suite(ManualControllerTestCase.class); } public ManualControllerTestCase(String name) { super(name); } public void testManualInstall() throws Throwable { TestDelegate delegate = new TestDelegate("ManualInstallTest"); delegate.setMode(ControllerMode.MANUAL); ControllerContext context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertEquals(-1, delegate.describeInstallOrder); assertEquals(-1, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.INSTANTIATED); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(-1, delegate.configureInstallOrder); assertEquals(-1, delegate.createInstallOrder); assertEquals(-1, delegate.startInstallOrder); assertEquals(-1, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.INSTALLED); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } public void testManualUninstall() throws Throwable { TestDelegate delegate = new TestDelegate("ManualUninstallTest"); delegate.setMode(ControllerMode.MANUAL); ControllerContext context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.INSTALLED); assertChange(context, ControllerState.CREATE); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertUninstall(context); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(9, delegate.createUninstallOrder); assertEquals(10, delegate.configureUninstallOrder); assertEquals(11, delegate.instantiateUninstallOrder); assertEquals(12, delegate.describeUninstallOrder); } public void testManualReinstall() throws Throwable { TestDelegate delegate = new TestDelegate("ManualReinstallTest"); delegate.setMode(ControllerMode.MANUAL); ControllerContext context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.INSTALLED); assertUninstall(context); context = assertInstall(delegate, ControllerState.NOT_INSTALLED); assertChange(context, ControllerState.INSTALLED); assertEquals(13, delegate.describeInstallOrder); assertEquals(14, delegate.instantiateInstallOrder); assertEquals(15, delegate.configureInstallOrder); assertEquals(16, delegate.createInstallOrder); assertEquals(17, delegate.startInstallOrder); assertEquals(18, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(9, delegate.createUninstallOrder); assertEquals(10, delegate.configureUninstallOrder); assertEquals(11, delegate.instantiateUninstallOrder); assertEquals(12, delegate.describeUninstallOrder); } public void testManualWithDependency() throws Throwable { TestDelegate dependee = new TestDelegate("Dependee"); TestDelegate dependent = new TestDelegate("Dependent"); dependent.addDependency(new AbstractDependencyItem("Dependent", "Dependee", ControllerState.START, ControllerState.INSTALLED)); dependee.setMode(ControllerMode.MANUAL); ControllerContext dependeeContext = assertInstall(dependee, ControllerState.NOT_INSTALLED); dependent.setMode(ControllerMode.MANUAL); ControllerContext dependentContext = assertInstall(dependent, ControllerState.NOT_INSTALLED); assertChange(dependentContext, ControllerState.INSTALLED, ControllerState.CREATE); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(-1, dependent.startInstallOrder); assertEquals(-1, dependent.installInstallOrder); assertEquals(-1, dependent.installUninstallOrder); assertEquals(-1, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertChange(dependeeContext, ControllerState.INSTALLED); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(11, dependent.startInstallOrder); assertEquals(12, dependent.installInstallOrder); assertEquals(-1, dependent.installUninstallOrder); assertEquals(-1, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertEquals(5, dependee.describeInstallOrder); assertEquals(6, dependee.instantiateInstallOrder); assertEquals(7, dependee.configureInstallOrder); assertEquals(8, dependee.createInstallOrder); assertEquals(9, dependee.startInstallOrder); assertEquals(10, dependee.installInstallOrder); assertEquals(-1, dependee.installUninstallOrder); assertEquals(-1, dependee.startUninstallOrder); assertEquals(-1, dependee.createUninstallOrder); assertEquals(-1, dependee.configureUninstallOrder); assertEquals(-1, dependee.instantiateUninstallOrder); assertEquals(-1, dependee.describeUninstallOrder); assertChange(dependeeContext, ControllerState.START); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(11, dependent.startInstallOrder); assertEquals(12, dependent.installInstallOrder); assertEquals(13, dependent.installUninstallOrder); assertEquals(14, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertEquals(5, dependee.describeInstallOrder); assertEquals(6, dependee.instantiateInstallOrder); assertEquals(7, dependee.configureInstallOrder); assertEquals(8, dependee.createInstallOrder); assertEquals(9, dependee.startInstallOrder); assertEquals(10, dependee.installInstallOrder); assertEquals(15, dependee.installUninstallOrder); assertEquals(-1, dependee.startUninstallOrder); assertEquals(-1, dependee.createUninstallOrder); assertEquals(-1, dependee.configureUninstallOrder); assertEquals(-1, dependee.instantiateUninstallOrder); assertEquals(-1, dependee.describeUninstallOrder); } public void testManualWithDependencyUninstallDependentFirst() throws Throwable { TestDelegate dependee = new TestDelegate("Dependee"); TestDelegate dependent = new TestDelegate("Dependent"); dependent.addDependency(new AbstractDependencyItem("Dependent", "Dependee", ControllerState.START, ControllerState.INSTALLED)); dependee.setMode(ControllerMode.MANUAL); ControllerContext dependeeContext = assertInstall(dependee, ControllerState.NOT_INSTALLED); dependent.setMode(ControllerMode.MANUAL); ControllerContext dependentContext = assertInstall(dependent, ControllerState.NOT_INSTALLED); assertChange(dependentContext, ControllerState.INSTALLED, ControllerState.CREATE); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(-1, dependent.startInstallOrder); assertEquals(-1, dependent.installInstallOrder); assertEquals(-1, dependent.installUninstallOrder); assertEquals(-1, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertChange(dependeeContext, ControllerState.INSTALLED); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(11, dependent.startInstallOrder); assertEquals(12, dependent.installInstallOrder); assertEquals(-1, dependent.installUninstallOrder); assertEquals(-1, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertEquals(5, dependee.describeInstallOrder); assertEquals(6, dependee.instantiateInstallOrder); assertEquals(7, dependee.configureInstallOrder); assertEquals(8, dependee.createInstallOrder); assertEquals(9, dependee.startInstallOrder); assertEquals(10, dependee.installInstallOrder); assertEquals(-1, dependee.installUninstallOrder); assertEquals(-1, dependee.startUninstallOrder); assertEquals(-1, dependee.createUninstallOrder); assertEquals(-1, dependee.configureUninstallOrder); assertEquals(-1, dependee.instantiateUninstallOrder); assertEquals(-1, dependee.describeUninstallOrder); assertChange(dependentContext, ControllerState.CREATE); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(11, dependent.startInstallOrder); assertEquals(12, dependent.installInstallOrder); assertEquals(13, dependent.installUninstallOrder); assertEquals(14, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertEquals(5, dependee.describeInstallOrder); assertEquals(6, dependee.instantiateInstallOrder); assertEquals(7, dependee.configureInstallOrder); assertEquals(8, dependee.createInstallOrder); assertEquals(9, dependee.startInstallOrder); assertEquals(10, dependee.installInstallOrder); assertEquals(-1, dependee.installUninstallOrder); assertEquals(-1, dependee.startUninstallOrder); assertEquals(-1, dependee.createUninstallOrder); assertEquals(-1, dependee.configureUninstallOrder); assertEquals(-1, dependee.instantiateUninstallOrder); assertEquals(-1, dependee.describeUninstallOrder); assertChange(dependeeContext, ControllerState.CREATE); assertEquals(1, dependent.describeInstallOrder); assertEquals(2, dependent.instantiateInstallOrder); assertEquals(3, dependent.configureInstallOrder); assertEquals(4, dependent.createInstallOrder); assertEquals(11, dependent.startInstallOrder); assertEquals(12, dependent.installInstallOrder); assertEquals(13, dependent.installUninstallOrder); assertEquals(14, dependent.startUninstallOrder); assertEquals(-1, dependent.createUninstallOrder); assertEquals(-1, dependent.configureUninstallOrder); assertEquals(-1, dependent.instantiateUninstallOrder); assertEquals(-1, dependent.describeUninstallOrder); assertEquals(5, dependee.describeInstallOrder); assertEquals(6, dependee.instantiateInstallOrder); assertEquals(7, dependee.configureInstallOrder); assertEquals(8, dependee.createInstallOrder); assertEquals(9, dependee.startInstallOrder); assertEquals(10, dependee.installInstallOrder); assertEquals(15, dependee.installUninstallOrder); assertEquals(16, dependee.startUninstallOrder); assertEquals(-1, dependee.createUninstallOrder); assertEquals(-1, dependee.configureUninstallOrder); assertEquals(-1, dependee.instantiateUninstallOrder); assertEquals(-1, dependee.describeUninstallOrder); } public void testManualAndAutoMixed() throws Throwable { ControllerContext manual = createControllerContext("Manual"); manual.setMode(ControllerMode.MANUAL); install(manual); assertChange(manual, ControllerState.DESCRIBED, ControllerState.DESCRIBED); ControllerContext auto = createControllerContext("Auto"); auto.setMode(ControllerMode.AUTOMATIC); install(auto); assertContext(auto); // check that the auto doesn't move the manual assertContext(manual, ControllerState.DESCRIBED); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/CrossContextDependencyBadObjectNameTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003104510603203450033372 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.OtherDelegate; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A CrossContext Dependency BadObjectName TestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class CrossContextDependencyBadObjectNameTestCase extends AbstractDependencyTest { public static Test suite() { return suite(CrossContextDependencyBadObjectNameTestCase.class); } public CrossContextDependencyBadObjectNameTestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyWrongOrder() throws Throwable { OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.PRE_INSTALL); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("test:a=1,b=2", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.PRE_INSTALL); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); assertInstall(delegate1); assertEquals(37, delegate1.describeInstallOrder); assertEquals(38, delegate1.instantiateInstallOrder); assertEquals(39, delegate1.configureInstallOrder); assertEquals(40, delegate1.createInstallOrder); assertEquals(41, delegate1.startInstallOrder); assertEquals(42, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(43, delegate2.describeInstallOrder); assertEquals(44, delegate2.instantiateInstallOrder); assertEquals(45, delegate2.configureInstallOrder); assertEquals(46, delegate2.createInstallOrder); assertEquals(47, delegate2.startInstallOrder); assertEquals(48, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { return new TestDelegate("test:a=1,b=2"); } protected OtherDelegate getDelegate2() { OtherDelegate result = new OtherDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "test:b=2,a=1", ControllerState.DESCRIBED, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/BasicDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003056410565031075033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A BasicDependencyTestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class BasicDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(BasicDependencyTestCase.class); } public BasicDependencyTestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyWrongOrder() throws Throwable { TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.PRE_INSTALL); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); TestDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("Name1", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.PRE_INSTALL); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); assertInstall(delegate1); assertEquals(37, delegate1.describeInstallOrder); assertEquals(38, delegate1.instantiateInstallOrder); assertEquals(39, delegate1.configureInstallOrder); assertEquals(40, delegate1.createInstallOrder); assertEquals(41, delegate1.startInstallOrder); assertEquals(42, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(43, delegate2.describeInstallOrder); assertEquals(44, delegate2.instantiateInstallOrder); assertEquals(45, delegate2.configureInstallOrder); assertEquals(46, delegate2.createInstallOrder); assertEquals(47, delegate2.startInstallOrder); assertEquals(48, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { return new TestDelegate("Name1"); } protected TestDelegate getDelegate2() { TestDelegate result = new TestDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "Name1", ControllerState.DESCRIBED, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/RecursiveControllerActionTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001510611173121305033373 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.test.dependency.controller.support.RecursiveControllerContext; import org.jboss.test.dependency.controller.support.TestControllerContext; import org.jboss.test.dependency.controller.support.TestDelegate; /** * RecursiveControllerActionTestCase. * * @author Adrian Brock * @version $Revision: 87586 $ */ public class RecursiveControllerActionTestCase extends AbstractDependencyTest { public static Test suite() { return suite(RecursiveControllerActionTestCase.class); } public RecursiveControllerActionTestCase(String name) { super(name); } public void testInstall() throws Throwable { TestDelegate delegate = new TestDelegate("InstallTestRecursive"); RecursiveControllerContext context = new RecursiveControllerContext(delegate, this); TestDelegate other = new TestDelegate("Other"); TestControllerContext otherContext = new TestControllerContext(other); DependencyItem item = new AbstractDependencyItem(other.getName(), delegate.getName(), ControllerState.CREATE, ControllerState.CONFIGURED); otherContext.getDependencyInfo().addIDependOn(item); assertInstall(otherContext, ControllerState.CONFIGURED); assertInstall(context, ControllerState.INSTALLED); assertContext(otherContext, ControllerState.INSTALLED); assertContext(context.child, ControllerState.INSTALLED); } public void testUninstall() throws Throwable { TestDelegate delegate = new TestDelegate("UninstallTestRecursive"); RecursiveControllerContext context = new RecursiveControllerContext(delegate, this); TestDelegate other = new TestDelegate("Other"); TestControllerContext otherContext = new TestControllerContext(other); DependencyItem item = new AbstractDependencyItem(other.getName(), delegate.getName(), ControllerState.CREATE, ControllerState.CONFIGURED); otherContext.getDependencyInfo().addIDependOn(item); assertInstall(otherContext, ControllerState.CONFIGURED); assertInstall(context, ControllerState.INSTALLED); assertContext(otherContext, ControllerState.INSTALLED); assertContext(context.child, ControllerState.INSTALLED); assertUninstall(context); if (context.child.error != null) throw context.child.error; assertNoContext(context.child); assertUninstall(otherContext); } public void testReinstall() throws Throwable { TestDelegate delegate = new TestDelegate("ReinstallTestRecursive"); RecursiveControllerContext context = new RecursiveControllerContext(delegate, this); TestDelegate other = new TestDelegate("Other"); TestControllerContext otherContext = new TestControllerContext(other); DependencyItem item = new AbstractDependencyItem(other.getName(), delegate.getName(), ControllerState.CREATE, ControllerState.CONFIGURED); otherContext.getDependencyInfo().addIDependOn(item); assertInstall(otherContext, ControllerState.CONFIGURED); assertInstall(context, ControllerState.INSTALLED); assertContext(otherContext, ControllerState.INSTALLED); assertContext(context.child, ControllerState.INSTALLED); assertUninstall(context); if (context.child.error != null) throw context.child.error; assertNoContext(context.child); assertContext(otherContext, ControllerState.CONFIGURED); context = new RecursiveControllerContext(delegate, this); assertInstall(context, ControllerState.INSTALLED); if (context.child.error != null) throw context.child.error; assertContext(otherContext, ControllerState.INSTALLED); assertContext(context.child, ControllerState.INSTALLED); } public void testInstallMany() throws Throwable { TestDelegate[] delegates = new TestDelegate[3]; RecursiveControllerContext[] contexts = new RecursiveControllerContext[delegates.length]; TestDelegate other = new TestDelegate("Other "); for (int i = 0; i < delegates.length; ++i) { delegates[i] = new TestDelegate("InstallTestRecursive " + i); contexts[i] = new RecursiveControllerContext(delegates[i], this); DependencyItem item = new AbstractDependencyItem(delegates[i].getName(), other.getName(), ControllerState.CREATE, ControllerState.CONFIGURED); contexts[i].getDependencyInfo().addIDependOn(item); assertInstall(contexts[i], ControllerState.CONFIGURED); } TestControllerContext otherContext = new TestControllerContext(other); assertInstall(otherContext, ControllerState.INSTALLED); for (int i = 0; i < delegates.length; ++i) { assertContext(contexts[i], ControllerState.INSTALLED); } } public void installChild(RecursiveControllerContext context) throws Throwable { if (++depth > 1) throw new IllegalStateException("Should not recurse depth=" + depth); TestDelegate delegate = new TestDelegate(context.getName() + "Child"); context.child = new RecursiveControllerContext(delegate, null); assertInstall(context.child, ControllerState.INSTALLED); depth--; } int depth = 0; public void uninstallChild(RecursiveControllerContext context) { try { assertUninstall(context.child); } catch (Throwable t) { context.child.error = t; } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/CardinalityTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001003610665060420033375 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.Cardinality; import org.jboss.test.AbstractTestCaseWithSetup; import org.jboss.test.AbstractTestDelegate; /** * CardinalityTestCase. * * @author Ales Justin */ public class CardinalityTestCase extends AbstractTestCaseWithSetup { public static Test suite() { return suite(CardinalityTestCase.class); } public CardinalityTestCase(String name) { super(name); } /** * Default setup. * * @param clazz the class * @return the delegate * @throws Exception for any error */ public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { return new AbstractTestDelegate(clazz); } public void testParseCardinality() throws Throwable { assertEquals(Cardinality.ZERO_TO_ONE, Cardinality.toCardinality("0..1")); assertEquals(Cardinality.ZERO_TO_MANY, Cardinality.toCardinality("0..n")); assertEquals(Cardinality.ONE_TO_ONE, Cardinality.toCardinality("1..1")); assertEquals(Cardinality.ONE_TO_MANY, Cardinality.toCardinality("1..n")); Cardinality c1 = Cardinality.toCardinality("2..20"); assertEquals(2, c1.getLeft()); assertEquals(20, c1.getRight()); Cardinality c2 = Cardinality.createCardinality(2, 20); assertEquals(2, c2.getLeft()); assertEquals(20, c2.getRight()); Cardinality c3 = Cardinality.createUnlimitedCardinality(10); assertEquals(10, c3.getLeft()); assertTrue(c3.isRightInfinity()); Cardinality c4 = Cardinality.createLimitedCardinality(10); assertEquals(0, c4.getLeft()); assertEquals(10, c4.getRight()); Cardinality c5 = Cardinality.createCardinality(Cardinality.INFINITY, Cardinality.INFINITY); assertTrue(c5.isLeftInfinity()); assertTrue(c5.isRightInfinity()); } public void testRangeCardinality() throws Throwable { Cardinality c1 = Cardinality.fromString("5..10"); assertTrue(c1.isInRange(5)); assertTrue(c1.isInRange(7)); assertTrue(c1.isInRange(10)); assertFalse(c1.isInRange(-1)); assertFalse(c1.isInRange(3)); assertFalse(c1.isInRange(20)); assertFalse(c1.isInRange(Cardinality.INFINITY)); Cardinality c2 = Cardinality.ZERO_TO_MANY; assertFalse(c2.isInRange(-1)); assertTrue(c2.isInRange(0)); assertTrue(c2.isInRange(Integer.MAX_VALUE)); Cardinality c3 = Cardinality.ONE_TO_MANY; assertFalse(c3.isInRange(-1)); assertFalse(c3.isInRange(0)); assertTrue(c3.isInRange(1)); assertTrue(c3.isInRange(Integer.MAX_VALUE)); Cardinality c4 = Cardinality.createCardinality(Cardinality.INFINITY, Cardinality.INFINITY); assertFalse(c4.isInRange(-1)); assertFalse(c4.isInRange(0)); assertFalse(c4.isInRange(1)); assertFalse(c4.isInRange(10)); assertFalse(c4.isInRange(Integer.MAX_VALUE)); } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/PreconfiguredScopeTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001443211047061010033370 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.util.ArrayList; import java.util.List; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.metadata.plugins.context.AbstractMetaDataContext; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; import org.jboss.metadata.plugins.repository.basic.BasicMetaDataRepository; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.context.MetaDataContext; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; /** * PreconfiguredScopeTestCase. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class PreconfiguredScopeTestCase extends AbstractDependencyTest { public static Test suite() { return suite(PreconfiguredScopeTestCase.class); } protected MutableMetaDataRepository repository = new BasicMetaDataRepository(); public PreconfiguredScopeTestCase(String name) { super(name); } public void testPreconfiguredScope() throws Throwable { TestControllerContext test = new TestControllerContext("test"); ScopeInfo scopeInfo = test.getScopeInfo(); // Preconfigure the mutable scope ScopeKey mutable = scopeInfo.getMutableScope(); MemoryMetaDataLoader loader = new MemoryMetaDataLoader(mutable); loader.addMetaData("Preconfigured", "testPreconfigured", String.class); repository.addMetaDataRetrieval(loader); // Setup the full scope ScopeKey scopeKey = scopeInfo.getScope(); List retrievals = new ArrayList(); for (Scope scope : scopeKey.getScopes()) { ScopeKey thisScope = new ScopeKey(scope); MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(thisScope); if (retrieval == null) retrieval = new MemoryMetaDataLoader(thisScope); retrievals.add(0, retrieval); } MetaDataContext metaDataContext = new AbstractMetaDataContext(null, retrievals); repository.addMetaDataRetrieval(metaDataContext); try { controller.install(test); MetaData metaData = scopeInfo.getMetaData(); assertNotNull(metaData); assertEquals("testPreconfigured", metaData.getMetaData("Preconfigured")); assertEquals("testFromInstall", metaData.getMetaData("FromInstall")); } finally { controller.uninstall(test.getName()); } assertNotNull(repository.getMetaDataRetrieval(mutable)); assertNotNull(repository.getMetaDataRetrieval(scopeKey)); MetaData metaData = repository.getMetaData(scopeKey); assertNotNull(metaData); assertEquals("testPreconfigured", metaData.getMetaData("Preconfigured")); assertNull(metaData.getMetaData("FromInstall")); } public void testNotPreconfiguredScope() throws Throwable { TestControllerContext test = new TestControllerContext("test"); ScopeInfo scopeInfo = test.getScopeInfo(); ScopeKey mutable = scopeInfo.getMutableScope(); ScopeKey scopeKey = scopeInfo.getScope(); try { controller.install(test); MetaData metaData = scopeInfo.getMetaData(); assertNotNull(metaData); assertEquals("testFromInstall", metaData.getMetaData("FromInstall")); } finally { controller.uninstall(test.getName()); } assertNull(repository.getMetaDataRetrieval(mutable)); assertNull(repository.getMetaDataRetrieval(scopeKey)); } public class TestControllerContext extends AbstractControllerContext { public TestControllerContext(Object name) { super(name, new Object()); } @Override public void install(ControllerState fromState, ControllerState toState) throws Throwable { if (toState.equals(ControllerState.INSTANTIATED)) { ScopeInfo scopeInfo = getScopeInfo(); scopeInfo.addMetaData(repository, this); ScopeKey scope = scopeInfo.getMutableScope(); MemoryMetaDataLoader loader = (MemoryMetaDataLoader) repository.getMetaDataRetrieval(scope); loader.addMetaData("FromInstall", "testFromInstall", String.class); // Initialise the full key ScopeKey full = scopeInfo.getScope(); if (repository.getMetaDataRetrieval(full) == null) scopeInfo.initMetaDataRetrieval(repository, this); } } @Override public void uninstall(ControllerState fromState, ControllerState toState) { if (fromState.equals(ControllerState.INSTANTIATED)) { ScopeInfo scopeInfo = getScopeInfo(); ScopeKey scope = scopeInfo.getMutableScope(); MemoryMetaDataLoader loader = (MemoryMetaDataLoader) repository.getMetaDataRetrieval(scope); loader.removeMetaData("FromInstall", String.class); scopeInfo.removeMetaData(repository, this); } } } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ControllerTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000530711301276642033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Controller Test Suite. * * @author Adrian Brock * @version $Revision: 96589 $ */ public class ControllerTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Dependency Controller Tests"); suite.addTest(AliasDependencyTestCase.suite()); suite.addTest(AliasUnitTestCase.suite()); suite.addTest(BadDependencyInfoTestCase.suite()); suite.addTest(BasicControllerTestCase.suite()); suite.addTest(BasicDependencyTestCase.suite()); suite.addTest(CardinalityTestCase.suite()); suite.addTest(ChangeAutomaticControllerTestCase.suite()); suite.addTest(ChangeDependencyTestCase.suite()); suite.addTest(CrossContextDependencyBadObjectName2TestCase.suite()); suite.addTest(CrossContextDependencyBadObjectNameTestCase.suite()); suite.addTest(CrossContextDependencyTestCase.suite()); suite.addTest(DisabledControllerTestCase.suite()); suite.addTest(ErrorControllerActionTestCase.suite()); suite.addTest(ManualControllerTestCase.suite()); suite.addTest(OnDemandDependencyTestCase.suite()); suite.addTest(PreconfiguredScopeTestCase.suite()); suite.addTest(RecursiveControllerActionTestCase.suite()); suite.addTest(SelfDependencyTestCase.suite()); suite.addTest(ShutdownControllerTestCase.suite()); suite.addTest(StateConsistencyUnitTestCase.suite()); suite.addTest(RecursiveResolutionTestCase.suite()); return suite; } } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/AliasDependencyTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000003070610604466300033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.OtherDelegate; import org.jboss.test.dependency.controller.support.TestDelegate; /** * AliasDependencyTestCase. * * @author Adrian Brock * @version $Revision: 60558 $ */ public class AliasDependencyTestCase extends AbstractDependencyTest { public static Test suite() { return suite(AliasDependencyTestCase.class); } public AliasDependencyTestCase(String name) { super(name); } public void testDependencyCorrectOrder() throws Throwable { TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyWrongOrder() throws Throwable { OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2, ControllerState.PRE_INSTALL); assertEquals(-1, delegate2.describeInstallOrder); assertEquals(-1, delegate2.instantiateInstallOrder); assertEquals(-1, delegate2.configureInstallOrder); assertEquals(-1, delegate2.createInstallOrder); assertEquals(-1, delegate2.startInstallOrder); assertEquals(-1, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); TestDelegate delegate1 = getDelegate1(); assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); assertContext(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); } public void testDependencyReinstall() throws Throwable { TestDelegate delegate1 = getDelegate1(); ControllerContext context1 = assertInstall(delegate1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); OtherDelegate delegate2 = getDelegate2(); ControllerContext context2 = assertInstall(delegate2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(-1, delegate2.installUninstallOrder); assertEquals(-1, delegate2.startUninstallOrder); assertEquals(-1, delegate2.createUninstallOrder); assertEquals(-1, delegate2.configureUninstallOrder); assertEquals(-1, delegate2.instantiateUninstallOrder); assertEquals(-1, delegate2.describeUninstallOrder); assertUninstall(context2); assertEquals(7, delegate2.describeInstallOrder); assertEquals(8, delegate2.instantiateInstallOrder); assertEquals(9, delegate2.configureInstallOrder); assertEquals(10, delegate2.createInstallOrder); assertEquals(11, delegate2.startInstallOrder); assertEquals(12, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertContext("Name1", ControllerState.INSTALLED); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(-1, delegate1.installUninstallOrder); assertEquals(-1, delegate1.startUninstallOrder); assertEquals(-1, delegate1.createUninstallOrder); assertEquals(-1, delegate1.configureUninstallOrder); assertEquals(-1, delegate1.instantiateUninstallOrder); assertEquals(-1, delegate1.describeUninstallOrder); context2 = assertInstall(delegate2); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(13, delegate2.installUninstallOrder); assertEquals(14, delegate2.startUninstallOrder); assertEquals(15, delegate2.createUninstallOrder); assertEquals(16, delegate2.configureUninstallOrder); assertEquals(17, delegate2.instantiateUninstallOrder); assertEquals(18, delegate2.describeUninstallOrder); assertUninstall(context1); assertEquals(1, delegate1.describeInstallOrder); assertEquals(2, delegate1.instantiateInstallOrder); assertEquals(3, delegate1.configureInstallOrder); assertEquals(4, delegate1.createInstallOrder); assertEquals(5, delegate1.startInstallOrder); assertEquals(6, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.PRE_INSTALL); assertEquals(19, delegate2.describeInstallOrder); assertEquals(20, delegate2.instantiateInstallOrder); assertEquals(21, delegate2.configureInstallOrder); assertEquals(22, delegate2.createInstallOrder); assertEquals(23, delegate2.startInstallOrder); assertEquals(24, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); assertInstall(delegate1); assertEquals(37, delegate1.describeInstallOrder); assertEquals(38, delegate1.instantiateInstallOrder); assertEquals(39, delegate1.configureInstallOrder); assertEquals(40, delegate1.createInstallOrder); assertEquals(41, delegate1.startInstallOrder); assertEquals(42, delegate1.installInstallOrder); assertEquals(31, delegate1.installUninstallOrder); assertEquals(32, delegate1.startUninstallOrder); assertEquals(33, delegate1.createUninstallOrder); assertEquals(34, delegate1.configureUninstallOrder); assertEquals(35, delegate1.instantiateUninstallOrder); assertEquals(36, delegate1.describeUninstallOrder); assertContext("Name2", ControllerState.INSTALLED); assertEquals(43, delegate2.describeInstallOrder); assertEquals(44, delegate2.instantiateInstallOrder); assertEquals(45, delegate2.configureInstallOrder); assertEquals(46, delegate2.createInstallOrder); assertEquals(47, delegate2.startInstallOrder); assertEquals(48, delegate2.installInstallOrder); assertEquals(25, delegate2.installUninstallOrder); assertEquals(26, delegate2.startUninstallOrder); assertEquals(27, delegate2.createUninstallOrder); assertEquals(28, delegate2.configureUninstallOrder); assertEquals(29, delegate2.instantiateUninstallOrder); assertEquals(30, delegate2.describeUninstallOrder); } protected TestDelegate getDelegate1() { return new TestDelegate("Name1", "Alias1"); } protected OtherDelegate getDelegate2() { OtherDelegate result = new OtherDelegate("Name2"); result.addDependency(new AbstractDependencyItem("Name2", "Alias1", ControllerState.DESCRIBED, ControllerState.INSTALLED)); return result; } } ././@LongLink0000000000000000000000000000022600000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/ChangeAutomaticControllerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001545410331006762033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import junit.framework.Test; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.support.TestDelegate; /** * A ChangeAutomaticControllerTestCase. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ChangeAutomaticControllerTestCase extends AbstractDependencyTest { public static Test suite() { return suite(ChangeAutomaticControllerTestCase.class); } public ChangeAutomaticControllerTestCase(String name) { super(name); } public void testChangeAutomatic() throws Throwable { TestDelegate delegate = new TestDelegate("ChangeAutomaticTest"); ControllerContext context = assertInstall(delegate); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.CREATE); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.INSTALLED); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(9, delegate.startInstallOrder); assertEquals(10, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } public void testNullChangeAutomatic() throws Throwable { TestDelegate delegate = new TestDelegate("NullChangeAutomaticTest"); ControllerContext context = assertInstall(delegate); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.INSTALLED); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(-1, delegate.installUninstallOrder); assertEquals(-1, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.CREATE); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); assertChange(context, ControllerState.CREATE); assertEquals(1, delegate.describeInstallOrder); assertEquals(2, delegate.instantiateInstallOrder); assertEquals(3, delegate.configureInstallOrder); assertEquals(4, delegate.createInstallOrder); assertEquals(5, delegate.startInstallOrder); assertEquals(6, delegate.installInstallOrder); assertEquals(7, delegate.installUninstallOrder); assertEquals(8, delegate.startUninstallOrder); assertEquals(-1, delegate.createUninstallOrder); assertEquals(-1, delegate.configureUninstallOrder); assertEquals(-1, delegate.instantiateUninstallOrder); assertEquals(-1, delegate.describeUninstallOrder); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/test/BadDependencyInfoTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000002240611037053072033400 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.test; import java.lang.reflect.Method; import junit.framework.Test; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.test.dependency.controller.support.MockControllerContextActions; import org.jboss.test.dependency.controller.support.ProxyDependencyInfo; import org.jboss.test.dependency.controller.support.ProxyDependencyItem; /** * Test bad DependencyInfo/Item. * * @author Ales Justin */ public class BadDependencyInfoTestCase extends AbstractDependencyTest { private static final int numberOfInvocations = 10; public BadDependencyInfoTestCase(String name) { super(name); } public static Test suite() { return suite(BadDependencyInfoTestCase.class); } public void testDependencyInfoMethods() throws Throwable { Method[] methods = DependencyInfo.class.getDeclaredMethods(); for(int i = numberOfInvocations; i >= 0; i--) { for (Method method : methods) { AbstractControllerContext context = new AbstractControllerContext( method.getName(), new MockControllerContextActions(), ProxyDependencyInfo.createDependencyInfo(method, i) ); try { install(context); assertTrue(context.getName().toString(), ControllerState.ERROR.equals(context.getState()) || ControllerState.INSTALLED.equals(context.getState())); } catch (Throwable t) { assertEquals("getLifecycleCallbacks", method.getName()); assertInstanceOf(t, RuntimeException.class); } try { uninstall(context); } catch (Throwable t) { assertEquals("getLifecycleCallbacks", method.getName()); assertInstanceOf(t, Error.class); } } } } public void testDependencyItemMethodsOnMe() throws Throwable { Method[] methods = DependencyItem.class.getDeclaredMethods(); for(int i = numberOfInvocations; i >= 0; i--) { for (Method method : methods) { for(ControllerState whenRequired : getStateModel()) { ControllerContext context = createControllerContext(method.getName()); DependencyInfo info = context.getDependencyInfo(); info.addDependsOnMe(ProxyDependencyItem.createDependencyInfo(method, i, whenRequired)); install(context); assertTrue(context.getName().toString(), ControllerState.ERROR.equals(context.getState()) || ControllerState.INSTALLED.equals(context.getState())); uninstall(context); } } } } public void testDependencyItemMethodsOnMeResolved() throws Throwable { ControllerContext bean = createControllerContext("bean"); Method[] methods = DependencyItem.class.getDeclaredMethods(); for(int i = numberOfInvocations; i >= 0; i--) { for (Method method : methods) { for(ControllerState whenRequired : getStateModel()) { ControllerContext context = createControllerContext(method.getName()); DependencyInfo info = context.getDependencyInfo(); info.addDependsOnMe(ProxyDependencyItem.createDependencyInfo(method, i, whenRequired)); DependencyItem beanDependency = new AbstractDependencyItem("bean", context.getName(), whenRequired, null); bean.getDependencyInfo().addIDependOn(beanDependency); ControllerState previous = getStateModel().getPreviousState(whenRequired); if (previous == null) previous = ControllerState.INSTALLED; install(bean); assertEquals(previous, bean.getState()); install(context); ControllerState state = context.getState(); assertTrue(context.getName().toString(), ControllerState.ERROR.equals(state) || ControllerState.INSTALLED.equals(state)); if (ControllerState.INSTALLED.equals(state)) assertEquals(ControllerState.INSTALLED, bean.getState()); else assertEquals(previous, bean.getState()); uninstall(context); if (beanDependency.isResolved()) { Throwable t = context.getError(); if (t != null) { StackTraceElement[] elements = t.getStackTrace(); for(StackTraceElement trace : elements) { // we failed in uninstall - cannot unwind dependencies if (trace.getClassName().equals(AbstractController.class.getName()) && "uninstallContext".equals(trace.getMethodName())) { previous = ControllerState.INSTALLED; break; } } } else if (ControllerState.INSTALLED.equals(previous)) previous = ControllerState.NOT_INSTALLED; } assertEquals(context.toString(), previous, bean.getState()); uninstall(bean); bean.getDependencyInfo().removeIDependOn(beanDependency); } } } } public void testDependencyItemMethodsOnThem() throws Throwable { Method[] methods = DependencyItem.class.getDeclaredMethods(); for(int i = numberOfInvocations; i >= 0; i--) { for (Method method : methods) { for(ControllerState whenRequired : getStateModel()) { ControllerContext context = createControllerContext(method.getName()); DependencyInfo info = context.getDependencyInfo(); info.addIDependOn(ProxyDependencyItem.createDependencyInfo(method, i, whenRequired)); install(context); ControllerState previous = getStateModel().getPreviousState(whenRequired); assertTrue(context.getName().toString(), ControllerState.ERROR.equals(context.getState()) || previous == null || previous.equals(context.getState())); uninstall(context); } } } } public void testDependencyItemMethodsOnThemResolved() throws Throwable { ControllerContext bean = createControllerContext("bean"); Method[] methods = DependencyItem.class.getDeclaredMethods(); for(int i = numberOfInvocations; i >= 0; i--) { for (Method method : methods) { for(ControllerState whenRequired : getStateModel()) { ControllerContext context = createControllerContext(method.getName()); DependencyInfo info = context.getDependencyInfo(); info.addIDependOn(ProxyDependencyItem.createDependencyInfo(method, i, whenRequired)); install(context); install(bean); assertEquals(bean.getName().toString(), ControllerState.INSTALLED, bean.getState()); assertTrue(context.getName().toString(), ControllerState.ERROR.equals(context.getState()) || ControllerState.INSTALLED.equals(context.getState())); uninstall(bean); ControllerState previous = getStateModel().getPreviousState(whenRequired); if (previous == null) previous = ControllerState.INSTALLED; if (ControllerState.ERROR.equals(context.getState()) == false) assertEquals(previous, context.getState()); uninstall(context); } } } } } ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000755000175000017500000000000011620312223033364 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/OtherControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001124410604153706033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.HashMap; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * A TestControllerContext. * * @author Adrian Brock * @version $Revision: 61978 $ */ public class OtherControllerContext extends AbstractControllerContext { private static final AbstractControllerContextActions actions; static { HashMap map = new HashMap(); map.put(ControllerState.DESCRIBED, new DescribeAction()); map.put(ControllerState.INSTANTIATED, new InstantiateAction()); map.put(ControllerState.CONFIGURED, new ConfigureAction()); map.put(ControllerState.CREATE, new CreateAction()); map.put(ControllerState.START, new StartAction()); map.put(ControllerState.INSTALLED, new InstallAction()); actions = new AbstractControllerContextActions(map); } private OtherDelegate delegate; public OtherControllerContext(OtherDelegate delegate) { super(delegate.getName(), actions, delegate.dependencies); this.delegate = delegate; } public static class DescribeAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.describeInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.describeUninstall(); } } public static class InstantiateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.instantiateInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.instantiateUninstall(); } } public static class ConfigureAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.configureInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.configureUninstall(); } } public static class CreateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.createInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.createUninstall(); } } public static class StartAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.startInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.startUninstall(); } } public static class InstallAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((OtherControllerContext) context).delegate.installInstall(); } public void uninstall(ControllerContext context) { ((OtherControllerContext) context).delegate.installUninstall(); } } } ././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/RecursiveControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000635110604153706033405 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.HashMap; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.test.dependency.controller.test.RecursiveControllerActionTestCase; /** * A TestControllerContext. * * @author Adrian Brock * @version $Revision: 61978 $ */ public class RecursiveControllerContext extends TestControllerContext { private static final AbstractControllerContextActions actions; static { HashMap map = new HashMap(); map.put(ControllerState.DESCRIBED, new DescribeAction()); map.put(ControllerState.INSTANTIATED, new InstantiateAction()); map.put(ControllerState.CONFIGURED, new ConfigureAction()); map.put(ControllerState.CREATE, new RecursiveCreateAction()); map.put(ControllerState.START, new StartAction()); map.put(ControllerState.INSTALLED, new InstallAction()); actions = new AbstractControllerContextActions(map); } RecursiveControllerActionTestCase recursive; public RecursiveControllerContext child; public Throwable error; public RecursiveControllerContext(TestDelegate delegate, RecursiveControllerActionTestCase recursive) { super(delegate, actions); this.recursive = recursive; } public static class RecursiveCreateAction extends CreateAction { public void install(ControllerContext context) throws Throwable { super.install(context); RecursiveControllerContext recursiveContext = (RecursiveControllerContext) context; if (recursiveContext.recursive != null) recursiveContext.recursive.installChild(recursiveContext); } public void uninstall(ControllerContext context) { RecursiveControllerContext recursiveContext = (RecursiveControllerContext) context; if (recursiveContext.recursive != null) recursiveContext.recursive.uninstallChild(recursiveContext); super.uninstall(context); } } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/ErrorDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000751010464415571033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import org.jboss.dependency.plugins.AbstractDependencyInfo; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.DependencyItem; /** * An ErrorDelegate. * * @author Adrian Brock * @version $Revision: 1.2 $ */ public class ErrorDelegate { private Object name; private int failWhen; public ControllerMode mode = ControllerMode.MANUAL; public AbstractDependencyInfo dependencies = new AbstractDependencyInfo(); public static final int FAIL_IN_DESCRIBE = 1; public static final int FAIL_IN_INSTANTIATE = 2; public static final int FAIL_IN_CONFIGURE = 3; public static final int FAIL_IN_CREATE = 4; public static final int FAIL_IN_START = 5; public static final int FAIL_IN_INSTALL = 6; public static final int FAIL_IN_UNDESCRIBE = -1; public static final int FAIL_IN_UNINSTANTIATE = -2; public static final int FAIL_IN_UNCONFIGURE = -3; public static final int FAIL_IN_UNCREATE = -4; public static final int FAIL_IN_UNSTART = -5; public static final int FAIL_IN_UNINSTALL = -6; public ErrorDelegate(Object name, int failWhen) { this.name = name; this.failWhen = failWhen; } public Object getName() { return name; } public void describeInstall() { if (failWhen == FAIL_IN_DESCRIBE) throw new Error("Fail"); } public void describeUninstall() { if (failWhen == FAIL_IN_UNDESCRIBE) throw new Error("Fail"); } public void instantiateInstall() { if (failWhen == FAIL_IN_INSTANTIATE) throw new Error("Fail"); } public void instantiateUninstall() { if (failWhen == FAIL_IN_UNINSTANTIATE) throw new Error("Fail"); } public void configureInstall() { if (failWhen == FAIL_IN_CONFIGURE) throw new Error("Fail"); } public void configureUninstall() { if (failWhen == FAIL_IN_UNCONFIGURE) throw new Error("Fail"); } public void createInstall() { if (failWhen == FAIL_IN_CREATE) throw new Error("Fail"); } public void createUninstall() { if (failWhen == FAIL_IN_UNCREATE) throw new Error("Fail"); } public void startInstall() { if (failWhen == FAIL_IN_START) throw new Error("Fail"); } public void startUninstall() { if (failWhen == FAIL_IN_UNSTART) throw new Error("Fail"); } public void installInstall() { if (failWhen == FAIL_IN_INSTALL) throw new Error("Fail"); } public void installUninstall() { if (failWhen == FAIL_IN_UNINSTALL) throw new Error("Fail"); } public void addDependency(DependencyItem dependency) { dependencies.addIDependOn(dependency); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/ProxyDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000464111035656544033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; /** * @author Ales Justin */ public class ProxyDependencyItem extends AbstractDependencyItem implements InvocationHandler { private Method method; private int allowedHits; public ProxyDependencyItem(Method method, int allowedHits, ControllerState whenRequired) { super(method.getName(), "bean", whenRequired, null); this.method = method; this.allowedHits = allowedHits; } public static DependencyItem createDependencyInfo(Method method, int allowedHits, ControllerState whenRequired) { return (DependencyItem)Proxy.newProxyInstance( DependencyItem.class.getClassLoader(), new Class[]{DependencyItem.class}, new ProxyDependencyItem(method, allowedHits, whenRequired)); } public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { if (m.equals(method)) { if (allowedHits <= 0) throw new RuntimeException("Failed"); allowedHits--; } return m.invoke(this, args); } }././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/MockControllerContextActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000323410604466300033377 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerState; /** * Actions that don't do anything * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class MockControllerContextActions implements ControllerContextActions { public void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { // Mock } public void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { // Mock } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/TestDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000771010770540334033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.HashSet; import java.util.Set; import org.jboss.dependency.plugins.AbstractDependencyInfo; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.DependencyItem; /** * A TestDelegate. * * @author Adrian Brock * @version $Revision: 71098 $ */ public class TestDelegate extends Ordering { private Object name; private Set aliases; public AbstractDependencyInfo dependencies = new AbstractDependencyInfo(); public ControllerMode mode = ControllerMode.AUTOMATIC; public int describeInstallOrder = -1; public int describeUninstallOrder = -1; public int instantiateInstallOrder = -1; public int instantiateUninstallOrder = -1; public int configureInstallOrder = -1; public int configureUninstallOrder = -1; public int createInstallOrder = -1; public int createUninstallOrder = -1; public int startInstallOrder = -1; public int startUninstallOrder = -1; public int installInstallOrder = -1; public int installUninstallOrder = -1; public TestDelegate(Object name) { this(name, (Object[]) null); } public TestDelegate(Object name, Object... aliases) { this.name = name; if (aliases != null) { this.aliases = new HashSet(); for (int i = 0; i < aliases.length; ++i) this.aliases.add(aliases[i]); } } public Object getName() { return name; } public Set getAliases() { return aliases; } public void describeInstall() { describeInstallOrder = order.incrementAndGet(); } public void describeUninstall() { describeUninstallOrder = order.incrementAndGet(); } public void instantiateInstall() { instantiateInstallOrder = order.incrementAndGet(); } public void instantiateUninstall() { instantiateUninstallOrder = order.incrementAndGet(); } public void configureInstall() { configureInstallOrder = order.incrementAndGet(); } public void configureUninstall() { configureUninstallOrder = order.incrementAndGet(); } public void createInstall() { createInstallOrder = order.incrementAndGet(); } public void createUninstall() { createUninstallOrder = order.incrementAndGet(); } public void startInstall() { startInstallOrder = order.incrementAndGet(); } public void startUninstall() { startUninstallOrder = order.incrementAndGet(); } public void installInstall() { installInstallOrder = order.incrementAndGet(); } public void installUninstall() { installUninstallOrder = order.incrementAndGet(); } public void addDependency(DependencyItem dependency) { dependencies.addIDependOn(dependency); } public void setMode(ControllerMode mode) { this.mode = mode; } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/OtherDelegate.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000652010622567717033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import org.jboss.dependency.plugins.AbstractDependencyInfo; import org.jboss.dependency.spi.DependencyItem; /** * A TestDelegate. * * @author Adrian Brock * @version $Revision: 63094 $ */ public class OtherDelegate extends Ordering { private Object name; public AbstractDependencyInfo dependencies = new AbstractDependencyInfo(); public int describeInstallOrder = -1; public int describeUninstallOrder = -1; public int instantiateInstallOrder = -1; public int instantiateUninstallOrder = -1; public int configureInstallOrder = -1; public int configureUninstallOrder = -1; public int createInstallOrder = -1; public int createUninstallOrder = -1; public int startInstallOrder = -1; public int startUninstallOrder = -1; public int installInstallOrder = -1; public int installUninstallOrder = -1; public OtherDelegate(Object name) { this.name = name; } public Object getName() { return name; } public void describeInstall() { describeInstallOrder = order.incrementAndGet(); } public void describeUninstall() { describeUninstallOrder = order.incrementAndGet(); } public void instantiateInstall() { instantiateInstallOrder = order.incrementAndGet(); } public void instantiateUninstall() { instantiateUninstallOrder = order.incrementAndGet(); } public void configureInstall() { configureInstallOrder = order.incrementAndGet(); } public void configureUninstall() { configureUninstallOrder = order.incrementAndGet(); } public void createInstall() { createInstallOrder = order.incrementAndGet(); } public void createUninstall() { createUninstallOrder = order.incrementAndGet(); } public void startInstall() { startInstallOrder = order.incrementAndGet(); } public void startUninstall() { startUninstallOrder = order.incrementAndGet(); } public void installInstall() { installInstallOrder = order.incrementAndGet(); } public void installUninstall() { installUninstallOrder = order.incrementAndGet(); } public void addDependency(DependencyItem dependency) { dependencies.addIDependOn(dependency); } } ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/Ordering.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000254210622567717033416 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.concurrent.atomic.AtomicInteger; /** * A Ordering. * * @author Adrian Brock * @version $Revision: 63094 $ */ public class Ordering { protected static final AtomicInteger order = new AtomicInteger(0); public static void resetOrder() { order.set(0); } } ././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/ProxyDependencyInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000435311035656544033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import org.jboss.dependency.plugins.AbstractDependencyInfo; import org.jboss.dependency.spi.DependencyInfo; /** * @author Ales Justin */ public class ProxyDependencyInfo extends AbstractDependencyInfo implements InvocationHandler { private Method method; private int allowedHits; public ProxyDependencyInfo(Method method, int allowedHits) { this.method = method; this.allowedHits = allowedHits; } public static DependencyInfo createDependencyInfo(Method method, int allowedHits) { return (DependencyInfo)Proxy.newProxyInstance( DependencyInfo.class.getClassLoader(), new Class[]{DependencyInfo.class}, new ProxyDependencyInfo(method, allowedHits)); } public Object invoke(Object proxy, Method m, Object[] args) throws Throwable { if (m.equals(method)) { if (allowedHits <= 0) throw new RuntimeException("Failed"); allowedHits--; } return m.invoke(this, args); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/ErrorControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001163510604153706033406 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.HashMap; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * An ErrorControllerContext. * * @author Adrian Brock * @version $Revision: 1.5 $ */ public class ErrorControllerContext extends AbstractControllerContext { private static final AbstractControllerContextActions actions; static { HashMap map = new HashMap(); map.put(ControllerState.DESCRIBED, new DescribeAction()); map.put(ControllerState.INSTANTIATED, new InstantiateAction()); map.put(ControllerState.CONFIGURED, new ConfigureAction()); map.put(ControllerState.CREATE, new CreateAction()); map.put(ControllerState.START, new StartAction()); map.put(ControllerState.INSTALLED, new InstallAction()); actions = new AbstractControllerContextActions(map); } private ErrorDelegate delegate; public ErrorControllerContext(ErrorDelegate delegate) { this(delegate, actions); } public ErrorControllerContext(ErrorDelegate delegate, AbstractControllerContextActions actions) { super(delegate.getName(), actions, delegate.dependencies); setMode(delegate.mode); this.delegate = delegate; } public ErrorDelegate getDelegate() { return delegate; } public static class DescribeAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.describeInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.describeUninstall(); } } public static class InstantiateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.instantiateInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.instantiateUninstall(); } } public static class ConfigureAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.configureInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.configureUninstall(); } } public static class CreateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.createInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.createUninstall(); } } public static class StartAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.startInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.startUninstall(); } } public static class InstallAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((ErrorControllerContext) context).delegate.installInstall(); } public void uninstall(ControllerContext context) { ((ErrorControllerContext) context).delegate.installUninstall(); } } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/TestControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000001166310604466300033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.test.dependency.controller.support; import java.util.HashMap; import org.jboss.dependency.plugins.AbstractControllerContext; import org.jboss.dependency.plugins.AbstractControllerContextActions; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * A TestControllerContext. * * @author Adrian Brock * @version $Revision: 62039 $ */ public class TestControllerContext extends AbstractControllerContext { private static final AbstractControllerContextActions actions; static { HashMap map = new HashMap(); map.put(ControllerState.DESCRIBED, new DescribeAction()); map.put(ControllerState.INSTANTIATED, new InstantiateAction()); map.put(ControllerState.CONFIGURED, new ConfigureAction()); map.put(ControllerState.CREATE, new CreateAction()); map.put(ControllerState.START, new StartAction()); map.put(ControllerState.INSTALLED, new InstallAction()); actions = new AbstractControllerContextActions(map); } private TestDelegate delegate; public TestControllerContext(TestDelegate delegate) { this(delegate, actions); } public TestControllerContext(TestDelegate delegate, AbstractControllerContextActions actions) { super(delegate.getName(), actions, delegate.dependencies); setMode(delegate.mode); setAliases(delegate.getAliases()); this.delegate = delegate; } public TestDelegate getDelegate() { return delegate; } public static class DescribeAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.describeInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.describeUninstall(); } } public static class InstantiateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.instantiateInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.instantiateUninstall(); } } public static class ConfigureAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.configureInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.configureUninstall(); } } public static class CreateAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.createInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.createUninstall(); } } public static class StartAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.startInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.startUninstall(); } } public static class InstallAction implements ControllerContextAction { public void install(ControllerContext context) throws Throwable { ((TestControllerContext) context).delegate.installInstall(); } public void uninstall(ControllerContext context) { ((TestControllerContext) context).delegate.installUninstall(); } } } ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/controller/support/RecursiveDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/test/java/org/jboss/test/dependency/contr0000644000175000017500000000456511301276642033412 0ustar twernertwerner/* * 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.test.dependency.controller.support; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; /** * RecursiveDependencyItem. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class RecursiveDependencyItem extends AbstractDependencyItem { public RecursiveDependencyItem(Object name, Object iDependOn, ControllerState whenRequired, ControllerState dependentState) { super(name, iDependOn, whenRequired, dependentState); } @Override public boolean resolve(Controller controller) { ControllerStateModel stateModel = controller.getStates(); ControllerContext other = controller.getContext(getIDependOn(), null); ControllerState otherState = getDependentState(); if (stateModel.isBeforeState(other.getState(), otherState)) { try { controller.change(other, otherState); } catch (Throwable t) { log.warn("Error", t); return false; } if (stateModel.isBeforeState(other.getState(), otherState)) return false; } addDependsOnMe(controller, other); return true; } } libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/assembly/0000755000175000017500000000000011620312222025230 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/assembly/spi.xml0000644000175000017500000000057210600031655026556 0ustar twernertwerner spi jar false target/classes org/jboss/dependency/spi/** libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/assembly/plugins.xml0000644000175000017500000000060210761567562027461 0ustar twernertwerner plugins jar false target/classes org/jboss/dependency/plugins/** libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/0000755000175000017500000000000011620312224024337 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/resources/0000755000175000017500000000000011620312224026351 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/resources/findbugs/0000755000175000017500000000000011620312224030152 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/resources/findbugs/exclude.xml0000644000175000017500000000274111262374224032343 0ustar twernertwerner libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/0000755000175000017500000000000011620312223025257 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/0000755000175000017500000000000011620312223026046 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/0000755000175000017500000000000011620312223027166 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/0000755000175000017500000000000011620312224031305 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/0000755000175000017500000000000011620312224032766 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/JMXObjectNameFix.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/JM0000644000175000017500000000410610604476342033235 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import javax.management.MalformedObjectNameException; import javax.management.ObjectName; /** * Hacky Class to fixup "object names" to their canonical form * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class JMXObjectNameFix { /** * Whether the given name needs an alias

* * By default we just add aliases for JMX like ObjectNames to have a canonical name alias * * @param original the original name * @return the alias if required or null if no alias required */ public static Object needsAnAlias(Object original) { // Not a string if (original == null || original instanceof String == false) return null; try { ObjectName canonical = ObjectName.getInstance((String) original); String alias = canonical.getCanonicalName(); if (original.equals(alias) == false) return alias; } catch (MalformedObjectNameException ignored) { // Not a JMX ObjectName } return null; } } ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractControllerMBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000000253311061472530033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; /** * AbstractControllerMBean. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface AbstractControllerMBean { /** * List the state times * * @param details whether to show details * @return the deployer times */ String listStateTimes(boolean details); } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AliasControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Al0000644000175000017500000000275111032634675033270 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.ControllerContext; /** * Alias controller context. * * @author Ales Justin */ public interface AliasControllerContext extends ControllerContext { /** * Get the alias. * * @return the alias to register */ Object getAlias(); /** * Get the original. * * @return the original to map to */ Object getOriginal(); } ././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/SecurityActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Se0000644000175000017500000000622510763752652033311 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.security.AccessController; import java.security.PrivilegedAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.logging.Logger; /** * SecurityActions. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class SecurityActions { /** The logger */ private static final Logger log = Logger.getLogger(SecurityActions.class); private static ClassLoader setContextClassLoaderInternal(final ControllerContext context) { ClassLoader result = Thread.currentThread().getContextClassLoader(); if (context instanceof InvokeDispatchContext) { ClassLoader cl = null; InvokeDispatchContext invokeContext = (InvokeDispatchContext) context; try { cl = invokeContext.getClassLoader(); } catch (Throwable t) { if (log.isTraceEnabled()) log.trace("Not setting classloader for " + context.getName() + " reason:" + context); } if (cl != null) Thread.currentThread().setContextClassLoader(cl); } return result; } static ClassLoader setContextClassLoader(final ControllerContext context) { if (System.getSecurityManager() == null) { return setContextClassLoaderInternal(context); } else { return AccessController.doPrivileged(new PrivilegedAction() { public ClassLoader run() { return setContextClassLoaderInternal(context); } }); } } static void resetContextClassLoader(final ClassLoader classLoader) { if (System.getSecurityManager() == null) { Thread.currentThread().setContextClassLoader(classLoader); } else { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { Thread.currentThread().setContextClassLoader(classLoader); return null; } }); } } } ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/action/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ac0000755000175000017500000000000011620312224033272 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/action/ControllerContextAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ac0000644000175000017500000000304310604153706033305 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.action; import org.jboss.dependency.spi.ControllerContext; /** * A controller context action. * * @author Adrian Brock * @version $Revision: 61978 $ */ public interface ControllerContextAction { /** * Install a context * * @param context the context * @throws Throwable for any error */ void install(ControllerContext context) throws Throwable; /** * Uninstall a context * * @param context the context */ void uninstall(ControllerContext context); } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/action/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ac0000644000175000017500000000147710604153706033316 0ustar twernertwerner

Definition of action plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/action/AccessControllerContextAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ac0000644000175000017500000001176210645110427033312 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.action; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import org.jboss.dependency.spi.ControllerContext; /** * Access controller context. * It runs action in simple mode if there is no security manager present. * While running simple action, you cast the actual context into less specific type. * * @param simple ControllerContext impl * @param full ControllerContext impl * @author Ales Justin */ public abstract class AccessControllerContextAction implements ControllerContextAction { /** * Validate context * * @param context context instance to validate * @return false if not able to use privileged action */ protected abstract boolean validateContext(ControllerContext context); /** * Cast context instance. * We can throw class cast exception if unable to cast it it S. * * @param context context to cast * @return casted context */ protected abstract S simpleContextCast(ControllerContext context); /** * Cast context instance. * We can throw class cast exception if unable to cast it it T. * * @param context context to cast * @return casted context */ protected abstract T fullContextCast(ControllerContext context); public void install(final ControllerContext context) throws Throwable { if (System.getSecurityManager() == null || validateContext(context) == false) simpleInstallAction(simpleContextCast(context)); else { PrivilegedExceptionAction action = new PrivilegedExceptionAction() { public Object run() throws Exception { try { secureInstallAction(fullContextCast(context)); return null; } catch (RuntimeException e) { throw e; } catch (Exception e) { throw e; } catch (Error e) { throw e; } catch (Throwable t) { throw new RuntimeException(t); } } }; try { AccessController.doPrivileged(action); } catch (PrivilegedActionException e) { throw e.getCause(); } } } /** * Unsecure call to install action. * * @param context the context * @throws Throwable for any error */ protected abstract void simpleInstallAction(S context) throws Throwable; /** * Secure call to install action. * * @param context the context * @throws Throwable for any error */ protected abstract void secureInstallAction(T context) throws Throwable; public void uninstall(final ControllerContext context) { if (System.getSecurityManager() == null || validateContext(context) == false) simpleUninstallAction(simpleContextCast(context)); else { PrivilegedAction action = new PrivilegedAction() { public Object run() { secureUninstallAction(fullContextCast(context)); return null; } }; AccessController.doPrivileged(action); } } /** * Unsecure call to uninstall action. * * @param context the context */ protected abstract void simpleUninstallAction(S context); /** * Secure call to uninstall action. * * @param context the context */ protected abstract void secureUninstallAction(T context); } ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/action/SimpleControllerContextAction.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ac0000644000175000017500000000504410645110427033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.action; import org.jboss.dependency.spi.ControllerContext; /** * Simple and full context impls are the same. * * @param ControllerContext impl * @author Ales Justin */ public abstract class SimpleControllerContextAction extends AccessControllerContextAction { /** * Cast the context to the actual implementation. * * @param context the context * @return exact context type */ protected abstract T contextCast(ControllerContext context); protected T simpleContextCast(ControllerContext context) { return contextCast(context); } protected T fullContextCast(ControllerContext context) { return contextCast(context); } /** * The install. * * @param context the context * @throws Throwable for any error */ protected abstract void installAction(T context) throws Throwable; protected void simpleInstallAction(T context) throws Throwable { installAction(context); } protected void secureInstallAction(T context) throws Throwable { installAction(context); } /** * The uninstall. * * @param context the context */ protected abstract void uninstallAction(T context); protected void simpleUninstallAction(T context) { uninstallAction(context); } protected void secureUninstallAction(T context) { uninstallAction(context); } } ././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractControllerContextActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000000501410604153706033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.Map; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerState; /** * ControllerContextActions. * * @author Adrian Brock * @version $Revision: 61978 $ */ public class AbstractControllerContextActions implements ControllerContextActions { /** The actions Map */ private Map actions; public AbstractControllerContextActions(Map actions) { this.actions = actions; } public void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { ControllerContextAction action = getAction(context, toState); if (action != null) action.install(context); } public void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { ControllerContextAction action = getAction(context, fromState); if (action != null) action.uninstall(context); } /** * Get the controller context action * * @param context the context * @param state the state * @return the action */ protected ControllerContextAction getAction(ControllerContext context, ControllerState state) { return actions.get(state); } } ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000755000175000017500000000000011620312224033317 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/HierarchyLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000323511035103604033324 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; /** * Hierarchy lookup strategy. * Does local lookup on controller - if supported. * * @author Ales Justin */ public abstract class HierarchyLookupStrategy extends LocalLookupStrategy { private boolean checkCurrent; protected HierarchyLookupStrategy() { } protected HierarchyLookupStrategy(boolean checkCurrent) { this.checkCurrent = checkCurrent; } /** * Should we check current / top. * * @return true if check surrent / top */ protected boolean isCheckCurrent() { return checkCurrent; } }././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ScopeKeySearchInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000436111147522315033335 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.io.Serializable; import java.util.Collections; import java.util.Map; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.metadata.spi.scope.ScopeKey; /** * ScopeKey search info. * * @author Ales Justin */ public class ScopeKeySearchInfo implements SearchInfo, Serializable { private static final long serialVersionUID = 1L; public static final String SCOPE_KEY = "ScopeKey"; private ScopeKey scopeKey; private Map info; private transient LookupStrategy strategy; public ScopeKeySearchInfo(ScopeKey scopeKey) { if (scopeKey == null) throw new IllegalArgumentException("Null scope key"); this.scopeKey = scopeKey; } public String getType() { return SCOPE_KEY; } public Map getInfo() { if (info == null) info = Collections.singletonMap(SCOPE_KEY, scopeKey); return info; } public LookupStrategy getStrategy() { if (strategy == null) strategy = new ScopeKeyLookupStrategy(scopeKey); return strategy; } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ScopeKeyLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000754711147522315033346 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Set; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.plugins.ScopedController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.metadata.spi.scope.ScopeKey; /** * ScopeKey lookup strategy. * It only matches exact scope key level. * * @author Ales Justin */ public class ScopeKeyLookupStrategy extends HierarchyLookupStrategy { private ScopeKey scopeKey; public ScopeKeyLookupStrategy(ScopeKey scopeKey) { if (scopeKey == null) throw new IllegalArgumentException("Null scope key"); this.scopeKey = scopeKey; } protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { // go all the way to the top AbstractController parent = controller.getParentController(); while (parent != null) { controller = parent; parent = controller.getParentController(); } AbstractController match = findMatchingScopedController(controller); if (match != null) return getLocalContext(match, name, state); return null; } /** * Find scope key matching scoped controller. * * @param current the current controller * @return match or null if no match */ private AbstractController findMatchingScopedController(AbstractController current) { boolean related = true; // by default it's related if (current instanceof ScopedController) { ScopedController scopedController = (ScopedController)current; ScopeKey key = scopedController.getScopeKey(); // see if this is even related, so that we don't go fwd for nothing if (key != null) { // exact match if (scopeKey.equals(key)) return current; related = false; // we have key, should prove that it's related ScopeKey ck = scopeKey; int keySize = key.getScopes().size(); int ckSize = ck.getScopes().size(); while (ck != null && keySize < ckSize) { if (key.isParent(ck)) { related = true; break; } ck = ck.getParent(); ckSize--; } } } if (related) { Set children = current.getControllers(); for (AbstractController child : children) { AbstractController found = findMatchingScopedController(child); if (found != null) return found; } } return null; } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ParentLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000331511035124176033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Check parent. * Return null if there is no parent. * * @author Ales Justin */ public class ParentLookupStrategy extends AbstractLookupStrategy { protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { AbstractController parent = controller.getParentController(); if (parent != null) return parent.getContext(name, state); else return null; } }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/LazySearchInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000523111147522315033332 0ustar twernertwerner/* * 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.dependency.plugins.graph; import java.util.Collections; import java.util.Map; import java.io.Serializable; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.reflect.plugins.introspection.ReflectionUtils; /** * Lazy search info. * The type is the class. * * @author Ales Justin */ public class LazySearchInfo implements SearchInfo, Serializable { private static final long serialVersionUID = 1L; private String className; private transient LookupStrategy strategy; public LazySearchInfo(String className) { if (className == null) throw new IllegalArgumentException("Null class name"); this.className = className; } public String getType() { return className; } public Map getInfo() { return Collections.emptyMap(); } public LookupStrategy getStrategy() { if (strategy == null) { Object result; try { result = ReflectionUtils.newInstance(className); } catch (Throwable t) { throw new RuntimeException(t); } if (LookupStrategy.class.isInstance(result) == false) throw new IllegalArgumentException("Result is not LookupStrategy instance: " + result); strategy = LookupStrategy.class.cast(result); } return strategy; } @Override public String toString() { return "LazySearchInfo: " + className; } } ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ChildrenOnlyDepthLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000246511033513560033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; /** * Children only - depth search. * * @author Ales Justin */ public class ChildrenOnlyDepthLookupStrategy extends DepthLookupStrategy { public ChildrenOnlyDepthLookupStrategy() { super(false); } }././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ChildrenOnlyWidthLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000246511033513560033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; /** * Children only - width search. * * @author Ales Justin */ public class ChildrenOnlyWidthLookupStrategy extends WidthLookupStrategy { public ChildrenOnlyWidthLookupStrategy() { super(false); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/LocalLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000432611035103604033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.plugins.ScopedController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Check only current scope. * * @author Ales Justin */ public class LocalLookupStrategy extends AbstractLookupStrategy { protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { return getLocalContext(controller, name, state); } /** * Get local context. * * @param controller the controller * @param name the context name * @param state the dependent state * @return found controller context or null */ protected ControllerContext getLocalContext(AbstractController controller, Object name, ControllerState state) { if (controller instanceof ScopedController) { ScopedController scopedController = (ScopedController)controller; return scopedController.getContextLocally(name, state); } else return controller.getContext(name, state); } }././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/DefaultLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000307411034660617033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; /** * Default lookup. * * @author Ales Justin */ public class DefaultLookupStrategy implements LookupStrategy { public ControllerContext getContext(Controller controller, Object name, ControllerState state) { return controller.getContext(name, state); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/Search.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000633511147522315033340 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Map; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.xb.annotations.JBossXmlEnum; /** * Search enum. * * @author Ales Justin */ @JBossXmlEnum(ignoreCase = true) public enum Search implements SearchInfo { DEFAULT(new DefaultSearchInfoWrapper()), LOCAL(new LocalLookupStrategy()), TOP(new TopLevelLookupStrategy()), PARENT_ONLY(new ParentOnlyLookupStrategy()), PARENT(new ParentLookupStrategy()), DEPTH(new DepthLookupStrategy()), LEAVES(new LeavesFirstLookupStrategy()), WIDTH(new WidthLookupStrategy()), CHILD_ONLY_DEPTH(new ChildrenOnlyDepthLookupStrategy()), CHILD_ONLY_LEAVES(new ChildrenOnlyLeavesFirstLookupStrategy()), CHILD_ONLY_WIDTH(new ChildrenOnlyWidthLookupStrategy()); private SearchInfo delegate; Search(SearchInfo delegate) { this.delegate = delegate; } /** * Get SearchInfo instance. * * @param typeString the type string * @return matching instance, lazy if none found */ public static SearchInfo getInstance(String typeString) { if (typeString == null || typeString.length() == 0) { return DEFAULT; } for(Search search : values()) { if (search.getType().equalsIgnoreCase(typeString) || search.name().equalsIgnoreCase(typeString)) return search; } return new LazySearchInfo(typeString); } public String getType() { return delegate.getType(); } public Map getInfo() { return delegate.getInfo(); } public LookupStrategy getStrategy() { return delegate.getStrategy(); } private static class DefaultSearchInfoWrapper implements SearchInfo { private DefaultLookupStrategy strategy = new DefaultLookupStrategy(); public String getType() { return ""; } public Map getInfo() { return null; } public LookupStrategy getStrategy() { return strategy; } } } ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/AbstractLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000570611035634543033344 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Map; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; /** * Abstract lookup strategy. * Only working on AbstractController controller instances. * * @author Ales Justin */ public abstract class AbstractLookupStrategy implements LookupStrategy, SearchInfo { private String type; private Map info; protected AbstractLookupStrategy() { } protected AbstractLookupStrategy(Map info) { this.info = info; } public String getType() { if (type == null) { String simpleName = getClass().getSimpleName(); int p = simpleName.indexOf("LookupStrategy"); type = simpleName.substring(0, p); } return type; } public Map getInfo() { return info; } public LookupStrategy getStrategy() { return this; } public ControllerContext getContext(Controller controller, Object name, ControllerState state) { if (controller instanceof AbstractController == false) throw new IllegalArgumentException("Can only handle AbstractController: " + controller); return getContextInternal((AbstractController)controller, name, state); } /** * Get context based on this strategy. * * @param controller the current abstract controller * @param name the name of the context * @param state the context's state * @return context or null if not available */ protected abstract ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state); }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/DepthLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000550511035103604033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Set; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Depth search. * * @author Ales Justin */ public class DepthLookupStrategy extends HierarchyLookupStrategy { public DepthLookupStrategy() { this(true); } protected DepthLookupStrategy(boolean checkCurrent) { super(checkCurrent); } protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { return getContextInternal(controller, name, state, isCheckCurrent()); } /** * Get context based on this strategy. * * @param controller the current abstract controller * @param name the name of the context * @param state the context's state * @param check check current * @return context or null if not available */ protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state, boolean check) { ControllerContext context; if (check) { context = getLocalContext(controller, name, state); if (context != null) return context; } Set children = controller.getControllers(); for (AbstractController child : children) { // check child first context = getLocalContext(child, name, state); if (context != null) return context; // then its children context = getContextInternal(child, name, state, false); if (context != null) return context; } return null; } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/TopLevelLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000337211034660617033341 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.plugins.AbstractController; /** * Check only top level. * * @author Ales Justin */ public class TopLevelLookupStrategy extends AbstractLookupStrategy { protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { AbstractController parent = controller.getParentController(); while (parent != null) { controller = parent; parent = controller.getParentController(); } return controller.getContext(name, state); } } ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/SearchDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000001024611147522315033334 0ustar twernertwerner/* * 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.dependency.plugins.graph; import org.jboss.dependency.plugins.AbstractDependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.graph.GraphController; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; /** * Search dependency item. * * @author Ales Justin */ public class SearchDependencyItem extends AbstractDependencyItem { private SearchInfo search; public SearchDependencyItem(Object name, Object iDependOn, ControllerState whenRequired, ControllerState dependentState, SearchInfo search) { super(name, iDependOn, whenRequired, dependentState); this.search = search; } /** * Get controller context. * * @param controller the controller * @param name the name * @param state the state * @return the controller context */ protected ControllerContext getControllerContext(Controller controller, Object name, ControllerState state) { LookupStrategy strategy = search.getStrategy(); return strategy.getContext(controller, name, state); } public boolean resolve(Controller controller) { if (controller instanceof GraphController) { boolean previous = isResolved(); ControllerContext context; if (getDependentState() == null) { context = getControllerContext(controller, getIDependOn(), ControllerState.INSTALLED); } else { context = getControllerContext(controller, getIDependOn(), getDependentState()); } if (context == null) { setResolved(false); ControllerContext unresolvedContext = getControllerContext(controller, getIDependOn(), null); if (unresolvedContext != null && ControllerMode.ON_DEMAND.equals(unresolvedContext.getMode())) { try { controller.enableOnDemand(unresolvedContext); } catch (Throwable ignored) { if (log.isTraceEnabled()) log.trace("Unexpected error", ignored); } } } else { addDependsOnMe(controller, context); setResolved(true); } if (previous != isResolved()) { flushJBossObjectCache(); if (log.isTraceEnabled()) { if (isResolved()) log.trace("Resolved " + this); else log.trace("Unresolved " + this); } } return isResolved(); } return super.resolve(controller); } protected void toHumanReadableString(StringBuilder builder) { super.toHumanReadableString(builder); builder.append("search=").append(search); } } ././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/LeavesFirstLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000510111035103604033316 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Set; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Leaves first. * * @author Ales Justin */ public class LeavesFirstLookupStrategy extends HierarchyLookupStrategy { public LeavesFirstLookupStrategy() { this(true); } protected LeavesFirstLookupStrategy(boolean checkCurrent) { super(checkCurrent); } protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { return getContextInternal(controller, name, state, isCheckCurrent()); } /** * Get context based on this strategy. * * @param controller the current abstract controller * @param name the name of the context * @param state the context's state * @param check check current * @return context or null if not available */ protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state, boolean check) { Set children = controller.getControllers(); for (AbstractController child : children) { ControllerContext context = getContextInternal(child, name, state, true); if (context != null) return context; } if (check) return getLocalContext(controller, name, state); return null; } }././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ChildrenOnlyLeavesFirstLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000251011033513560033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; /** * Children only - leaves first. * * @author Ales Justin */ public class ChildrenOnlyLeavesFirstLookupStrategy extends LeavesFirstLookupStrategy { public ChildrenOnlyLeavesFirstLookupStrategy() { super(false); } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/WidthLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000551111035103604033323 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import java.util.Set; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Width search. * * @author Ales Justin */ public class WidthLookupStrategy extends HierarchyLookupStrategy { public WidthLookupStrategy() { this(true); } protected WidthLookupStrategy(boolean checkCurrent) { super(checkCurrent); } protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { return getContextInternal(controller, name, state, isCheckCurrent()); } /** * Get context based on this strategy. * * @param controller the current abstract controller * @param name the name of the context * @param state the context's state * @param check check current * @return context or null if not available */ protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state, boolean check) { ControllerContext context; if (check) { context = getLocalContext(controller, name, state); if (context != null) return context; } Set children = controller.getControllers(); for (AbstractController child : children) { context = getLocalContext(child, name, state); if (context != null) return context; } for(AbstractController child : children) { context = getContextInternal(child, name, state, false); if (context != null) return context; } return null; } }././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/graph/ParentOnlyLookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/gr0000644000175000017500000000333511035124176033334 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins.graph; import org.jboss.dependency.plugins.AbstractController; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Check only parent. * Return null if there is no parent. * * @author Ales Justin */ public class ParentOnlyLookupStrategy extends HierarchyLookupStrategy { protected ControllerContext getContextInternal(AbstractController controller, Object name, ControllerState state) { AbstractController parent = controller.getParentController(); if (parent != null) return getLocalContext(parent, name, state); else return null; } }././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000002742210772743225033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.io.PrintWriter; import java.io.StringWriter; import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * A ControllerContext. * * @author Adrian Brock * @version $Revision: 71354 $ */ public class AbstractControllerContext extends JBossObject implements ControllerContext { /** The name */ private Object name; /** The aliases */ private Set aliases; /** The target */ private Object target; /** The controller */ private Controller controller; /** The state */ private ControllerState state = ControllerState.ERROR; /** The required state */ private ControllerState requiredState = ControllerState.NOT_INSTALLED; /** The mode */ private ControllerMode mode = ControllerMode.AUTOMATIC; /** The error handling mode */ private ErrorHandlingMode errorHandlingMode = ErrorHandlingMode.DISCARD; /** The actions */ private ControllerContextActions actions; /** The dependencies */ private DependencyInfo dependencies; /** The scope info */ private ScopeInfo scopeInfo; /** Any error */ private Throwable error; /** * Create a new AbstractControllerContext. * * @param name the name * @param actions the actions */ public AbstractControllerContext(Object name, ControllerContextActions actions) { this(name, null, actions, null, null); } /** * Create a new AbstractControllerContext. * * @param name the name * @param actions the actions * @param dependencies the dependencies */ public AbstractControllerContext(Object name, ControllerContextActions actions, DependencyInfo dependencies) { this(name, null, actions, dependencies, null); } /** * Create a new AbstractControllerContext. * * @param name the name * @param actions the actions * @param dependencies the dependencies * @param target the target */ public AbstractControllerContext(Object name, ControllerContextActions actions, DependencyInfo dependencies, Object target) { this(name, null, actions, dependencies, target); } /** * Create a new AbstractControllerContext. * * @param name the name * @param aliases the aliases * @param actions the actions * @param dependencies the dependencies * @param target the target */ public AbstractControllerContext(Object name, Set aliases, ControllerContextActions actions, DependencyInfo dependencies, Object target) { if (name == null) throw new IllegalArgumentException("Null name"); if (actions == null) throw new IllegalArgumentException("Null actions"); this.name = name; this.actions = actions; if (dependencies == null) this.dependencies = new AbstractDependencyInfo(); else this.dependencies = dependencies; this.target = target; setAliases(aliases); initScopeInfo(); } /** * Create a new AbstractControllerContext. * * @param name the name * @param target the target */ public AbstractControllerContext(Object name, Object target) { if (name == null) throw new IllegalArgumentException("Null name"); this.name = name; this.target = target; initScopeInfo(); } public Object getName() { return name; } /** * Set the name * * @param name the name */ public void setName(Object name) { this.name = name; } public Set getAliases() { return aliases; } /** * Set the aliases

* * Aliases in this list only take effect if they are set before installation on the controller * * @param aliases the aliases */ public void setAliases(Set aliases) { // WARNING: This code is hack for backwards compatiblity // Here we fixup the aliases to map JMX like ObjectNames to their canonical form // I've made it a protected method needsAnAlias so others can subclass and // change the rules (including not doing this at all) // NOTE: This method should be invoked from all constructors if (aliases == null) { // There are no explicit aliases so just see whether the name is an ObjectName. Object alias = needsAnAlias(name); // No alias required if (alias == null) this.aliases = null; else // Add a single alias with canonical name this.aliases = Collections.singleton(alias); } else { // Always clone the aliases passed it this.aliases = new HashSet(); // Check the main name Object alias = needsAnAlias(name); if (alias != null) this.aliases.add(alias); // Check the aliases for (Object passedAlias : aliases) { this.aliases.add(passedAlias); alias = needsAnAlias(passedAlias); if (alias != null) this.aliases.add(alias); } } } public ControllerState getState() { return state; } public ControllerState getRequiredState() { return requiredState; } public void setRequiredState(ControllerState state) { this.requiredState = state; } public ControllerMode getMode() { return mode; } public void setMode(ControllerMode mode) { if (ControllerMode.ASYNCHRONOUS.equals(mode)) throw new IllegalArgumentException("Not yet implemented, asynchronouse mode."); this.mode = mode; flushJBossObjectCache(); } public ErrorHandlingMode getErrorHandlingMode() { return errorHandlingMode; } /** * Set the error handling mode. * * @param errorHandlingMode the error handling mode */ public void setErrorHandlingMode(ErrorHandlingMode errorHandlingMode) { if (errorHandlingMode != null && ErrorHandlingMode.DISCARD.equals(errorHandlingMode) == false) throw new IllegalArgumentException("Not yet implemented, manual or checked error handling mode."); this.errorHandlingMode = errorHandlingMode; flushJBossObjectCache(); } public Controller getController() { return controller; } public void setController(Controller controller) { this.controller = controller; flushJBossObjectCache(); } public DependencyInfo getDependencyInfo() { return dependencies; } public ScopeInfo getScopeInfo() { return scopeInfo; } /** * Set the scopeInfo. * * @param scopeInfo the scopeInfo. */ public void setScopeInfo(ScopeInfo scopeInfo) { if (scopeInfo == null) throw new IllegalArgumentException("Null scope info"); this.scopeInfo = scopeInfo; } public Object getTarget() { return target; } /** * Set the target * * @param target the target */ public void setTarget(Object target) { this.target = target; flushJBossObjectCache(); } public Throwable getError() { return error; } public void setError(Throwable error) { this.error = error; state = ControllerState.ERROR; flushJBossObjectCache(); } public void setState(ControllerState state) { this.state = state; flushJBossObjectCache(); } public void install(ControllerState fromState, ControllerState toState) throws Throwable { this.error = null; flushJBossObjectCache(); actions.install(this, fromState, toState); } public void uninstall(ControllerState fromState, ControllerState toState) { flushJBossObjectCache(); actions.uninstall(this, fromState, toState); } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); if (aliases != null) buffer.append(" aliases=").append(aliases); buffer.append(" target=").append(target); if (error != null || state.equals(ControllerState.ERROR) == false) buffer.append(" state=").append(state.getStateString()); if (ControllerMode.AUTOMATIC.equals(mode) == false) { buffer.append(" mode=").append(mode.getModeString()); buffer.append(" requiredState=").append(requiredState.getStateString()); } if (ErrorHandlingMode.DISCARD.equals(errorHandlingMode) == false) buffer.append(" error-handling=").append(errorHandlingMode); if (dependencies != null) buffer.append(" depends=").append(dependencies); if (error != null) { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); error.printStackTrace(writer); writer.flush(); buffer.append(" error=").append(stringWriter.getBuffer()); } } public void toShortString(JBossStringBuilder buffer) { buffer.append("name=").append(name); if (aliases != null) buffer.append(" aliases=").append(aliases); if (error != null || state.equals(ControllerState.ERROR) == false) buffer.append(" state=").append(state.getStateString()); if (ControllerMode.AUTOMATIC.equals(mode) == false) { buffer.append(" mode=").append(mode.getModeString()); buffer.append(" requiredState=").append(requiredState.getStateString()); } if (ErrorHandlingMode.DISCARD.equals(errorHandlingMode) == false) buffer.append(" error-handling=").append(errorHandlingMode); if (error != null) buffer.append(" error=").append(error.getClass().getName()).append(": ").append(error.getMessage()); } /** * Initialise the scope info */ protected void initScopeInfo() { String className = null; Object target = getTarget(); if (target != null) className = target.getClass().getName(); setScopeInfo(new AbstractScopeInfo(getName(), className)); } /** * Whether the given name needs an alias

* * By default we just add aliases for JMX like ObjectNames to have a canonical name alias * * @param original the original name * @return the alias if required or null if no alias required */ protected Object needsAnAlias(Object original) { return JMXObjectNameFix.needsAnAlias(original); } } ././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AttributeCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/At0000644000175000017500000000412210652365637033300 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.AttributeDispatchContext; /** * Attribute callback item. * * @param the callback type * @author Ales Justin */ public class AttributeCallbackItem extends OwnerCallbackItem { public AttributeCallbackItem(T name, AttributeDispatchContext owner, String attribute) { this(name, null, null, owner, attribute); } public AttributeCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, AttributeDispatchContext owner, String attribute) { super(name, whenRequired, dependentState, attribute, owner); } protected void execute(Object target) throws Throwable { owner.set(getAttributeName(), target); } protected void changeCallback(ControllerContext context, boolean isInstallPhase) throws Throwable { execute(context.getTarget()); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractController.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000016703511301276642033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.Executor; import java.util.concurrent.locks.ReentrantReadWriteLock; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.dependency.plugins.action.SimpleControllerContextAction; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ControllerStateModel; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.LifecycleCallbackItem; import org.jboss.dependency.spi.graph.GraphController; import org.jboss.dependency.spi.graph.LookupStrategy; import org.jboss.dependency.spi.graph.SearchInfo; import org.jboss.util.JBossObject; import org.jboss.util.collection.CollectionsFactory; /** * Abstract controller. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 96589 $ */ public class AbstractController extends JBossObject implements Controller, ControllerStateModel, GraphController, AbstractControllerMBean { /** The lock */ private ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); /** The executor */ private Executor executor; /** Whether we are shutdown */ private boolean shutdown = false; /** The states in order List */ private List states = new CopyOnWriteArrayList(); /** All contexts by name Map */ private Map allContexts = new ConcurrentHashMap(); /** The contexts by state Map> */ private Map> contextsByState = new ConcurrentHashMap>(); /** The error contexts Map */ private Map errorContexts = new ConcurrentHashMap(); /** The contexts that are currently being resolved/installed */ private Set installing = new CopyOnWriteArraySet(); /** The parent controller */ private AbstractController parentController; /** The child controllers */ private Set childControllers = new CopyOnWriteArraySet(); /** The callback items */ private Map>> installCallbacks = new ConcurrentHashMap>>(); private Map>> uninstallCallbacks = new ConcurrentHashMap>>(); /** Whether an on demand context has been enabled */ private boolean onDemandEnabled = true; /** Whether stats are enabled */ private boolean collectStats = false; /** The install stats */ private volatile StateStatistics installStats = null; /** * Create an abstract controller */ public AbstractController() { addState(ControllerState.NOT_INSTALLED, null); addState(ControllerState.PRE_INSTALL, null); addState(ControllerState.DESCRIBED, null); addState(ControllerState.INSTANTIATED, null); addState(ControllerState.CONFIGURED, null); addState(ControllerState.CREATE, null); addState(ControllerState.START, null); addState(ControllerState.INSTALLED, null); } /** * Set the executor. * * @param executor the executor */ public void setExecutor(Executor executor) { // TODO - security this.executor = executor; } /** * Get the executor. * * @return the executor */ public Executor getExecutor() { // TODO - security return getExecutionEnvironment(); } /** * Get the executor internal w/o security check. * * @return the executor */ protected Executor getExecutionEnvironment() { return executor; } public boolean isShutdown() { lockWrite(); try { return shutdown; } finally { unlockWrite(); } } /** * Check whether the controller is shutdown * * @throws IllegalStateException when already shutdown */ public void checkShutdown() { lockWrite(); try { if (shutdown) throw new IllegalStateException("Already shutdown"); } finally { unlockWrite(); } } public void shutdown() { lockWrite(); try { Set children = getControllers(); if (children != null && children.isEmpty() == false) { for (AbstractController child : children) { try { child.shutdown(); } catch (Throwable t) { log.warn("Error during shutdown of child: " + child, t); } } } Set contexts = getAllContexts(); if (contexts != null && contexts.isEmpty() == false) { for (ControllerContext context : contexts) { try { uninstall(context.getName()); } catch (Throwable t) { log.warn("Error during shutdown while uninstalling: " + context, t); } } } } finally { shutdown = true; unlockWrite(); } } /** * Get the collectStats. * * @return the collectStats. */ public boolean isCollectStats() { return collectStats; } /** * Set the collectStats. * * @param collectStats the collectStats. */ public void setCollectStats(boolean collectStats) { this.collectStats = collectStats; } public String listStateTimes(boolean details) { synchronized (this) { if (installStats == null) return "No statistics available"; return installStats.listTimes(details); } } public void addState(ControllerState state, ControllerState before) { lockWrite(); try { if (states.contains(state)) return; if (before == null) { states.add(state); } else { states.add(getStateIndex(before), state); } Set contexts = new CopyOnWriteArraySet(); contextsByState.put(state, contexts); } finally { unlockWrite(); } } /** * Add controller context. * * This is normally used when switching from top * level controller to a scoped one. * * @param context the controller context */ void addControllerContext(ControllerContext context) { lockWrite(); try { registerControllerContext(context); } finally { unlockWrite(); } } /** * Remove controller context. * * This is normally used when switching from scoped * level controller to a top one. * * @param context the controller context */ void removeControllerContext(ControllerContext context) { lockWrite(); try { unregisterControllerContext(context); } finally { unlockWrite(); } } /** * Get the parent controller. * * @return the parent controller */ public AbstractController getParentController() { return parentController; } /** * Set the parent controller. * * @param parentController the parent controller */ protected void setParentController(AbstractController parentController) { this.parentController = parentController; } /** * Get child controllers. * * @return the child controllers */ public Set getControllers() { lockRead(); try { return Collections.unmodifiableSet(childControllers); } finally { unlockRead(); } } /** * Add child controller. * * @param controller the child controller * @return true if equal controller has been already added, see Set.add usage */ public boolean addController(AbstractController controller) { lockWrite(); try { return childControllers.add(controller); } finally { unlockWrite(); } } /** * Remove child controller. * * @param controller the child controller * @return true if equal controller was present, see Set.remove usage */ public boolean removeController(AbstractController controller) { lockWrite(); try { return childControllers.remove(controller); } finally { unlockWrite(); } } /** * Whether the controller has contexts * * @return true when there are registered contexts */ public boolean isActive() { lockRead(); try { // is this active if (allContexts.isEmpty() == false) return true; // any of the children still active for (AbstractController child : getControllers()) { if (child.isActive()) return true; } return false; } finally { unlockRead(); } } public ControllerContext getContext(Object name, ControllerState state, SearchInfo info) { if (info == null) throw new IllegalArgumentException("Null search info."); LookupStrategy strategy = info.getStrategy(); if (strategy == null) throw new IllegalArgumentException("AbstractController doesn't implement this search info: " + info); if (log.isTraceEnabled()) log.trace("Executing search " + info.getType()); return strategy.getContext(this, name, state); } /** * Get all the contexts. * In state decending order. * * @return all contexts */ public Set getAllContexts() { lockRead(); try { LinkedHashSet result = new LinkedHashSet(); for (int i = states.size()-1; i>=0; --i) { ControllerState state = states.get(i); result.addAll(contextsByState.get(state)); } result.addAll(errorContexts.values()); return result; } finally { unlockRead(); } } public ControllerContext getContext(Object name, ControllerState state) { if (name == null) throw new IllegalArgumentException("Null name"); lockRead(); try { ControllerContext result = getRegisteredControllerContext(name, false); if (result != null && state != null && isBeforeState(result.getState(), state)) { return null; } return result; } finally { unlockRead(); } } public ControllerContext getInstalledContext(Object name) { return getContext(name, ControllerState.INSTALLED); } public Set getNotInstalled() { lockWrite(); try { Set result = new HashSet(errorContexts.values()); for (int i = 0; ControllerState.INSTALLED.equals(states.get(i)) == false; ++i) { Set stateContexts = getContextsByState(states.get(i)); result.addAll(stateContexts); } return result; } finally { unlockWrite(); } } public ControllerStateModel getStates() { return this; } public Set getContextsByState(ControllerState state) { return contextsByState.get(state); } public void install(ControllerContext context) throws Throwable { boolean trace = log.isTraceEnabled(); if (context == null) throw new IllegalArgumentException("Null context"); Object name = context.getName(); if (name == null) throw new IllegalArgumentException("Null name " + context.toShortString()); install(context, trace); } public void change(ControllerContext context, ControllerState state) throws Throwable { boolean trace = log.isTraceEnabled(); if (context == null) throw new IllegalArgumentException("Null context"); if (state == null) throw new IllegalArgumentException("Null state"); change(context, state, trace); } public void enableOnDemand(ControllerContext context) throws Throwable { boolean trace = log.isTraceEnabled(); if (context == null) throw new IllegalArgumentException("Null context"); enableOnDemand(context, trace); } public ControllerContext uninstall(Object name) { return uninstall(name, 0); } /** * Get controller id - impl detail. * It should be unique. * * @return controller's id */ protected String getId() { StringBuffer buffer = new StringBuffer(); buffer.append(getClass().getSimpleName()); buffer.append("[").append(System.identityHashCode(this)).append("]"); return buffer.toString(); } public void addAlias(Object alias, Object original) throws Throwable { Map map = createAliasActions(); ControllerContextActions actions = new AbstractControllerContextActions(map); AliasControllerContext context = new InnerAliasControllerContext(alias, getId(), original, actions); preAliasInstall(context); install(context); // is alias in error Throwable error = context.getError(); if (error != null) throw error; if (ControllerState.ERROR.equals(context.getState())) throw new IllegalArgumentException("Alias " + context + " is in error."); } /** * Create alias controller context actions. * * @return the alias controller context actions */ protected Map createAliasActions() { return Collections.singletonMap(ControllerState.INSTALLED, new AliasControllerContextAction()); } /** * Apply pre install - e.g. scope key in scoped controller. * * @param aliasContext the new alias context */ protected void preAliasInstall(ControllerContext aliasContext) { } public void removeAlias(Object alias) { uninstall(alias + "_Alias_" + getId()); } /** * Uninstall the context. * * @param name the context name * @param level the controller level * @return uninstalled controller context */ // todo - some better way to find context's by name // currently the first one found is used protected ControllerContext uninstall(Object name, int level) { boolean trace = log.isTraceEnabled(); if (name == null) throw new IllegalArgumentException("Null name"); lockWrite(); try { if (errorContexts.remove(name) != null && trace) log.trace("Tidied up context in error state: " + name); ControllerContext context = getRegisteredControllerContext(name, false); if (context != null) { if (trace) log.trace("Uninstalling " + context.toShortString()); // get a hold on possible parent before its nullified in uninstall AbstractController parent = getParentController(); uninstallContext(context, ControllerState.NOT_INSTALLED, trace); try { unregisterControllerContext(context); } catch (Throwable t) { log.warn("Error unregistering context: " + context.toShortString() + " with name: " + name); } while (parent != null) { try { parent.unregisterControllerContext(context); } catch (Throwable t) { log.warn("Error unregistering context in parent controller: " + context.toShortString() + " with name: " + name); } parent = parent.getParentController(); } } else { for (AbstractController controller : getControllers()) { context = controller.uninstall(name, level + 1); if (context != null) break; } } if (context == null && level == 0) throw new IllegalStateException("Not installed: " + name); return context; } finally { unlockWrite(); } } /** * Install a context * * @param context the context * @param trace whether trace is enabled * @throws Throwable for any error */ protected void install(ControllerContext context, boolean trace) throws Throwable { lockWrite(); try { checkShutdown(); Object name = context.getName(); // Check the name is not already registered if (getRegisteredControllerContext(name, false) != null) throw new IllegalStateException(name + " is already installed."); // Check any alias is not already registered Set aliases = context.getAliases(); if (aliases != null && aliases.isEmpty() == false) { for (Object alias : aliases) { if (getRegisteredControllerContext(alias, false) != null) throw new IllegalStateException(alias + " an alias of " + name + " is already installed."); } } // set the required state ControllerMode mode = context.getMode(); context.setRequiredState(mode.getRequiredState()); if (trace) log.trace("Installing " + context.toShortString()); context.setController(this); DependencyInfo dependencies = context.getDependencyInfo(); if (trace) { String dependsOn = "[]"; if (dependencies != null) { try { Set set = dependencies.getIDependOn(null); if (set != null) dependsOn = set.toString(); } catch (Throwable t) { log.warn("Exception getting dependencies: " + t); dependsOn = null; } } if (dependsOn != null) log.trace("Dependencies for " + name + ": " + dependsOn); } boolean ok = incrementState(context, trace); if (ok) { try { registerControllerContext(context); } catch (Throwable t) { // This is probably unreachable? But let's be paranoid ok = false; throw t; } } if (ok) { resolveContexts(trace); } else { errorContexts.remove(context); throw context.getError(); } } finally { unlockWrite(); } } /** * Change a context's state * * @param context the context * @param state the required state * @param trace whether trace is enabled * @throws Throwable for any error */ protected void change(ControllerContext context, ControllerState state, boolean trace) throws Throwable { lockWrite(); try { checkShutdown(); ControllerState fromState = context.getState(); int currentIndex = states.indexOf(fromState); int requiredIndex = states.indexOf(state); if (requiredIndex == -1) throw new IllegalArgumentException("Unknown state: " + state); if (currentIndex == requiredIndex) { if (trace) log.trace("No change required toState=" + state.getStateString() + " " + context.toShortString()); return; } if (trace) log.trace("Change toState=" + state.getStateString() + " " + context.toShortString()); context.setRequiredState(state); if (currentIndex < requiredIndex) resolveContexts(trace); else { while (currentIndex > requiredIndex) { uninstallContext(context, trace); currentIndex = states.indexOf(context.getState()); } } } finally { unlockWrite(); } } /** * Enable an on demand context * * @param context the context * @param trace whether trace is enabled * @throws Throwable for any error */ protected void enableOnDemand(ControllerContext context, boolean trace) throws Throwable { lockWrite(); try { checkShutdown(); if (ControllerMode.ON_DEMAND.equals(context.getMode()) == false) throw new IllegalStateException("Context is not ON DEMAND: " + context.toShortString()); // Sanity check getRegisteredControllerContext(context.getName(), true); // Already done if (ControllerState.INSTALLED.equals(context.getRequiredState())) return; context.setRequiredState(ControllerState.INSTALLED); if (trace) log.trace("Enable onDemand: " + context.toShortString()); onDemandEnabled = true; } finally { unlockWrite(); } } /** * Increment state

*

* This method must be invoked with the write lock taken. * * @param context the context * @param trace whether trace is enabled * @return whether the suceeded */ protected boolean incrementState(ControllerContext context, boolean trace) { ControllerState fromState = context.getState(); Controller fromController = context.getController(); Set fromContexts = null; int currentIndex = -1; if (ControllerState.ERROR.equals(fromState)) { errorContexts.remove(context); Throwable error = null; unlockWrite(); try { install(context, ControllerState.ERROR, ControllerState.NOT_INSTALLED); } catch (Throwable t) { error = t; } finally { lockWrite(); if (error != null) { log.error("Error during initial installation: " + context.toShortString(), error); context.setError(error); errorContexts.put(context.getName(), context); return false; } } Set notInstalled = fromController.getContextsByState(ControllerState.NOT_INSTALLED); notInstalled.add(context); context.setState(ControllerState.NOT_INSTALLED); } else { currentIndex = states.indexOf(fromState); fromContexts = fromController.getContextsByState(fromState); if (fromContexts.contains(context) == false) throw new IllegalStateException("Context not found in previous state: " + context.toShortString()); } int toIndex = currentIndex + 1; ControllerState toState = states.get(toIndex); unlockWrite(); Throwable error = null; try { install(context, fromState, toState); if (fromContexts != null) fromContexts.remove(context); Controller toController = context.getController(); Set toContexts = toController.getContextsByState(toState); toContexts.add(context); context.setState(toState); handleInstallLifecycleCallbacks(context, toState); resolveCallbacks(context, toState, true); } catch (Throwable t) { error = t; } finally { lockWrite(); if (error != null) { log.error("Error installing to " + toState.getStateString() + ": " + context.toShortString(), error); uninstallContext(context, ControllerState.NOT_INSTALLED, trace); errorContexts.put(context.getName(), context); context.setError(error); return false; } } return true; } /** * Resolve unresolved contexts

*

* This method must be invoked with the write lock taken * * @param trace whether trace is enabled */ protected void resolveContexts(boolean trace) { boolean resolutions = true; while (resolutions || onDemandEnabled) { onDemandEnabled = false; resolutions = false; for (int i = 0; i < states.size() - 1; ++i) { ControllerState fromState = states.get(i); ControllerState toState = states.get(i + 1); if (resolveContexts(fromState, toState, trace)) { resolutions = true; break; } } } if (trace) { for (int i = 0; i < states.size() - 1; ++i) { ControllerState state = states.get(i); ControllerState nextState = states.get(i + 1); Set stillUnresolved = contextsByState.get(state); if (stillUnresolved.isEmpty() == false) { for (ControllerContext ctx : stillUnresolved) { if (advance(ctx)) log.trace("Still unresolved " + nextState.getStateString() + ": " + ctx); } } } } // resolve child controllers for (AbstractController controller : childControllers) { controller.lockWrite(); try { controller.resolveContexts(trace); } finally { controller.unlockWrite(); } } } /** * Resolve contexts

*

* This method must be invoked with the write lock taken * * @param fromState the from state * @param toState the to state * @param trace whether trace is enabled * @return true when there were resolutions */ protected boolean resolveContexts(ControllerState fromState, ControllerState toState, boolean trace) { boolean resolutions = false; Set unresolved = contextsByState.get(fromState); Set resolved = resolveContexts(unresolved, fromState, toState, trace); if (resolved.isEmpty() == false) { Set toProcess = new HashSet(); for (ControllerContext context : resolved) { Object name = context.getName(); if (fromState.equals(context.getState()) == false) { if (trace) log.trace("Skipping already installed " + name + " for " + toState.getStateString()); installing.remove(context); } else { toProcess.add(context); } } try { if (toProcess.isEmpty() == false) { for (Iterator iter = toProcess.iterator(); iter.hasNext(); ) { ControllerContext context = iter.next(); iter.remove(); Object name = context.getName(); try { if (fromState.equals(context.getState()) == false) { if (trace) log.trace("Skipping already installed " + name + " for " + toState.getStateString()); } else { if (trace) log.trace("Dependencies resolved " + name + " for " + toState.getStateString()); if (incrementState(context, trace)) { resolutions = true; if (trace) log.trace(name + " " + toState.getStateString()); } } } finally { installing.remove(context); } } } } finally { // If we get here something has gone seriously wrong, // but try to tidyup as much state as possible if (toProcess.isEmpty() == false) { for (ControllerContext context : toProcess) installing.remove(context); } } } return resolutions; } /** * Resolve contexts

*

* This method must be invoked with the write lock taken * * @param contexts the contexts * @param fromState the from state * @param toState the to state * @param trace whether trace is enabled * @return the set of resolved contexts */ protected Set resolveContexts(Set contexts, ControllerState fromState, ControllerState toState, boolean trace) { HashSet result = new HashSet(); if (contexts.isEmpty() == false) { for (ControllerContext ctx : contexts) { Object name = ctx.getName(); if (fromState.equals(ctx.getState()) == false) { if (trace) log.trace("Skipping already installed " + name + " for " + toState.getStateString()); } else if (installing.add(ctx) == false) { if (trace) log.trace("Already installing " + name + " for " + toState.getStateString()); } else if (advance(ctx)) { DependencyInfo dependencies = ctx.getDependencyInfo(); try { if (dependencies == null || dependencies.resolveDependencies(this, toState)) result.add(ctx); else installing.remove(ctx); } catch (Throwable error) { installing.remove(ctx); log.error("Error resolving dependencies for " + toState.getStateString() + ": " + ctx.toShortString(), error); uninstallContext(ctx, ControllerState.NOT_INSTALLED, trace); errorContexts.put(ctx.getName(), ctx); ctx.setError(error); } } else { installing.remove(ctx); } } } return result; } /** * Uninstall a context *

* This method must be invoked with the write lock taken * * @param context the context to uninstall * @param toState the target state * @param trace whether trace is enabled */ protected void uninstallContext(ControllerContext context, ControllerState toState, boolean trace) { int targetState = states.indexOf(toState); if (targetState == -1) log.error("INTERNAL ERROR: unknown state " + toState + " states=" + states, new Exception("STACKTRACE")); while (true) { ControllerState fromState = context.getState(); if (ControllerState.ERROR.equals(fromState)) return; int currentState = states.indexOf(fromState); if (currentState == -1) log.error("INTERNAL ERROR: current state not found: " + context.toShortString(), new Exception("STACKTRACE")); if (targetState > currentState) return; else uninstallContext(context, trace); } } /** * Uninstall a context

*

* This method must be invoked with the write lock taken * * @param context the context to uninstall * @param trace whether trace is enabled */ protected void uninstallContext(ControllerContext context, boolean trace) { Object name = context.getName(); ControllerState fromState = context.getState(); if (trace) log.trace("Uninstalling " + name + " from " + fromState.getStateString()); Controller fromController = context.getController(); Set fromContexts = fromController.getContextsByState(fromState); if (fromContexts == null || fromContexts.remove(context) == false) throw new Error("INTERNAL ERROR: context not found in previous state " + fromState.getStateString() + " context=" + context.toShortString(), new Exception("STACKTRACE")); DependencyInfo dependencies = context.getDependencyInfo(); if (dependencies != null) { try { Set dependsOnMe = dependencies.getDependsOnMe(null); if (dependsOnMe.isEmpty() == false) { for (DependencyItem item : dependsOnMe) { if (item.isResolved()) { ControllerState dependentState = item.getDependentState(); if (dependentState == null || dependentState.equals(fromState)) { if (item.unresolved(this)) { Set dependents = CollectionsFactory.createLazySet(); getContexts(item.getName(), dependents); if (dependents.isEmpty() == false) { ControllerState whenRequired = item.getWhenRequired(); if (whenRequired == null) whenRequired = ControllerState.NOT_INSTALLED; for (ControllerContext dependent : dependents) { boolean selfDependency = (dependent == context); if (selfDependency == false && isBeforeState(dependent.getState(), whenRequired) == false) uninstallContext(dependent, whenRequired, trace); } } } } } } } } catch (Throwable error) { log.error("Error resolving dependencies for " + fromState.getStateString() + ": " + context.toShortString(), error); // Not much else we can do - no uninstall, since we are at uninstall ;-) errorContexts.put(context.getName(), context); context.setError(error); } } // The state could have changed while calling out to dependents fromState = context.getState(); if (ControllerState.ERROR.equals(fromState)) return; // Calculate the previous state int currentIndex = states.indexOf(fromState); int toIndex = currentIndex - 1; if (toIndex < 0) { // This is hack, we signal true uninstalled status by putting it in the error state context.setState(ControllerState.ERROR); return; } ControllerState toState = states.get(toIndex); unlockWrite(); try { resolveCallbacks(context, fromState, false); handleUninstallLifecycleCallbacks(context, toState); uninstall(context, fromState, toState); Controller toController = context.getController(); Set toContexts = toController.getContextsByState(toState); toContexts.add(context); context.setState(toState); } catch (Throwable t) { log.warn("Error uninstalling from " + fromState.getStateString() + ": " + context.toShortString(), t); } finally { lockWrite(); } } /** * Get all contexts by name, * check child controllers as well. * * @param name the name of the context * @param contexts found contexts */ protected void getContexts(Object name, Set contexts) { ControllerContext context = getContext(name, null); if (context != null) { Set aliases = context.getAliases(); // only pick up unique name // TODO also ignore alises from @Aliases? if (aliases == null || aliases.contains(name) == false) contexts.add(context); } Set children = getControllers(); if (children != null && children.isEmpty() == false) { for (AbstractController child : children) { child.getContexts(name, contexts); } } } /** * Add callback item under demand name. * * @param the callback item type * @param name demand name * @param isInstallPhase install or uninstall phase * @param callback callback item */ protected void addCallback(Object name, boolean isInstallPhase, CallbackItem callback) { lockWrite(); try { Map>> map = (isInstallPhase ? installCallbacks : uninstallCallbacks); Set> callbacks = map.get(name); if (callbacks == null) { callbacks = new HashSet>(); map.put(name, callbacks); } callbacks.add(callback); } finally { unlockWrite(); } } /** * Remove callback item under demand name. * * @param the callback item type * @param name demand name * @param isInstallPhase install or uninstall phase * @param callback callback item */ protected void removeCallback(Object name, boolean isInstallPhase, CallbackItem callback) { lockWrite(); try { Map>> map = (isInstallPhase ? installCallbacks : uninstallCallbacks); Set> callbacks = map.get(name); if (callbacks != null) { callbacks.remove(callback); if (callbacks.isEmpty()) map.remove(name); } } finally { unlockWrite(); } } /** * Get calbacks from context. * * @param context current context * @param isInstallPhase install or uninstall phase * @return callback items from dependency info */ protected Set> getDependencyCallbacks(ControllerContext context, boolean isInstallPhase) { DependencyInfo di = context.getDependencyInfo(); if (di != null) { return isInstallPhase ? di.getInstallItems() : di.getUninstallItems(); } return null; } /** * Get the matching callbacks. * * @param name demand name * @param isInstallPhase install or uninstall phase * @return all matching registered callbacks or empty set if no such item */ protected Set> getCallbacks(Object name, boolean isInstallPhase) { lockRead(); try { Map>> map = (isInstallPhase ? installCallbacks : uninstallCallbacks); Set> callbacks = map.get(name); return callbacks != null ? callbacks : Collections.>emptySet(); } finally { unlockRead(); } } /** * Resolve callbacks. * * @param callbacks the callbacks * @param state current context state * @param execute do execute callback * @param isInstallPhase install or uninstall phase * @param type install or uninstall type */ protected void resolveCallbacks(Set> callbacks, ControllerState state, boolean execute, boolean isInstallPhase, boolean type) { if (callbacks != null && callbacks.isEmpty() == false) { for (CallbackItem callback : callbacks) { if (callback.getWhenRequired().equals(state)) { if (isInstallPhase) { addCallback(callback.getIDependOn(), type, callback); } else { removeCallback(callback.getIDependOn(), type, callback); } if (execute) { try { callback.ownerCallback(this, isInstallPhase); } catch (Throwable t) { log.warn("Broken callback: " + callback, t); } } } } } } /** * Resolve callback items. * * @param context current context * @param state current context state * @param isInstallPhase install or uninstall phase */ protected void resolveCallbacks(ControllerContext context, ControllerState state, boolean isInstallPhase) { ClassLoader previous = null; try { previous = SecurityActions.setContextClassLoader(context); // existing owner callbacks Set> installs = getDependencyCallbacks(context, true); resolveCallbacks(installs, state, isInstallPhase, isInstallPhase, true); Set> uninstalls = getDependencyCallbacks(context, false); resolveCallbacks(uninstalls, state, isInstallPhase == false, isInstallPhase, false); // change callbacks, applied only if context is autowire candidate DependencyInfo dependencyInfo = context.getDependencyInfo(); if (dependencyInfo != null && dependencyInfo.isAutowireCandidate()) { // match callbacks by name Set> existingCallbacks = new HashSet>(); existingCallbacks.addAll(getCallbacks(context.getName(), isInstallPhase)); // match by classes Collection> classes = getClassesImplemented(context.getTarget()); if (classes != null && classes.isEmpty() == false) { for (Class clazz : classes) { existingCallbacks.addAll(getCallbacks(clazz, isInstallPhase)); } } // Do the installs if we are at the required state if (existingCallbacks != null && existingCallbacks.isEmpty() == false) { for(CallbackItem callback : existingCallbacks) { if (state.equals(callback.getDependentState())) { try { callback.changeCallback(this, context, isInstallPhase); } catch (Throwable t) { log.warn("Broken callback: " + callback, t); } } } } } } // let's make sure we suppress any exceptions catch (Throwable t) { log.warn("Cannot resolve callbacks, state= " + state + ", isInstall= " + isInstallPhase + ", context= " + context, t); } finally { if (previous != null) SecurityActions.resetContextClassLoader(previous); } } /** * Handle install lifecycle callbacks. * * @param context the context * @param state the state * @throws Throwable for any error */ protected void handleInstallLifecycleCallbacks(ControllerContext context, ControllerState state) throws Throwable { handleLifecycleCallbacks(context, state, true); } /** * Handle uninstall lifecycle callbacks. * * @param context the context * @param state the state * @throws Throwable for any error */ protected void handleUninstallLifecycleCallbacks(ControllerContext context, ControllerState state) throws Throwable { ControllerState oldState = getNextState(state); handleLifecycleCallbacks(context, oldState, false); } /** * Handle lifecycle callbacks. * * @param context the context * @param state the state * @param install is it install or uninstall * @throws Throwable for any error */ protected void handleLifecycleCallbacks(ControllerContext context, ControllerState state, boolean install) throws Throwable { DependencyInfo di = context.getDependencyInfo(); if (di != null) { List callbacks = di.getLifecycleCallbacks(); for (LifecycleCallbackItem callback : callbacks) { if (callback.getWhenRequired().equals(state)) { if (install) callback.install(context); else callback.uninstall(context); } } } } /** * Get implemented classes. * * @param target target value / bean * @return collection of implementing classes by target */ protected Collection> getClassesImplemented(Object target) { if (target == null) return null; Set> classes = new HashSet>(); traverseClass(target.getClass(), classes); return classes; } /** * Recurse over classes. * * @param clazz current class * @param classes classes holder set */ protected void traverseClass(Class clazz, Set> classes) { if (clazz != null && Object.class.equals(clazz) == false) { classes.add(clazz); traverseClass(clazz.getSuperclass(), classes); Class[] interfaces = clazz.getInterfaces(); // traverse interfaces for (Class intface : interfaces) { traverseClass(intface, classes); } } } /** * Install a context

*

* This method must be invoked with NO locks taken * * @param context the context * @param fromState the from state * @param toState the toState * @throws Throwable for any error */ protected void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable { long time = 0; boolean collectStats = this.collectStats; if (collectStats) time = System.currentTimeMillis(); try { context.install(fromState, toState); } finally { if (collectStats) { time = System.currentTimeMillis() - time; if (time > 0) { synchronized (this) { if (installStats == null) installStats = new StateStatistics();; String state = toState.getStateString(); String name = context.getName().toString(); installStats.addStatistic(state, name, time); } } } } } /** * Uninstall a context

*

* This method must be invoked with NO locks taken * * @param context the context * @param fromState the from state * @param toState the to state */ protected void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState) { context.uninstall(fromState, toState); } /** * Whether we should advance the context

*

* This method must be invoked with the write lock taken * * @param context the context * @return true when we should advance the context */ protected boolean advance(ControllerContext context) { ControllerMode mode = context.getMode(); // Never advance for disabled if (ControllerMode.DISABLED.equals(mode)) return false; return isBeforeState(context.getState(), context.getRequiredState()); } /** * Lock for read */ protected void lockRead() { lock.readLock().lock(); } /** * Unlock for read */ protected void unlockRead() { lock.readLock().unlock(); } /** * Lock for write */ protected void lockWrite() { lock.writeLock().lock(); } /** * Unlock for write */ protected void unlockWrite() { lock.writeLock().unlock(); } /** * Get a registered context

*

* This method should be invoked with at least the read lock taken * * @param name the name with which to register it * @param mustExist whether to throw an error when the context does not exist * @return context the registered context * @throws IllegalArgumentException for null parameters * @throws IllegalStateException if the context if must exist is true and the context does not exist */ protected ControllerContext getRegisteredControllerContext(Object name, boolean mustExist) { if (name == null) throw new IllegalArgumentException("Null name"); ControllerContext result = allContexts.get(name); if (mustExist && result == null) throw new IllegalStateException("Context does not exist with name: " + name); return result; } /** * Register a context and all its aliases

*

* This method must be invoked with the write lock taken * * @param context the context to register * @throws IllegalArgumentException for null parameters * @throws IllegalStateException if the context is already registered with that name or alias */ protected void registerControllerContext(ControllerContext context) { if (context == null) throw new IllegalArgumentException("Null context"); Set aliases = context.getAliases(); // Register the context Object name = context.getName(); registerControllerContext(name, context); // Register the aliases if (aliases != null && aliases.isEmpty() == false) { int ok = 0; try { for (Object alias : aliases) { registerControllerContext(alias, context); ++ok; } } finally { // It didn't work if (ok != aliases.size() && ok > 0) { // Unregister the aliases we added for (Object alias : aliases) { if (ok-- == 0) break; try { unregisterControllerContext(alias); } catch (Throwable ignored) { log.debug("Error unregistering alias: " + alias, ignored); } } // Unregister the context try { unregisterControllerContext(name); } catch (Throwable ignored) { log.debug("Error unregistering context with name: " + name, ignored); } } } } } /** * Unregister a context and all its aliases

*

* This method must be invoked with the write lock taken * * @param context the context * @throws IllegalArgumentException for null parameters * @throws IllegalStateException if the context is not registered */ protected void unregisterControllerContext(ControllerContext context) { if (context == null) throw new IllegalArgumentException("Null context"); Set aliases = context.getAliases(); // Unregister the context Object name = context.getName(); unregisterControllerContext(name); // Unegister the aliases if (aliases != null && aliases.isEmpty() == false) { for (Object alias : aliases) { try { unregisterControllerContext(alias); } catch (Throwable ignored) { log.debug("Error unregistering alias: " + alias, ignored); } } } } /** * Register a context

*

* This method must be invoked with the write lock taken

*

* NOTE: You probably want to use the {@link #registerControllerContext(ControllerContext)} * * @param name the name with which to register it * @param context the context to register * @throws IllegalArgumentException for null parameters * @throws IllegalStateException if the context is already registered with that name */ protected void registerControllerContext(Object name, ControllerContext context) { if (name == null) throw new IllegalArgumentException("Null name"); if (context == null) throw new IllegalArgumentException("Null context"); if (allContexts.containsKey(name) == false) allContexts.put(name, context); else throw new IllegalStateException("Unable to register context " + context.toShortString() + ", name already exists: " + name); } /** * Unregister a context

*

* This method must be invoked with the write lock taken

*

* NOTE: You probably want to use the {@link #unregisterControllerContext(ControllerContext)} * * @param name the name it was registered with * @throws IllegalArgumentException for null parameters */ protected void unregisterControllerContext(Object name) { if (name == null) throw new IllegalArgumentException("Null name"); allContexts.remove(name); } // --- alias dependency private static class InnerAliasControllerContext extends AbstractAliasControllerContext { private InnerAliasControllerContext(Object alias, String id, Object original, ControllerContextActions actions) { super(alias, id, original, actions); } } private class AliasControllerContextAction extends SimpleControllerContextAction { protected AliasControllerContext contextCast(ControllerContext context) { return AliasControllerContext.class.cast(context); } protected boolean validateContext(ControllerContext context) { return (context instanceof AliasControllerContext); } protected void installAction(AliasControllerContext context) throws Throwable { Object alias = context.getAlias(); Object jmxAlias = JMXObjectNameFix.needsAnAlias(alias); if (jmxAlias != null) alias = jmxAlias; Object original = context.getOriginal(); Object jmxOriginal = JMXObjectNameFix.needsAnAlias(original); if (jmxOriginal != null) original = jmxOriginal; // get the context's controller - not the one we registered with AbstractController controller = (AbstractController)context.getController(); lockWrite(); try { ControllerContext lookup = controller.getRegisteredControllerContext(original, true); controller.registerControllerContext(alias, lookup); if (log.isTraceEnabled()) log.trace("Added alias " + alias + " for context " + context); } finally { unlockWrite(); } } protected void uninstallAction(AliasControllerContext context) { lockWrite(); try { Object alias = context.getAlias(); Object jmxAlias = JMXObjectNameFix.needsAnAlias(alias); if (jmxAlias != null) alias = jmxAlias; // get the context's controller - not the one we registered with AbstractController controller = (AbstractController)context.getController(); controller.unregisterControllerContext(alias); if (log.isTraceEnabled()) log.trace("Removed alias " + alias); } finally { unlockWrite(); } } } public ListIterator listIteraror() { return states.listIterator(states.size() - 1); } public ControllerState getPreviousState(ControllerState state) { return getState(getStateIndex(state) - 1); } public ControllerState getNextState(ControllerState state) { return getState(getStateIndex(state) + 1); } public boolean isBeforeState(ControllerState state, ControllerState reference) { int stateIndex = getStateIndex(state, true); int referenceIndex = getStateIndex(reference, true); return stateIndex < referenceIndex; } public boolean isAfterState(ControllerState state, ControllerState reference) { int stateIndex = getStateIndex(state, true); int referenceIndex = getStateIndex(reference, true); return stateIndex > referenceIndex; } public Iterator iterator() { return states.iterator(); } /** * Get the state index. * * @param state the state * @return state index */ protected int getStateIndex(ControllerState state) { return getStateIndex(state, false); } /** * Get the state index. * * You have allow not found flag in case * error state is passed in, which is legal. * * @param state the state * @param allowNotFound allow not found state * @return state index */ protected int getStateIndex(ControllerState state, boolean allowNotFound) { if (state == null) throw new IllegalArgumentException("Null state"); int stateIndex = states.indexOf(state); if (stateIndex < 0 && allowNotFound == false) throw new IllegalArgumentException("No such state " + state + " in states " + states); return stateIndex; } /** * Get the controller state form index. * * @param index the state index * @return controller state */ protected ControllerState getState(int index) { if (index < 0 || index >= states.size()) return null; else return states.get(index); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractDependencyInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000001517111146775532033262 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.LifecycleCallbackItem; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * A DependencyInfo. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 84381 $ */ public class AbstractDependencyInfo extends JBossObject implements DependencyInfo { /** My dependencies */ private Set iDependOn = new CopyOnWriteArraySet(); /** Dependencies referencing me */ private Set dependsOnMe = new CopyOnWriteArraySet(); /** Install callbacks */ private Set> installCallbacks = new CopyOnWriteArraySet>(); /** Uninstall callbacks */ private Set> uninstallCallbacks = new CopyOnWriteArraySet>(); /** Lifecycle callbacks */ private List lifecycleCallbacks = new CopyOnWriteArrayList(); /** Whether this is an autowire candidate */ private boolean autowireCandidate = true; /** * Create an abstract dependency info */ public AbstractDependencyInfo() { } public Set getIDependOn(Class type) { if (type == null || iDependOn.isEmpty()) return iDependOn; else { HashSet set = new HashSet(); for (DependencyItem item : iDependOn) { if (type.isInstance(item)) set.add(item); } return set; } } public void addIDependOn(DependencyItem dependency) { iDependOn.add(dependency); flushJBossObjectCache(); } public void removeIDependOn(DependencyItem dependency) { iDependOn.remove(dependency); flushJBossObjectCache(); } public Set getDependsOnMe(Class type) { if (type == null || dependsOnMe.isEmpty()) return dependsOnMe; else { HashSet set = new HashSet(); for (DependencyItem item : dependsOnMe) { if (type.isInstance(item)) set.add(item); } return set; } } public void addDependsOnMe(DependencyItem dependency) { dependsOnMe.add(dependency); flushJBossObjectCache(); } public void removeDependsOnMe(DependencyItem dependency) { dependsOnMe.remove(dependency); flushJBossObjectCache(); } public boolean resolveDependencies(Controller controller, ControllerState state) { boolean resolved = true; Set items = getUnresolvedDependencies(state); if (items.isEmpty() == false) { for (DependencyItem item : items) { if (item.resolve(controller) == false) resolved = false; } } return resolved; } public Set getUnresolvedDependencies(ControllerState state) { if (iDependOn.isEmpty()) return Collections.emptySet(); Set result = null; for (DependencyItem item : iDependOn) { if (state == null || state.equals(item.getWhenRequired())) { if (item.isResolved() == false) { if (result == null) result = new HashSet(); result.add(item); } } } if (result == null) return Collections.emptySet(); return result; } public void addInstallItem(CallbackItem callbackItem) { installCallbacks.add(callbackItem); flushJBossObjectCache(); } public void removeInstallItem(CallbackItem callbackItem) { installCallbacks.remove(callbackItem); flushJBossObjectCache(); } public Set> getInstallItems() { return installCallbacks; } public void addUninstallItem(CallbackItem callbackItem) { uninstallCallbacks.add(callbackItem); flushJBossObjectCache(); } public void removeUninstallItem(CallbackItem callbackItem) { uninstallCallbacks.remove(callbackItem); flushJBossObjectCache(); } public Set> getUninstallItems() { return uninstallCallbacks; } public void addLifecycleCallback(LifecycleCallbackItem lifecycleCallbackItem) { lifecycleCallbacks.add(lifecycleCallbackItem); } public List getLifecycleCallbacks() { return lifecycleCallbacks; } public boolean isAutowireCandidate() { return autowireCandidate; } public void setAutowireCandidate(boolean candidate) { this.autowireCandidate = candidate; } public void toString(JBossStringBuilder buffer) { buffer.append("idependOn=").append(iDependOn); try { Set unresolved = getUnresolvedDependencies(null); if (unresolved.isEmpty() == false) buffer.append(" unresolved=").append(unresolved); } catch (Throwable ignored) { buffer.append(" unresolved=" + ignored); } } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractAliasControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000000536111032634675033256 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.util.JBossStringBuilder; /** * Abstract alias controller context. * * @author Ales Justin */ public abstract class AbstractAliasControllerContext extends AbstractControllerContext implements AliasControllerContext { private Object alias; private Object original; public AbstractAliasControllerContext(Object alias, String id, Object original, ControllerContextActions actions) { super(alias + "_Alias_" + id, actions); if (alias == null) throw new IllegalArgumentException("Null alias"); if (id == null) throw new IllegalArgumentException("Null id"); if (original == null) throw new IllegalArgumentException("Null original"); this.alias = alias; this.original = original; DependencyInfo info = getDependencyInfo(); info.addIDependOn(new AbstractDependencyItem(getName(), original, ControllerState.INSTALLED, ControllerState.INSTANTIATED)); } public Object getAlias() { return alias; } public Object getOriginal() { return original; } public void toString(JBossStringBuilder buffer) { buffer.append("alias=").append(alias); buffer.append(" original=").append(original).append(" "); super.toString(buffer); } public void toShortString(JBossStringBuilder buffer) { buffer.append("alias=").append(alias); buffer.append(" original=").append(original).append(" "); super.toShortString(buffer); } }././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/BasicStatistic.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ba0000644000175000017500000000422511061472530033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; /** * BasicStatistic. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class BasicStatistic implements Comparable { /** The name */ private String name; /** The total time */ private long time = 0; /** * Create a new BasicStatistic. * * @param name the name */ public BasicStatistic(String name) { this.name = name; } /** * Create a new BasicStatistic with the given time. * * @param name the name * @param time the time */ public BasicStatistic(String name, long time) { this.name = name; this.time = time; } /** * Get the name. * * @return the name. */ public String getName() { return name; } /** * Get the time. * * @return the time. */ public long getTime() { return time; } /** * Add some time * * @param time the time to add */ public void addTime(long time) { this.time += time; } public int compareTo(BasicStatistic o) { return (int) (o.getTime() - getTime()); } }././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ScopedAliasControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Sc0000644000175000017500000000575511032634675033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.Map; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContextActions; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.plugins.action.ControllerContextAction; import org.jboss.metadata.spi.scope.ScopeKey; /** * Scoped alias controller context. * * @author Ales Justin */ public class ScopedAliasControllerContext extends AbstractAliasControllerContext { private ScopedAliasControllerContext(Object alias, Object original, ScopeKey scopeKey, ControllerContextActions actions) { super(alias, scopeKey.toString(), original, actions); ScopeInfo scopeInfo = getScopeInfo(); scopeInfo.setInstallScope(scopeKey); } /** * Add scoped alias. * * @param alias the alias * @param original the original * @param scopeKey the scope key * @param controller the controller * @throws Throwable for any error */ public static void addAlias(Object alias, Object original, ScopeKey scopeKey, Controller controller) throws Throwable { if (controller instanceof AbstractController == false) throw new IllegalArgumentException("Can only handle AbstractController."); AbstractController ac = (AbstractController)controller; Map map = ac.createAliasActions(); ControllerContextActions actions = new AbstractControllerContextActions(map); controller.install(new ScopedAliasControllerContext(alias, original, scopeKey, actions)); } /** * Remove alias. * * @param alias the alias * @param scopeKey the scope key * @param controller the controller */ public static void removeAlias(Object alias, ScopeKey scopeKey, Controller controller) { controller.uninstall(alias + "_Alias_" + scopeKey); } }././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/pa0000644000175000017500000000151110244655216033323 0ustar twernertwerner

An abstract dependency implementation.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistics.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/St0000644000175000017500000000611711262374224033316 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * StateStatistics. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class StateStatistics { /** The stage statistics */ private Map states = new ConcurrentHashMap(); /** * Add a statistic * * @param state the stage name * @param name the name * @param time the time */ public synchronized void addStatistic(String state, String name, long time) { StateStatistic stat = states.get(state); if (stat == null) { stat = new StateStatistic(state); states.put(state, stat); } stat.addDetail(name, time); } /** * List the times * * @param details whether to show details * @return the times */ public synchronized String listTimes(boolean details) { List stats = new ArrayList(states.values()); Collections.sort(stats); StringBuilder builder = new StringBuilder(); builder.append(""); for (StateStatistic stat : stats) { builder.append(""); builder.append(""); builder.append(""); builder.append(""); if (details) { List list = new ArrayList(stat.getDetails().values()); Collections.sort(list); for (BasicStatistic detail : list) { builder.append(""); builder.append(""); builder.append(""); builder.append(""); } } } builder.append("
State/NameTime (milliseconds)
").append(stat.getName()).append("").append(stat.getTime()).append("
`-- ").append(detail.getName()).append("").append(detail.getTime()).append("
"); return builder.toString(); } } ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000000725611247271442033260 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Abstract callback item. * * @param the callback type * @author Ales Justin */ public abstract class AbstractCallbackItem extends JBossObject implements CallbackItem { protected T name; protected ControllerState whenRequired = ControllerState.INSTALLED; protected ControllerState dependentState = ControllerState.INSTALLED; protected String attributeName; protected AbstractCallbackItem(T name) { this.name = name; } protected AbstractCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, String attributeName) { this.name = name; if (whenRequired != null) this.whenRequired = whenRequired; if (dependentState != null) this.dependentState = dependentState; if (attributeName == null) throw new IllegalArgumentException("Null attribute name!"); this.attributeName = attributeName; } public void ownerCallback(Controller controller, boolean isInstallPhase) throws Throwable { if (log.isTraceEnabled()) log.trace("Owner callback not implemented: " + getClass()); } /** * Helper method. * * @param context changed context * @param isInstallPhase install or uninstall phase * @throws Throwable for any error */ protected void changeCallback(ControllerContext context, boolean isInstallPhase) throws Throwable { } public void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase) throws Throwable { changeCallback(context, isInstallPhase); } public T getIDependOn() { return name; } public ControllerState getWhenRequired() { return whenRequired; } public ControllerState getDependentState() { return dependentState; } public String getAttributeName() { return attributeName; } public void toShortString(JBossStringBuilder buffer) { buffer.append("name=").append(name); } protected void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); buffer.append(" whenRequired=").append(whenRequired); buffer.append(" dependentState=").append(dependentState); buffer.append(" attributeName=").append(attributeName); } } ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/SingleCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Si0000644000175000017500000000563410652365637033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.util.JBossStringBuilder; /** * Single callback item. * * @param the callback type * @author Ales Justin */ public class SingleCallbackItem extends OwnerCallbackItem { protected String signature; public SingleCallbackItem(T name, InvokeDispatchContext owner, String method) { this(name, owner, method, null); } public SingleCallbackItem(T name, InvokeDispatchContext owner, String method, String signature) { this(name, null, null, owner, method, signature); } public SingleCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, InvokeDispatchContext owner, String method) { this(name, whenRequired, dependentState, owner, method, null); } public SingleCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, InvokeDispatchContext owner, String method, String signature) { super(name, whenRequired, dependentState, method, owner); this.signature = signature; } protected void changeCallback(ControllerContext context, boolean isInstallPhase) throws Throwable { Object target = context.getTarget(); if (target != null) { if (signature == null) signature = target.getClass().getName(); owner.invoke(getAttributeName(), new Object[]{target}, new String[]{signature}); } else log.warn("Null target, cannot invoke non-static method: " + this); } protected void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" signature=").append(signature); } } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/ScopedController.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Sc0000644000175000017500000001137111045777032033276 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.concurrent.Executor; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.metadata.spi.scope.ScopeKey; import org.jboss.util.JBossStringBuilder; /** * Scoped controller. * * The only scoping logic is local lookup and * add/remove of controller context. * Subclasses should provide parent lookup after looking * at the current scoped instance. * * @author Ales Justin */ public abstract class ScopedController extends AbstractController { private ScopeKey scopeKey; private AbstractController underlyingController; protected Executor getExecutionEnvironment() { Executor executor = super.getExecutionEnvironment(); if (executor == null) executor = getParentController().getExecutionEnvironment(); return executor; } /** * Get scope key. * * @return the scope key */ public ScopeKey getScopeKey() { return scopeKey; } protected void setScopeKey(ScopeKey scopeKey) { // save a clone scope key - so we don't care about modifications this.scopeKey = scopeKey.clone(); this.scopeKey.freeze(); } protected void setUnderlyingController(AbstractController underlyingController) { this.underlyingController = underlyingController; } protected void preAliasInstall(ControllerContext aliasContext) { ScopeInfo scopeInfo = aliasContext.getScopeInfo(); scopeInfo.setInstallScope(scopeKey); } /** * Get the context only in this scope. * No hierarchy lookup. * * @param name the context name * @param state the controller state * @return found context or null if not available */ public ControllerContext getContextLocally(Object name, ControllerState state) { return super.getContext(name, state); } /** * Is controller scoped. * * @return true if scoped */ protected boolean isScoped() { return underlyingController != null; } protected void addControllerContext(ControllerContext context) { if (isScoped()) { lockWrite(); try { underlyingController.removeControllerContext(context); context.setController(this); registerControllerContext(context); } catch (Throwable t) { // put the context back to original context.setController(underlyingController); underlyingController.addControllerContext(context); // rethrow if (t instanceof RuntimeException) throw (RuntimeException)t; else throw new RuntimeException(t); } finally { unlockWrite(); } } else super.addControllerContext(context); } protected void removeControllerContext(ControllerContext context) { if (isScoped()) { lockWrite(); try { unregisterControllerContext(context); context.setController(underlyingController); underlyingController.addControllerContext(context); } finally { unlockWrite(); } } else super.removeControllerContext(context); } /** * Add scope key info to toString. * * @param buffer the string buffer */ protected void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(getScopeKey()); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractScopeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000002147111050031647033244 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArraySet; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.logging.Logger; import org.jboss.metadata.plugins.context.AbstractMetaDataContext; import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.context.MetaDataContext; import org.jboss.metadata.spi.loader.MutableMetaDataLoader; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.CommonLevels; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; /** * AbstractScopeInfo. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class AbstractScopeInfo implements ScopeInfo { /** The log */ private static final Logger log = Logger.getLogger(AbstractScopeInfo.class); /** The scope */ private ScopeKey scopeKey; /** The mutable scope */ private ScopeKey mutableScopeKey; /** The install scope */ private ScopeKey installScope; /** The repository */ private MutableMetaDataRepository repository; /** The added scopes */ private CopyOnWriteArraySet addedScopes = new CopyOnWriteArraySet(); /** * Create a new AbstractScopeInfo. * * @param name the name */ public AbstractScopeInfo(Object name) { this(name, null); } /** * Create a new AbstractScopeInfo. * * @param name the name * @param className the class name */ public AbstractScopeInfo(Object name, String className) { if (name == null) throw new IllegalArgumentException("Null scope"); ScopeKey scopeKey = ScopeKey.DEFAULT_SCOPE.clone(); scopeKey.addScope(CommonLevels.INSTANCE, name.toString()); if (className != null) scopeKey.addScope(CommonLevels.CLASS, className); setScope(scopeKey); setMutableScope(new ScopeKey(CommonLevels.INSTANCE, name.toString())); } /** * Create a new AbstractScopeInfo. * * @param key the scope key * @param mutable the mutable scope key */ public AbstractScopeInfo(ScopeKey key, ScopeKey mutable) { setScope(key); setMutableScope(mutable); } public MetaData getMetaData() { if (repository == null) return null; return repository.getMetaData(getScope()); } public void addMetaData(MutableMetaDataRepository repository, ControllerContext context) { this.repository = repository; ScopeKey scope = getMutableScope(); MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(scope); MutableMetaDataLoader mutable; if (retrieval == null) { mutable = initMutableMetaDataRetrieval(repository, context, scope); repository.addMetaDataRetrieval(mutable); addedScopes.add(scope); } else { mutable = getMutableMetaDataLoader(retrieval); } if (mutable == null) { log.warn("MetaData context is not mutable: " + retrieval + " for " + context.toShortString()); return; } updateMetaData(repository, context, mutable, true); } /** * Update metadata * * @param repository the repository * @param context the context * @param mutable the mutable * @param add true for add, false for remove */ protected void updateMetaData(MutableMetaDataRepository repository, ControllerContext context, MutableMetaDataLoader mutable, boolean add) { // nothing } public void removeMetaData(MutableMetaDataRepository repository, ControllerContext context) { ScopeKey mutableScope = getMutableScope(); MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(mutableScope); if (retrieval != null) { MutableMetaDataLoader mutable = getMutableMetaDataLoader(retrieval); if (mutable != null) updateMetaData(repository, context, mutable, false); } for (ScopeKey scope : addedScopes) { try { repository.removeMetaDataRetrieval(scope); } catch (Exception e) { log.trace("Ignored", e); } } addedScopes.clear(); this.repository = null; } /** * Get mutable metadata loader. * * @param retrieval current metadata retrieval * @return found mutable metadata loader instance, null otherwise */ protected MutableMetaDataLoader getMutableMetaDataLoader(MetaDataRetrieval retrieval) { if (retrieval == null) return null; if (retrieval instanceof MutableMetaDataLoader) { return (MutableMetaDataLoader) retrieval; } else if (retrieval instanceof MetaDataContext) { MetaDataContext metaDataContext = (MetaDataContext) retrieval; List locals = metaDataContext.getLocalRetrievals(); if (locals != null) { for (MetaDataRetrieval local : locals) { if (local instanceof MutableMetaDataLoader) return (MutableMetaDataLoader) local; } } } return null; } public MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, Scope scope) { // Nothing return null; } public MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context) { ScopeKey scopeKey = getScope(); List retrievals = new ArrayList(); for (Scope scope : scopeKey.getScopes()) { ScopeKey thisScope = new ScopeKey(scope); MetaDataRetrieval retrieval = repository.getMetaDataRetrieval(thisScope); if (retrieval == null) { retrieval = initMetaDataRetrieval(repository, context, scope); if (retrieval == null) { retrieval = initMutableMetaDataRetrieval(repository, context, thisScope); repository.addMetaDataRetrieval(retrieval); addedScopes.add(thisScope); } } retrievals.add(0, retrieval); } MetaDataRetrieval metaDataRetrieval = createMetaDataRetrieval(context, retrievals); repository.addMetaDataRetrieval(metaDataRetrieval); addedScopes.add(metaDataRetrieval.getScope()); return metaDataRetrieval; } public MutableMetaDataLoader initMutableMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, ScopeKey scopeKey) { return new MemoryMetaDataLoader(scopeKey); } public ScopeKey getScope() { return scopeKey; } public void setScope(ScopeKey key) { if (key == null) throw new IllegalArgumentException("Null scope key"); this.scopeKey = key; } public ScopeKey getMutableScope() { return mutableScopeKey; } public void setMutableScope(ScopeKey key) { if (key == null) throw new IllegalArgumentException("Null scope key"); this.mutableScopeKey = key; } public ScopeKey getInstallScope() { return installScope; } public void setInstallScope(ScopeKey key) { this.installScope = key; } /** * Create metadata retrieval. * * @param context the controller context * @param retrievals the retrievals * @return new metadata retrieval instance */ protected MetaDataRetrieval createMetaDataRetrieval(ControllerContext context, List retrievals) { return new AbstractMetaDataContext(null, retrievals); } } ././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractDependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000001545511147522315033255 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.logging.Logger; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * A DependencyItem. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 84514 $ */ public class AbstractDependencyItem extends JBossObject implements DependencyItem { /** The log */ protected static final Logger log = Logger.getLogger(AbstractDependencyItem.class); /** What I depend on */ private Object iDependOn; /** My name */ private Object name; /** When the dependency is required */ private ControllerState whenRequired = ControllerState.DESCRIBED; /** The state of the dependency */ private ControllerState dependentState; /** Whether we are resolved */ private boolean resolved; /** * Create a new dependency item */ public AbstractDependencyItem() { } /** * Create a new dependency item * * @param name my name * @param iDependOn what I depend on * @param whenRequired when the dependency is required * @param dependentState the required state of the dependent */ public AbstractDependencyItem(Object name, Object iDependOn, ControllerState whenRequired, ControllerState dependentState) { this.name = name; setIDependOn(iDependOn); this.whenRequired = whenRequired; this.dependentState = dependentState; } public Object getName() { return name; } public Object getIDependOn() { return iDependOn; } public ControllerState getWhenRequired() { return whenRequired; } public ControllerState getDependentState() { return dependentState; } public boolean isResolved() { return resolved; } public boolean resolve(Controller controller) { boolean previous = resolved; ControllerContext context; if (dependentState == null) context = controller.getInstalledContext(iDependOn); else { context = controller.getContext(iDependOn, dependentState); if (context == null) { if (ControllerState.INSTALLED.equals(dependentState)) context = controller.getInstalledContext(iDependOn); } } if (context == null) { resolved = false; ControllerContext unresolvedContext = controller.getContext(iDependOn, null); if (unresolvedContext != null && ControllerMode.ON_DEMAND.equals(unresolvedContext.getMode())) { try { controller.enableOnDemand(unresolvedContext); } catch (Throwable ignored) { if (log.isTraceEnabled()) log.trace("Unexpected error", ignored); } } } else { addDependsOnMe(controller, context); resolved = true; } if (previous != resolved) { flushJBossObjectCache(); if (log.isTraceEnabled()) { if (resolved) log.trace("Resolved " + this); else log.trace("Unresolved " + this); } } return resolved; } public void unresolved() { if (resolved) { resolved = false; flushJBossObjectCache(); log.trace("Forced unresolved " + this); } } public boolean unresolved(Controller controller) { unresolved(); return true; } public void toString(JBossStringBuilder buffer) { buffer.append("name=").append(name); buffer.append(" dependsOn=").append(iDependOn); if (whenRequired != null) buffer.append(" whenRequired=").append(whenRequired.getStateString()); if (dependentState != null) buffer.append(" dependentState=").append(dependentState.getStateString()); buffer.append(" resolved=").append(resolved); } public void toShortString(JBossStringBuilder buffer) { buffer.append(name).append(" dependsOn ").append(iDependOn); } /** * Register a dependency with another context * * @param controller the controller * @param context the other context */ protected void addDependsOnMe(Controller controller, ControllerContext context) { DependencyInfo info = context.getDependencyInfo(); if (info != null) info.addDependsOnMe(this); } /** * Set what I depend upon * * @param iDependOn what I depend upon */ protected void setIDependOn(Object iDependOn) { this.iDependOn = iDependOn; // only check if not null if (iDependOn != null) { // HACK: Try to fixup JMX like ObjectNames to their canonical name Object fixup = JMXObjectNameFix.needsAnAlias(iDependOn); if (fixup != null) this.iDependOn = fixup; } flushJBossObjectCache(); } /** * Set the resolved state * * @param resolved the new resolved state */ protected void setResolved(boolean resolved) { this.resolved = resolved; flushJBossObjectCache(); } public String toHumanReadableString() { StringBuilder builder = new StringBuilder(); toHumanReadableString(builder); return builder.toString(); } /** * Add info to builder. * * @param builder the string builder */ protected void toHumanReadableString(StringBuilder builder) { builder.append("Depends on '").append(getIDependOn()).append("'"); } } ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/StateStatistic.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/St0000644000175000017500000000402511061472530033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2008, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; /** * StateStatistic. * * @author Adrian Brock * @version $Revision: 1.1 $ */ class StateStatistic extends BasicStatistic { /** The details */ private Map details = new ConcurrentHashMap(); /** * Create a new StateStatistic. * * @param name the name */ public StateStatistic(String name) { super(name); } /** * Get the details. * * @return the details. */ public Map getDetails() { return details; } /** * Add a detail * * @param name the name * @param time the time */ public synchronized void addDetail(String name, long time) { BasicStatistic previous = details.get(name); if (previous != null) previous.addTime(time); else details.put(name, new BasicStatistic(name, time)); addTime(time); } } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/AbstractLifecycleCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ab0000644000175000017500000001136110763553123033251 0ustar twernertwerner/* * 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.dependency.plugins; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.LifecycleCallbackItem; import org.jboss.dependency.spi.dispatch.InvokeDispatchContext; import org.jboss.logging.Logger; import org.jboss.util.JBossStringBuilder; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public class AbstractLifecycleCallbackItem implements LifecycleCallbackItem { private static final Logger log = Logger.getLogger(AbstractLifecycleCallbackItem.class); ControllerState dependentState; ControllerState whenRequired; String installMethod; String uninstallMethod; Object bean; boolean installed; public AbstractLifecycleCallbackItem( Object bean, ControllerState whenRequired, ControllerState dependentState, String installMethod, String uninstallMethod) { this.bean = bean; this.whenRequired = whenRequired; this.dependentState = dependentState; this.installMethod = installMethod; this.uninstallMethod = uninstallMethod; } public Object getBean() { return bean; } public ControllerState getDependentState() { return dependentState; } public ControllerState getWhenRequired() { return whenRequired; } public void install(ControllerContext ctx) throws Exception { log.trace("Invoking install callback '" + installMethod + "' on " + bean + " for target " + bean + " at " + whenRequired); installed = true; Controller controller = ctx.getController(); ControllerContext callbackContext = controller.getContext(bean, dependentState); if (callbackContext instanceof InvokeDispatchContext) { try { ((InvokeDispatchContext)callbackContext).invoke(installMethod, new Object[]{ctx}, new String[]{ControllerContext.class.getName()}); } catch(Throwable t) { throw new Exception("Error calling callback " + bean + " for target context " + ctx.getName(), t); } } else { throw new IllegalArgumentException("Cannot install " + ctx.getName() + ". Lifecycle callback context " + bean + " does not implement InvokeDispatchContext"); } } public void uninstall(ControllerContext ctx) { if (installed) { log.trace("Invoking uninstall callback '" + installMethod + "' on " + bean + " for target " + bean + " at " + whenRequired); installed = false; Controller controller = ctx.getController(); ControllerContext callbackContext = controller.getContext(bean, dependentState); if (callbackContext instanceof InvokeDispatchContext) { try { ((InvokeDispatchContext)callbackContext).invoke(uninstallMethod, new Object[]{ctx}, new String[]{ControllerContext.class.getName()}); } catch (Throwable ignored) { log.warn("Ignored error uninstalling context " + ctx.getName() + "; callback=" + bean, ignored); } } else { log.warn("Cannot uninstall " + ctx.getName() + ". Lifecycle callback context " + bean + " does not implement InvokeDispatchContext"); } } } public String toString() { JBossStringBuilder sb = new JBossStringBuilder("LifecycleCallbackItem-"); sb.append(bean); sb.append(":"); sb.append(whenRequired); return sb.toString(); } } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/OwnerCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/plugins/Ow0000644000175000017500000000656110652365637033332 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.plugins; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyItem; import org.jboss.util.JBossStringBuilder; /** * Owner callback item. * * @param the callback type * @param owner type * @author Ales Justin */ public abstract class OwnerCallbackItem extends AbstractCallbackItem { protected C owner; protected OwnerCallbackItem(T name, String attributeName, C owner) { this(name, null, null, attributeName, owner); } protected OwnerCallbackItem(T name, ControllerState whenRequired, ControllerState dependentState, String attributeName, C owner) { super(name, whenRequired, dependentState, attributeName); if (owner == null) throw new IllegalArgumentException("Null owner!"); this.owner = owner; } /** * Add dependency. * * @param controller the controller * @param context changed context * @param isInstallPhase install or uninstall phase */ protected void addDependency(Controller controller, ControllerContext context, boolean isInstallPhase) { if (owner instanceof ControllerContext) { ControllerContext co = (ControllerContext)owner; DependencyItem dependency = createDependencyItem(co); if (dependency != null && dependency.resolve(controller)) { context.getDependencyInfo().addDependsOnMe(dependency); co.getDependencyInfo().addIDependOn(dependency); } } } /** * Create dependency - if it exists. * * @param owner if owner is controller context * @return dependency or null if no such dependency exists */ protected DependencyItem createDependencyItem(ControllerContext owner) { return null; } public void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase) throws Throwable { super.changeCallback(controller, context, isInstallPhase); addDependency(controller, context, isInstallPhase); } protected void toString(JBossStringBuilder buffer) { super.toString(buffer); buffer.append(" owner=").append(owner); } } libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/0000755000175000017500000000000011620312224032100 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/DependencyInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Depend0000644000175000017500000001076610776707200033251 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.util.List; import java.util.Set; import org.jboss.util.JBossInterface; /** * Information about dependencies. * * @author Adrian Brock * @version $Revision: 71794 $ */ public interface DependencyInfo extends JBossInterface { /** * Return what we depend upon * * @param type the class of the dependency or null for all types * @return our dependencies */ Set getIDependOn(Class type); /** * Return what depends upon me * * @param type the class of the dependency or null for all types * @return what depends upon this */ Set getDependsOnMe(Class type); /** * Add a dependency * * @param dependency the dependency to add */ void addIDependOn(DependencyItem dependency); /** * Remove a dependency * * @param dependency the dependency to remove */ void removeIDependOn(DependencyItem dependency); /** * Add a dependency reference * * @param dependency the dependency to add */ void addDependsOnMe(DependencyItem dependency); /** * Remove a dependency reference * * @param dependency the dependency to remove */ void removeDependsOnMe(DependencyItem dependency); /** * Try to resolve dependencies * * @param controller the controller * @param state the state of dependency to resolve * @return true when all dependencies are resolved */ boolean resolveDependencies(Controller controller, ControllerState state); /** * Return the unresolved dependencies * * @param state the controller state * @return our unresolved dependencies */ Set getUnresolvedDependencies(ControllerState state); /** * Add a callback reference * * @param the callback item type * @param callbackItem the callback to add */ void addInstallItem(CallbackItem callbackItem); /** * Remove a callback reference * * @param the callback item type * @param callbackItem the callback to remove */ void removeInstallItem(CallbackItem callbackItem); /** * Return install callbacks. * * @return our install callbacks */ Set> getInstallItems(); /** * Add a callback reference * * @param the callback item type * @param callbackItem the callback to add */ void addUninstallItem(CallbackItem callbackItem); /** * Remove a callback reference * * @param the callback item type * @param callbackItem the callback to remove */ void removeUninstallItem(CallbackItem callbackItem); /** * Return uninstall callbacks. * * @return our uninstall callbacks */ Set> getUninstallItems(); /** * Add a lifecycle callback * * @param lifecycleCallbackItem The lifecycle callback to add */ void addLifecycleCallback(LifecycleCallbackItem lifecycleCallbackItem); /** * Get the lifecycle callbacks * * @return our lifecycle callbacks */ List getLifecycleCallbacks(); /** * Can we use this context for autowiring. * * @return true if context can be used for autowiring */ boolean isAutowireCandidate(); /** * Set whether this is an autowire candidate * * @param candidate true if it is a candidate for autowiring */ void setAutowireCandidate(boolean candidate); }././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ControllerContextActions.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000000333410331006762033277 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; /** * Controller context actions. * * @author Adrian Brock * @version $Revision: 37459 $ */ public interface ControllerContextActions { /** * Install a context * * @param context the context * @param fromState the old state * @param toState the new state * @throws Throwable for any error */ void install(ControllerContext context, ControllerState fromState, ControllerState toState) throws Throwable; /** * Uninstall a context * * @param context the context * @param fromState the old state * @param toState the new state */ void uninstall(ControllerContext context, ControllerState fromState, ControllerState toState); } ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Controller.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000000750210776707200033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.util.Set; import org.jboss.util.JBossInterface; /** * A controller.

* * The controller is the core component for keeping track * of contexts to make sure the configuration and lifecycle are * done in the correct order including dependencies and * classloading considerations. * * @author Adrian Brock * @version $Revision: 71794 $ */ public interface Controller extends JBossInterface { /** * Install a context * * @param context the context * @throws Throwable for any error */ void install(ControllerContext context) throws Throwable; /** * Change a context to the given state * * @param context the context * @param state the state * @throws Throwable for any error */ void change(ControllerContext context, ControllerState state) throws Throwable; /** * Enable an on demand context * * @param context the context * @throws Throwable for any error */ void enableOnDemand(ControllerContext context) throws Throwable; /** * Uninstall a context * * @param name the name of the component * @return the context */ ControllerContext uninstall(Object name); /** * Add alias. * * @param alias the alias to add * @param original original name * @throws Throwable for any error */ void addAlias(Object alias, Object original) throws Throwable; /** * Remove alias. * * @param alias alias to remove */ void removeAlias(Object alias); /** * Get a context * * @param name the name of the component * @param state the state (pass null for any state) * @return the context */ ControllerContext getContext(Object name, ControllerState state); /** * Get an installed context * * @param name the name of the component * @return the context */ ControllerContext getInstalledContext(Object name); /** * Get the contexts not installed * * @return Set */ Set getNotInstalled(); /** * Add a state. * * @param state the state to add * @param before the state to add before or null to add to the end */ void addState(ControllerState state, ControllerState before); /** * Get the states model. * * @return the states in order */ ControllerStateModel getStates(); /** * Get the contexts in certain state * * @param state controller state to get contexts for * @return set of contexts in certain state */ Set getContextsByState(ControllerState state); /** * Whether the controller is shutdown * * @return true when shutdown */ boolean isShutdown(); /** * Shutdown the controller */ void shutdown(); } ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/0000755000175000017500000000000011620312224033201 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/LookupStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/0000644000175000017500000000323611034660617033222 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.graph; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; /** * Context lookup strategy. * * @author Ales Justin */ public interface LookupStrategy { /** * Get context based on this strategy. * * @param controller the current controller * @param name the name of the context * @param state the context's state * @return context or null if not available */ ControllerContext getContext(Controller controller, Object name, ControllerState state); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/GraphController.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/0000644000175000017500000000325211034660617033220 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.graph; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerState; /** * Graph controller. * * Either GraphController itself understands * SearchInfo, or delegates work to LookupStrategy. * * @author Ales Justin */ public interface GraphController { /** * Get the context. * * @param name the context name * @param state the required state * @param info the seatch info * @return found context or null if not available */ ControllerContext getContext(Object name, ControllerState state, SearchInfo info); } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/SearchInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/graph/0000644000175000017500000000403411147522315033214 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.graph; import java.util.Map; import javax.xml.bind.annotation.XmlTransient; /** * Search info. * * Holding the type or/and lookup strategy. * * @author Ales Justin */ public interface SearchInfo { /** * The search type. * * If there is no supported lookup strategy * GraphController implementation might * return context on itself. * * @return the type */ @XmlTransient String getType(); /** * Get the info. * Additional parameters to be used for search. * * @return the additional info */ @XmlTransient Map getInfo(); /** * Get the lookup strategy. * * Might be null, but then we expect the GraphController * to implement this search type. * Otherwise error should be thown by GraphController. * * @return the strategy or null depending on GraphContorller */ @XmlTransient LookupStrategy getStrategy(); } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ErrorHandlingMode.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ErrorH0000644000175000017500000000256011034362472033240 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import org.jboss.xb.annotations.JBossXmlEnum; /** * Error handling mode. * * @author Ales Justin */ @JBossXmlEnum(ignoreCase=true) public enum ErrorHandlingMode { DISCARD, // The default as before MANUAL, // Handle contexts in error yourself CHECKED // As MANUAL but RuntimeExceptions, Errors lead to a DISCARD } ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ScopeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ScopeI0000644000175000017500000000707711047121272033224 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.loader.MutableMetaDataLoader; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; /** * ScopeInfo. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public interface ScopeInfo { /** * Get the metadata * * @return the metadata */ MetaData getMetaData(); /** * Add metadata * * @param repository the repository * @param context the controller context */ void addMetaData(MutableMetaDataRepository repository, ControllerContext context); /** * Add metadata * * @param repository the repository * @param context the controller context */ void removeMetaData(MutableMetaDataRepository repository, ControllerContext context); /** * Initialise the metadata retrieval * * @param repository the repository * @param context the context * @param scope the scope level * @return the retrieval */ MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, Scope scope); /** * Initialise the main metadata retrieval * * @param repository the repository * @param context the context * @return the retrieval */ MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context); /** * Initialise the main mutable metadata retrieval. * * @param repository the mutable metadata repository * @param context the controller context * @param scopeKey the scope key * @return new mutable metadata loader instance */ MutableMetaDataLoader initMutableMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, ScopeKey scopeKey); /** * Get the scope * * @return the scope */ ScopeKey getScope(); /** * Set the scope * * @param key the scope key */ void setScope(ScopeKey key); /** * Get the mutable scope * * @return the scope */ ScopeKey getMutableScope(); /** * Set the mutable scope * * @param key the scope key */ void setMutableScope(ScopeKey key); /** * Get the install scope * * @return the scope */ ScopeKey getInstallScope(); /** * Set the install scope * * @param key the scope key */ void setInstallScope(ScopeKey key); } ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/LifecycleCallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Lifecy0000644000175000017500000000403210763553123033251 0ustar twernertwerner/* * 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.dependency.spi; /** * * @author Kabir Khan * @version $Revision: 1.1 $ */ public interface LifecycleCallbackItem { /** * Gets the target bean implementing this callback * @return the target bean name */ Object getBean(); /** * Get the target state of the bean this callback applies to indicating when this callback should trigger * @return the state */ ControllerState getWhenRequired(); /** * The required state of the lifecycle callback bean * @return the dependant state */ ControllerState getDependentState(); /** * Call when the target bean is installed * @param ctx the context of the target bean * @throws Exception for any error */ void install(ControllerContext ctx) throws Exception; /** * Call when the target bean is uninstalled * @param ctx the context of the target bean */ void uninstall(ControllerContext ctx); } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/package.htmllibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/packag0000644000175000017500000000151510244655216033267 0ustar twernertwerner

Classes used to define dependency plugins.

Package Specification

Related Documentation

Package Status

  • ALPHA

Todo

  • ???
././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/CallbackItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Callba0000644000175000017500000000473710652365637033240 0ustar twernertwerner/** * @author Ales Justin */ /* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; /** * Callback information. * * @param expected name type - Class, String, ... * @author Ales Justin */ public interface CallbackItem { /** * Get the object name i depend on * * @return the name */ T getIDependOn(); /** * Get when the dependency is required * * @return the state when required */ ControllerState getWhenRequired(); /** * Get the dependent's state * * @return the state of the required of the dependent */ ControllerState getDependentState(); /** * Get the method/attribute/property name * * @return the name */ String getAttributeName(); /** * Execute callback when item added to controller. * * @param controller the controller * @param isInstallPhase install or uninstall * @throws Throwable for any error */ void ownerCallback(Controller controller, boolean isInstallPhase) throws Throwable; /** * Execute callback with current changed context. * * @param controller the controller * @param context the new context * @param isInstallPhase install or uninstall * @throws Throwable for any error */ void changeCallback(Controller controller, ControllerContext context, boolean isInstallPhase) throws Throwable; } ././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ControllerStateModel.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000000543010777100032033275 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.util.ListIterator; /** * ControllerState model. * Helper/util methods. * * @author Ales Justin */ public interface ControllerStateModel extends Iterable { /** * Get the list iterator. * * The list iterator cursor should be * pointing to the last state. * Since the usage of this list iterator * is mostly to iterate over the states in * reverted order. * * @return list iterator */ ListIterator listIteraror(); /** * Get previous state from state param * or null if state param is the first. * * Throw exception if state is not recognized. * * @param state the current state * @return previous state */ ControllerState getPreviousState(ControllerState state); /** * Get next state from state param * or null if state param is the last. * * Throw exception if state is not recognized. * * @param state the current state * @return next state */ ControllerState getNextState(ControllerState state); /** * Is state param before reference state param. * * @param state the state we are checking * @param reference the state we are checking against * @return true if state is before reference */ boolean isBeforeState(ControllerState state, ControllerState reference); /** * Is state param after reference state param. * * @param state the state we are checking * @param reference the state we are checking against * @return true if state is after reference */ boolean isAfterState(ControllerState state, ControllerState reference); } ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Cardinality.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Cardin0000644000175000017500000001410610613354013033230 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.io.Serializable; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Cardinality def. * * @author Ales Justin */ public class Cardinality extends JBossObject implements Serializable { private static final long serialVersionUID = 2L; public static final int INFINITY = -1; public static final Cardinality ZERO_TO_ONE = new Cardinality("0..1", 0, 1); public static final Cardinality ZERO_TO_MANY = new Cardinality("0..n", 0, INFINITY); public static final Cardinality ONE_TO_ONE = new Cardinality("1..1", 1, 1); public static final Cardinality ONE_TO_MANY = new Cardinality("1..n", 1, INFINITY); private static Cardinality[] values = new Cardinality[] { ZERO_TO_ONE, ZERO_TO_MANY, ONE_TO_ONE, ONE_TO_MANY }; private String type; private int left; private int right; private Cardinality(String type, int left, int right) { this.type = type; this.left = left; this.right = right; } /** * Is number in cardinality's range. * * @param number number to check * @return left <= number <= right */ public boolean isInRange(int number) { return (number < 0 || number < left || left == INFINITY) == false && (number <= right || right == INFINITY); } /** * Get the cardinality by type. * * @param type the commont type * @return cardinality by type */ public static Cardinality toCardinality(String type) { for (Cardinality c : values) { if (c.getType().equals(type)) { return c; } } return fromString(type); } /** * Get limit from string. * * @param limit from string * @return limit as int from string */ protected static int getLimitFromString(String limit) { try { return Integer.parseInt(limit); } catch (NumberFormatException e) { return INFINITY; } } /** * Get limit as string. * * @param limit right limit * @return limit as string */ protected static String getLimitFromInt(int limit) { return limit == INFINITY ? "n" : String.valueOf(limit); } /** * Parse cardinality from string - #1..#2. * * @param string cardinality string * @return cardinality */ public static Cardinality fromString(String string) { if (string == null) throw new IllegalArgumentException("Null string."); if (string.contains("..")) { String[] args = string.split("\\.\\."); if (args == null || args.length != 2) throw new IllegalArgumentException("Illegal cardinality format: " + string); return createCardinality(getLimitFromString(args[0]), getLimitFromString(args[1])); } else return createUnlimitedCardinality(getLimitFromString(string)); } /** * Create cardinality which starts at #start and has no limit. * * @param start the left number of cardinality interval * @return cardinality * @see org.jboss.dependency.spi.Cardinality#createCardinality(int,int) */ public static Cardinality createUnlimitedCardinality(int start) { return createCardinality(start, INFINITY); } /** * Create cardinality which ends at #end and starts at zero. * * @param end the right number of cardinality interval * @return cardinality * @see org.jboss.dependency.spi.Cardinality#createCardinality(int,int) */ public static Cardinality createLimitedCardinality(int end) { return createCardinality(0, end); } /** * Create cardinality with [#left, #right] interval. * * @param left left point in interval * @param right right point in interval * @return cardinality */ public static Cardinality createCardinality(int left, int right) { return new Cardinality(getLimitFromInt(left) + ".." + getLimitFromInt(right), left, right); } protected int getHashCode() { return type.hashCode(); } public void toShortString(JBossStringBuilder buffer) { buffer.append("type=").append(type); } protected void toString(JBossStringBuilder buffer) { buffer.append("type=").append(type); } public boolean equals(Object obj) { if (obj instanceof Cardinality == false) return false; Cardinality card = (Cardinality)obj; return left == card.left && right == card.right; } public String getType() { return type; } public int getLeft() { return left; } public int getRight() { return right; } public boolean isLeftInfinity() { return left <= INFINITY; } public boolean isRightInfinity() { return right <= INFINITY; } } ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispatch/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispat0000755000175000017500000000000011620312224033305 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispatch/InvokeDispatchContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispat0000644000175000017500000000414310674761467033342 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.dispatch; /** * The API similar to the DynamicMBean API * where there are methods to get/set Properties/Attributes and invoke on * methods/operations with each context knowing how to do this, e.g. * KernelControllerContext -> Configurator * ServiceControllerContext -> MBeanServer * * @author Ales Justin */ public interface InvokeDispatchContext extends AttributeDispatchContext { /** * Invoke method / operation * * @param name method name * @param parameters parameter values * @param signature method's parameter types / signatures * @return inovocation's return object * @throws Throwable for any error */ Object invoke(String name, Object parameters[], String[] signature) throws Throwable; /** * Get context's classloader. * Used when determining type info for parameter and * getting the parameter actual value. * * @return context's classloader * @throws Throwable for any error */ ClassLoader getClassLoader() throws Throwable; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispatch/AttributeDispatchContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispat0000644000175000017500000000370310614361055033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.dispatch; /** * The API similar to the DynamicMBean API * where there are methods to get/set Properties/Attributes. * It is missing invoke, since not all context support it. * KernelControllerContext -> Configurator * ServiceControllerContext -> MBeanServer * * @see InvokeDispatchContext * * @author Ales Justin */ public interface AttributeDispatchContext { /** * Getter property / attribute * * @param name property / attribute name * @return target's property / attribute instance * @throws Throwable for any error */ Object get(String name) throws Throwable; /** * Setter property / attribute * * @param name property / attribute name * @param value set target's property / attribute instance * @throws Throwable for any error */ void set(String name, Object value) throws Throwable; } ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispatch/LifecycleDispatchContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/dispat0000644000175000017500000000405711216157032033322 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.dispatch; import org.jboss.dependency.spi.ControllerState; /** * This context knows how to handle lifecycle invocation. * Resulting in valid lifecycle invocation will force this context to change state. * * @author Ales Justin */ public interface LifecycleDispatchContext extends InvokeDispatchContext { /** * Is this invocation a lifecycle invocation. * * Return state value to which this context should be moved * or return current state if we're already past the lifecycle state * or null if the invocation is actually not a lifecycle invocation. * * @param name method name * @param parameters parameter values * @param signature method's parameter types / signatures * @return state to which we should move this context, or null if this is not lifecycle invocation * @throws Throwable for any error */ ControllerState lifecycleInvocation(String name, Object parameters[], String[] signature) throws Throwable; }././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ControllerState.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000001025211032416742033276 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.io.ObjectStreamException; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import org.jboss.util.JBossObject; import org.jboss.util.JBossStringBuilder; /** * Description of state. * * @author Adrian Brock * @version $Revision: 75258 $ */ public class ControllerState extends JBossObject implements Serializable { private static final long serialVersionUID = 2L; /** Error */ public static final ControllerState ERROR = new ControllerState("**ERROR**"); /** Not installed state */ public static final ControllerState NOT_INSTALLED = new ControllerState("Not Installed"); /** Pre install state */ public static final ControllerState PRE_INSTALL = new ControllerState("PreInstall"); /** Described state */ public static final ControllerState DESCRIBED = new ControllerState("Described"); /** Instantiated state */ public static final ControllerState INSTANTIATED = new ControllerState("Instantiated"); /** Configured state */ public static final ControllerState CONFIGURED = new ControllerState("Configured"); /** Create state */ public static final ControllerState CREATE = new ControllerState("Create"); /** Start state */ public static final ControllerState START = new ControllerState("Start"); /** Installed state */ public static final ControllerState INSTALLED = new ControllerState("Installed"); /** The state string */ protected final String stateString; private static Map values = new HashMap(); static { values.put(ERROR.getStateString(), ERROR); values.put(NOT_INSTALLED.getStateString(), NOT_INSTALLED); values.put(PRE_INSTALL.getStateString(), PRE_INSTALL); values.put(DESCRIBED.getStateString(), DESCRIBED); values.put(INSTANTIATED.getStateString(), INSTANTIATED); values.put(CONFIGURED.getStateString(), CONFIGURED); values.put(CREATE.getStateString(), CREATE); values.put(START.getStateString(), START); values.put(INSTALLED.getStateString(), INSTALLED); } /** * Create a new state * * @param stateString the string representation */ public ControllerState(String stateString) { if (stateString == null) throw new IllegalArgumentException("Null state string"); this.stateString = stateString; } /** * Get the state string * * @return the state string */ public String getStateString() { return stateString; } public boolean equals(Object object) { if (object == null || object instanceof ControllerState == false) return false; ControllerState other = (ControllerState) object; return stateString.equals(other.stateString); } public void toString(JBossStringBuilder buffer) { buffer.append(stateString); } public void toShortString(JBossStringBuilder buffer) { buffer.append(stateString); } protected int getHashCode() { return stateString.hashCode(); } protected Object readResolve() throws ObjectStreamException { return values.get(stateString); } } ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helpers/libjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helper0000755000175000017500000000000011620312224033300 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helpers/UnmodifiableScopeInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helper0000644000175000017500000000713511047121272033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2007, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.helpers; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.metadata.spi.MetaData; import org.jboss.metadata.spi.loader.MutableMetaDataLoader; import org.jboss.metadata.spi.repository.MutableMetaDataRepository; import org.jboss.metadata.spi.retrieval.MetaDataRetrieval; import org.jboss.metadata.spi.scope.Scope; import org.jboss.metadata.spi.scope.ScopeKey; /** * UnmodifiableScopeInfo. * * @author Adrian Brock * @version $Revision: 1.1 $ */ public class UnmodifiableScopeInfo implements ScopeInfo { /** The delegate */ private ScopeInfo delegate; /** * Create a new UnmodifiableScopeInfo. * * @param delegate the delegate */ public UnmodifiableScopeInfo(ScopeInfo delegate) { if (delegate == null) throw new IllegalArgumentException("Null delegate"); this.delegate = delegate; } public void addMetaData(MutableMetaDataRepository repository, ControllerContext context) { throw new UnsupportedOperationException("Cannot modify immutable"); } public void removeMetaData(MutableMetaDataRepository repository, ControllerContext context) { throw new UnsupportedOperationException("Cannot modify immutable"); } public MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, Scope scope) { throw new UnsupportedOperationException("Cannot modify immutable"); } public MetaDataRetrieval initMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context) { throw new UnsupportedOperationException("Cannot modify immutable"); } public MutableMetaDataLoader initMutableMetaDataRetrieval(MutableMetaDataRepository repository, ControllerContext context, ScopeKey scopeKey) { throw new UnsupportedOperationException("Cannot modify immutable"); } public MetaData getMetaData() { return delegate.getMetaData(); } public ScopeKey getScope() { return delegate.getScope(); } public void setScope(ScopeKey key) { throw new UnsupportedOperationException("Cannot modify immutable"); } public ScopeKey getMutableScope() { return delegate.getScope(); } public void setMutableScope(ScopeKey key) { throw new UnsupportedOperationException("Cannot modify immutable"); } public ScopeKey getInstallScope() { return delegate.getInstallScope(); } public void setInstallScope(ScopeKey key) { throw new UnsupportedOperationException("Cannot modify immutable"); } } ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helpers/UnmodifiableDependencyInfo.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helper0000644000175000017500000001102210776707200033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.helpers; import java.util.Set; import java.util.List; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.DependencyItem; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.CallbackItem; import org.jboss.dependency.spi.LifecycleCallbackItem; import org.jboss.util.JBossObject; /** * Unmodifiable instance. * * @author Ales Justin */ public class UnmodifiableDependencyInfo extends JBossObject implements DependencyInfo { private DependencyInfo delegate; public UnmodifiableDependencyInfo(DependencyInfo delegate) { if (delegate == null) throw new IllegalArgumentException("Null dependency info!"); this.delegate = delegate; } public Set getIDependOn(Class type) { return delegate.getIDependOn(type); } public Set getDependsOnMe(Class type) { return delegate.getDependsOnMe(type); } public void addIDependOn(DependencyItem dependency) { throw new UnsupportedOperationException("Cannot execute add on unmodifiable wrapper."); } public void removeIDependOn(DependencyItem dependency) { throw new UnsupportedOperationException("Cannot execute remove on unmodifiable wrapper."); } public void addDependsOnMe(DependencyItem dependency) { throw new UnsupportedOperationException("Cannot execute add on unmodifiable wrapper."); } public void removeDependsOnMe(DependencyItem dependency) { throw new UnsupportedOperationException("Cannot execute remove on unmodifiable wrapper."); } public boolean resolveDependencies(Controller controller, ControllerState state) { return delegate.resolveDependencies(controller, state); } public Set getUnresolvedDependencies(ControllerState state) { return delegate.getUnresolvedDependencies(state); } public void addInstallItem(CallbackItem callbackItem) { throw new UnsupportedOperationException("Cannot execute add on unmodifiable wrapper."); } public void removeInstallItem(CallbackItem callbackItem) { throw new UnsupportedOperationException("Cannot execute remove on unmodifiable wrapper."); } public Set> getInstallItems() { return delegate.getInstallItems(); } public void addUninstallItem(CallbackItem callbackItem) { throw new UnsupportedOperationException("Cannot execute add on unmodifiable wrapper."); } public void removeUninstallItem(CallbackItem callbackItem) { throw new UnsupportedOperationException("Cannot execute remove on unmodifiable wrapper."); } public Set> getUninstallItems() { return delegate.getUninstallItems(); } public void addLifecycleCallback(LifecycleCallbackItem lifecycleCallbackItem) { throw new UnsupportedOperationException("Cannot execute add on unmodifiable wrapper."); } public List getLifecycleCallbacks() { return delegate.getLifecycleCallbacks(); } public boolean isAutowireCandidate() { return delegate.isAutowireCandidate(); } public void setAutowireCandidate(boolean candidate) { throw new UnsupportedOperationException("Cannot execute set on unmodifiable wrapper."); } } ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helpers/UnmodifiableControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/helper0000644000175000017500000001061711002477016033314 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi.helpers; import java.util.Collections; import java.util.Set; import org.jboss.dependency.spi.Controller; import org.jboss.dependency.spi.ControllerContext; import org.jboss.dependency.spi.ControllerMode; import org.jboss.dependency.spi.ControllerState; import org.jboss.dependency.spi.DependencyInfo; import org.jboss.dependency.spi.ScopeInfo; import org.jboss.dependency.spi.ErrorHandlingMode; import org.jboss.util.JBossObject; /** * Unmodifiable delegate instance. * * @author Ales Justin */ public class UnmodifiableControllerContext extends JBossObject implements ControllerContext { private ControllerContext delegate; public UnmodifiableControllerContext(ControllerContext delegate) { if (delegate == null) throw new IllegalArgumentException("Null delegate"); this.delegate = delegate; } /** * Get the delegate. * * @return the delegate */ protected ControllerContext getDelegate() { return delegate; } public Object getName() { return delegate.getName(); } public Set getAliases() { Set aliases = delegate.getAliases(); return aliases != null ? Collections.unmodifiableSet(aliases) : null; } public DependencyInfo getDependencyInfo() { DependencyInfo dependencyInfo = delegate.getDependencyInfo(); return dependencyInfo != null ? new UnmodifiableDependencyInfo(dependencyInfo) : null; } public ScopeInfo getScopeInfo() { ScopeInfo scopeInfo = delegate.getScopeInfo(); return scopeInfo != null ? new UnmodifiableScopeInfo(scopeInfo) : null; } public Object getTarget() { return delegate.getTarget(); } public Controller getController() { return delegate.getController(); } public void setController(Controller controller) { throw new UnsupportedOperationException("Cannot invoke set on unmodifiable wrapper."); } public void install(ControllerState fromState, ControllerState toState) throws Throwable { delegate.install(fromState, toState); } public void uninstall(ControllerState fromState, ControllerState toState) { delegate.uninstall(fromState, toState); } public ControllerState getState() { return delegate.getState(); } public void setState(ControllerState state) { throw new UnsupportedOperationException("Cannot invoke set on unmodifiable wrapper."); } public ControllerState getRequiredState() { return delegate.getRequiredState(); } public void setRequiredState(ControllerState state) { throw new UnsupportedOperationException("Cannot invoke set on unmodifiable wrapper."); } public ControllerMode getMode() { return delegate.getMode(); } public void setMode(ControllerMode mode) { throw new UnsupportedOperationException("Cannot invoke set on unmodifiable wrapper."); } public ErrorHandlingMode getErrorHandlingMode() { return delegate.getErrorHandlingMode(); } public Throwable getError() { return delegate.getError(); } public void setError(Throwable error) { throw new UnsupportedOperationException("Cannot invoke set on unmodifiable wrapper."); } } ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ControllerContext.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000000670110772743225033313 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.util.Set; import org.jboss.util.JBossInterface; /** * Information about a context. * * @author Adrian Brock * @version $Revision: 71354 $ */ public interface ControllerContext extends JBossInterface { /** * Get the name * * @return the name */ Object getName(); /** * The aliases * * @return the aliases or null if there are no aliases */ Set getAliases(); /** * Get the dependency information * * @return the dependency information */ DependencyInfo getDependencyInfo(); /** * Get the scope information * * @return the scope information */ ScopeInfo getScopeInfo(); /** * Get any target * * @return the target */ Object getTarget(); /** * Get the controller * * @return the controller */ Controller getController(); /** * Set the controller * * @param controller the controller */ void setController(Controller controller); /** * Install * * @param fromState the old state * @param toState the new state * @throws Throwable for any error */ void install(ControllerState fromState, ControllerState toState) throws Throwable; /** * Uninstall * * @param fromState the old state * @param toState the new state */ void uninstall(ControllerState fromState, ControllerState toState); /** * Get the state * * @return the state */ ControllerState getState(); /** * Set the state * * @param state the state */ void setState(ControllerState state); /** * Get the required state * * @return the required state */ ControllerState getRequiredState(); /** * Set the required state * * @param state the required state */ void setRequiredState(ControllerState state); /** * Get the mode * * @return the mode */ ControllerMode getMode(); /** * Set the mode * * @param mode the mode */ void setMode(ControllerMode mode); /** * Get the error handling mode. * * @return the error handling mode */ ErrorHandlingMode getErrorHandlingMode(); /** * Get the error * * @return the error */ Throwable getError(); /** * Set the error * * @param error the error */ void setError(Throwable error); } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/ControllerMode.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Contro0000644000175000017500000000643511216157032033304 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; import java.util.Arrays; import javax.xml.bind.annotation.XmlEnumValue; import org.jboss.util.JBossStringBuilder; import org.jboss.xb.annotations.JBossXmlEnum; /** * Mode of the context. * * @author Adrian Brock * @author Ales Justin * @version $Revision: 90317 $ */ @JBossXmlEnum(ignoreCase=true) public enum ControllerMode { AUTOMATIC("Automatic", ControllerState.INSTALLED), @XmlEnumValue("On Demand") ON_DEMAND("On Demand", ControllerState.DESCRIBED), MANUAL("Manual"), DISABLED("Disabled"), ASYNCHRONOUS("Asynchronous", ControllerState.INSTALLED); /** The mode string */ private final String modeString; /** The required state */ private ControllerState requiredState; /** * Create a new mode * * @param modeString the mode representation */ private ControllerMode(String modeString) { this(modeString, null); } private ControllerMode(String modeString, ControllerState requiredState) { if (modeString == null) throw new IllegalArgumentException("Null mode string"); if (requiredState == null) requiredState = ControllerState.NOT_INSTALLED; this.modeString = modeString; this.requiredState = requiredState; } /** * Get the right enum instance from mode string. * * @param modeString the mode string param * @return matching enum or exception if no match */ public static ControllerMode getInstance(String modeString) { if (modeString == null) throw new IllegalArgumentException("Null mode string."); for(ControllerMode cm : values()) { if (modeString.equalsIgnoreCase(cm.getModeString())) return cm; } throw new IllegalArgumentException("No such controller mode: " + modeString + ", available: " + Arrays.toString(values())); } /** * Get the mode string * * @return the mode string */ public String getModeString() { return modeString; } /** * The required state. * * @return the required state */ public ControllerState getRequiredState() { return requiredState; } public void toString(JBossStringBuilder buffer) { buffer.append(modeString); } } ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/DependencyItem.javalibjboss-microcontainer-java-2.0.10.GA.orig/dependency/src/main/java/org/jboss/dependency/spi/Depend0000644000175000017500000000446110640505653033242 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.dependency.spi; /** * Information about a single dependency. * * @author Adrian Brock * @version $Revision: 63688 $ */ public interface DependencyItem { /** * Get the object name i depend on * * @return the name */ Object getIDependOn(); /** * Get my object name * * @return the name */ Object getName(); /** * Get when the dependency is required * * @return the state when required */ ControllerState getWhenRequired(); /** * Get the dependent's state * * @return the state of the required of the dependent */ ControllerState getDependentState(); /** * Whether we are resolved * * @return true for resolved, false otherwise */ boolean isResolved(); /** * Try to resolve * * @param controller the controller * @return true for resolved, false otherwise */ boolean resolve(Controller controller); /** * Mark the dependency as unresolved * * @param controller the controller * @return true if proceed with unresolving, false otherwise */ boolean unresolved(Controller controller); /** * Return a human readable version of the dependency * * @return the string */ String toHumanReadableString(); }libjboss-microcontainer-java-2.0.10.GA.orig/dependency/.settings/0000755000175000017500000000000011620312224024542 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/dependency/.settings/org.eclipse.jdt.core.prefs0000644000175000017500000000032010674774740031546 0ustar twernertwerner#Fri Sep 21 17:48:18 BST 2007 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.source=1.5 org.eclipse.jdt.core.compiler.compliance=1.5 libjboss-microcontainer-java-2.0.10.GA.orig/dependency/.project0000644000175000017500000000075111301257231024300 0ustar twernertwerner jboss-dependency JBoss Microcontainer Dependency org.eclipse.jdt.core.javabuilder org.maven.ide.eclipse.maven2Builder org.maven.ide.eclipse.maven2Nature org.eclipse.jdt.core.javanature libjboss-microcontainer-java-2.0.10.GA.orig/docs/0000755000175000017500000000000011620312220021432 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/0000755000175000017500000000000011620312214023253 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/0000755000175000017500000000000011620312220025303 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/0000755000175000017500000000000011620312220027616 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/pom.xml0000644000175000017500000000241510716066501031152 0ustar twernertwerner 4.0.0 org.jboss.microcontainer.examples integrating pom 1.0.0 mbeans maven-compiler-plugin 1.5 1.5 true true true true org.apache.maven.plugins maven-jar-plugin false libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/0000755000175000017500000000000011620312220031063 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/pom.xml0000644000175000017500000000113210715032235032406 0ustar twernertwerner org.jboss.microcontainer.examples integrating 1.0.0 4.0.0 org.jboss.microcontainer.examples mbeans jar 1.0.0 MBeans libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/0000755000175000017500000000000011620312220031652 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/0000755000175000017500000000000011620312220032576 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/res0000755000175000017500000000000011620312220033310 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/res0000755000175000017500000000000011620312220033310 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-services.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/res0000644000175000017500000000050310715032235033321 0ustar twernertwerner ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/res0000644000175000017500000000100710715032235033321 0ustar twernertwerner MBeanServerChecker ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000755000175000017500000000000011620312220033277 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoInjectee.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000644000175000017500000000236510715032235033320 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.mbeans; /** * @author Ales Justin */ public class PojoInjectee { public PojoName getName() { return new PojoName("SimplePojoInjectee"); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestService.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000644000175000017500000000242010715032235033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.mbeans; /** * @author Ales Justin */ public class TestService implements TestServiceMBean { public void setInjecteeName(PojoName name) { System.out.println(name); } } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/MBeanServerChecker.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000644000175000017500000000275710715032235033325 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.mbeans; import java.util.ArrayList; import javax.management.MBeanServerFactory; /** * @author Ales Justin */ public class MBeanServerChecker { public void create() { ArrayList servers = MBeanServerFactory.findMBeanServer("jboss"); if (servers == null || servers.isEmpty()) throw new IllegalArgumentException("Only able to run this demo with MBeanServer present!"); } } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/TestServiceMBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000644000175000017500000000232110715032235033310 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.mbeans; /** * @author Ales Justin */ public interface TestServiceMBean { public void setInjecteeName(PojoName name); } ././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/java/org/jboss/example/microcontainer/mbeans/PojoName.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/integrating/mbeans/src/main/jav0000644000175000017500000000276710715032235033326 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.mbeans; import java.io.Serializable; /** * @author Ales Justin */ public class PojoName implements Serializable { private static final long serialVersionUID = 2468887813576431620L; private String name; public PojoName(String name) { this.name = name; } public String getName() { return name; } public String toString() { return getName(); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/0000755000175000017500000000000011620312214030270 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/pom.xml0000644000175000017500000000772711203030634031622 0ustar twernertwerner 4.0.0 org.jboss.microcontainer.examples aopDev pom 1.0.0 aspects org.jboss.microcontainer jboss-kernel ${mc.release} org.jboss.aop jboss-aop ${aop.release} org.jboss.microcontainer jboss-aop-mc-int ${mc.release} org.jboss.microcontainer jboss-kernel org.jboss.microcontainer jboss-aop-mc-int org.jboss.aop jboss-aop compile org.codehaus.mojo exec-maven-plugin 1.1.1 true run exec verify java -classpath org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap maven-compiler-plugin 1.5 1.5 true true true true org.apache.maven.plugins maven-jar-plugin false org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap true lib . maven-assembly-plugin ${parent.relative.dir}/dist.xml ${pom.artifactId} package directory-inline . 2.0.6.GA 2.1.1.GA libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/0000755000175000017500000000000011620312214031732 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/pom.xml0000644000175000017500000000155610716044320033263 0ustar twernertwerner org.jboss.microcontainer.examples aopDev 1.0.0 4.0.0 org.jboss.microcontainer.examples aspects jar 1.0.0 Aspects org.jboss.microcontainer jboss-aop-mc-int compile .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/0000755000175000017500000000000011620312214032521 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000476411203030634033403 0ustar twernertwerner java.naming.factory.initial org.jboss.example.microcontainer.aspects.EnvInitialContextFactory org.jboss.kernel.spi.dependency.KernelControllerContextAware @org.jboss.aop.microcontainer.aspects.jndi.JndiBinding(name="beans/SimpleBean", aliases={"beans/XmlAnnotatedSimpleBean"}) java.naming.factory.initial org.jboss.example.microcontainer.aspects.EnvInitialContextFactory JndiBinding ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000022400000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000755000175000017500000000000011620312214033366 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/AnnotatedSimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000264010715026425033404 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.aspects; import java.io.Serializable; import org.jboss.aop.microcontainer.aspects.jndi.JndiBinding; /** * @author Ales Justin */ @JndiBinding(name = "beans/AnnotatedSimpleBean") public class AnnotatedSimpleBean implements Serializable { public String toString() { return "I'm annotated SimpleBean."; } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/EnvInitialContextFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000357110715026425033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.example.microcontainer.aspects; import java.util.Hashtable; import java.util.List; import javax.management.MBeanServerFactory; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.naming.spi.InitialContextFactory; /** * We check if we are in AS or standalone. * * @author Ales Justin */ public class EnvInitialContextFactory implements InitialContextFactory { public Context getInitialContext(Hashtable env) throws NamingException { return isApplicationServer() ? new InitialContext(env) : new MockJndiProvider(env); } protected boolean isApplicationServer() { List servers = MBeanServerFactory.findMBeanServer("jboss"); return servers != null && servers.isEmpty() == false; } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBeanLookup.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000510511202775431033403 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.aspects; import org.jboss.aop.proxy.container.AspectManaged; import java.util.Properties; import javax.naming.Context; import javax.naming.InitialContext; /** * @author Ales Justin */ public class SimpleBeanLookup { private Properties env; public String getName() { return getClass().getName(); } public void setEnv(Properties env) { this.env = env; } public void start() throws Exception { System.out.println("======== SimpleBeanLookup: Looking up beans bound in JNDI"); Context context = new InitialContext(env); lookupAndOutput(context, "beans/SimpleBean"); lookupAndOutput(context, "beans/AnnotatedSimpleBean"); lookupAndOutput(context, "beans/XmlAnnotatedSimpleBean"); } private void lookupAndOutput(Context context, String name) throws Exception { Object o = context.lookup(name); System.out.println("Found bean bound under: " + name); System.out.println("\tType: " + getClassInformation(o.getClass())); System.out.println("\ttoString on found bean: " + o.toString()); } private String getClassInformation(Class clazz) { if (AspectManaged.class.isAssignableFrom(clazz)) { //Classes with aspects will be an instance of AspectManaged Class superClass = clazz.getSuperclass(); return "AOP proxy for " + superClass.getName(); } else { return clazz.getName(); } } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockJndiProvider.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000001265710715026425033415 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * 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.example.microcontainer.aspects; import java.io.IOException; import java.rmi.MarshalledObject; import java.util.Hashtable; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import javax.naming.Binding; import javax.naming.Context; import javax.naming.Name; import javax.naming.NameClassPair; import javax.naming.NameParser; import javax.naming.NamingEnumeration; import javax.naming.NamingException; /** * @author Scott.Stark@jboss.org * @version $Revision:$ */ public class MockJndiProvider implements Context { private static Map bindings = new ConcurrentHashMap(); private Hashtable env; MockJndiProvider(Hashtable env) { this.env = env; } public Object addToEnvironment(String propName, Object propVal) throws NamingException { return null; } public void bind(Name name, Object obj) throws NamingException { String sname = name.toString(); bind(sname, obj); } public void bind(String name, Object obj) throws NamingException { try { MarshalledObject mo = new MarshalledObject(obj); bindings.put(name, mo); } catch(IOException e) { NamingException ex = new NamingException("Failed to bind name: "+name); ex.setRootCause(e); throw ex; } } public void close() throws NamingException { } public Name composeName(Name name, Name prefix) throws NamingException { return null; } public String composeName(String name, String prefix) throws NamingException { return null; } public Context createSubcontext(Name name) throws NamingException { return null; } public Context createSubcontext(String name) throws NamingException { return null; } public void destroySubcontext(Name name) throws NamingException { } public void destroySubcontext(String name) throws NamingException { } public Hashtable getEnvironment() throws NamingException { return env; } public String getNameInNamespace() throws NamingException { return null; } public NameParser getNameParser(Name name) throws NamingException { return new MockNameParser(); } public NameParser getNameParser(String name) throws NamingException { return new MockNameParser(); } public NamingEnumeration list(Name name) throws NamingException { return null; } public NamingEnumeration list(String name) throws NamingException { return null; } public NamingEnumeration listBindings(Name name) throws NamingException { return null; } public NamingEnumeration listBindings(String name) throws NamingException { return null; } public Object lookup(Name name) throws NamingException { String sname = name.toString(); return lookup(sname); } public Object lookup(String name) throws NamingException { MarshalledObject mo = (MarshalledObject) bindings.get(name); Object value = null; if( mo != null ) { try { value = mo.get(); } catch(Exception e) { NamingException ex = new NamingException(); ex.setRootCause(e); throw ex; } } return value; } public Object lookupLink(Name name) throws NamingException { return null; } public Object lookupLink(String name) throws NamingException { return null; } public void rebind(Name name, Object obj) throws NamingException { } public void rebind(String name, Object obj) throws NamingException { bindings.put(name, obj); } public Object removeFromEnvironment(String propName) throws NamingException { return null; } public void rename(Name oldName, Name newName) throws NamingException { } public void rename(String oldName, String newName) throws NamingException { } public void unbind(Name name) throws NamingException { unbind(name.toString()); } public void unbind(String name) throws NamingException { bindings.remove(name); } } ././@LongLink0000000000000000000000000000024300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000244010715026425033402 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.aspects; import java.io.Serializable; /** * @author Ales Justin */ public class SimpleBean implements Serializable { public String toString() { return "I'm plain SimpleBean."; } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main/java/org/jboss/example/microcontainer/aspects/MockNameParser.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/aspects/src/main0000644000175000017500000000103510715026425033401 0ustar twernertwernerpackage org.jboss.example.microcontainer.aspects; import java.util.Properties; import javax.naming.CompoundName; import javax.naming.Name; import javax.naming.NameParser; import javax.naming.NamingException; public class MockNameParser implements NameParser { private static final Properties syntax = new Properties(); static { syntax.setProperty("jndi.syntax.direction", "flat"); } public Name parse(String name) throws NamingException { return new CompoundName(name, syntax); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/dist.xml0000644000175000017500000000310710716044320031763 0ustar twernertwerner dist zip false target *.jar ${parent.relative.dir}/log4j.properties /lib false runtime org.jboss.microcontainer:jboss-kernel org.jboss.microcontainer:jboss-dependency org.jboss.microcontainer:jboss-container org.jboss:jboss-common-core jboss:jboss-common-core jboss:jboss-common-logging-spi jboss:jboss-common-logging-log4j log4j:log4j org.jboss:jbossxb apache-xerces:xercesImpl oswego-concurrent:concurrent org.jboss.aop:jboss-aop org.jboss.microcontainer:jboss-aop-mc-int org.jboss:javassist trove:trove ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/log4j.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/aopDevelopment/log4j.properties0000644000175000017500000000047510716014637033450 0ustar twernertwernerlog4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=AOP Example %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/0000755000175000017500000000000011620312215030277 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000472010716014637033442 0ustar twernertwerner org.jboss.microcontainer.examples gettingStarted 1.0.0 4.0.0 org.jboss.microcontainer.examples client jar 1.0.0 Client A simple command line client that uses the Human Resources Service. org.jboss.microcontainer jboss-kernel org.jboss.aop jboss-aop org.jboss.microcontainer jboss-aop-mc-int org.jboss.microcontainer.examples humanResourcesService 1.0.0 org.jboss.microcontainer.examples auditAspect 1.0.0 junit junit org.apache.maven.plugins maven-jar-plugin false maven-assembly-plugin src/main/assembly/pojo.xml src/main/assembly/aop.xml src/main/assembly/classloader.xml ${pom.artifactId} package directory-inline ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/resources/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000051410716031605033431 0ustar twernertwerner ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/MockUserInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000177610715044266033452 0ustar twernertwernerpackage org.jboss.example.client; import java.io.IOException; import java.text.ParseException; import java.util.Calendar; import java.util.Date; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * A mock user interface to simulate values being passed in by a user. * * @author Mark Newton */ public class MockUserInterface implements UserInterface { public Address getAddress() throws IOException { return new Address(5, "Oxford St", "London"); } public Date getDateOfBirth() throws ParseException, IOException { Calendar age = Calendar.getInstance(); int year = age.get(Calendar.YEAR); int month = age.get(Calendar.MONTH); int day = age.get(Calendar.DAY_OF_MONTH); age.set(year - 43, month, day); return age.getTime(); } public Employee getEmployee() throws IOException { return new Employee("David", "Hasselhof"); } public Integer getSalary() throws IOException { return new Integer("50000"); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000106510715044266033441 0ustar twernertwernerpackage org.jboss.example.client; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Allow all Client tests to be run. * * @author Mark Newton */ public class ClientTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Client Tests"); suite.addTestSuite(ClientTestCase.class); return suite; } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/test/java/org/jboss/example/client/ClientTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000254210715044266033442 0ustar twernertwernerpackage org.jboss.example.client; import junit.framework.TestCase; /** * Use a mock User Interface to pass values into the client * and check that the Human Resources service is called correctly. * * @author Mark Newton */ public class ClientTestCase extends TestCase { public ClientTestCase(String name) { super(name); } public void testClientWithoutBus() throws Exception { Client client = new Client(false); assertNotNull(client); runTests(client); } public void testClientWithBus() throws Exception { Client client = new Client(true); assertNotNull(client); runTests(client); } private void runTests(Client client) throws Exception { client.setUserInterface(new MockUserInterface()); client.deploy(); assertEquals(true, client.toggleHiringFreeze()); assertEquals(false, client.addEmployee()); assertEquals(0, client.listEmployees().size()); assertEquals(false, client.toggleHiringFreeze()); assertEquals(true, client.addEmployee()); assertEquals(1, client.listEmployees().size()); assertEquals((Integer) 10000, client.getSalary()); client.setSalary(); assertEquals((Integer) 50000, client.getSalary()); client.removeEmployee(); assertEquals(0, client.listEmployees().size()); client.undeploy(); } } ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000016700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/run.shlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000014410716055160033435 0ustar twernertwerner#!/bin/sh java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1 ././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/aop-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000265010716113550033434 0ustar twernertwerner ././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/classloader-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000262610716055160033441 0ustar twernertwerner file:${project.build.directory}/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar ././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/config/pojo-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000163310715100307033427 0ustar twernertwerner ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/classloader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000136310716055160033436 0ustar twernertwerner cl zip false src/main/config/classloader-beans.xml jboss-beans.xml true /otherLib false runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/common.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000237210716066501033440 0ustar twernertwerner target *.jar src/main/config/run.sh 0744 /lib false runtime org.jboss.microcontainer:jboss-kernel org.jboss.microcontainer:jboss-dependency org.jboss.microcontainer:jboss-container org.jboss:jboss-common-core jboss:jboss-common-core jboss:jboss-common-logging-spi jboss:jboss-common-logging-log4j log4j:log4j org.jboss:jbossxb apache-xerces:xercesImpl oswego-concurrent:concurrent ././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000170010716031605033427 0ustar twernertwerner aop zip false src/main/config/aop-beans.xml jboss-beans.xml /lib false org.jboss.microcontainer.examples:humanResourcesService org.jboss.microcontainer.examples:auditAspect org.jboss.aop:jboss-aop org.jboss.microcontainer:jboss-aop-mc-int org.jboss:javassist trove:trove src/main/assembly/common.xml ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/assembly/pojo.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000131310716031605033427 0ustar twernertwerner pojo zip false src/main/config/pojo-beans.xml jboss-beans.xml /lib false runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/resources/log4j.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000046710713610501033433 0ustar twernertwernerlog4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=Client %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000755000175000017500000000000011620312215033421 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/EmbeddedBootstrap.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000275210715044266033445 0ustar twernertwernerpackage org.jboss.example.client; import java.net.URL; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; /** * Add a BasicXMLDeployer to the BasicBootstrap so that we can parse * XML descriptors for the beans (*-beans.xml). * * @author Mark Newton */ public class EmbeddedBootstrap extends BasicBootstrap { protected BasicXMLDeployer deployer; public EmbeddedBootstrap() throws Exception { super(); } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BasicXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); } public void deploy(URL url) { try { // Workaround the fact that the BasicXMLDeployer does not handle redeployment correctly if (deployer.getDeploymentNames().contains(url.toString())) { System.out.println("Service is already deployed."); return; } deployer.deploy(url); } catch (Throwable t) { log.warn("Error during deployment: " + url, t); } } public void undeploy(URL url) { if (!deployer.getDeploymentNames().contains(url.toString())) { System.out.println("Service is already undeployed."); return; } try { deployer.undeploy(url); } catch (Throwable t) { log.warn("Error during undeployment: " + url, t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); deployer.shutdown(); } } }././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/UserInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000000117510715044266033443 0ustar twernertwernerpackage org.jboss.example.client; import java.io.IOException; import java.text.ParseException; import java.util.Date; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * Allow different implementations of a user interface to be used. * i.e. command line, Swing or even a mock for testing purposes. * * @author Mark Newton */ public interface UserInterface { Employee getEmployee() throws IOException; Address getAddress() throws IOException; Date getDateOfBirth() throws ParseException, IOException; Integer getSalary() throws IOException; } ././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/Client.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000001355611030076670033444 0ustar twernertwernerpackage org.jboss.example.client; import java.io.IOException; import java.net.URL; import java.text.ParseException; import java.util.Date; import java.util.Set; import org.jboss.dependency.spi.ControllerContext; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; import org.jboss.example.service.HRManager; import org.jboss.example.service.util.SalaryStrategy; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.registry.KernelBus; /** * A simple client that starts JBoss Microcontainer and then * uses the command line as a User Interface to pass requests * to the Human Resources service either directly or via the bus. * * @author Mark Newton */ public class Client { private boolean useBus = false; private URL url; private UserInterface userInterface; private HRManager manager; private EmbeddedBootstrap bootstrap; private KernelController controller; private KernelBus bus; private final static String HRSERVICE = "HRService"; private final static String EMPLOYEE = "org.jboss.example.service.Employee"; public static void main(String[] args) throws Exception { if ((args.length == 1 && !args[0].equals("bus")) || args.length > 1) { System.out.println("Usage: ./run.sh [bus]"); System.exit(1); } Client client = new Client(args.length == 1); client.setUserInterface(new ConsoleInput(client)); } public Client(final boolean useBus) throws Exception { this.useBus = useBus; ClassLoader cl = Thread.currentThread().getContextClassLoader(); url = cl.getResource("jboss-beans.xml"); // Start JBoss Microcontainer bootstrap = new EmbeddedBootstrap(); bootstrap.run(); controller = bootstrap.getKernel().getController(); bus = bootstrap.getKernel().getBus(); } public void setUserInterface(UserInterface userInterface) { this.userInterface = userInterface; } void deploy() { bootstrap.deploy(url); if (!useBus && manager == null) { ControllerContext context = controller.getInstalledContext(HRSERVICE); if (context != null) { manager = (HRManager) context.getTarget(); } } } void undeploy() { bootstrap.undeploy(url); } private Object invoke(String serviceName, String methodName, Object[] args, String[] types) { Object result = null; try { result = bus.invoke(serviceName, methodName, args, types); } catch (Throwable t) { t.printStackTrace(); } return result; } boolean addEmployee() throws ParseException, NumberFormatException, IllegalArgumentException, IOException { Employee newEmployee = userInterface.getEmployee(); Address address = userInterface.getAddress(); Date dateOfBirth = userInterface.getDateOfBirth(); newEmployee.setAddress(address); newEmployee.setDateOfBirth(dateOfBirth); if (useBus) return (Boolean) invoke(HRSERVICE, "addEmployee", new Object[] {newEmployee}, new String[] {EMPLOYEE}); else return manager.addEmployee(newEmployee); } @SuppressWarnings("unchecked") Set listEmployees() { if (useBus) return (Set) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {}); else return manager.getEmployees(); } void removeEmployee() throws IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); if (useBus) invoke(HRSERVICE, "removeEmployee", new Object[] {employee}, new String[] {EMPLOYEE}); else manager.removeEmployee(employee); } Integer getSalary() throws IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); if (useBus) return(Integer) invoke(HRSERVICE, "getSalary", new Object[] {employee}, new String[] {EMPLOYEE}); else return manager.getSalary(employee); } void setSalary() throws NumberFormatException, IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); Integer salary = userInterface.getSalary(); Employee actualEmployee; if (useBus) { actualEmployee = (Employee) invoke(HRSERVICE, "getEmployee", new Object[] {employee.getFirstName(), employee.getLastName()}, new String[] {"java.lang.String","java.lang.String"}); invoke(HRSERVICE, "setSalary", new Object[] {actualEmployee, salary}, new String[] {EMPLOYEE, "java.lang.Integer"}); } else { actualEmployee = manager.getEmployee(employee.getFirstName(), employee.getLastName()); manager.setSalary(actualEmployee, salary); } } boolean toggleHiringFreeze() { boolean hiringFreeze; if (useBus) { hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {}); invoke(HRSERVICE, "setHiringFreeze", new Object[] {!hiringFreeze}, new String[] {"boolean"}); } else { hiringFreeze = manager.isHiringFreeze(); manager.setHiringFreeze(!hiringFreeze); } return !hiringFreeze; } @SuppressWarnings("unchecked") String printStatus() { boolean hiringFreeze; int totalEmployees; SalaryStrategy salaryStrategy; if (useBus) { hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {}); Set employees = (Set) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {}); totalEmployees = employees.size(); salaryStrategy = (SalaryStrategy) invoke(HRSERVICE, "getSalaryStrategy", new Object[] {}, new String[] {}); } else { hiringFreeze = manager.isHiringFreeze(); totalEmployees = manager.getEmployees().size(); salaryStrategy = manager.getSalaryStrategy(); } StringBuffer buffer = new StringBuffer(); buffer.append("Total number of employees: " + totalEmployees); buffer.append("\nHiring Freeze: " + hiringFreeze); buffer.append("\nSalary Strategy: "); if (salaryStrategy == null) { buffer.append("None"); } else { buffer.append(salaryStrategy.toString()); } return buffer.toString(); } } ././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClient/src/main/java/org/jboss/example/client/ConsoleInput.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/commandLineClien0000644000175000017500000001105210715044266033436 0ustar twernertwernerpackage org.jboss.example.client; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * A simple Text User Interface (TUI) so a user can access * the Human Resources service from the command line. * * @author Mark Newton */ public class ConsoleInput implements UserInterface { private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public ConsoleInput(final Client client) { System.out.println(getMenu()); Thread eventThread = new Thread(new Runnable() { private boolean initialDeployment = false; private boolean quit = false; public void run() { while (!quit) { System.out.print(">"); try { String input = in.readLine(); if (input.length() != 1) { System.out.println("Please enter a valid option."); continue; } char option = input.charAt(0); if (initialDeployment == false && (option == 'u' || option == 'a' || option == 'l' || option == 'r' || option == 'g' || option == 's' || option == 't' || option == 'p')) { System.out.println("Service has not been deployed yet."); continue; } switch (option) { case 'd': client.deploy(); initialDeployment = true; break; case 'u': client.undeploy(); break; case 'a': System.out.println("Added employee: " + client.addEmployee()); break; case 'l': System.out.println("Employees: " + client.listEmployees()); break; case 'r': client.removeEmployee(); break; case 'g': System.out.println("Salary: " + client.getSalary()); break; case 's': client.setSalary(); break; case 't': System.out.println("Hiring Freeze: " + client.toggleHiringFreeze()); break; case 'm': System.out.println(getMenu()); break; case 'p': System.out.println(client.printStatus()); break; case 'q': quit = true; break; default: System.out.println("Invalid option."); break; } } catch (ParseException e) { System.out.println(e.getMessage()); } catch (NumberFormatException e) { System.out.println("Invalid integer " + e.getMessage()); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); } catch (IOException e) { e.printStackTrace(); } } } }); eventThread.start(); } private String getMenu() { StringBuffer buffer = new StringBuffer(); buffer.append("-----------------------------------\n"); buffer.append("Menu:\n"); buffer.append("\n"); buffer.append("d) Deploy Human Resources service\n"); buffer.append("u) Undeploy Human Resources service\n"); buffer.append("\n"); buffer.append("a) Add employee\n"); buffer.append("l) List employees\n"); buffer.append("r) Remove employee\n"); buffer.append("g) Get a salary\n"); buffer.append("s) Set a salary\n"); buffer.append("t) Toggle hiring freeze\n"); buffer.append("\n"); buffer.append("m) Display menu\n"); buffer.append("p) Print service status\n"); buffer.append("q) Quit"); return buffer.toString(); } public Employee getEmployee() throws IllegalArgumentException, IOException { System.out.println("Please enter the employee's name [firstName lastName]:"); String name = in.readLine(); String[] names = name.split("\\s"); if (names.length != 2) { throw new IllegalArgumentException("Employees must have a first and last name."); } return new Employee(names[0], names[1]); } public Address getAddress() throws NumberFormatException, IllegalArgumentException, IOException { System.out.println("Please enter the employee's address [number,street,city]:"); String address = in.readLine(); String[] lines = address.split(","); if (lines.length != 3) { throw new IllegalArgumentException("Addresses must contain a number, street and city."); } return new Address(Integer.parseInt(lines[0]), lines[1], lines[2]); } public Date getDateOfBirth() throws ParseException, IOException { System.out.println("Please enter the employee's date of birth [dd/MM/yyyy]:"); String date = in.readLine(); return new SimpleDateFormat("dd/MM/yyyy").parse(date); } public Integer getSalary() throws NumberFormatException, IOException { System.out.println("Please enter the employee's new salary [integer]: "); String salary = in.readLine(); return Integer.valueOf(salary); } } ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312215033513 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000217011203030634033514 0ustar twernertwerner org.jboss.microcontainer.examples gettingStarted 1.0.0 4.0.0 org.jboss.microcontainer.examples humanResourcesService jar 1.0.0 Human Resources Service A simple service created using a POJO. org.jboss.microcontainer jboss-kernel test org.jboss.test jboss-test test junit junit test ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000027200000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerLocationBasedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000126510712100662033523 0ustar twernertwerner false 2000 70000 ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000026700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/AgeBasedSalaryTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000071310712100662033520 0ustar twernertwerner 1000 80000 ././@LongLink0000000000000000000000000000027400000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/util/LocationBasedSalaryTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000072510712100662033523 0ustar twernertwerner 2000 90000 ././@LongLink0000000000000000000000000000025500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000061110712073565033530 0ustar twernertwerner true ././@LongLink0000000000000000000000000000026500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/org/jboss/example/service/HRManagerAgeBasedTestCase.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000124610712100662033522 0ustar twernertwerner false 1000 80000 ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/resources/log4j.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000047410715027371033534 0ustar twernertwernerlog4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=HRService %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000151410715044266033532 0ustar twernertwernerpackage org.jboss.example.service; import org.jboss.example.service.util.SalaryStrategyTestSuite; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Allow all HRManager tests to be run. * * @author Mark Newton */ public class HRManagerTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("HRManager Tests"); suite.addTestSuite(HRManagerTestCase.class); suite.addTestSuite(HRManagerAgeBasedTestCase.class); suite.addTestSuite(HRManagerLocationBasedTestCase.class); suite.addTest(SalaryStrategyTestSuite.suite()); return suite; } } ././@LongLink0000000000000000000000000000024500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTest.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000267610715044266033544 0ustar twernertwernerpackage org.jboss.example.service; import java.util.Calendar; import org.jboss.test.kernel.junit.MicrocontainerTest; /** * Setup a number of test employees for the various tests. * * @author Mark Newton */ public abstract class HRManagerTest extends MicrocontainerTest { protected Employee bob, rebecca, karen, joe; public HRManagerTest(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); Calendar now = Calendar.getInstance(); int year = now.get(Calendar.YEAR); int month = now.get(Calendar.MONTH); int day = now.get(Calendar.DAY_OF_MONTH); Calendar age = Calendar.getInstance(); bob = new Employee("Bob", "Smith"); age.set(year - 17, month, day); bob.setDateOfBirth(age.getTime()); bob.setAddress(new Address(5, "Waterloo Road", "London")); rebecca = new Employee("Rebecca", "Jones"); age.set(year - 25, month, day); rebecca.setDateOfBirth(age.getTime()); rebecca.setAddress(new Address(16, "Holt Street", "Belfast")); karen = new Employee("Karen", "McKenzie"); age.set(year - 44, month, day); karen.setDateOfBirth(age.getTime()); karen.setAddress(new Address(78, "Kelvinbridge Road", "Glasgow")); joe = new Employee("Joe", "Yates"); age.set(year - 62, month, day); joe.setDateOfBirth(age.getTime()); joe.setAddress(new Address(30, "Oxford Street", "Manchester")); } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000026400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/SalaryStrategyTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000145210715044266033533 0ustar twernertwernerpackage org.jboss.example.service.util; import org.jboss.example.service.util.AgeBasedSalaryTestCase; import org.jboss.example.service.util.LocationBasedSalaryTestCase; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Allow all SalaryStrategy tests to be run. * * @author Mark Newton */ public class SalaryStrategyTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("SalaryStrategy Tests"); suite.addTestSuite(AgeBasedSalaryTestCase.class); suite.addTestSuite(LocationBasedSalaryTestCase.class); return suite; } } ././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/LocationBasedSalaryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000306610715044266033536 0ustar twernertwernerpackage org.jboss.example.service.util; import org.jboss.example.service.HRManagerTest; import org.jboss.example.service.util.SalaryStrategy; /** * Check the behaviour of the LocationBasedSalaryStrategy. * * @author Mark Newton */ public class LocationBasedSalaryTestCase extends HRManagerTest { public LocationBasedSalaryTestCase(String name) { super(name); } public void testSalaryRanges() throws Exception { SalaryStrategy strategy = (SalaryStrategy) getBean("LocationBasedSalary"); assertNotNull(strategy); // Check the minimum and maximum salaries for all employees assertEquals(2000, strategy.getMinSalary()); assertEquals(90000, strategy.getMaxSalary()); // Check the minimum and maximum salaries that bob (London) can earn assertEquals((Integer) 50000, strategy.checkSalary(bob, 30000)); assertEquals((Integer) 90000, strategy.checkSalary(bob, 95000)); // Check the minimum and maximum salaries that rebecca (Belfast) can earn assertEquals((Integer) 20000, strategy.checkSalary(rebecca, 10000)); assertEquals((Integer) 90000, strategy.checkSalary(rebecca, 91000)); // Check the minimum and maximum salaries that karen (Glagow) can earn assertEquals((Integer) 30000, strategy.checkSalary(karen, 29000)); assertEquals((Integer) 90000, strategy.checkSalary(karen, 98000)); // Check the minimum and maximum salaries that joe (Manchester) can earn assertEquals((Integer) 40000, strategy.checkSalary(joe, 31000)); assertEquals((Integer) 90000, strategy.checkSalary(joe, 96000)); } }././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/util/AgeBasedSalaryTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000302710715044266033533 0ustar twernertwernerpackage org.jboss.example.service.util; import org.jboss.example.service.HRManagerTest; import org.jboss.example.service.util.SalaryStrategy; /** * Check the behaviour of the AgeBasedSalaryStrategy. * * @author Mark Newton */ public class AgeBasedSalaryTestCase extends HRManagerTest { public AgeBasedSalaryTestCase(String name) { super(name); } public void testSalaryRanges() throws Exception { SalaryStrategy strategy = (SalaryStrategy) getBean("AgeBasedSalary"); assertNotNull(strategy); // Check the minimum and maximum salaries for all employees assertEquals(1000, strategy.getMinSalary()); assertEquals(80000, strategy.getMaxSalary()); // Check the minimum and maximum salaries that bob (age 17) can earn assertEquals((Integer) 1000, strategy.checkSalary(bob, 500)); assertEquals((Integer) 80000, strategy.checkSalary(bob, 85000)); // Check the minimum and maximum salaries that rebecca (age 25) can earn assertEquals((Integer) 25000, strategy.checkSalary(rebecca, 20000)); assertEquals((Integer) 80000, strategy.checkSalary(rebecca, 90000)); // Check the minimum and maximum salaries that karen (age 44) can earn assertEquals((Integer) 50000, strategy.checkSalary(karen, 49000)); assertEquals((Integer) 80000, strategy.checkSalary(karen, 81000)); // Check the minimum and maximum salaries that joe (age 62) can earn assertEquals((Integer) 1000, strategy.checkSalary(joe, 900)); assertEquals((Integer) 80000, strategy.checkSalary(joe, 90000)); } }././@LongLink0000000000000000000000000000026600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerLocationBasedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000212210715044266033526 0ustar twernertwernerpackage org.jboss.example.service; import org.jboss.example.service.HRManager; /** * Check that the LocationBasedSalaryStrategy behaves as expected * when used by the HRManager. * * @author Mark Newton */ public class HRManagerLocationBasedTestCase extends HRManagerTest { public HRManagerLocationBasedTestCase(String name) { super(name); } public void testSalaryStrategy() throws Exception { HRManager manager = (HRManager) getBean("HRService"); assertNotNull(manager); assertEquals(false, manager.isHiringFreeze()); assertEquals(true, manager.addEmployee(rebecca)); assertEquals((Integer) 10000, manager.getSalary(rebecca)); // Test setting a salary using a location based salary strategy Employee employee = manager.getEmployee("Rebecca", "Jones"); assertNotNull(employee); manager.setSalary(employee, 15000); assertEquals((Integer) 20000, manager.getSalary(employee)); manager.setSalary(employee, 71000); assertEquals((Integer) 70000, manager.getSalary(employee)); } } ././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerAgeBasedTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000206010715044266033527 0ustar twernertwernerpackage org.jboss.example.service; import org.jboss.example.service.HRManager; /** * Check that the AgeBasedSalaryStrategy behaves as expected * when used by the HRManager. * * @author Mark Newton */ public class HRManagerAgeBasedTestCase extends HRManagerTest { public HRManagerAgeBasedTestCase(String name) { super(name); } public void testSalaryStrategy() throws Exception { HRManager manager = (HRManager) getBean("HRService"); assertNotNull(manager); assertEquals(false, manager.isHiringFreeze()); assertEquals(true, manager.addEmployee(bob)); assertEquals((Integer) 10000, manager.getSalary(bob)); // Test setting a salary using an age based salary strategy Employee employee = manager.getEmployee("Bob", "Smith"); assertNotNull(employee); manager.setSalary(employee, 600); assertEquals((Integer) 1000, manager.getSalary(employee)); manager.setSalary(employee, 90000); assertEquals((Integer) 80000, manager.getSalary(employee)); } } ././@LongLink0000000000000000000000000000025100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/test/java/org/jboss/example/service/HRManagerTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000245710715044266033541 0ustar twernertwernerpackage org.jboss.example.service; import org.jboss.example.service.HRManager; /** * Check that the HRManager behaves as expected when no * salary strategy is used. * * @author Mark Newton */ public class HRManagerTestCase extends HRManagerTest { public HRManagerTestCase(String name) { super(name); } public void testHiringFiring() throws Exception { HRManager manager = (HRManager) getBean("HRService"); assertNotNull(manager); // Test add and remove (with and without a hiring freeze) assertEquals(true, manager.isHiringFreeze()); assertEquals(false, manager.addEmployee(bob)); assertEquals(0, manager.getEmployees().size()); manager.setHiringFreeze(false); assertEquals(false, manager.isHiringFreeze()); assertEquals(true, manager.addEmployee(bob)); assertEquals(1, manager.getEmployees().size()); assertEquals((Integer) 10000, manager.getSalary(bob)); // Test setting a salary without using a salary strategy Employee employee = manager.getEmployee("Bob", "Smith"); assertNotNull(employee); manager.setSalary(employee, 600); assertEquals((Integer) 600, manager.getSalary(employee)); manager.removeEmployee(bob); assertEquals(0, manager.getEmployees().size()); } } ././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Address.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000141410715044266033531 0ustar twernertwernerpackage org.jboss.example.service; /** * A basic address. * * @author Mark Newton */ public class Address { private int number; private String street; private String city; public Address(int number, String street, String city) { this.number = number; this.street = street; this.city = city; } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } public String getStreet() { return street; } public void setStreet(String street) { this.street = street; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } @Override public String toString() { return number + " " + street + ", " + city; } } ././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000755000175000017500000000000011620312214033512 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/SalaryStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000061310715044266033531 0ustar twernertwernerpackage org.jboss.example.service.util; import org.jboss.example.service.Employee; /** * Apply some rules to calculate an employee's minimum and maximum salary. * * @author Mark Newton */ public interface SalaryStrategy { public int getMinSalary(); public int getMaxSalary(); public Integer checkSalary(Employee employee, Integer salary); } ././@LongLink0000000000000000000000000000027000000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/LocationBasedSalaryStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000331610716113550033526 0ustar twernertwernerpackage org.jboss.example.service.util; import org.jboss.example.service.Employee; /** * Check that the salary is relative to the employee's location. * * @author Mark Newton */ public class LocationBasedSalaryStrategy implements SalaryStrategy { private int minSalary = 5000; private int maxSalary = 100000; private static final int LONDON_MIN_SALARY = 50000; private static final int MANCHESTER_MIN_SALARY = 40000; private static final int GLASGOW_MIN_SALARY = 30000; private static final int BELFAST_MIN_SALARY = 20000; public Integer checkSalary(Employee employee, Integer salary) { String city = employee.getAddress().getCity(); // Set minimum salaries depending on the location of the employee if (city.equals("London") && salary < LONDON_MIN_SALARY) { salary = LONDON_MIN_SALARY; } else if (city.equals("Manchester") && salary < MANCHESTER_MIN_SALARY) { salary = MANCHESTER_MIN_SALARY; } else if (city.equals("Glasgow") && salary < GLASGOW_MIN_SALARY) { salary = GLASGOW_MIN_SALARY; } else if (city.equals("Belfast") & salary < BELFAST_MIN_SALARY) { salary = BELFAST_MIN_SALARY; } // Apply company-wide ranges if (salary < minSalary) { salary = minSalary; } else if (salary > maxSalary) { salary = maxSalary; } return salary; } public int getMinSalary() { return minSalary; } public void setMinSalary(int minSalary) { this.minSalary = minSalary; } public int getMaxSalary() { return maxSalary; } public void setMaxSalary(int maxSalary) { this.maxSalary = maxSalary; } @Override public String toString() { return "LocationBased - MinSalary: " + minSalary + " MaxSalary: " + maxSalary; } } ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/util/AgeBasedSalaryStrategy.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000402710716113550033526 0ustar twernertwernerpackage org.jboss.example.service.util; import java.util.Calendar; import org.jboss.example.service.Employee; /** * Check that the salary is relative to the employee's age in years. * * @author Mark Newton */ public class AgeBasedSalaryStrategy implements SalaryStrategy { private int minSalary = 5000; private int maxSalary = 100000; private static final int JUNIOR_MIN_SALARY = 25000; private static final int SENIOR_MIN_SALARY = 50000; public Integer checkSalary(Employee employee, Integer salary) { Calendar dateOfBirth = Calendar.getInstance(); dateOfBirth.setTime(employee.getDateOfBirth()); Calendar now = Calendar.getInstance(); if (now.before(dateOfBirth)) { throw new IllegalArgumentException("Employee is not born yet!"); } int age = now.get(Calendar.YEAR) - dateOfBirth.get(Calendar.YEAR); // Check if the employee has already had their birthday this year if (age > 0) { if (now.get(Calendar.MONTH) - dateOfBirth.get(Calendar.MONTH) > 0) { age--; } else if (now.get(Calendar.MONTH) - dateOfBirth.get(Calendar.MONTH) == 0) { if (now.get(Calendar.DAY_OF_MONTH) - dateOfBirth.get(Calendar.DAY_OF_MONTH) > 0 ) { age--; } } } // Set minimum salaries depending on the age of the employee if (age >= 21 && age < 30 && salary < JUNIOR_MIN_SALARY) { salary = JUNIOR_MIN_SALARY; } if (age >= 30 && age < 50 && salary < SENIOR_MIN_SALARY) { salary = SENIOR_MIN_SALARY; } // Apply company-wide ranges if (salary < minSalary) { salary = minSalary; } else if (salary > maxSalary) { salary = maxSalary; } return salary; } public int getMinSalary() { return minSalary; } public void setMinSalary(int minSalary) { this.minSalary = minSalary; } public int getMaxSalary() { return maxSalary; } public void setMaxSalary(int maxSalary) { this.maxSalary = maxSalary; } @Override public String toString() { return "AgeBased - MinSalary: " + minSalary + " MaxSalary: " + maxSalary; } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/HRManager.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000401010715044266033524 0ustar twernertwernerpackage org.jboss.example.service; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import org.jboss.example.service.util.SalaryStrategy; /** * An HRManager (Human Resource Manager) keeps track * of a set of employees and their associated salaries. * * @author Mark Newton */ public class HRManager { private static final Integer STANDARD_SALARY = 10000; private Map employees; private boolean hiringFreeze = false; private SalaryStrategy salaryStrategy = null; public HRManager() { employees = new ConcurrentHashMap(); } public boolean addEmployee(Employee employee) { if (hiringFreeze == false) { employees.put(employee, STANDARD_SALARY); } return (hiringFreeze == false); } public Set getEmployees() { return employees.keySet(); } public Employee getEmployee(String firstName, String lastName) { Set employees = getEmployees(); for (Employee employee : employees) { if (employee.getFirstName().equals(firstName) && employee.getLastName().equals(lastName)) { return employee; } } return null; } public void removeEmployee(Employee employee) { employees.remove(employee); } public Integer getSalary(Employee employee) { return employees.get(employee); } public void setSalary(Employee employee, Integer salary) { if (employee == null || !employees.containsKey(employee)) { return; } int adjustedSalary = salary; if (salaryStrategy != null) { adjustedSalary = salaryStrategy.checkSalary(employee, salary); } employees.put(employee, adjustedSalary); } public boolean isHiringFreeze() { return hiringFreeze; } public void setHiringFreeze(boolean hiringFreeze) { this.hiringFreeze = hiringFreeze; } public SalaryStrategy getSalaryStrategy() { return salaryStrategy; } public void setSalaryStrategy(SalaryStrategy salaryStrategy) { this.salaryStrategy = salaryStrategy; } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesService/src/main/java/org/jboss/example/service/Employee.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/humanResourcesSe0000644000175000017500000000420110716113550033520 0ustar twernertwernerpackage org.jboss.example.service; import java.text.SimpleDateFormat; import java.util.Date; /** * A basic employee. * * @author Mark Newton */ public class Employee { private String firstName; private String lastName; private Date dateOfBirth; private Address address; public Employee(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Date getDateOfBirth() { return dateOfBirth; } public void setDateOfBirth(Date dateOfBirth) { this.dateOfBirth = dateOfBirth; } public Address getAddress() { return address; } public void setAddress(Address address) { this.address = address; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; final Employee other = (Employee) obj; if (firstName == null) { if (other.firstName != null) return false; } else if (!firstName.equals(other.firstName)) return false; if (lastName == null) { if (other.lastName != null) return false; } else if (!lastName.equals(other.lastName)) return false; return true; } @Override public String toString() { SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); StringBuffer buffer = new StringBuffer(); buffer.append("(" + firstName + " " + lastName + ", "); buffer.append(address + " - "); if (dateOfBirth == null) { buffer.append("Birth date unknown" + ")"); } else { buffer.append(formatter.format(dateOfBirth) + ")"); } return buffer.toString(); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/0000755000175000017500000000000011620312215032545 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/pom.0000644000175000017500000000164310715036663033363 0ustar twernertwerner org.jboss.microcontainer.examples gettingStarted 1.0.0 4.0.0 org.jboss.microcontainer.examples auditAspect jar 1.0.0 Audit Aspect An auditing aspect that keeps a log of actions performed. org.jboss.aop jboss-aop junit junit ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000755000175000017500000000000011620312215033334 5ustar twernertwerner././@LongLink0000000000000000000000000000023000000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/main/java/org/jboss/example/aspect/AuditAspect.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/auditAspect/src/0000644000175000017500000000342410716127737033363 0ustar twernertwernerpackage org.jboss.example.aspect; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.text.SimpleDateFormat; import java.util.Calendar; import org.jboss.aop.joinpoint.ConstructorInvocation; import org.jboss.aop.joinpoint.MethodInvocation; /** * An auditing aspect to keep track of all invocations made to * methods on an object. A log file is used to store the audit * information. * * @author Mark Newton */ public class AuditAspect { private String logDir; private BufferedWriter out; public AuditAspect() { logDir = System.getProperty("user.dir") + "/log"; File directory = new File(logDir); if (!directory.exists()) { directory.mkdir(); } } public Object audit(ConstructorInvocation inv) throws Throwable { SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy-kkmmss"); Calendar now = Calendar.getInstance(); String filename = "auditLog-" + formatter.format(now.getTime()); File auditLog = new File(logDir + "/" + filename); auditLog.createNewFile(); out = new BufferedWriter(new FileWriter(auditLog)); return inv.invokeNext(); } public Object audit(MethodInvocation inv) throws Throwable { String name = inv.getMethod().getName(); Object[] args = inv.getArguments(); Object retVal = inv.invokeNext(); StringBuffer buffer = new StringBuffer(); for (int i=0; i < args.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(args[i].toString()); } if (out != null) { out.write("Method: " + name); if (buffer.length() > 0) { out.write(" Args: " + buffer.toString()); } if (retVal != null) { out.write(" Return: " + retVal.toString()); } out.write("\n"); out.flush(); } return retVal; } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/pom.xml0000644000175000017500000001072311203030634031616 0ustar twernertwerner 4.0.0 org.jboss.microcontainer.examples gettingStarted pom 1.0.0 humanResourcesService auditAspect commandLineClient org.jboss.microcontainer jboss-kernel ${mc.release} org.jboss.microcontainer jboss-deployers-client-spi ${mc.release} org.jboss.microcontainer jboss-deployers-client ${mc.release} org.jboss.microcontainer jboss-deployers-core-spi ${mc.release} org.jboss.microcontainer jboss-deployers-core ${mc.release} org.jboss.microcontainer jboss-deployers-impl ${mc.release} org.jboss.microcontainer jboss-deployers-spi ${mc.release} org.jboss.microcontainer jboss-deployers-structure-spi ${mc.release} org.jboss.microcontainer jboss-deployers-vfs-spi ${mc.release} org.jboss.microcontainer jboss-deployers-vfs ${mc.release} org.jboss.microcontainer jboss-managed ${mc.release} org.jboss.microcontainer jboss-metatype ${mc.release} org.jboss jboss-vfs ${vfs.release} org.jboss.aop jboss-aop ${aop.release} org.jboss.microcontainer jboss-aop-mc-int ${mc.release} runtime org.jboss.test jboss-test ${test.release} test junit junit 3.8.1 test maven-compiler-plugin 1.5 1.5 true true true true 2.0.6.GA 2.1.2.GA 2.1.1.GA 1.1.4.GA libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/0000755000175000017500000000000011620312216033113 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/po0000644000175000017500000000755210742673767033516 0ustar twernertwerner org.jboss.microcontainer.examples gettingStarted 1.0.0 4.0.0 org.jboss.microcontainer.examples advDeployment jar 1.0.0 Advanced Deployment A simple command line client that uses the aspectized deployers. org.jboss.microcontainer jboss-kernel org.jboss.microcontainer jboss-deployers-client-spi org.jboss.microcontainer jboss-deployers-client org.jboss.microcontainer jboss-deployers-core-spi org.jboss.microcontainer jboss-deployers-core org.jboss.microcontainer jboss-deployers-impl org.jboss.microcontainer jboss-deployers-spi org.jboss.microcontainer jboss-deployers-structure-spi org.jboss.microcontainer jboss-deployers-vfs-spi org.jboss.microcontainer jboss-deployers-vfs org.jboss.microcontainer jboss-managed org.jboss.microcontainer jboss-metatype org.jboss jboss-vfs org.jboss.microcontainer.examples humanResourcesService 1.0.0 junit junit org.apache.maven.plugins maven-jar-plugin false maven-assembly-plugin src/main/assembly/xml.xml src/main/assembly/jar.xml src/main/assembly/properties.xml src/main/assembly/structure.xml src/main/assembly/classloader.xml src/main/assembly/addStage.xml ${pom.artifactId} package directory-inline ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000020500000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/resources/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000051410740715110033464 0ustar twernertwerner ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312215033457 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312215033457 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312215033457 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312215033457 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312215033457 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/MockUserInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000177610740715110033477 0ustar twernertwernerpackage org.jboss.example.client; import java.io.IOException; import java.text.ParseException; import java.util.Calendar; import java.util.Date; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * A mock user interface to simulate values being passed in by a user. * * @author Mark Newton */ public class MockUserInterface implements UserInterface { public Address getAddress() throws IOException { return new Address(5, "Oxford St", "London"); } public Date getDateOfBirth() throws ParseException, IOException { Calendar age = Calendar.getInstance(); int year = age.get(Calendar.YEAR); int month = age.get(Calendar.MONTH); int day = age.get(Calendar.DAY_OF_MONTH); age.set(year - 43, month, day); return age.getTime(); } public Employee getEmployee() throws IOException { return new Employee("David", "Hasselhof"); } public Integer getSalary() throws IOException { return new Integer("50000"); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestSuite.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000106510740715110033466 0ustar twernertwernerpackage org.jboss.example.client; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * Allow all Client tests to be run. * * @author Mark Newton */ public class ClientTestSuite extends TestSuite { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("Client Tests"); suite.addTestSuite(ClientTestCase.class); return suite; } } ././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/test/java/org/jboss/example/client/ClientTestCase.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000262610740730253033477 0ustar twernertwernerpackage org.jboss.example.client; import junit.framework.TestCase; /** * Use a mock User Interface to pass values into the client * and check that the Human Resources service is called correctly. * * @author Mark Newton */ public class ClientTestCase extends TestCase { public ClientTestCase(String name) { super(name); } public void testClientWithoutBus() throws Exception { // Client client = new Client(false); // assertNotNull(client); // runTests(client); } public void testClientWithBus() throws Exception { // Client client = new Client(true); // assertNotNull(client); // runTests(client); } private void runTests(Client client) throws Exception { // client.setUserInterface(new MockUserInterface()); // // client.deploy(); // // assertEquals(true, client.toggleHiringFreeze()); // assertEquals(false, client.addEmployee()); // assertEquals(0, client.listEmployees().size()); // // assertEquals(false, client.toggleHiringFreeze()); // assertEquals(true, client.addEmployee()); // assertEquals(1, client.listEmployees().size()); // assertEquals((Integer) 10000, client.getSalary()); // // client.setSalary(); // assertEquals((Integer) 50000, client.getSalary()); // // client.removeEmployee(); // assertEquals(0, client.listEmployees().size()); // // client.undeploy(); } } ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-xml.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000522310742673767033515 0ustar twernertwerner -service.xml -beans.xml -ds.xml -aop.xml beans beans beans ././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-classloader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000755210742673767033524 0ustar twernertwerner .zip .ear .jar .rar .war .sar .har .aop .deployer .beans .class beans beans beans beans ././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/run.shlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000015310742663626033506 0ustar twernertwerner#!/bin/sh java -Djava.ext.dirs=`pwd`/lib -cp .:advDeployment-1.0.0.jar org.jboss.example.client.Client $1 ././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-properties.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000523710742673767033522 0ustar twernertwerner -service.xml -beans.xml -ds.xml -aop.xml beans beans beans ././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-jar.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000731710742673767033523 0ustar twernertwerner .zip .ear .jar .rar .war .sar .har .aop .deployer .beans .class beans beans beans ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-addStage.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000543310742673767033520 0ustar twernertwerner -service.xml -beans.xml -ds.xml -aop.xml beans beans beans beans ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/jboss-structure.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000030310742663626033500 0ustar twernertwerner ././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000163310740730253033474 0ustar twernertwerner ././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/hrService-beans.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000066610741175534033507 0ustar twernertwernerHRService.(class)=org.jboss.example.service.HRManager #HRService.hiringFreeze=true #HRService.salaryStrategy=(inject).AgeBasedSalary #AgeBasedSalary.(class)=org.jboss.example.service.util.AgeBasedSalaryStrategy #AgeBasedSalary.minSalary=1000 #AgeBasedSalary.maxSalary=80000 #LocationBasedSalary.(class)=org.jboss.example.service.util.LocationBasedSalaryStrategy #LocationBasedSalary.minSalary=2000 #LocationBasedSalary.maxSalary=90000 ././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/config/deployer-beans-structure.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000430710742673767033517 0ustar twernertwerner beans beans beans ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000020400000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/classloader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000163010742673767033513 0ustar twernertwerner classloader zip false src/main/config/deployer-beans-classloader.xml deployer-beans.xml src/main/config/hrService-beans.xml otherLib/humanResourcesService-1.0.0.jar/META-INF/jboss-beans.xml /otherLib true runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/addStage.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000146110742673767033515 0ustar twernertwerner addStage zip false src/main/config/deployer-beans-addStage.xml deployer-beans.xml src/main/config/hrService-beans.xml /lib false runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/jar.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000157610742673767033524 0ustar twernertwerner jar zip false src/main/config/deployer-beans-jar.xml deployer-beans.xml src/main/config/hrService-beans.xml lib/humanResourcesService-1.0.0.jar/META-INF/jboss-beans.xml /lib true runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/common.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000375210742673767033522 0ustar twernertwerner target *.jar src/main/config/run.sh 0744 /lib false runtime org.jboss.microcontainer:jboss-kernel org.jboss.microcontainer:jboss-dependency org.jboss.microcontainer:jboss-container org.jboss.microcontainer:jboss-deployers-client org.jboss.microcontainer:jboss-deployers-client-spi org.jboss.microcontainer:jboss-deployers-core org.jboss.microcontainer:jboss-deployers-core-spi org.jboss.microcontainer:jboss-deployers-impl org.jboss.microcontainer:jboss-deployers-spi org.jboss.microcontainer:jboss-deployers-structure-spi org.jboss.microcontainer:jboss-deployers-vfs org.jboss.microcontainer:jboss-deployers-vfs-spi org.jboss.microcontainer:jboss-managed org.jboss.microcontainer:jboss-metatype org.jboss:jboss-common-core jboss:jboss-common-logging-spi jboss:jboss-common-logging-log4j log4j:log4j org.jboss:jbossxb apache-xerces:xercesImpl org.jboss:jboss-vfs ././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/properties.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000147410742673767033521 0ustar twernertwerner properties zip false src/main/config/deployer-beans-properties.xml deployer-beans.xml src/main/config/hrService-beans.properties /lib false runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/structure.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000207110742673767033513 0ustar twernertwerner structure zip false src/main/config/deployer-beans-structure.xml deployer-beans.xml src/main/config/hrService-beans.xml lib/humanResourcesService-1.0.0.jar/OTHER-DIR/jboss-beans.xml src/main/config/jboss-structure.xml lib/humanResourcesService-1.0.0.jar/META-INF/jboss-structure.xml /lib true runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/assembly/xml.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000144710742673767033521 0ustar twernertwerner xml zip false src/main/config/deployer-beans-xml.xml deployer-beans.xml src/main/config/hrService-beans.xml /lib false runtime org.jboss.microcontainer.examples:humanResourcesService src/main/assembly/common.xml ././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000020600000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/resources/log4j.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000047610741161116033475 0ustar twernertwernerlog4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=AdvDeployment %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000021200000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/EmbeddedBootstrap.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000300610740730253033470 0ustar twernertwernerpackage org.jboss.example.client; import java.net.URL; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer; /** * Add a BasicXMLDeployer to the BasicBootstrap so that we can parse * XML descriptors for the beans (*-beans.xml). * * @author Mark Newton */ public class EmbeddedBootstrap extends BasicBootstrap { protected BasicXMLDeployer deployer; public EmbeddedBootstrap() throws Exception { super(); } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BasicXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); } public void deploy(URL url) { try { // Workaround the fact that the BasicXMLDeployer does not handle redeployment correctly if (deployer.getDeploymentNames().contains(url.toString())) { System.out.println("Aspectized deployers are already deployed."); return; } deployer.deploy(url); } catch (Throwable t) { log.warn("Error during deployment: " + url, t); } } public void undeploy(URL url) { if (!deployer.getDeploymentNames().contains(url.toString())) { System.out.println("Aspectized deployers are already undeployed."); return; } try { deployer.undeploy(url); } catch (Throwable t) { log.warn("Error during undeployment: " + url, t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); deployer.shutdown(); } } }././@LongLink0000000000000000000000000000023400000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/UserInterface.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000117510740715110033470 0ustar twernertwernerpackage org.jboss.example.client; import java.io.IOException; import java.text.ParseException; import java.util.Date; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * Allow different implementations of a user interface to be used. * i.e. command line, Swing or even a mock for testing purposes. * * @author Mark Newton */ public interface UserInterface { Employee getEmployee() throws IOException; Address getAddress() throws IOException; Date getDateOfBirth() throws ParseException, IOException; Integer getSalary() throws IOException; } ././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/Client.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000002137310742663626033512 0ustar twernertwernerpackage org.jboss.example.client; import java.io.File; import java.io.IOException; import java.net.URL; import java.text.ParseException; import java.util.Date; import java.util.Set; import org.jboss.dependency.spi.ControllerContext; import org.jboss.deployers.client.spi.Deployment; import org.jboss.deployers.plugins.main.MainDeployerImpl; import org.jboss.deployers.spi.DeploymentException; import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; import org.jboss.example.service.HRManager; import org.jboss.example.service.util.SalaryStrategy; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.registry.KernelBus; import org.jboss.virtual.VFS; import org.jboss.virtual.VirtualFile; /** * A simple client that starts JBoss Microcontainer and then * uses the command line as a User Interface to pass requests * to the Human Resources service either directly or via the bus. * * @author Mark Newton */ public class Client { private boolean useBus = false; private URL deployerBeansUrl, hrServiceBeansUrl; private UserInterface userInterface; private HRManager manager; private MainDeployerImpl mainDeployer; private Deployment deployment; private EmbeddedBootstrap bootstrap; private KernelController controller; private KernelBus bus; private final static String MAIN_DEPLOYER = "MainDeployer"; private final static String DEPLOYMENT = "org.jboss.deployers.client.spi.Deployment"; private final static String HRSERVICE = "HRService"; private final static String EMPLOYEE = "org.jboss.example.service.Employee"; public static void main(String[] args) throws Exception { if ((args.length == 1 && !args[0].equals("bus")) || args.length > 1) { System.out.println("Usage: ./run.sh [bus]"); System.exit(1); } Client client = new Client(args.length == 1); client.setUserInterface(new ConsoleInput(client)); } public Client(final boolean useBus) throws Exception { this.useBus = useBus; ClassLoader cl = Thread.currentThread().getContextClassLoader(); deployerBeansUrl = cl.getResource("deployer-beans.xml"); hrServiceBeansUrl = cl.getResource("hrService-beans.xml"); if (hrServiceBeansUrl == null) { hrServiceBeansUrl = cl.getResource("hrService-beans.properties"); } if (hrServiceBeansUrl == null) { hrServiceBeansUrl = cl.getResource("lib/humanResourcesService-1.0.0.jar"); } if (hrServiceBeansUrl == null) { hrServiceBeansUrl = cl.getResource("otherLib/humanResourcesService-1.0.0.jar"); } // Create VFSDeployment to use with aspectized deployers File hrServiceBeans = new File(hrServiceBeansUrl.getFile()); VirtualFile root = VFS.getRoot(hrServiceBeans.toURI()); VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance(); deployment = deploymentFactory.createVFSDeployment(root); // Start JBoss Microcontainer bootstrap = new EmbeddedBootstrap(); bootstrap.run(); controller = bootstrap.getKernel().getController(); bus = bootstrap.getKernel().getBus(); } public void setUserInterface(UserInterface userInterface) { this.userInterface = userInterface; } void deploy() { bootstrap.deploy(deployerBeansUrl); if (!useBus && mainDeployer == null) { ControllerContext context = controller.getInstalledContext(MAIN_DEPLOYER); if (context != null) { mainDeployer = (MainDeployerImpl) context.getTarget(); } } } void undeploy() { bootstrap.undeploy(deployerBeansUrl); } void deployService() throws DeploymentException { if (useBus) { if (invoke(MAIN_DEPLOYER, "getDeployment", new Object[] {deployment.getName()}, new String[] {"java.lang.String"}) != null) { System.out.println("Service is already deployed."); return; } invoke(MAIN_DEPLOYER, "addDeployment", new Object[] {deployment}, new String[] {DEPLOYMENT}); invoke(MAIN_DEPLOYER, "process", new Object[] {}, new String[] {}); } else { if (mainDeployer.getDeployment(deployment.getName()) != null) { System.out.println("Service is already deployed."); return; } mainDeployer.addDeployment(deployment); mainDeployer.process(); if (manager == null) { ControllerContext hrServiceCtx = controller.getInstalledContext(HRSERVICE); if (hrServiceCtx != null) { manager = (HRManager) hrServiceCtx.getTarget(); } } } } void undeployService() throws DeploymentException { if (useBus) { if (invoke(MAIN_DEPLOYER, "getDeployment", new Object[] {deployment.getName()}, new String[] {"java.lang.String"}) == null) { System.out.println("Service is already undeployed."); return; } invoke(MAIN_DEPLOYER, "removeDeployment", new Object[] {deployment}, new String[] {DEPLOYMENT}); invoke(MAIN_DEPLOYER, "process", new Object[] {}, new String[] {}); } else { if (mainDeployer.getDeployment(deployment.getName()) == null) { System.out.println("Service is already undeployed."); return; } mainDeployer.removeDeployment(deployment); mainDeployer.process(); } } private Object invoke(String serviceName, String methodName, Object[] args, String[] types) { Object result = null; try { result = bus.invoke(serviceName, methodName, args, types); } catch (Throwable t) { t.printStackTrace(); } return result; } boolean addEmployee() throws ParseException, NumberFormatException, IllegalArgumentException, IOException { Employee newEmployee = userInterface.getEmployee(); Address address = userInterface.getAddress(); Date dateOfBirth = userInterface.getDateOfBirth(); newEmployee.setAddress(address); newEmployee.setDateOfBirth(dateOfBirth); if (useBus) return (Boolean) invoke(HRSERVICE, "addEmployee", new Object[] {newEmployee}, new String[] {EMPLOYEE}); else return manager.addEmployee(newEmployee); } @SuppressWarnings("unchecked") Set listEmployees() { if (useBus) return (Set) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {}); else return manager.getEmployees(); } void removeEmployee() throws IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); if (useBus) invoke(HRSERVICE, "removeEmployee", new Object[] {employee}, new String[] {EMPLOYEE}); else manager.removeEmployee(employee); } Integer getSalary() throws IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); if (useBus) return(Integer) invoke(HRSERVICE, "getSalary", new Object[] {employee}, new String[] {EMPLOYEE}); else return manager.getSalary(employee); } void setSalary() throws NumberFormatException, IllegalArgumentException, IOException { Employee employee = userInterface.getEmployee(); Integer salary = userInterface.getSalary(); Employee actualEmployee; if (useBus) { actualEmployee = (Employee) invoke(HRSERVICE, "getEmployee", new Object[] {employee.getFirstName(), employee.getLastName()}, new String[] {"java.lang.String","java.lang.String"}); invoke(HRSERVICE, "setSalary", new Object[] {actualEmployee, salary}, new String[] {EMPLOYEE, "java.lang.Integer"}); } else { actualEmployee = manager.getEmployee(employee.getFirstName(), employee.getLastName()); manager.setSalary(actualEmployee, salary); } } boolean toggleHiringFreeze() { boolean hiringFreeze; if (useBus) { hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {}); invoke(HRSERVICE, "setHiringFreeze", new Object[] {!hiringFreeze}, new String[] {"boolean"}); } else { hiringFreeze = manager.isHiringFreeze(); manager.setHiringFreeze(!hiringFreeze); } return !hiringFreeze; } @SuppressWarnings("unchecked") String printStatus() { boolean hiringFreeze; int totalEmployees; SalaryStrategy salaryStrategy; if (useBus) { hiringFreeze = (Boolean) invoke(HRSERVICE, "isHiringFreeze", new Object[] {}, new String[] {}); Set employees = (Set) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {}); totalEmployees = employees.size(); salaryStrategy = (SalaryStrategy) invoke(HRSERVICE, "getSalaryStrategy", new Object[] {}, new String[] {}); } else { hiringFreeze = manager.isHiringFreeze(); totalEmployees = manager.getEmployees().size(); salaryStrategy = manager.getSalaryStrategy(); } StringBuffer buffer = new StringBuffer(); buffer.append("Total number of employees: " + totalEmployees); buffer.append("\nHiring Freeze: " + hiringFreeze); buffer.append("\nSalary Strategy: "); if (salaryStrategy == null) { buffer.append("None"); } else { buffer.append(salaryStrategy.toString()); } return buffer.toString(); } } ././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/client/ConsoleInput.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000001252610741161116033474 0ustar twernertwernerpackage org.jboss.example.client; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URISyntaxException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import org.jboss.deployers.spi.DeploymentException; import org.jboss.example.service.Address; import org.jboss.example.service.Employee; /** * A simple Text User Interface (TUI) so a user can access * the Human Resources service from the command line. * * @author Mark Newton */ public class ConsoleInput implements UserInterface { private static BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); public ConsoleInput(final Client client) { System.out.println(getMenu()); Thread eventThread = new Thread(new Runnable() { private boolean deployersDeployed = false, hrServiceDeployed = false; private boolean quit = false; public void run() { while (!quit) { System.out.print(">"); try { String input = in.readLine(); if (input.length() != 1) { System.out.println("Please enter a valid option."); continue; } char option = input.charAt(0); if (deployersDeployed == false && (option == 'D' || option == 'U' ||option == 'u' || option == 'a' || option == 'l' || option == 'r' || option == 'g' || option == 's' || option == 't' || option == 'p')) { System.out.println("Aspectized deployers have not been deployed yet."); continue; } else if (hrServiceDeployed == false && (option == 'U' || option == 'a' || option == 'l' || option == 'r' || option == 'g' || option == 's' || option == 't' || option == 'p')) { System.out.println("Service has not been deployed yet."); continue; } switch (option) { case 'd': client.deploy(); deployersDeployed = true; break; case 'D': client.deployService(); hrServiceDeployed = true; break; case 'U': client.undeployService(); break; case 'u': client.undeploy(); break; case 'a': System.out.println("Added employee: " + client.addEmployee()); break; case 'l': System.out.println("Employees: " + client.listEmployees()); break; case 'r': client.removeEmployee(); break; case 'g': System.out.println("Salary: " + client.getSalary()); break; case 's': client.setSalary(); break; case 't': System.out.println("Hiring Freeze: " + client.toggleHiringFreeze()); break; case 'm': System.out.println(getMenu()); break; case 'p': System.out.println(client.printStatus()); break; case 'q': quit = true; break; default: System.out.println("Invalid option."); break; } } catch (ParseException e) { System.out.println(e.getMessage()); } catch (NumberFormatException e) { System.out.println("Invalid integer " + e.getMessage()); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); } catch (IOException e) { e.printStackTrace(); } catch (DeploymentException e) { System.out.println("Error during deployment/undeployment: " + e.getMessage()); } } } }); eventThread.start(); } private String getMenu() { StringBuffer buffer = new StringBuffer(); buffer.append("-----------------------------------\n"); buffer.append("Menu:\n"); buffer.append("\n"); buffer.append("d) Deploy Aspectized Deployers\n"); buffer.append("D) Deploy Human Resources service\n"); buffer.append("U) Undeploy Human Resources service\n"); buffer.append("u) Undeploy Aspectized Deployers\n"); buffer.append("\n"); buffer.append("a) Add employee\n"); buffer.append("l) List employees\n"); buffer.append("r) Remove employee\n"); buffer.append("g) Get a salary\n"); buffer.append("s) Set a salary\n"); buffer.append("t) Toggle hiring freeze\n"); buffer.append("\n"); buffer.append("m) Display menu\n"); buffer.append("p) Print service status\n"); buffer.append("q) Quit"); return buffer.toString(); } public Employee getEmployee() throws IllegalArgumentException, IOException { System.out.println("Please enter the employee's name [firstName lastName]:"); String name = in.readLine(); String[] names = name.split("\\s"); if (names.length != 2) { throw new IllegalArgumentException("Employees must have a first and last name."); } return new Employee(names[0], names[1]); } public Address getAddress() throws NumberFormatException, IllegalArgumentException, IOException { System.out.println("Please enter the employee's address [number,street,city]:"); String address = in.readLine(); String[] lines = address.split(","); if (lines.length != 3) { throw new IllegalArgumentException("Addresses must contain a number, street and city."); } return new Address(Integer.parseInt(lines[0]), lines[1], lines[2]); } public Date getDateOfBirth() throws ParseException, IOException { System.out.println("Please enter the employee's date of birth [dd/MM/yyyy]:"); String date = in.readLine(); return new SimpleDateFormat("dd/MM/yyyy").parse(date); } public Integer getSalary() throws NumberFormatException, IOException { System.out.println("Please enter the employee's new salary [integer]: "); String salary = in.readLine(); return Integer.valueOf(salary); } } ././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000755000175000017500000000000011620312216033460 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000145310742667272033510 0ustar twernertwernerpackage org.jboss.example.deployment; import org.jboss.deployers.spi.DeploymentException; import org.jboss.deployers.spi.deployer.DeploymentStage; import org.jboss.deployers.spi.deployer.DeploymentStages; import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer; import org.jboss.deployers.structure.spi.DeploymentUnit; public class MyDeployer extends AbstractDeployer { public MyDeployer() { // We want this deployer to be called after the installed stage setStage(new DeploymentStage("MyDeploymentStage", DeploymentStages.INSTALLED)); } public void deploy(DeploymentUnit unit) throws DeploymentException { System.out.println("Calling deploy() within MyDeployer..."); } public void undeploy(DeploymentUnit unit) { System.out.println("Calling undeploy() within MyDeployer..."); } } ././@LongLink0000000000000000000000000000025000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/src/main/java/org/jboss/example/deployment/MyClassLoaderDeployer.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/gettingStarted/advDeployment/sr0000644000175000017500000000200110742663626033475 0ustar twernertwernerpackage org.jboss.example.deployment; import java.net.URL; import java.net.URLClassLoader; import org.jboss.deployers.spi.deployer.helpers.AbstractTopLevelClassLoaderDeployer; import org.jboss.deployers.structure.spi.DeploymentContext; import org.jboss.deployers.vfs.plugins.client.AbstractVFSDeployment; import org.jboss.virtual.VirtualFile; public class MyClassLoaderDeployer extends AbstractTopLevelClassLoaderDeployer { @Override protected ClassLoader createTopLevelClassLoader(DeploymentContext context) throws Exception { ClassLoader current = Thread.currentThread().getContextClassLoader(); AbstractVFSDeployment deployment = (AbstractVFSDeployment) context.getDeployment(); VirtualFile root = deployment.getRoot(); URL url = root.getHandler().toURL(); URLClassLoader cl = new URLClassLoader(new URL[] {url}, current); context.setClassLoader(cl); // Hack to get the PreInstallAction working Thread.currentThread().setContextClassLoader(cl); return context.getClassLoader(); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/extending/0000755000175000017500000000000011620312214027273 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/extending/osgi/0000755000175000017500000000000011620312214030234 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/0000755000175000017500000000000011620312220030455 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/0000755000175000017500000000000011620312220032120 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/pom.xml0000644000175000017500000000156110716044320033450 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples locator jar 1.0.0 Locator org.jboss.microcontainer jboss-kernel compile .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/0000755000175000017500000000000011620312220032707 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000342110715026425033415 0ustar twernertwerner Simple1 Simple2 Simple1 Simple2 ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000755000175000017500000000000011620312220033376 5ustar twernertwerner././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/HashtableLocator.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000327510715026425033424 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.locator; import java.util.Hashtable; /** * A locator that uses a hashtable. * * @author Adrian Brock * @version $Revision: 40465 $ */ public class HashtableLocator implements Locator { private static final HashtableLocator singleton = new HashtableLocator(); private Hashtable locations; public static HashtableLocator getLocator() { return singleton; } private HashtableLocator () { } public void setLocations(Hashtable locations) { this.locations = locations; } public Object locate(String name) { if (locations == null) return null; return locations.get(name); } } ././@LongLink0000000000000000000000000000024100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/Locator.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000227710715026425033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.locator; /** * Locator. * * @author Adrian Brock * @version $Revision: 40465 $ */ public interface Locator { Object locate(String name); } ././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000253610715026425033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.locator; /** * A SimpleBean. * * @author Adrian Brock * @version $Revision: 40465 $ */ public class SimpleBean { private String text; public SimpleBean() { } public String getText() { return text; } public void setText(String text) { this.text = text; } } ././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/ControllerLocator.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000333010715026425033414 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.locator; import org.jboss.dependency.spi.ControllerContext; import org.jboss.kernel.spi.dependency.KernelController; /** * A locator that uses the kernel controller. * * @author Adrian Brock * @version $Revision: 40465 $ */ public class ControllerLocator implements Locator { private KernelController controller; public void setController(KernelController controller) { this.controller = controller; } public Object locate(String name) { if (controller == null) return null; ControllerContext context = controller.getInstalledContext(name); if (context == null) return null; return context.getTarget(); } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/main/java/org/jboss/example/microcontainer/locator/User.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/locator/src/mai0000644000175000017500000000373210715026425033422 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.locator; /** * User of a locator * * @author Adrian Brock * @version $Revision: 40465 $ */ public class User { private Locator locator; public Locator getLocator() { return locator; } public void setLocator(Locator locator) { this.locator = locator; } public void create() { if (locator == null) throw new IllegalStateException("Locator is not set"); System.out.println("============================================================="); System.out.println("Using locator: " + locator); System.out.println(); SimpleBean bean = (SimpleBean) locator.locate("Simple1"); System.out.println("SimpleBean1 text=" + bean.getText()); bean = (SimpleBean) locator.locate("Simple2"); System.out.println("SimpleBean2 text=" + bean.getText()); System.out.println("============================================================="); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/0000755000175000017500000000000011620312220031757 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/pom.xml0000644000175000017500000000155510716044320033312 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples spring jar 1.0.0 Spring org.jboss.microcontainer jboss-spring-int runtime .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/0000755000175000017500000000000011620312220032546 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000644000175000017500000000252010715026425033431 0ustar twernertwerner SpringBean 1 3.14159 onel twol threel ones twos ones test_key myvalue ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000755000175000017500000000000011620312220033413 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/MCBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000644000175000017500000000242510715026425033435 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.spring; /** * @author Ales Justin */ public class MCBean { public void setSimpleBean(SimpleBean simpleBean) { System.out.println("Setting simple bean: " + simpleBean); } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main/java/org/jboss/example/microcontainer/spring/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/spring/src/main0000644000175000017500000000535710715026425033444 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.spring; import java.util.List; import java.util.Map; import java.util.Set; /** * @author Ales Justin */ public class SimpleBean { private int x; private double y; private String s; private List mylist; private Set myset; private Map mymap; private MCBean refBean; public SimpleBean() { } public SimpleBean(int x, double y, String s) { this.x = x; this.y = y; this.s = s; } public int getX() { return x; } public double getY() { return y; } public String getS() { return s; } public List getMylist() { return mylist; } public void setMylist(List mylist) { this.mylist = mylist; } public Set getMyset() { return myset; } public void setMyset(Set myset) { this.myset = myset; } public Map getMymap() { return mymap; } public void setMymap(Map mymap) { this.mymap = mymap; } public MCBean getRefBean() { return refBean; } public void setRefBean(MCBean refBean) { System.out.println("Setting ref bean: " + refBean); refBean.setSimpleBean(this); this.refBean = refBean; } public String toString() { StringBuilder builder = new StringBuilder(); builder.append(x).append(","); builder.append(y).append(","); builder.append(s).append(","); builder.append(mylist).append(","); builder.append(myset).append(","); builder.append(mymap); builder.append(refBean); return builder.toString(); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/0000755000175000017500000000000011620312220032751 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/pom0000644000175000017500000000126110716044320033477 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples classloader jar 1.0.0 Classloader .. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src/main/java/org/jboss/example/microcontainer/classloader/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/classloader/src0000755000175000017500000000000011620312220033461 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/0000755000175000017500000000000011620312220032011 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/pom.xml0000644000175000017500000000124710716044320033342 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples supply jar 1.0.0 Supply .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/0000755000175000017500000000000011620312217032606 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312220033445 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312220033445 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312220033445 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000644000175000017500000000107510715026425033467 0ustar twernertwerner pojo pojo ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312217033453 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312217033453 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312217033453 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312217033453 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312217033453 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000755000175000017500000000000011620312220033445 5ustar twernertwerner././@LongLink0000000000000000000000000000024400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/StaticBinder.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000644000175000017500000000302110715026425033460 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.supply; /** * @author Ales Justin */ public class StaticBinder implements Binder { private static Binder instance; private StaticBinder() { System.out.println("Creating StaticBinder"); } public static Binder getInstance() { if (instance == null) instance = new StaticBinder(); return instance; } public Object getBindedObject() { return "[BindedObject]"; } } ././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/Binder.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000644000175000017500000000226510715026425033471 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.supply; /** * @author Ales Justin */ public interface Binder { Object getBindedObject(); } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main/java/org/jboss/example/microcontainer/supply/PojoLookup.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/supply/src/main0000644000175000017500000000246010715026425033466 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.supply; /** * @author Ales Justin */ public class PojoLookup { public void start() { Binder binder = StaticBinder.getInstance(); System.out.println("Got it, " + binder.getBindedObject()); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/0000755000175000017500000000000011620312220032773 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/pom0000644000175000017500000000126110716044320033521 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples collections jar 1.0.0 Collections .. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000644000175000017500000000652210715026425033527 0ustar twernertwerner Collection Value of type elementClass 4 List Value of type elementClass 4 LinkedList Value of type elementClass 4 Set Value of type elementClass 4 Map Key1 of type keyClass Value1 of type valueClass Key2 of type keyClass 4 4 Value of type valueClass Hashtable Key1 of type keyClass Value1 of type valueClass Key2 of type keyClass 4 4 Value of type valueClass ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000755000175000017500000000000011620312220033503 5ustar twernertwerner././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src/main/java/org/jboss/example/microcontainer/collections/ObjectPrinter.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/collections/src0000644000175000017500000000475010715026425033530 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.collections; import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; /** * A ObjectPrinter. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ObjectPrinter { String context; public ObjectPrinter(String context) { this.context = context; } public void setPrint(Object print) { if (print != null) { System.out.println(context + " type=" + print.getClass().getName()); if (print instanceof Collection) { for (Iterator i = ((Collection) print).iterator(); i.hasNext();) { Object object = i.next(); System.out.println("value='" + object + "' type=" + object.getClass().getName()); } } else if (print instanceof Map) { for (Iterator i = ((Map) print).entrySet().iterator(); i.hasNext();) { Entry entry = (Entry) i.next(); Object key = entry.getKey(); Object value = entry.getValue(); System.out.println("key='" + key + "' type=" + key.getClass().getName()); System.out.println("value='" + value + "' type=" + value.getClass().getName()); } } else { System.out.println("value='" + print + "'"); } System.out.println(); } } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/pom.xml0000644000175000017500000000774111216157032032014 0ustar twernertwerner 4.0.0 org.jboss.microcontainer.examples pojoDev pom 1.0.0 simple constructor factory properties injection collections lifecycle installation classloader annotations alias supply demand autowiring javabeans spring locator org.jboss.microcontainer jboss-kernel ${mc.release} org.jboss.microcontainer jboss-spring-int ${mc.release} org.jboss.microcontainer jboss-kernel org.codehaus.mojo exec-maven-plugin 1.1.1 true run exec verify java -classpath org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap maven-compiler-plugin 1.5 1.5 true true true true org.apache.maven.plugins maven-jar-plugin false org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap true lib . maven-assembly-plugin ${parent.relative.dir}/dist.xml ${pom.artifactId} package directory-inline . 2.0.6.GA libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/0000755000175000017500000000000011620312217032653 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/pom.0000644000175000017500000000125710716044320033456 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples autowiring jar 1.0.0 Autowiring .. ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/main/java/org/jboss/example/microcontainer/autowiring/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/autowiring/src/0000755000175000017500000000000011620312217033442 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/0000755000175000017500000000000011620312220032651 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/pom.0000644000175000017500000000125710716044320033462 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples properties jar 1.0.0 Properties .. ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000644000175000017500000000116110715026425033456 0ustar twernertwerner JBoss Microcontainer property example http://www.jboss.org 4 ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000020100000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000022000000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000023300000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000755000175000017500000000000011620312220033440 5ustar twernertwerner././@LongLink0000000000000000000000000000025600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/main/java/org/jboss/example/microcontainer/properties/PropertiesBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/properties/src/0000644000175000017500000000333010715026425033456 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.properties; import java.net.URL; /** * A PropertiesBean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class PropertiesBean { public PropertiesBean() { System.out.println("PropertiesBean()"); } public void setTitle(String title) { System.out.println("setTitle: " + title); } public void setSubTitle(String subTitle) { System.out.println("setSubTitle: " + subTitle); } public void setLink(URL url) { System.out.println("setLink: " + url); } public void setNumber(Number number) { System.out.println("setNumber: " + number + " type=" + number.getClass().getName()); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/0000755000175000017500000000000011620312220032124 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/pom.xml0000644000175000017500000000125110716044320033450 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples factory jar 1.0.0 Factory .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/0000755000175000017500000000000011620312220032713 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000021100000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000644000175000017500000000171210715026425033422 0ustar twernertwerner ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000022500000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000755000175000017500000000000011620312220033402 5ustar twernertwerner././@LongLink0000000000000000000000000000025400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/FactoryCreatedBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000644000175000017500000000246010715026425033423 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.factory; /** * A FactoryCreatedBean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class FactoryCreatedBean { /* package */ FactoryCreatedBean(String where) { System.out.println("FactoryCreatedBean() from " + where); } } ././@LongLink0000000000000000000000000000024700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/StaticFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000644000175000017500000000261010715026425033420 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.factory; /** * A static factory. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class StaticFactory { public static FactoryCreatedBean createBean() { return new FactoryCreatedBean("StaticFactory.createBean()"); } private StaticFactory() { System.out.println("YOU SHOULD NOT SEE THIS!"); } } ././@LongLink0000000000000000000000000000025200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/main/java/org/jboss/example/microcontainer/factory/SingletonFactory.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/factory/src/mai0000644000175000017500000000314610715026425033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.factory; /** * A singleton factory. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class SingletonFactory { private static SingletonFactory singleton; public synchronized static SingletonFactory getInstance() { if (singleton == null) singleton = new SingletonFactory(); return singleton; } public FactoryCreatedBean createBean() { return new FactoryCreatedBean("SingletonFactory.createBean()"); } private SingletonFactory() { System.out.println("SingletonFactory()"); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/dist.xml0000644000175000017500000000257110716044320032157 0ustar twernertwerner dist zip false target *.jar ${parent.relative.dir}/log4j.properties /lib false runtime org.jboss.microcontainer:jboss-kernel org.jboss.microcontainer:jboss-dependency org.jboss.microcontainer:jboss-container org.jboss:jboss-common-core jboss:jboss-common-core jboss:jboss-common-logging-spi jboss:jboss-common-logging-log4j log4j:log4j org.jboss:jbossxb apache-xerces:xercesImpl oswego-concurrent:concurrent libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/0000755000175000017500000000000011620312217032415 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/pom.x0000644000175000017500000000125510716044320033406 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples javabeans jar 1.0.0 Javabeans .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/0000755000175000017500000000000011620312217033204 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/main/java/org/jboss/example/microcontainer/javabeans/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/javabeans/src/m0000755000175000017500000000000011620312217033361 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/0000755000175000017500000000000011620312217033050 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/pom0000644000175000017500000000126110716044320033570 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples constructor jar 1.0.0 Constructor .. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312216033557 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000644000175000017500000000124710715026425033575 0ustar twernertwerner 4 a string 10 ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000755000175000017500000000000011620312217033560 5ustar twernertwerner././@LongLink0000000000000000000000000000026100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src/main/java/org/jboss/example/microcontainer/constructor/ConstructorBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/constructor/src0000644000175000017500000000312710715026425033574 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.constructor; /** * A ConstructorBean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class ConstructorBean { public ConstructorBean(int integer) { System.out.println("ConstructorBean(int) with " + integer); } public ConstructorBean(String string, int integer) { System.out.println("ConstructorBean(String, int) with " + string + " and " + integer); } public ConstructorBean(String string, long l) { System.out.println("ConstructorBean(String, long) with " + string + " and " + l); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/0000755000175000017500000000000011620312220032414 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/pom.x0000644000175000017500000000125510716044320033413 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples lifecycle jar 1.0.0 Lifecycle .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/0000755000175000017500000000000011620312220033203 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000644000175000017500000000124110715026425033375 0ustar twernertwerner Lifecycle1 Lifecycle2 Lifecycle2 ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000755000175000017500000000000011620312220033360 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/main/java/org/jboss/example/microcontainer/lifecycle/LifecycleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/lifecycle/src/m0000644000175000017500000000327710715026425033410 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.lifecycle; /** * A Lifecycle Bean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class LifecycleBean { String name; public LifecycleBean(String name) { this.name = name; System.out.println("LifecycleBean() " + this); } public void create() { System.out.println("create: " + this); } public void start() { System.out.println("start: " + this); } public void stop() { System.out.println("stop: " + this); } public void destroy() { System.out.println("destroy: " + this); } public String toString() { return name; } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/0000755000175000017500000000000011620312217031554 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/pom.xml0000644000175000017500000000154710716044320033102 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples alias jar 1.0.0 Alias org.jboss.microcontainer jboss-kernel compile .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/0000755000175000017500000000000011620312217032343 5ustar twernertwerner././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000020700000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000644000175000017500000000173110715026425033302 0ustar twernertwerner viaprop viaconst viaset viaextalias ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000755000175000017500000000000011620312217033267 5ustar twernertwerner././@LongLink0000000000000000000000000000023600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/Nameable.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000644000175000017500000000376010715026425033306 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.alias; import java.util.HashSet; import java.util.Set; import org.jboss.kernel.spi.dependency.CreateKernelControllerContextAware; import org.jboss.kernel.spi.dependency.KernelControllerContext; /** * @author Ales Justin */ public class Nameable implements CreateKernelControllerContextAware { private Set names; public void setKernelControllerContext(KernelControllerContext context) throws Exception { names = new HashSet(); names.add(context.getName()); names.addAll(context.getAliases()); } public void unsetKernelControllerContext(KernelControllerContext context) throws Exception { names.clear(); names = null; } public boolean contains(Object name) { return names != null && names.contains(name); } public String toString() { return names != null ? names.toString() : ""; } } ././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/java/org/jboss/example/microcontainer/alias/ObjectHolder.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/alias/src/main/0000644000175000017500000000331610715026425033303 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.alias; import java.util.Set; /** * @author Ales Justin */ public class ObjectHolder { private Nameable nameable; private Set names; public ObjectHolder(Nameable nameable) { this.nameable = nameable; } public void setNameable(Nameable nameable) { this.nameable = nameable; } public void setNames(Set names) { this.names = names; } public void validate() { System.out.println("I'm nameable: " + nameable); System.out.println("Names size: " + names.size()); System.out.println("Names: " + names); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/0000755000175000017500000000000011620312220033012 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/pom0000644000175000017500000000157110716044320033544 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples annotations jar 1.0.0 Annotations org.jboss.microcontainer jboss-kernel compile .. ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000017600000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000021500000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000644000175000017500000000214410715026425033542 0ustar twernertwerner pojo org.jboss.example.microcontainer.annotations.Name pojo @org.jboss.example.microcontainer.annotations.Name("pojo") ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000016400000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000017200000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000020200000000000011557 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000022100000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000023500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000755000175000017500000000000011620312220033522 5ustar twernertwerner././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/POJO.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000644000175000017500000000222610715026425033543 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.annotations; /** * @author Ales Justin */ public class POJO { } ././@LongLink0000000000000000000000000000024600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/Name.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000644000175000017500000000262610715026425033547 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @author Ales Justin */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface Name { String value(); } ././@LongLink0000000000000000000000000000026300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src/main/java/org/jboss/example/microcontainer/annotations/AnnotationChecker.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/annotations/src0000644000175000017500000000604210715026425033543 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.annotations; import java.lang.annotation.Annotation; import java.util.Map; import java.util.Set; import org.jboss.kernel.Kernel; import org.jboss.kernel.spi.dependency.KernelController; import org.jboss.kernel.spi.dependency.KernelControllerContext; import org.jboss.kernel.spi.metadata.KernelMetaDataRepository; import org.jboss.metadata.spi.MetaData; /** * @author Ales Justin */ public class AnnotationChecker { private Kernel kernel; private Map> checker; public void setKernel(Kernel kernel) { this.kernel = kernel; } public void setCheckerMap(Map> checker) { this.checker = checker; } public void check() { KernelController controller = kernel.getController(); for(String key : checker.keySet()) { KernelControllerContext context = (KernelControllerContext)controller.getInstalledContext(key); Set annotations = checker.get(key); for(String annotation : annotations) { System.out.println( "Annotation " + annotation + (check(context, annotation) ? " exists " : " doesn't exist ") + " on " + context.getTarget().getClass().getSuperclass() ); } } } public boolean check(KernelControllerContext context, String annotation) { KernelMetaDataRepository repository = kernel.getMetaDataRepository(); MetaData retrieval = repository.getMetaData(context); if (retrieval != null) { Annotation[] annotations = retrieval.getAnnotations(); if (annotations != null && annotations.length > 0) { for (Annotation annItem : annotations) { if (annItem.annotationType().getName().equals(annotation)) { return true; } } } } return false; } } ././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/log4j.propertieslibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/log4j.propertie0000644000175000017500000000047610716014637033456 0ustar twernertwernerlog4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=POJO Example %5p [%d{dd-MM-yyyy HH:mm:ss}] %c{1} - %m%n libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/0000755000175000017500000000000011620312216032444 5ustar twernertwerner././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/pom.x0000644000175000017500000000140111216157032033430 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 .. 4.0.0 org.jboss.microcontainer.examples injection jar 1.0.0 Injection Injection Example ${project.parent.relativePath} libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/0000755000175000017500000000000011620312216033233 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000017400000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000021300000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000644000175000017500000000272110715026425033424 0ustar twernertwerner http://www.jboss.org/index.html InjectionBean1 InjectionBean2 Circular1 Circular2 ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000017000000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000020000000000000011555 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000021700000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000023100000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000755000175000017500000000000011620312216033410 5ustar twernertwerner././@LongLink0000000000000000000000000000025300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/main/java/org/jboss/example/microcontainer/injection/InjectionBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/injection/src/m0000644000175000017500000000314210715026425033422 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.injection; /** * A PropertiesBean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class InjectionBean { String name; public InjectionBean(String name) { this.name = name; System.out.println("InjectionBean() " + this); } public String toString() { return name; } public void setHost(String host) { System.out.println("setHost: " + host + " on " + this); } public void setOther(InjectionBean other) { System.out.println("setOther: " + other + " on " + this); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/0000755000175000017500000000000011620312217031713 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/pom.xml0000644000175000017500000000124710716044320033236 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples demand jar 1.0.0 Demand .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/0000755000175000017500000000000011620312217032502 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000644000175000017500000000130610715026425033360 0ustar twernertwerner guice coke ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000755000175000017500000000000011620312217033347 5ustar twernertwerner././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Demander.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000644000175000017500000000246110715026425033363 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.demand; /** * @author Ales Justin */ public class Demander { public static int counter = 0; public void start() { System.out.println(counter != 2 ? "I demanded 2 beans!" : "I'm fine. :-)"); } } ././@LongLink0000000000000000000000000000024000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main/java/org/jboss/example/microcontainer/demand/Starters.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/demand/src/main0000644000175000017500000000246410715026425033366 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.demand; /** * @author Ales Justin */ public class Starters { public void start() { System.out.println("I'm started: " + this); } public void installed() { Demander.counter++; } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/0000755000175000017500000000000011620312220033156 5ustar twernertwerner././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/pom.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/po0000644000175000017500000000126310716044320033531 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples installation jar 1.0.0 Installation .. ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000016600000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000017700000000000011572 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000021600000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000644000175000017500000000135410715026425033545 0ustar twernertwerner 100 10000 ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000017300000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000020300000000000011560 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000022200000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000023700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000755000175000017500000000000011620312220033523 5ustar twernertwerner././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/DeamonTimer.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000644000175000017500000000256510715026425033552 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.installation; import java.util.Timer; /** * @author Ales Justin */ public class DeamonTimer extends Timer { public DeamonTimer() { super(true); } public void cancel() { System.out.println("Canceling timer: " + this); super.cancel(); } } ././@LongLink0000000000000000000000000000025700000000000011571 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/src/main/java/org/jboss/example/microcontainer/installation/MyTimerTask.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/installation/sr0000644000175000017500000000262410715026425033546 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2006, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.installation; import java.util.TimerTask; /** * @author Ales Justin */ public class MyTimerTask extends TimerTask { public MyTimerTask() { System.out.println("Creating MyTimerTask [" + this + "]"); } public void run() { System.out.println("Running timer task: " + this); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/0000755000175000017500000000000011620312217031754 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/pom.xml0000644000175000017500000000124710716044320033277 0ustar twernertwerner org.jboss.microcontainer.examples pojoDev 1.0.0 4.0.0 org.jboss.microcontainer.examples simple jar 1.0.0 Simple .. libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/0000755000175000017500000000000011620312217032543 5ustar twernertwerner././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/resources/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000017100000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000021000000000000011556 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/resources/META-INF/jboss-beans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000644000175000017500000000053010715026425033417 0ustar twernertwerner ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000017500000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000021400000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000022300000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/libjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000755000175000017500000000000011620312217033410 5ustar twernertwerner././@LongLink0000000000000000000000000000024200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main/java/org/jboss/example/microcontainer/simple/SimpleBean.javalibjboss-microcontainer-java-2.0.10.GA.orig/docs/examples/User_Guide/pojoDevelopment/simple/src/main0000644000175000017500000000237210715026425033425 0ustar twernertwerner/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.example.microcontainer.simple; /** * A SimpleBean. * * @author Adrian Brock * @version $Revision: 37459 $ */ public class SimpleBean { public SimpleBean() { System.out.println("SimpleBean() constructor"); } } libjboss-microcontainer-java-2.0.10.GA.orig/docs/pom.xml0000644000175000017500000000144611130742473022771 0ustar twernertwerner org.jboss.microcontainer jboss-microcontainer 2.0.3-SNAPSHOT 4.0.0 org.jboss.microcontainer.docs jboss-microcontainer-docs pom JBoss Microcontainer Docs http://www.jboss.com/products/jbossmc JBoss Microcontainer Documentation gettingstarted reference libjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/0000755000175000017500000000000011620312214023470 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/pom.xml0000644000175000017500000000717311014250135025015 0ustar twernertwerner 4.0.0 org.jboss.microcontainer user-guide-${translation} 1.0-SNAPSHOT jdocbook User Guide (${translation}) org.jboss.maven.plugins maven-jdocbook-plugin 2.0.0 true org.jboss jbossorg-docbook-xslt 1.1.0 org.jboss jbossorg-jdocbook-style 1.1.0 jdocbook-style User_Guide.xml src/main/docbook images/*.png pdf classpath:/xslt/org/jboss/pdf.xsl User_Guide.pdf html classpath:/xslt/org/jboss/xhtml.xsl index.html html_single classpath:/xslt/org/jboss/xhtml-single.xsl index.html eclipse classpath:/xslt/org/jboss/eclipse.xsl index.html true saxon 1.72.0 en-US libjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/0000755000175000017500000000000011620312213024256 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/0000755000175000017500000000000011620312213025202 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/0000755000175000017500000000000011620312214026623 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/User_Guide.xml0000644000175000017500000077620411014250135031420 0ustar twernertwerner ]> JBoss Microcontainer 2.0.0 Beta9 User Guide 2.0 2 What this Book Covers This book aims to help you become familiar with JBoss Microcontainer in order that you can use it to develop your own services or applications. Part I 'Getting Started' introduces the technology and explains how it relates to Java development in general. It then goes on to cover a complete use-case so that you can quickly see how the microcontainer works in real-life. Part II 'POJO Development' takes a look at the various methods you can use to construct POJOs and wire them together using injection together with other features. Part III 'AOP Development' goes on to look at how you can add behaviour to your POJOs using aspects and modify the deployment/undeployment process with lifecycle callbacks. Part IV 'Extending the Microcontainer' shows how you can write your own extensions by creating new dependencies and gives some examples of how this has already been done. Getting Started Introduction The Java platform has traditionally been distributed in 3 editions, each providing a different type of runtime environment: Java ME (Micro Edition) - Mobile or other embedded devices Java SE (Standard Edition) - Desktop machines or servers (typically running 2-tier applications) Java EE (Enterprise Edition) - Servers (typically running 3-tier applications) Each environment aims to provide a base level of functionality on top of which developers can add their own code to create applications. For example Java SE provides networking and security libraries together with graphical user interface toolkits to facilitate the development of desktop and simple client-server applications. Java EE takes this a stage further by adding a number of 'enterprise services' such as transactions, messaging, and persistence that allow much more robust and scalable 'enterprise applications' to be developed. These services are typically combined together inside a JEE application server in order to provide a standard runtime environment for enterprise applications but it is often the case that some are never used. Services that are never used are undesirable as they can take up valuable resources such as CPU and memory resulting in lower performance. They may also clutter up the environment with redundant configuration files, complicating maintenance and adding unnecessary complexity. Given these drawbacks it would be better if there was a way to create a custom runtime environment containing only those services that were needed. You would then be able to create your own custom 'Java Edition' tailored to your requirements. JBoss Microcontainer aims to provide these capabilities by allowing services, created using Plain Old Java Objects (POJOs), to be deployed into a standard Java SE runtime environment in a controlled manner to create a customized environment for your applications. Dependencies are fully managed to ensure that new services cannot be deployed until services they depend on have first been deployed. Where it makes sense to do so you can even redeploy services at runtime providing that you access them via the microcontainer bus. Undeploying a service causes all dependent services to be undeployed first in order to maintain the integrity of the system. JBoss Application Server 5.0 uses the microcontainer to integrate enterprise services together with a Servlet/JSP container, EJB container, deployers and management utilities in order to provide a standard Java EE environment. If you need additional services then you can simply deploy these on top of Java EE to provide the functionality you need. Likewise you are free to remove any services that you don't need simply by changing the configuration. You can even use the microcontainer to do this in other environments such as Tomcat and GlassFish since you can plug in different classloading models during the service deployment phase. Since JBoss Microcontainer is very lightweight and deals with POJOs it can also be used to deploy services into a Java ME runtime environment. This opens up new possibilities for mobile applications that can now take advantage of enterprise services without requiring a full JEE application server. In common with other lightweight containers JBoss Microcontainer uses dependency injection to wire individual POJOs together to create services. Configuration is performed using either annotations or XML depending on where the information is best located. Finally unit testing is made extremely simple thanks to a helper class that extends JUnit to setup the test environment, allowing you to access POJOs and services from your test methods using just a few lines of code. Download and Installing JBoss Microcontainer 2.0.0 is currently only available as a beta release via Maven2. This means that you need to install and configure Maven before you can begin development. Once this is done then you can create a maven project that depends on the JBoss Microcontainer JARs in order to download and install them into your local maven repository. You can then create an assembly for your final application in order to package the relevant JARs into a distributable format. The examples created for this User Guide use Maven2 to achieve exactly this so it is highly recommended that you download these first and take a look at how they work. To build and run the examples you first need to install and configure Maven 2.0.7 available from http://maven.apache.org/ Installation is performed by downloading and unzipping the maven-2.0.7-bin.zip file to a convenient location on your local disk. Configuration consists of adding $MAVEN_HOME/bin to your path and adding the following profile to your ~/.m2/settings.xml file: <settings> <profiles> <profile> <id>jboss.repository</id> <activation> <property> <name>!jboss.repository.off</name> </property> </activation> <repositories> <repository> <id>snapshots.jboss.org</id> <url>http://snapshots.jboss.org/maven2</url> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>repository.jboss.org</id> <url>http://repository.jboss.org/maven2</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>repository.jboss.org</id> <url>http://repository.jboss.org/maven2</url> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>snapshots.jboss.org</id> <url>http://snapshots.jboss.org/maven2</url> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> </settings> This profile informs maven of the two JBoss repositories (snapshots and releases) that are needed to download the JBoss Microcontainer and dependant JARs. Once you have configured Maven and downloaded the examples then you can go to one of the following subdirectories in the examples/User_Guide directory and enter mvn install to perform a build: gettingStarted - projects for creating and using a service together with AOP pojoDevelopment - examples of creating and configuring POJOs using XML and annotations aopDevelopment - examples of using AOP to add behaviour to POJOs extending - examples of how we created various extensions to the microcontainer by creating new dependencies Instructions on how to run the individual examples can be found in the corresponding parts of this guide. Building services Before we talk about building services using POJOs it is necessary to define what we mean by these terms. POJOs The term POJO is an acronym for Plain Old Java Object and was first coined while Rebecca Parsons, Josh MacKenzie, and Martin Fowler were preparing for a talk at a conference in September 2000. It describes the practice of encoding business logic in regular java objects instead of components such as EJB 2.1 Entity Beans. The benefit of this approach is that you're not required to implement any special interfaces. This not only keeps your code simple but allows it to be used in a wider variety of environments and makes it easy to unit test. Definition: A POJO declares business methods, which define behaviour, and properties, which represent state. Some properties represent associations to other POJOs. For experienced developers this should sound familiar as it mimicks almost exactly the proposals set out in the JavaBeans specification. JavaBeans describes a component model for User Interface development emphasizing simplicity and standardized naming conventions for property accessor methods. The idea was that this would allow automatic discovery of an object's properties so that an instance could easily be created and populated with state at runtime. The main use case was creating and configuring visual user interface components such as text boxes, buttons, and tables from within an Integrated Development Environment (IDE). Definition: A Java Bean is a reusable software component that can be manipulated visually in a builder tool. Importantly a Java Bean is not required to inherit from any particular base class or interface. Also while Java Beans are primarily targeted at builder tools they are entirely usable by programmers with conventional text editors. Strictly speaking a Java Bean should include support for events and persistence but in many cases developers choose not to implement these features and simply follow the standardized naming conventions for property accessor methods; i.e. get and set. This 'lightweight' form of Java Bean is commonly referred to as simply a 'bean' and is semantically equivalent to a POJO. The terms POJO and bean are therefore interchangeable and you will encounter both in the microcontainer documentation and configuration files. Services The word 'service' has many definitions in the English language but in the context of developing Java applications it is helpful to define it as follows: A service should perform work that is useful to multiple clients, thereby preventing each client from having to perform the work themselves. A service should have a name that clients can lookup at runtime to gain access. This provides a standard way to access different kinds of services and removes the need for clients to explicitly create them before they can be used. Internal changes to a service should not affect any clients. In practice this means that clients should access a service using a well defined interface so that the implementation can be changed without having to recompile any clients. Using this definition we can now answer some simple questions: Q) Is a POJO a service? A) No, because although it performs work that is useful to multiple clients you cannot access it using a name. Also clients have to explicitly create a POJO themselves either directly using the new operator or indirectly using a factory. Q) Does a class have to implement an interface in order to provide a 'well-defined' interface? A) Not necessarily. Providing that we don't remove fields or methods from a class, or restrict access to them, we can always change its implementation without needing to recompile any clients. See the section entitled Resolution of Symbolic References from the Java Language Specification for more details. The 'well-defined' interface in this respect is composed from the original class's fields and methods together with their access modifiers. Implementing an interface is only necessary if we want to allow a client to choose between alternative implementations. i.e. if the client is compiled against an interface then we can provide as many different implementations of the interface as we like without having to recompile the client. This is because the interface ensures that the method signatures do not change. What then must we do in order to create a service using a POJO? The answer is to provide a naming mechanism that allows us to register a reference to the POJO instance with a name. Clients can then lookup the POJO reference using the name at runtime and use it to perform work. The POJO class is not required to implement an interface unless it is important that the client can choose between alternative implementations. JBoss Microcontainer provides such a naming mechanism in the form of a Controller so that we can deploy our POJO services into a runtime environment such as Java SE and look them up from within our applications. Since robust implementations of Java EE services are already available from JBoss.org and other communities it is common for companies to focus on creating more 'business-oriented' services. For this reason we shall look at creating, configuring and testing a simple Human Resources service that could potentially be used by a number of different applications.
Creating POJOs The example that relates to this section can be found in the examples/User_Guide/gettingStarted/humanResourcesService directory. The directory layout, as with all of the examples for the User Guide, follows the Maven Standard Directory Layout. humanResourcesService/pom.xml /src/main/java /test/java /test/resources Java source files are located in packages beneath the src/main/java directory: org/jboss/example/service/Address.java /Employee.java /HRManager.java org/jboss/example/service/util/SalaryStrategy.java /AgeBasedSalaryStrategy.java /LocationBasedSalaryStrategy.java Each of these classes represents a simple POJO that doesn't implement any special interfaces. The most important class is HRManager as this represents the service entry point providing all of the public methods that clients will call. addEmployee(Employee employee) removeEmployee(Employee employee) getEmployee(String firstName, String lastName) getEmployees() getSalary(Employee employee) setSalary(Employee employee, Integer newSalary) isHiringFreeze() setHiringFreeze(boolean hiringFreeze) getSalaryStrategy() setSalaryStrategy(SalaryStrategy strategy) The Human Resources Service is therefore composed of a handful of classes which work together to allow a list of employees, together with details of their addresses and salaries, to be maintained by an HRManger. Thanks to the SalaryStrategy interface it is possible to configure the HRManager so that different salary strategy implementations are used. These place minimum and maximum limits on the salaries that can be awarded to employees depending on various rules. To compile the source code you simply need to enter mvn compile from the humanResourcesService/ directory. This will create a new directory called target/classes containing the compiled code. To clean up the project and remove the target directory simply enter mvn clean. Now that we have compiled our classes we need to create instances of them. This is done by creating an XML deployment descriptor that contains a list of beans representing individual instances. Each bean is given a name so that the instance can be looked up at runtime by clients. <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="HRService" class="org.jboss.example.service.HRManager"/> </deployment> Here we have declared that we want to create an instance of the HRManager class and register it with the name HRService. This file is passed to an XML deployer associated with the microcontainer at runtime to perform the actual deployment and instantiate the beans.
Wiring POJOs together So far we have seen how to create POJOs and declare instances of them together with names in an XML deployment descriptor. However, individual POJO instances can only provide relatively simple behaviour. Things really get interesting when we combine POJOs together to perform more complex tasks. In our example we know that we can choose different salary strategy implementations for the HRManager so how do we go about wiring the POJOs together? The answer is to use the XML deployment descriptor again as follows: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="HRService" class="org.jboss.example.service.HRManager"> <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> </bean> <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy"/> </deployment> We first need to create an instance of our chosen salary strategy implementation by including an additional <bean> element. Here we have chosen the AgeBasedSalaryStrategy. Next we need to inject a reference to this bean into the instance of HRManager created using the HRService bean. Injection is possible as the HRManager class contains a setSalaryStrategy(SalaryStrategy strategy) method. Behind the scenes JBoss Microcontainer will call this method on the newly created HRManager instance and pass in a reference to the AgeBasedSalaryStrategy instance. In other words the XML deployment descriptor causes the same sequence of events to occur as if you had written the following code: HRManager hrService = new HRManager(); AgeBasedSalaryStrategy ageBasedSalary = new AgeBasedSalaryStrategy(); hrService.setSalaryStrategy(ageBasedSalary); In addition to performing injection via property setter methods JBoss Microcontainer can also perform injection via constructor parameters if necessary. For more details please see the 'Injection' chapter in Part II 'POJO Development'. Although we can create instances of classes using the <bean> element in the deployment descriptor it is not always appropriate to do so. For example we do not need to create instances of the Employee and Address classes since these will be created by the client in response to input from the user. As such they remain part of the service but are not mentioned in the deployment descriptor. Also note that it is possible to define multiple beans within a deployment descriptor providing that each has a unique name. The names are required in order to perform injection as shown above. However this does not mean to say that all of the beans represent services. While a service could be implemented using a single bean it is most often the case that multiple beans are used together as in our example. In these cases there is usually one bean that represents the service entry point containing the public methods intended for the clients to call. In our example this is the HRService bean. Notice that there is nothing in the XML deployment descriptor to say which beans represent a service or indeed which bean if any is the service entry point (a service may run autonomously in which case it is its own client). Care must therefore be taken when creating deployment descriptors to ensure that sufficient comments are included to describe what the beans are used for. Alternatively a naming convention such as ending each bean name that represents a service entry point with 'Service' can be used instead, e.g. HRService.
Configuring a service Injecting references between POJO instances is one way of configuring a service however we can also inject values into POJO properties. The following deployment descriptor shows how we can configure the HRManager instance to have a hiring freeze and the AgeBasedSalaryStrategy to have new minimum and maximum salary values: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="HRService" class="org.jboss.example.service.HRManager"> <property name="hiringFreeze">false</property> <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> </bean> <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy"> <property name="minSalary">1000</property> <property name="maxSalary">80000</property> </bean> </deployment> As with wiring POJOs together the classes need to have public setter methods for the relevant properties so that values can be injected. For example the HRManager class has a setHiringFreeze(boolean hiringFreeze) method and the AgeBasedSalaryStrategy class has setMinSalary(int minSalary) and setMaxSalary(int maxSalary) methods. The values in the deployment descriptor are converted from strings into the relevant types (boolean, int etc...) by JavaBean PropertyEditors. A large number of these are provided by default for standard types but you can easily create your own if necessary. See the Properties chapter in Part II 'POJO Development' for more details.
Testing a service We should now have a good idea about how to create POJOs and configure them using an XML deployment descriptor so how do we go about testing them? Thankfully JBoss Microcontainer makes it extremely easy to unit test individual POJOs as well as POJOs that are wired together through the use of a MicrocontainerTest class. The org.jboss.test.kernel.junit.MicrocontainerTest class inherits from junit.framework.TestCase and as such it sets up each test by bootstrapping JBoss Microcontainer and adding a BasicXMLDeployer. It then looks on the classpath for an XML deployment descriptor with the same name as the test class ending in .xml and residing in a directory structure representing the class's package name. Any beans found in this file are deployed and can then be accessed using a convenience method called getBean(String name). You can see examples of these deployment descriptors in the src/test/resources directory: org/jboss/example/service/HRManagerTestCase.xml /HRManagerAgeBasedTestCase.xml /HRManagerLocationBasedTestCase.xml org/jboss/example/service/util/AgeBasedSalaryTestCase.xml /LocationBasedSalaryTestCase.xml The test code is located in the src/test/java directory: org/jboss/example/service/HRManagerTestCase.java /HRManagerAgeBasedTestCase.xml /HRManagerLocationBasedTestCase.xml /HRManagerTest.java /HRManagerTestSuite.java org/jboss/example/service/util/AgeBasedSalaryTestCase.java /LocationBasedSalaryTestVase.java /SalaryStrategyTestSuite.java The HRManagerTest class extends MicrocontainerTest in order to set up a number of employees to use as the basis for the tests. Individual test cases then subclass this to perform the actual work. You can also see a couple of TestSuite classes that are used to group individual test cases together for convenience. To run the tests simply enter mvn test from the humanResourcesService/ directory. You should see some DEBUG log output which shows JBoss Microcontainer booting up and deploying beans from the relevant XML file before running each test. At the end of the test it then undeploys the beans and shuts down the microcontainer. Some of the tests such as HRManagerTestCase, AgeBasedSalaryTestCase and LocationBasedSalaryTestCase simply unit test individual POJOs whilst other tests such as HRManagerAgeBasedTestCase and HRManagerLocationBasedTestCase unit test the whole service consisting of multiple POJOs wired together. Either way the method for conducting the tests remains the same. Thanks to the MicrocontainerTest class it is trivial to set up and conduct comprehensive tests for any part of your code. Finally note that we didn't unit test the Address or Employee classes here. They were deliberately left out as they only contain trivial logic which is very unlikely to break.
Packaging a service Now that we have successfully created and tested our service it is time to package it up so that others can use it. The simplest way to do this is to create a JAR containing all of the classes. You can choose to include the deployment descriptor if there is a sensible default way to configure the service but you are not required to do so. If you do choose to include the deployment descriptor then by convention you should call it jboss-beans.xml and put it in a META-INF directory. This helps if you want to later deploy the service in JBoss AS 5 as the JAR deployer recognises this layout by default and will automatically perform the deployment. In our case we will not include it as we want to configure the service by editing the descriptor directly as a separate file. To generate a JAR in the target directory containing all of the compiled classes simply enter mvn package from the humanResourcesService/ directory. To make the JAR available to other maven projects you then need to enter mvn install in order to copy it to your local maven repository. The final layout of the JAR is as follows: org/jboss/example/service/Address.class /Employee.class /HRManager.class org/jboss/example/service/util/AgeBasedSalaryStrategy.class /LocationBasedSalaryStrategy.class /SalaryStrategy.class META-INF/MANIFEST.MF META-INF/maven/org.jboss.microcontainer.examples/humanResourcesService/pom.xml /pom.properties The META-INF/maven directory is automatically produced by maven and is required so that other maven projects can use this JAR as a dependency. If you are not using maven as your build system then you will not have this directory.
Using services In the previous chapter we looked at how to create, configure, test and package a service. It is now time to move on and create a client so that we can use the service to perform actual work. In order to keep things simple the client uses a Text User Interface (TUI) to accept input from the user and output results. In the real-world a Graphical User Interface (GUI) would almost certainly be used but here we are more concerned with demonstrating how the client interacts with the service than showing how to develop a rich desktop application. You will find all of the necessary files in the examples/User_Guide/gettingstarted/commandLineClient directory. As with the previous example this follows the Maven Standard Directory Layout: commandLineClient/pom.xml /src/main/assembly /main/config /main/java /main/resources /test/java /test/resources The client consists of 3 classes and 1 interface, located in the src/main/java directory: org/jboss/example/client/Client.java /ConsoleInput.java /EmbeddedBootstrap.java /UserInterface.java UserInterface describes methods that the client will call at runtime to request data from the user. ConsoleInput is an implementation of this that creates a TUI allowing the user to operate the client from the command line. The advantage of this design is that we can easily create a Swing implementation of UserInterface at a later date and replace the TUI with a GUI if we decide to improve usability. We can also create a mock implementation for testing purposes that simulates a user entering data. This allows us to check the behaviour of the client automatically using conventional JUnit test cases as demonstrated by the code in the src/test/java directory: org/jboss/example/client/ClientTestCase.java /ClientTestSuite.java /MockUserInterface.java To compile the source code, run the unit tests, build a client JAR and assemble a distribution containing all of the necessary files simply type mvn package from the commandLineClient directory. For the build to work you must first have built and installed auditAspect.jar from the examples/User_Guide/gettingStarted/auditAspect directory using the mvn install command. This is because we actually create a number of different client distributions including one based on AOP which relies on auditAspect.jar being available in the local maven repositiory. If you previously typed mvn install from the examples/User_Guide/gettingStarted directory then you will have already built and installed humanResourcesService.jar together with auditAspect.jar and the client will have already been packaged so this step will not be necessary. Once you have successfully compiled and packaged the client you will find the following subdirectories in the commandLineClient/target directory: client-pojo.dir - used to call the service without any AOP client-cl.dir - used to demonstrate classloading features client-aop.dir - used in Chapter 5. Adding behaviour through AOP Each of these represents a different distribution containing all of the shell scripts, JARs, and XML deployment descriptors that we need to run the client in different configurations. For the moment we will use the client-pojo distribution which can be found in the client-pojo.dir subdirectory: run.sh client-1.0.0.jar jboss-beans.xml lib/concurrent-1.3.4.jar /humanResourcesService-1.0.0.jar /jboss-common-core-2.0.4.GA.jar /jboss-common-core-2.2.1.GA.jar /jboss-common-logging-log4j-2.0.4.GA.jar /jboss-common-logging-spi-2.0.4.GA.jar /jboss-container-2.0.0.Beta6.jar /jboss-dependency-2.0.0.Beta6.jar /jboss-kernel-2.0.0.Beta6.jar /jbossxb-2.0.0.CR4.jar /log4j-1.2.14.jar /xercesImpl-2.7.1.jar To run the client simply cd into client-pojo.dir and type ./run.sh. You will then be presented with the following menu of options: To select an option enter the letter shown on the left-hand side and press return. For example to redisplay the menu options enter 'm' followed by return. This is useful if they scroll off the top of the screen as you input data and read results. Entering more than one letter or entering an invalid option will result in an appropriate error message. The run.sh script sets up the runtime environment by adding all of the JARs found in the lib directory to the classpath using the java.ext.dirs system property. It also adds the current directory and the client-1.0.0.jar using the -cp flag so that the jboss-beans.xml deployment descriptor can be found at runtime together with the org.jboss.example.client.Client class which is called to start the application.
Bootstrapping the microcontainer Before we use the client to deploy and call our service, lets take a closer look at what happened during its construction: public Client(final boolean useBus) throws Exception { this.useBus = useBus; ClassLoader cl = Thread.currentThread().getContextClassLoader(); url = cl.getResource("jboss-beans.xml"); // Start JBoss Microcontainer bootstrap = new EmbeddedBootstrap(); bootstrap.run(); kernel = bootstrap.getKernel(); controller = kernel.getController(); bus = kernel.getBus(); } First of all a url representing the jboss-beans.xml deployment descriptor was created. This is required later on by the XML deployer so that we can deploy and undeploy beans declared in the file. Here we have chosen to use the getResource() method of the application classloader as we deliberately placed the jboss-beans.xml file on the classpath. However, this is not a requirement and you are free to call the deployment descriptor anything you like and place it anywhere you want provided that the URL is valid and reachable. Next we created an instance of JBoss Microcontainer together with an XML deployer. This process is called bootstrapping and for convenience a BasicBootstrap class is provided as part of the microcontainer to allow for configuration via system properties. To add an XML deployer we simply extend BasicBootstrap to create an EmbeddedBootstrap class and override the protected bootstrap() method as follows: public class EmbeddedBootstrap extends BasicBootstrap { protected BasicXMLDeployer deployer; public EmbeddedBootstrap() throws Exception { super(); } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BasicXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); } public void deploy(URL url) { ... deployer.deploy(url); ... } public void undeploy(URL url) { ... deployer.undeploy(url); ... } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); deployer.shutdown(); } } } The shutdown hook ensures that when the JVM is exited all of the beans are undeployed in the correct order. The public deploy/undeploy methods simply delegate to the BasicXMLDeployer so that we can deploy and undeploy beans declared in our jboss-beans.xml file. Finally we stored references to the microcontainer controller and bus so that we can lookup bean references by name and access them directly or indirectly as necessary.
Deploying the service Once the client has been created we can proceed to deploy the Human Resources service. This is done by entering the 'd' option. You should see the following log output indicating that the BasicXMLDeployer has parsed the jboss-beans.xml file using the url and instantiated the beans found within. The microcontainer is able to instantiate the beans as their classes are available in the extension classpath inside the lib/humanResourcesService.jar file. We could have equally placed these classes in an exploded directory structure and added this to the application classpath but in general you will package them in a JAR for convenience. Notice that our deployment descriptor is entirely separate from the humanResourcesService.jar file. This is done on purpose so that you can easily edit it and test your changes by redeploying the service. The jboss-beans.xml file in the example contains some commented out fragments of XML that you can uncomment to configure it in different ways: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="HRService" class="org.jboss.example.service.HRManager"> <!-- <property name="hiringFreeze">true</property> <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> --> </bean> <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy"> <property name="minSalary">1000</property> <property name="maxSalary">80000</property> </bean> <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy"> <property name="minSalary">2000</property> <property name="maxSalary">90000</property> </bean> --> </deployment> Depending on how you access the service at runtime you may need to shutdown the application and restart it again to redeploy the service and see your changes. This reduces the flexibility of the application but results in faster performance at runtime. Alternatively you may be able to simply redeploy the service whilst the application is running. This increases flexilibity but results in slower runtime performance. Careful consideration of these tradeoffs must be made before deciding on the approach you will take.
Direct access If no parameter is given to the run.sh script when the client is started then a reference to the HRService bean is looked up using the microcontainer controller once the service is deployed: private HRManager manager; ... private final static String HRSERVICE = "HRService"; ... void deploy() { bootstrap.deploy(url); if (!useBus && manager == null) { ControllerContext context = controller.getInstalledContext(HRSERVICE); if (context != null) { manager = (HRManager) context.getTarget(); } } } Rather than immediately looking up a reference to the bean instance we first lookup a reference to a ControllerContext. We then obtain a reference to the bean instance from the context using the getTarget() method. The reason for this is because the bean can exist in many states within the microcontainer e.g. NOT_INSTALLED, DESCRIBED, INSTANTIATED, CONFIGURED, INSTALLED. In order to keep track of which state the bean is in we need to wrap it in another object called a context that describes the current state. The name of the context is the same as the bean name. Once a context reaches the INSTALLED state then the bean it represents is considered to be deployed. Now that we have a reference to the bean instance representing our service entry point we can call methods on it to perform work: @SuppressWarnings("unchecked") Set<Employee> listEmployees() { if (useBus) ... else return manager.getEmployees(); } The client is said to be accessing the service directly since it's using a reference to the actual bean instance. Performance is good as each method call goes directly to the bean but what happens if we want to reconfigure the service and redeploy it whilst the application is running? Reconfiguration as we know is achieved by making changes to the XML deployment descriptor and saving the file but in order to redeploy the service we must first undeploy the current one. During undeployment the microcontainer controller releases its reference to the bean instance together with any beans that depend on it. The intention is that these beans will subsequently become available for garbage collection as they are no longer required by the application. Deploying the service again creates new bean instances representing the new configuration. Any subsequent lookups from clients will then retrieve references to these new instances and they will be able to access the reconfigured service. The problem is that we cache the reference to the bean instance representing our service entry point in our client when we deploy the service for the first time. Undeploying the service therefore has no affect as the bean instance can still be accessed using the cached reference and it will not be garbage collected until the client releases it. Similarly deploying the service again will not cause another lookup as the client already has a cached reference. It will therefore continue to use the bean instance representing the initial service configuration. You can test this behaviour for yourself by typing 'u' followed by return to undeploy the current service. You should still be able to access the service from the client even though it is 'undeployed'. Now make some changes to the configuration using the jboss-beans.xml file and deploy it again using the 'd' option (remember to save any changes you make to jboss-beans.xml first). Printing out the status of the service using the 'p' option should allow you to see that the client is still accessing the initial instance of the service that was deployed. Even if we change our client so that we lookup a new reference each time the service is redeployed there is nothing to prevent new developers from coming along and mistakedly handing out copies of this reference to other objects. If all of these references are not cleaned up during redeployment then this then puts us in the same situation as before with access to older instances of the service still possible. To reliably redeploy the reconfigured service you must therefore shutdown the application completely using the 'q' option and restart it again using the run.sh script. For enterprise services such as transactions, messaging and persistance this is perfectly acceptable since they are generally always in use. As such they cannot be redeployed at runtime and benefit from the high performance given by using direct access. If your service falls into this category then you too should consider using direct access via the microcontainer controller.
Indirect access The run.sh script can be called with an optional parameter 'bus' to specify that calls to the Human Resources service should take place using the microcontainer bus: ./run.sh bus Instead of using a direct reference to the bean instance obtained from the microcontainer controller we now call an invoke() method on the bus passing in the bean name, method name, method arguments and method types. The bus takes this information and uses it to call the bean on the client's behalf. private final static String HRSERVICE = "HRService"; ... @SuppressWarnings("unchecked") Set<Employee> listEmployees() { if (useBus) return (Set<Employee>) invoke(HRSERVICE, "getEmployees", new Object[] {}, new String[] {}); else return manager.getEmployees(); } private Object invoke(String serviceName, String methodName, Object[] args, String[] types) { Object result = null; try { result = bus.invoke(serviceName, methodName, args, types); } catch (Throwable t) { t.printStackTrace(); } return result; } Behind the scenes the bus looks up the reference to the bean instance specified by the bean name and calls the chosen method using reflecton. Since the client never has a direct reference to the bean instance we say that it accesses the service 'indirectly'. As the bus does not cache the reference we can safely make changes to our service configuration and redeploy it at runtime. Subsequent calls by the client will then result in the new reference to the service being used as expected. In technical terms we say that the client and service have been decoupled. You can test this behaviour for yourself by deploying the service and using the 'p' option to print out the status. Undeploy the service using the 'u' option and check that you cannot access it anymore. Now make some changes to the configuration using the jboss-beans.xml file and deploy it again using the 'd' option (remember to save any changes you make to jboss-beans.xml first). Printing out the status again using the 'p' option should reveal that the client is accessing the new service configuration. As the bus uses reflection to call bean instances it is slower than using direct access. The benefit however is that only the bus has references to the bean instances. This means that when a service is redeployed we can clean up all of the existing references and replace them with new ones, allowing us to reliably redeploy a service at runtime. Services that are not used very often or that are specific to certain applications are good candidates for indirect access using the microcontainer bus. This is either because the reduction in performance does not matter if the service is used rarely or the service can be deployed and undeployed together with the relevant applications to keep the runtime environment clean.
Dynamic classloading So far we have been using the extension and application classloaders to load all of the classes in our application. The application classpath was setup by the run.sh script using the -cp flag to include the current directory and the client-1.0.0.jar. java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1 For convenience the JARs in the lib directory were added to the extenion classloader's classpath using the java.ext.dirs system property as this prevents us from having to list the full path to each of the JARs after the -cp flag. Since the extension classloader is the parent of the application classloader our client classes can find all of the microcontainer classes together with the Human Resources service classes at runtime. If you are using Java 6+ then you can use a wildcard to include all JARs in a directory with the -cp flag.java -cp `pwd`/lib/*:.:client-1.0.0.jar org.jboss.example.client.Client $1This means that all of the classes in our application will be added to the application classloader's classpath and the extension classloader's classpath will retain its default value. This is all well and good but what happens if we now want to deploy an additional service at runtime? If the new service is packaged in a JAR file then it needs to be visible to a classloader before any of its classes can be loaded. The trouble is we have already setup the classpath for the application classloader (and extension classloader) on startup so we cannot easily add the url of the JAR. The same situation applies if the service classes are contained in a directory structure. Unless the top-level directory is located in the current directory (which is on the application classpath) then the classes will not be found by the application classloader. It's also possible that we may wish to redeploy an existing service with changes to some of its classes. Since it is forbidden for an existing classloader to reload classes due to security constraints how can this be done? What we need is the ability to create a new classloader that knows the location of the new service's classes, or that can load new versions of an existing service's classes, so that we can deploy the service's beans. JBoss Microcontainer allows us to do this using the <classloader> element in the deployment descriptor. The client-cl distribution in the commandLineClient/target/client-cl.dir directory contains the following files that demonstrate how this works: run.sh client-1.0.0.jar jboss-beans.xml lib/concurrent-1.3.4.jar /jboss-common-core-2.0.4.GA.jar /jboss-common-core-2.2.1.GA.jar /jboss-common-logging-log4j-2.0.4.GA.jar /jboss-common-logging-spi-2.0.4.GA.jar /jboss-container-2.0.0.Beta6.jar /jboss-dependency-2.0.0.Beta6.jar /jboss-kernel-2.0.0.Beta6.jar /jbossxb-2.0.0.CR4.jar /log4j-1.2.14.jar /xercesImpl-2.7.1.jar otherLib/humanResourcesService-1.0.0.jar As you can see the humanResourcesService.jar file has been moved to a new subdirectory called otherLib. In this location it is no longer available to either the extension or application classloaders whose classpaths are setup in the run.sh script: java -Djava.ext.dirs=`pwd`/lib -cp .:client-1.0.0.jar org.jboss.example.client.Client $1 We must therefore create a new classloader during the deployment of the service so that we can load in the service classes and create instances of the beans. You can see how this is done by looking at the contents of the jboss-beans.xml file: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="URL" class="java.net.URL"> <constructor> <parameter>file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar</parameter> </constructor> </bean> <bean name="customCL" class="java.net.URLClassLoader"> <constructor> <parameter> <array> <inject bean="URL"/> </array> </parameter> </constructor> </bean> <bean name="HRService" class="org.jboss.example.service.HRManager"> <classloader><inject bean="customCL"/></classloader> <!-- <property name="hiringFreeze">true</property> <property name="salaryStrategy"><inject bean="AgeBasedSalary"/></property> --> </bean> <!-- <bean name="AgeBasedSalary" class="org.jboss.example.service.util.AgeBasedSalaryStrategy"> <property name="minSalary">1000</property> <property name="maxSalary">80000</property> </bean> <bean name="LocationBasedSalary" class="org.jboss.example.service.util.LocationBasedSalaryStrategy"> <property name="minSalary">2000</property> <property name="maxSalary">90000</property> </bean> --> </deployment> First of all we create an instance of java.net.URL called URL using parameter injection in the constructor to specify the location of the humanResourcesService.jar file on our local filesystem. Then we create an instance of a URLClassLoader by injecting the URL bean into the constructor as the only element in an array. Once this is done then we simply include a <classloader> element in our HRService bean definition and inject the customCL bean. This specifies that the HRManager class needs to be loaded by the customCL classloader. But how do we know which classloader to use for the other beans in the deployment? The answer is that all beans in the deployment use the current thread's context classloader. In our case the thread that handles deployment is the main thread of the application which has its context classloader set to the application classloader on startup. If you wish, you can choose to specify a different classloader for the entire deployment using a <classloader> element as follows: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <classloader><inject bean="customCL"/></classloader> <bean name="URL" class="java.net.URL"> <constructor> <parameter>file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar</parameter> </constructor> </bean> <bean name="customCL" class="java.net.URLClassLoader"> <constructor> <parameter> <array> <inject bean="URL"/> </array> </parameter> </constructor> </bean> ... </deployment> This would be necessary for example if you wished to reconfigure the service by uncommenting the AgeBasedSalary or LocationBasedSalary beans. As you might expect, classloaders specified at the bean level override the deployment level classloader and if you wish to ignore the deployment level classloader altogether, and use the default classloader for a bean, then you can use the <null/> value as follows: <bean name="HRService" class="org.jboss.example.service.HRManager"> <classloader><null/></classloader> </bean> If you decide to create a new classloader for your service using the deployment descriptor then be aware that you may not be able to access classes loaded by it from the application classloader anymore. In our example this means that the client will no longer be able to cache a direct reference to the bean instance when using the microcontainer controller. You can see this for yourself by starting the client using the run.sh command and then trying to deploy the service. You should see that a java.lang.NoClassDefFoundError exception is thrown and the application will then exit. You must therefore use the bus to access the service indirectly and provide access to any classes shared by the client in the application classpath. In our example this means the Address, Employee, and SalaryStrategy classes.
Adding behaviour with AOP Object Oriented Programming (OOP) contains many useful techniques for software development including encapsulation, inheritance, and polymorphism but does not solve the problem of how to address logic that is often repeated in many different classes. Examples of this include logging, security, and transactional logic which is traditionally hard-coded into each class making the source code difficult to maintain. We call logic of this nature a 'cross-cutting concern' as it typically applies across class hierarchies. Aspect Oriented Programming (AOP) provides a solution to this by allowing cross-cutting concerns to be applied to classes after they have been compiled. This keeps the source code free of logic which is not central to the main purpose of the class and aids maintenance. The way it is done varies depending on the AOP implementation. Typically if a class implements an interface then all method calls to an instance of the class first pass through a proxy that implements the same interface and adds in the required behaviour. Alternatively, if an interface is not used, then the java bytecode of the compiled class is modified so that the original methods are renamed and replaced by methods that implement the cross-cutting logic. These new methods then call the original methods after the cross-cutting logic has been executed. The same result can be achieved by modifying the bytecode to create a subclass of the original class that overrides its methods. The overriden methods then execute the cross-cutting logic before calling the corresponding methods of the super class. JBoss AOP is a framework for Aspect-Oriented Programming that allows you to create cross-cutting concerns using conventional java classes and methods. In AOP terminology each concern is represented by an aspect that you implement using a simple POJO. Behaviour is provided by methods within the aspect called advices that follow certain rules for their parameter and return types together with any exceptions that they throw. Other than this you are free to use conventional object-oriented notions such as inheritance, encapsulation, and composition in order to make your cross-cutting concerns as maintainable as possible. Aspects are applied to code using an expression language that allows you to specify which constructors, methods and even fields to target. This means that you can quickly change the behaviour of a number of classes simply by editing a configuration file. In this chapter we are going to look at using JBoss AOP together with the microcontainer to create and apply an auditing aspect to the Human Resources Service. We could choose to place auditing code within the HRManager class but it would detract from the main purpose of the class and add unnecessary complexity. The design of the aspect will ensure that it can also be used with other classes if our requirements change at a later date. We shall also look at how AOP can be used to apply additional behaviour during the deployment phase. Specifically we will show how you can create and bind a proxy to a bean instance into a basic JNDI service so that you can access it using a JNDI lookup instead of the microcontainer controller.
Creating an aspect The examples/User_Guide/gettingStarted/auditAspect directory contains all the files you need to create the aspect. auditAspect/pom.xml /src/main/java/org/jboss/example/aspect/AuditAspect.java As you can see from the source code below all we need is a simple POJO. public class AuditAspect { private String logDir; private BufferedWriter out; public AuditAspect() { logDir = System.getProperty("user.dir") + "/log"; File directory = new File(logDir); if (!directory.exists()) { directory.mkdir(); } } public Object audit(ConstructorInvocation inv) throws Throwable { SimpleDateFormat formatter = new SimpleDateFormat("ddMMyyyy-kkmmss"); Calendar now = Calendar.getInstance(); String filename = "auditLog-" + formatter.format(now.getTime()); File auditLog = new File(logDir + "/" + filename); auditLog.createNewFile(); out = new BufferedWriter(new FileWriter(auditLog)); return inv.invokeNext(); } public Object audit(MethodInvocation inv) throws Throwable { String name = inv.getMethod().getName(); Object[] args = inv.getArguments(); Object retVal = inv.invokeNext(); StringBuffer buffer = new StringBuffer(); for (int i=0; i < args.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(args[i].toString()); } if (out != null) { out.write("Method: " + name); if (buffer.length() > 0) { out.write(" Args: " + buffer.toString()); } if (retVal != null) { out.write(" Return: " + retVal.toString()); } out.write("\n"); out.flush(); } return retVal; } } The constructor checks for the presence of a log directory in the current working directory and creates one if not found. After this we define an advice that will be called whenever the constructor of our target class is called. The purpose of this is to create a new log file within the log directory so that we can record method calls made on different instances of our target class in separate files. Finally we define an advice that will apply to each method call made on the target class. Here we store the method name and arguments together with the return value so that we can construct an audit record and write it to the current log file. Notice how each advice calls inv.invokeNext(). This is required in order to call the next advice, if more than one cross-cutting concern has been applied, or to call the target constructor/method. Each advice is implemented using a method that takes an invocation object as a parameter, throws Throwable and returns Object. This is necessary as we do not know at design time which constructors or methods our advices will be applied to so the types must be as generic as possible. For more information on creating aspects and advices together with additional examples of how to apply them to various classes please consult the JBoss AOP project documentation. To compile the class and create an auditAspect.jar file that can be used by other examples simply type mvn install from the auditAspect directory.
Configuring the microcontainer Before we can apply the audit aspect to our service we must first add a number of JARs to the extension classpath. These can be found in the lib subdirectory of the client-aop distribution located in the examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir directory: run.sh client-1.0.0.jar jboss-beans.xml lib/auditAspect-1.0.0.jar /concurrent-1.3.4.jar /humanResourcesService-1.0.0.jar /javassist-3.6.0.GA.jar /jboss-aop-2.0.0.beta1.jar /jboss-aop-mc-int-2.0.0.Beta6.jar /jboss-common-core-2.0.4.GA.jar /jboss-common-core-2.2.1.GA.jar /jboss-common-logging-log4j-2.0.4.GA.jar /jboss-common-logging-spi-2.0.4.GA.jar /jboss-container-2.0.0.Beta6.jar /jboss-dependency-2.0.0.Beta6.jar /jboss-kernel-2.0.0.Beta6.jar /jbossxb-2.0.0.CR4.jar /log4j-1.2.14.jar /trove-2.1.1.jar /xercesImpl-2.7.1.jar First of all we need to include the auditAspect jar as we need to create an instance of our aspect at runtime in order to execute the logic. We then need to include the jar file for JBoss AOP (jboss-aop) together with its dependencies; javassist and trove. Finally we need to add the jboss-aop-mc-int jar as this contains an XML schema definition that allows us to define aspects inside our XML deployment descriptor. It also contains integration code to create dependencies between normal beans and aspect beans within the microcontainer so that we can add behaviour during the deployment and undeployment phases. Since we are using Maven2 to assemble the client-aop distribution we can easily add these JAR files by declaring the appropriate dependencies in our pom.xml file and creating a valid assembly descriptor. If you are using Ant to perform your build then you will need to do this in a different way.
Applying an aspect Now that we have a valid distribution containing everything we need we can configure our jboss-beans.xml file to apply the audit aspect. This can be found in the examples/User_Guide/gettingStarted/commandLineClient/target/client-aop.dir directory: <?xml version="1.0" encoding="UTF-8"?> <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="AspectManager" class="org.jboss.aop.AspectManager"> <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/> </bean> <aop:aspect xmlns:aop="urn:jboss:aop-beans:1.0" name="AuditAspect" class="org.jboss.example.aspect.AuditAspect" method="audit" pointcut="execution(public org.jboss.example.service.HRManager->new(..)) OR execution(public * org.jboss.example.service.HRManager->*(..))"> </aop:aspect> ... </deployment> Before we can apply our aspect to any classes we need to create an instance of org.jboss.aop.AspectManager using a <bean> element. We use a factory method instead of calling a conventional constructor as we only want one instance of the AspectManager in the JVM at runtime i.e. it is a singleton. Next we create an instance of our aspect called AuditAspect using the <aop:aspect> element. This looks much like the <bean> element as it has name and class attributes that you can use in the same way. However it also has method and pointcut attributes that you can use to apply or 'bind' an advice within the aspect to constructors and methods within other classes. We use these attributes to bind the audit advice to all public constructors and methods within the HRManager class. We only need to specify one method called audit as we have overloaded this method within our AuditAspect class with different parameters. JBoss AOP knows at runtime which one to select based on whether a constructor or method invocation is being made. This additional configuration is all we need to apply the audit aspect at runtime and add auditing behaviour to the Human Resources service. You can test this out for yourself by running the client using the run.sh script. A log directory will be created on startup alongside the lib directory as the AuditAspect bean is created by the microcontainer. Each deployment of the Human Resources service will then cause a new log file to appear within the log directory containing a record of any calls made from the client to the service: log/auditLog-28112007-163902 /auditLog-28112007-164055 /auditLog-28112007-164108 The audit records inside the log files will look something like this: Method: getEmployees Return: [] Method: addEmployee Args: (Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860) Return: true Method: getSalary Args: (Santa Claus, null - Birth date unknown) Return: 10000 Method: getEmployees Return: [(Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860)] Method: isHiringFreeze Return: false Method: getEmployees Return: [(Santa Claus, 1 Reindeer Avenue, Lapland City - 25/12/1860)] Method: getSalaryStrategy If you wish to remove the auditing behaviour then you can simply comment out the relevant fragments of XML in the deployment descriptor and restart the application. The order of deployment for aspects declared in this way relative to normal beans matters in the deployment descriptor. Specifically each aspect must be declared before the beans that it applies to so that the microcontainer deploys them in that order. This is because the microcontainer may need to alter the bytecode of the normal bean class in order to add the cross-cutting logic before it creates an instance and stores a reference to it in the controller. If a normal bean instance has already been created then this is not possible.
Lifecycle callbacks In addition to applying aspects to beans that we instantiate using the microcontainer we can also add behaviour during the deployment and undeployment process. As you may recall from the Direct access section of Chapter 4, a bean goes through several different states as it is deployed. These include: NOT_INSTALLED - the deployment descriptor containing the bean has been parsed along with any annotations on the bean itself. DESCRIBED - any dependencies created by AOP have been added to the bean and custom annotations have been processed. INSTANTIATED - an instance of the bean has been created. CONFIGURED - properties have been injected into the bean along with any references to other beans. CREATE - the create method, if defined on the bean, has been called. START - the start method, if defined on the bean, has been called. INSTALLED - any custom install actions that were defined in the deployment descriptor have been executed and the bean is ready to access. The CREATE and START states are included in order to allow services that used to be implemented as MBeans in JBoss AS 3.x and 4.x to function correctly when implemented as beans in JBoss AS 5.x. If you do not define any corresponding create/start methods in your bean then it will simply pass straight through these states. Together these states represent the bean's lifecycle and using an additional set of <aop> elements you can define a number of callbacks to be applied to any point: <aop:lifecycle-describe> - applied when entering/leaving the DESCRIBED state <aop:lifecycle-instantiate> - applied when entering/leaving the INSTANTIATED state <aop:lifecycle-configure> - applied when entering/leaving the CONFIGURED state <aop:lifecycle-create> - applied when entering/leaving the CREATE state <aop:lifecycle-start> - applied when entering/leaving the START state <aop:lifecycle-install> - applied when entering/leaving the INSTALLED state Just like the <bean> element and the <aop:aspect> element the <aop:lifecycle-> elements contain name and class attributes. These allow the microcontainer to create an instance of the callback class and give it a name so that it can be used as beans enter/leave the relevant state during deployment and undeployment. You can specify which beans are affected by the callback using the classes attribute: <aop:lifecycle-install xmlns:aop="urn:jboss:aop-beans:1.0" name="InstallAdvice" class="org.jboss.test.microcontainer.support.LifecycleCallback" classes="@org.jboss.test.microcontainer.support.Install"> </aop:lifecycle-install> Here we have specified that additional logic in the LifecycleCallback class should be applied to any bean classes that are annotated with @org.jboss.test.microcontainer.support.Install before they enter and after they leave the INSTALLED state. In order for the callback class to work it must contain install and uninstall methods that take ControllerContext as a parameter: import org.jboss.dependency.spi.ControllerContext; public class LifecycleCallback { public void install(ControllerContext ctx) { System.out.println("Bean " + ctx.getName() + " is being installed"; } public void uninstall(ControllerContext ctx) { System.out.println("Bean " + ctx.getName() + " is being uninstalled"; } } The install method will be called during the bean's deployment and the uninstall method during its undeployment. Although we are adding behaviour to the deployment and undeployment process using callbacks we are not actually using AOP to achieve this. The reason we have included them in this section, and the reason why they are part of the aop XML schema, is that they use the pointcut expression functionality of JBoss AOP to determine which bean classes they should apply to. We have already shown how the classes attribute allows you to write a shorthand pointcut expression to target annotated bean classes. Later in Part III - AOP Development we will show how it is possible to use regular pointcut expressions to target classes in a much more powerful way.
Adding service lookup through JNDI Until now we have looked up references to bean instances representing services through the microcontainer controller. Whilst there is nothing wrong with this it is not ideal since we must first have a reference to the microcontainer kernel before we can access the controller: private HRManager manager; private EmbeddedBootstrap bootstrap; private Kernel kernel; private KernelController controller; private final static String HRSERVICE = "HRService"; ... // Start JBoss Microcontainer bootstrap = new EmbeddedBootstrap(); bootstrap.run(); kernel = bootstrap.getKernel(); controller = kernel.getController(); ... ControllerContext context = controller.getInstalledContext(HRSERVICE); if (context != null) { manager = (HRManager) context.getTarget(); } Handing out kernel references to every client that looks up a service represents a significant risk as it provides wide-spread access to the microcontainer configuration. It would be better to apply the ServiceLocator pattern and have a class that performs lookups on behalf of the clients. Better still we could pass the bean references, together with their names, to the ServiceLocator at deployment time using a lifecycle callback so that it could look them up without knowing about the microcontainer at all. Undeployment would subsequently remove the bean references from the ServiceLocator to prevent further lookups. While it would not be too difficult to write our own ServiceLocator implementation we can save time by integrating an existing one such as JBoss Naming Service (JBoss NS). This has the additional benefit of complying to the Java Naming and Directory Interface (JNDI) specification. JNDI enables clients to access different, possibly multiple, naming services using a common API. All that we need to do is create an instance of JBoss NS using the microcontainer and then add a lifecycle callback to perform the binding and unbinding of our bean references during deployment/undeployment. We can then mark the bean classes that we wish to bind references for using annotations and find them at runtime using the shorthand pointcut expression as shown earlier.
Advanced deployment Mention the need for a main deployer and explain how we add various deployers to this.
Deployment stages and actions Give example of using aspectized bean deployer and show how it's the same as the BasicXMLDeployer.
Changing the descriptor file format Give an example where we move the jboss-beans.xml file out of the META-INF directory and change the location of the classes.
Changing the archive structure Give an example of changing the jboss-beans.xml file for a jboss-beans.properties file.
Changing the classloader
Adding a deployment action
POJO Development Introduction In Part I of this guide we looked at a complete use-case showing how to develop a service using POJOs and access it from one or more clients. This should have given you a good overview of how the microcontainer is intended to be used in real applications. In Part II we look more closely at the various features available for creating POJOs, wiring them together, deploying them into the runtime environment, and managing their dependencies. With this knowledge you should be able to create flexible and reusable services that can be integrated together to provide a custom runtime suited to your needs. Running the examples You can find examples of how to use each of the features described here in the examples/User_Guide/pojoDevelopment directory: alias annotations autowiring classloader collections constructor demand factory injection installation javabeans lifecycle locator properties simple spring supply To build these simply cd to this directory and enter mvn package. A target directory will then be created in each subdirectory as follows: target/archive-tmp /classes /<exampleName>-1.0.0.jar /<exampleName>-dist.dir The contents of the <exampleName>-dist.dir will be similar for each example: <exampleName>-1.0.0.jar log4j.properties lib/concurrent-1.3.4.jar /jboss-common-core-2.0.4.GA.jar /jboss-common-core-2.2.1.GA.jar /jboss-common-logging-log4j-2.0.4.GA.jar /jboss-common-logging-spi-2.0.4.GA.jar /jboss-container-2.0.0.Beta6.jar /jboss-dependency-2.0.0.Beta6.jar /jboss-kernel-2.0.0.Beta6.jar /jbossxb-2.0.0.CR4.jar /log4j-1.2.14.jar /xercesImpl-2.7.1.jar If you previously used the examples from Part I you will notice that we no longer have a run.sh script. Instead we have made <exampleName>-1.0.0.jar executable. This means that it contains a META-INF/MANIFEST.MF file with Main-Class and Class-Path attributes: Main-Class: org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap Class-Path: . lib/jboss-common-core-2.0.4.GA.jar lib/junit-3.8.1.jar l ib/jboss-common-logging-spi-2.0.4.GA.jar lib/xercesImpl-2.7.1.jar lib /ant-1.6.5.jar lib/jboss-container-2.0.0.Beta6.jar lib/jboss-common-c ore-2.2.1.GA.jar lib/dtdparser121-1.2.1.jar lib/jbossxb-2.0.0.CR4.jar lib/jboss-aop-2.0.0.beta1.jar lib/jboss-common-logging-log4j-2.0.4.G A.jar lib/activation-1.0.2.jar lib/jboss-test-1.0.4.GA.jar lib/xml-ap is-2.7.1.jar lib/concurrent-1.3.4.jar lib/webdavlib-2.0.jar lib/jboss -profiler-jvmti-1.0.0.CR5.jar lib/jboss-kernel-2.0.0.Beta6.jar lib/jb oss-managed-2.0.0.Beta6.jar lib/jboss-metatype-2.0.0.Beta6.jar lib/co mmons-httpclient-2.0.2.jar lib/javassist-3.6.0.GA.jar lib/jboss-loggi ng-spi-2.0.3.GA.jar lib/log4j-1.2.14.jar lib/jboss-dependency-2.0.0.B eta6.jar lib/ant-junit-1.6.5.jar Certain JAR files included in the Class-Path attribute are not present in the lib directory. This is because the maven-jar-plugin is creating the Class-Path value using its internal dependency resolution mechanism and including JARs that are not actually needed at runtime. This is the fault of the pom.xml descriptors in projects such as jbossxb, which the microcontainer depends on, that do not currently mark their dependencies as optional. For clarity we have prevented all of these JARs appearing in the lib directory of the distribution by explicitly listing only those that are required in the examples/User_Guide/pojoDevelopment/dist.xml file which is passed to the maven-assembly-plugin. Once we have fixed the pom.xml files in the projects that the microcontainer depends on then this filtering will no longer be necessary. The Main-Class attribute contains the name of a StandaloneBootstrap class that is provided with the microcontainer. This class is very similar to the EmbeddedBootstrap class that we used in Part I with the addition of a main() method so that it can be called from the command line: public class StandaloneBootstrap extends BasicBootstrap { protected BasicXMLDeployer deployer; protected String[] args; public static void main(String[] args) throws Exception { StandaloneBootstrap bootstrap = new StandaloneBootstrap(args); bootstrap.run(); } public StandaloneBootstrap(String[] args) throws Exception { super(); this.args = args; } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BasicXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); ClassLoader cl = Thread.currentThread().getContextClassLoader(); for (Enumeration e = cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } for (Enumeration e = cl.getResources("META-INF/" + StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } // Validate that everything is ok deployer.validate(); } protected void deploy(URL url) throws Throwable { deployer.deploy(url); } protected void undeploy(URL url) { try { deployer.undeploy(url); } catch (Throwable t) { log.warn("Error during undeployment: " + url, t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); deployer.shutdown(); } } } The bootstrap() method also includes code to automatically scan the classpath for files called jboss-beans.xml (the value of StandaloneKernelConstants.DEPLOYMENT_XML_NAME) that may or may not reside in a META-INF directory. If any such files are found then their URLs are passed to the BasicXMLDeployer to deploy any beans declared inside. In our examples we place a jboss-beans.xml file into the META-INF directory of our <exampleName>-1.0.0.jar so that it can be found in this way. To run any of the examples simply cd to the relevant target/<exampleName>-dist.dir directory and execute the JAR file using the java -jar <exampleName>-1.0.0.jar command, replacing <exampleName> with the name of the example you are running, .e.g java -jar constructor-1.0.0.jar Running an example causes the following sequence of events to occur: The <exampleName>-1.0.0.jar is executed. The StandaloneBootstrap class defined in the Main-Class attribute of the META-INF/MANIFEST.MF file within the JAR is run which bootstraps the microcontainer and searches the classpath for files called jboss-beans.xml. The META-INF/jboss-beans.xml file in the <exampleName>-1.0.0.jar is found and the beans declared within it are deployed. The main() method of the StandaloneBootstrap class ends and the JVM shuts down undeploying the beans in reverse order. If you would like to use the StandaloneBootstrap class within your own applications to deploy beans on startup then you can do so as follows: import org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap; public class MyApp { public static void main(String[] args) throws Exception { StandaloneBootstrap.main(args); // your application code... } } Because the deploy() and undeploy() methods of the StandaloneBootstrap are protected you will not be able to call them from your application after the initial startup. If you wish to deploy and undeploy beans at runtime then the EmbeddedBootstrap class may be a better choice. Alternatively you are free to create your own bootstrap class that uses BasicBootstrap and BasicXMLDeployer to provide whatever functionality you need. Configuring POJOs In accordance with modern development methods JBoss Microcontainer supports POJO configuration via annotations and/or deployment descriptors. The decision to use one or the other depends on what you are trying to achieve. If there is a sensible default configuration for your POJOs then it may be worthwhile defining this using annotations so that users do not have to maintain a separate deployment descriptor. Since annotations are overriden by deployment descriptors at runtime it is always possible for users to change the default configuration using a descriptor if necessary. Annotations are overriden by deployment descriptors at runtime. If there is no sensible default configuration then it may be worthwhile using a deployment descriptor instead of annotations. This keeps the source code free of potentially redundant information and allows for easy customization since the initial deployment descriptor acts as a template for further changes. Sometimes a mixture of annotations and a deployment descriptor is best. It's up to you to discover what makes most sense for your particular situation.
Using annotations With the notable exception of defining classloaders nearly all of the microcontainer features can be used by adding annotations to your POJO classes. We are not able to define classloaders using annotations for the simple reason that in order to read any annotations we must first load the class. Once the class is loaded we cannot change its classloader so a classloader annotation would be useless. The microcontainer annotations live in the org.jboss.beans.metadata.api.annotations package and to use them you need Java 1.5 or above. If you are using Java 1.4 or below then JBoss Microcontainer allows you to define a subset of the annotations in the XML deployment descriptor. The caveat is that these apply to bean instances instead of bean classes. As with normal annotations you are free to add as many as necessary at a single point. However you must always specify the fully-qualified class name since there is no way to 'import' packages in XML. Currently you can place annotations inside the following elements: <deployment> -all beans in the deployment inherit this annotation <deployment name="SimpleDeployment" xmlns="urn:jboss:bean-deployer:2.0"> <annotation>@org.jboss.test.TestAnnotation</annotation> </deployment> <bean> <bean name="example" class="org.jboss.test.Example"> <annotation>@org.jboss.test.TestAnnotation1</annotation> <annotation>@org.jboss.test.TestAnnotation2</annotation> </bean> <constructor> <bean name="example" class="org.jboss.test.Example"> <constructor> <annotation>@org.jboss.test.TestAnnotation</annotation> </constructor> </bean> <create>, <start>, <stop>, <destroy> <bean name="example" class="org.jboss.test.Example"> <create> <annotation>@org.jboss.test.TestAnnotation</annotation> </create> </bean> <install>, <uninstall> <bean name="example" class="org.jboss.test.Example"> <install method="someMethod"> <annotation>@org.jboss.test.TestAnnotation</annotation> </install> </bean> <incallback>, <uncallback> <value> <bean name="example" class="org.jboss.test.Example"> <property name="PropertyName"> <annotation>@org.jboss.test.TestAnnotation</annotation> <value>123</value> </property> </bean> Annotations declared in XML apply to bean instances instead of bean classes. Examples of how to use both normal and XML annotations will be given in the following sections.
Writing deployment descriptors Deployment descriptors externalize the configuration of POJOs into one or more files that are separate from the source code. This means that changes can be made without having to recompile any classes. The usual way to define a deployment descriptor is using the bean-deployer XML schema whose root element is <deployment>. This is used to group multiple beans together so that they are deployed as a unit: <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <!-- Bean definitions --> </deployment> The bean definitions are created using <bean> elements that each describe a single POJO instance. Each bean is given a name so that it can be referenced elsewhere in the deployment descriptor or looked up by a client at runtime. <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="Person" class="org.jboss.example.microcontainer.PersonBean"/> <bean name="Address" class="org.jboss.example.microcontainer.AddressBean"/> </deployment> The name of the file containing these elements can be anything you like providing that a deployer can access it and parse the contents correctly. By convention it is called jboss-beans.xml as anything that ends in -beans.xml is found by default using the FileStructure deployer. Although deployment descriptors are usually created using the bean-deployer XML schema it is also possible to use other XML schemas or even Java properties as shown in the following sections.
Using JavaBean XML Together with the bean-deployer XML schema the microcontainer also contains a javabean XML schema. This is a lightweight version of bean-deployer that allows for the construction and configuration of JavaBeans without any advanced features like bean injection, callbacks or dependencies. It is intended to be used in situations where the microcontainer has been customised to remove all of the advanced functionality so that it can be bootstrapped in very small runtime environments. Construction of POJOs is performed using either a normal constructor or a static factory method. In either case constructor or method parameters can be added as necessary: Default constructor <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"/> Contructor with parameters <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <constructor> <property name="ABoolean">true</property> <property name="ACharacter">x</property> <property name="AShort">123</property> </constructor> </javabean> Static factory method <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <constructor factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory" factoryMethod="newInstance"/> </javabean> Static factory method with parameters <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <constructor factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory" factoryMethod="newInstance"> <property name="AString">StringValue</property> <property name="AByte">12</property> </constructor> </javabean> JavaBean declarations do not include a name attribute which means that you cannot inject references into other JavaBeans or lookup a reference to a JavaBean instance from a client at runtime. Once a JavaBean has been constructed then simple injection of property values is possible using the <property> element: <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <property name="ADouble">3.14e12</property> <property name="ADate">Jan 01 00:00:00 CET 2001</property> <property name="ABigDecimal">12e4</property> <property name="ABigInteger">123456</property> <property name="abyte">12</property> </javabean> As with properties defined using the bean-deployer XML schema the string values are converted into objects of the correct type using JavaBean PropertyEditors. For cases where the type is ambiguous, e.g. when defining numbers, you can specify the required type by including a class attribute: <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <property name="ANumber" class="java.lang.Long">12345</property> </javabean> Beans created using the bean-deployer XML schema can include JavaBeans created using the javabean XML schema instead of string values. This provides a simple way to inject objects composed of multiple values into a bean property without having to write a complicated property editor: <bean name="example" class="org.jboss.acme.Example"> <property name="myProperty"> <javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.SimpleBean"> <property name="ADate">Jan 01 00:00:00 CET 2001</property> <property name="ABigDecimal">12e4</property> </javabean> </property> </bean>
Using Spring XML Spring like JBoss Microcontainer allows POJOs to be created and configured using an XML schema. As the microcontainer largely supports the same set of features as Spring it is possible to use the spring-beans schema to define beans instead of the bean-deployer schema. This makes migrating services built and tested using Spring to JBoss Microcontainer very straightforward. To define beans using the spring-beans schema you need to include spring-int.jar on the microcontainer classpath. You can then create a deployment descriptor containing a <beans> element at the root instead of the usual <deployment> element: <beans xmlns="urn:jboss:spring-beans:2.0"> <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean"> <constructor-arg index="2"> <value>SpringBean</value> </constructor-arg> <constructor-arg index="0"> <value>1</value> </constructor-arg> <constructor-arg index="1"> <value>3.14159</value> </constructor-arg> <property name="mylist"> <list value-type="java.lang.String"> <value>onel</value> <value>twol</value> <value>threel</value> </list> </property> <property name="myset"> <set value-type="java.lang.String"> <value>ones</value> <value>twos</value> <value>ones</value> </set> </property> <property name="mymap"> <map key-type="java.lang.String"> <entry> <key> <value>test_key</value> </key> <value type="java.lang.String">myvalue</value> </entry> </map> </property> </bean> </beans> The namespace declaration xmlns="urn:jboss:spring-beans:2.0" tells the microcontainer that it should interpret the XML according to the spring-bean schema. You can even mix beans declared using the bean-deployer schema with those declared using the spring-beans schema just like we did with the javabean schema. All that you need to do is include the correct namespace declarations in the relevant elements: JBoss Microcontainer deployment containing Spring defined beans <deployment xmlns="urn:jboss:bean-deployer:2.0"> <bean name="oldBean" class="org.jboss.test.spring.support.OldBean"> <property name="testBean"> <inject/> </property> </bean> <bean xmlns="urn:jboss:spring-beans:2.0" id="testBean" class="org.jboss.test.TestBean"> <property name="mylist"> <list value-type="java.lang.String"> <value>onel</value> <value>twol</value> <value>threel</value> </list> </property> </bean> </deployment> Spring defined deployment containing JBoss Microcontainer beans <beans xmlns="urn:jboss:spring-beans:2.0"> <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean"> <property name="refBean"> <ref bean="oldBean"/> </property> </bean> <bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" class="org.jboss.test.spring.support.OldBean"> <property name="myString">I'm an old bean</property> </bean> </beans> Adding spring-int.jar to the microcontainer classpath simply adds the ability to define beans using the spring-beans XML schema. It does not integrate JBoss Microcontainer with Spring libraries.
Using Java Properties Using XML schemas to create deployment descriptors provides us wth a powerful way to express complex configuration information. However the XML parsers that are needed to interpret this information are often large in size which doesn't help when bootstrapping the microcontainer in small runtime environments. For this reason you can also choose to create deployment descriptors using Java properties.
Creating POJOs
Defining classloaders In order to create POJO instances we must first load the corresponding POJO classes into the JVM using a classloader. JBoss Microcontainer does this by using the classloader associated with the current thread of execution, i.e. the thread context classloader. But what do we mean by the current thread of execution and who sets its context classloader? In all of our examples so far we have created applications that only use a single thread. This is the 'primordial' thread created by the main() function: public static void main(String[] args) {} As the only thread in the application (other than the garbage collecton thread which is created for every Java application) this executes all of the code including calling the deploy() method of our BasicXMLDeployer: public class BasicXMLDeployer extends BasicKernelDeployer { ... public KernelDeployment deploy(final URL url) throws Throwable { ... long start = System.currentTimeMillis(); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver); if (deployment == null) throw new RuntimeException("The xml " + url + " is not well formed!"); deployment.setName(url.toString()); if (trace) { long now = System.currentTimeMillis(); log.trace("Parsing " + url + " took " + (now-start) + " milliseconds"); } deploy(deployment); if (trace) { long now = System.currentTimeMillis(); log.trace("Deploying " + url + " took " + (now-start) + " milliseconds"); } return deployment; } ... } The deploy() method takes a URL representing the location of an XML deployment descriptor and passes it as a string to an unmarshaller. The unmarshaller parses the XML, converts it into an object representation called a KernelDeployment and sets its name. The KernelDeployment object is then passed to the deploy() method of the superclass BasicKernelDeployer. This iterates through all of the beans in the deployment creating a context for each one which it subsequently passes to the contoller's install() method to peform the deployment. The controller then performs actions on each context to take the bean from one state to another: NOT_INSTALLED, DESCRIBED, CONFIGURED, INSTANTIATED, CREATE, START, INSTALLED. Once a bean reaches the INSTALLED state then it's considered to be deployed. During the deployment process, as the controller performs the Instantiate action, the thread context classloader is used to load the bean's class into the JVM. As all of the controller code is executed by the thread that calls controller.install() we refer to this as the current thread of execution. Therefore when using the BasicXMLDeployer the classloader used to load bean classes is retrieved from the thread that calls the BasicXMLDeployer's deploy() method as this goes on to call controller.install() which subsequently executes the Instantiate action. For all of our examples this is the primordial thread whose context classloader is set on startup to the classloader that loaded the application, i.e. the application classloader. This means that in our examples the microcontainer can load any bean classes present on the application, extension or boot classpaths. What happens though if we create our own threads in the application and use these to call the deploy() method of our BasicXMLDeployer? If you create a thread then by default its context classloader will be set to the parent thread's context classloader. As any hierarchy of threads is ultimately rooted at the primordial thread this means that by default they will all use the application classloader. To change this you simply need to call setContextClassLoader() on a thread at runtime. This is typically done on the current thread using Thread.currentThread().setContextClassloader(). If you choose not to use the BasicXMLDeployer and instead use the equivalent aspectized deployer then the classloader used to load bean classes is taken from the thread that calls the process() method of the MainDeployer. This is because the MainDeployer process() method iterates through all of the registered deployers calling their process() methods which in turn call controller.install() to perform the deployment. Now that we know the default classloader comes from the current thread of execution, which if not set explicitly is set on startup to be the application classloader, how can we change it to load bean classes from other locations? If you are using the BasicXMLDeployer or its equivalent aspectized deployer then you can define classloaders for entire deployments or individual beans by including <classloader> elements within the XML deployment descriptor. To specify a different classloader for all the beans in a deployment you need to include a <classloader> element above all of the <bean> elements: <deployment> <classloader><inject bean="deploymentCL"/></classloader> <bean name="Bean1" ... > ... </bean> <bean name="Bean2" ... > ... </bean> </deployment> If instead you wish to override either the default classloader or a deployment classloader for a particular bean then you need to include a <classloader> element within the <bean> definition itself: <deployment> <classloader><inject bean="deploymentCL"/></classloader> <bean name="Bean1" ... > <classloader><inject bean="beanCL"/></classloader> ... </bean> <bean name="Bean2" ... > ... </bean> </deployment> Finally you can choose to use the default classloader for a bean instead of the deployment classloader, if one is defined, by including a <classloader> element with a </null> value: <deployment> <classloader><inject bean="deploymentCL"/></classloader> <bean name="Bean1" ... > <classloader><inject bean="beanCL"/></classloader> ... </bean> <bean name="Bean2" ... > <classloader></null></classloader> ... </bean> </deployment> The classloader beans that you inject must be deployed in the runtime environment before bean classes can be loaded. Typically this is done by also declaring them in the XML deployment descriptor: <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="URL" class="java.net.URL"> <constructor> <parameter>file:/Users/newtonm/jbossmc/microcontainer/trunk/docs/examples/User_Guide/gettingStarted/commandLineClient/target/client-cl.dir/otherLib/humanResourcesService-1.0.0.jar</parameter> </constructor> </bean> <bean name="customCL" class="java.net.URLClassLoader"> <constructor> <parameter> <array> <inject bean="URL"/> </array> </parameter> </constructor> </bean> <bean name="HRService" class="org.jboss.example.service.HRManager"> <classloader><inject bean="customCL"/></classloader> ... </bean> If a classloader is not available for a bean when an attempt is made to deploy it then the bean will remain in a pre INSTANTIATED state. Once the classloader is deployed then the bean will automatically continue to deploy. This means that you can define classloaders in the deployment descriptor after beans that depend on them and everything will deploy as expected. User defined classloaders are detected by the microcontainer during the deployment process as the controller performs the Instantiate action. They are used instead of the default classloader by calling setContextClassLoader() on the current thread. In this way they can be subsequently retrieved by code that loads the bean class using Thread.currentThread().getContextClassLoader(). After the bean class has been loaded the default classloader is put back by calling setContexClassLoader() again.
Calling constructors Creating POJO instances is performed either by calling a constructor or using a factory method. The <constructor> element is used in both cases and parameters can be passed if necessary using nested <parameter> elements. Annotations also exist for either case with parameter values represented as annotations of the constructor parameters themselves. At present it is not possible to create a POJO instance only using annotations. This is because classes are not automatically loaded and scanned whenever they are added to the classpath. Doing so would significantly reduce the performance of the deployment process as all classes would need to be loaded, even if they were not yet required. Instead you must always define beans using a deployment descriptor as this tells the microcontainer which classes to load. These classes are subsequently scanned for annotations such as @Constructor and @Factory to discover how to create instances. <bean name="SimpleBean" class="org.jboss.example.SimpleBean"/> Default constructor @Constructor public TestConstructorBean() { ... } <bean name="Test" class="org.jboss.example.constructor.TestConstructorBean"/> Constructor with parameters @Constructor public TestConstructorBean(@StringValue("this is a test contructor") String testString, @StringValue("25") int testNumber) { ... } <bean name="Test" class="org.jboss.example.constructor.TestConstructorBean"> <constructor> <parameter>this is a test constructor</parameter> <parameter>25</parameter> </constructor> </bean> Choosing between two constructors with the same number of parameters public TestConstructorBean(String testString, int testNumber) { ... } @Constructor public TestConstructorBean(@StringValue("this is a test constructor") String testString, @StringValue(value="25", type="long") long testNumber) { ... } <bean name="Test" class="org.jboss.example.constructor.TestConstructorBean"> <constructor> <parameter>this is a test constructor</parameter> <parameter class="long">25</parameter> </constructor> </bean> You only need to include the class attribute on enough parameters to resolve the ambiguity. You can also specify javabeans as parameters if required using the @JavaBeanValue annotation or <javabean> element. In this particular case the annotation is not very useful as it can only call the default constructor of the javabean class to create an instance. If you want to use a different constructor or inject properties then you should use the XML element instead. @Constructor public TestConstructorBean(@StringValue("this is a test constructor") String testString, @JavaBeanValue("org.jboss.test.Person") Person testPerson) { ... } <bean name="Test" class="org.jboss.example.constructor.TestConstructorBean"> <constructor> <parameter>this is a test constructor</parameter> <parameter> <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.Person"> <constructor> <property name="age">21</property> </constructor> <property name="firstName">Mark</property> <property name="lastName">Newton</property> </javabean> </parameter> </constructor> </bean> Finally you can inject references to other beans or their properties into constructor parameters giving you complete control of the construction of your POJOs. @Constructor public TestConstructorBean(@Inject(bean="TestPerson") Person testPerson, @Inject(bean="TestAddress", property="street") String street) { ... } <bean name="Test" class="org.jboss.example.constructor.TestConstructorBean"> <constructor> <parameter> <inject bean="TestPerson"/> </parameter> <parameter> <inject bean="TestAddress" property="street"/> </parameter> </constructor> </bean>
Using factories If you have a number of classes that share the same interface then you may want to use a factory to create your POJO instances. JBoss Microcontainer provides support for static or non-static factory methods which can also take parameters if necessary. Static factory method @Factory (factoryClass="org.jboss.example.MyFactory", factoryMethod="newInstance") public class SimpleBean { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <constructor factoryClass="org.jboss.example.MyFactory" factoryMethod="newInstance"/> </bean> Static factory method with parameters @Factory (factoryClass="org.jboss.example.MyFactory", factoryMethod="newInstance", parameters={@Value(string=@StringValue("a string")),@Value(string=@StringValue("7"))}) public class SimpleBean { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <constructor factoryClass="org.jboss.example.MyFactory" factoryMethod="newInstance"> <parameter>a string</parameter> <parameter>7</parameter> </constructor> </bean> Non-static factory method @Factory (factory=@Value(javabean=@JavaBeanValue("org.jboss.example.MyOtherFactory")), factoryMethod="createBean") public class SimpleBean { ... } <bean name="MyOtherFactory" class="org.jboss.example.MyOtherFactory"/> <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <constructor factoryMethod="createBean"> <factory bean="MyOtherFactory"/> </constructor> </bean> Non-static factory method with parameters @Factory (factory=@Value(javabean=@JavaBeanValue("org.jboss.example.MyOtherFactory")), factoryMethod="createBean", parameters={@Value(string=@StringValue("a string")),@Value(string=@StringValue("7"))}) public class SimpleBean { ... } <bean name="MyOtherFactory" class="org.jboss.example.MyOtherFactory"/> <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <constructor factoryMethod="createBean"> <factory bean="MyOtherFactory"/> <parameter>a string</parameter> <parameter>7</parameter> </constructor> </bean> For the special case where a bean implements its own static factory method in order to create itself then you can also use a shorthand notation: Bean implementing its own static factory method public class SimpleBean { @FactoryMethod public static newInstance(@StringValue("a string") String name, @StringValue("5") int level) { ... } } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <constructor factoryMethod="newInstance"> <parameter>a string</parameter> <parameter>5</parameter> </constructor> </bean> Note that the @FactoryMethod annotation doesn't have a parameter attribute as the method parameters themselves are annotated. Factory method parameters can also be configured using JavaBeans and injected bean references if necessary just like constructor parameters.
Creating bean aliases By default each bean declared in the deployment descriptor has a unique name that is used to inject it into other beans or to provide a reference to clients at runtime. Sometimes however it is useful to define additional names or aliases. This can be done using the @Aliases annotation or <alias> XML element. System property replacement is used by default to change the value of the alias at runtime but you can disable this if required. Defining extra bean names @Aliases({"MyAlias", "Test: ${test.name}"}) public class SimpleBean { ... } <bean name="MyBean" class="org.acme.SimpleBean"> <alias>MyAlias</alias> <alias>Test: ${test.name}</alias> </bean> Disabling System property replacement @Aliases({"MyAlias", "Test: ${test.name}"} replace="false") public class SimpleBean { ... } <bean name="MyBean" class="org.acme.SimpleBean"> <alias>MyAlias</alias> <alias replace="false">Test: ${test.name}</alias> </bean> The type of an alias doesn't have to be a string. If you want to choose a different type then you can specify a class attribute in the <alias> XML element. At present you cannot do this using the @Aliases annotation. Choosing a different alias type <bean name="MyBean" class="org.acme.SimpleBean"> <alias class="java.lang.Integer">12345</alias> </bean> Sometimes you may wish to define an alias for a bean after it has been deployed. This can be done using the standalone <alias> element in the deployment descriptor. There is no equivalent annotation in this case as there is no sensible place to put it. Defining a standalone alias <deployment name="FirstDeployment" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="Bean1" class="java.lang.Object"/> <bean name="Bean2" class="java.lang.Object"/> </deployment> <deployment name="SecondDeployment" xmlns="urn:jboss:bean-deployer:2.0"> <bean name="Xyz1" class="java.lang.Object"> <property name="locker1"><inject name="Lock1"></property> <property name="locker2"><inject name="Lock2"></property> </bean> <alias name="Bean1">Lock1</alias> <alias name="Bean2">Lock2</alias> </deployment> Standalone aliases behave just like normal beans with respect to dependencies. Specifically they won't be deployed until the beans that they represent have been deployed first. Likewise when a bean is undeployed then any corresponding standalone aliases are undeployed first. Furthermore if any beans depend on a standalone alias then they will not be deployed until the alias is deployed first. Similarly undeploying a standalone alias will cause all dependent beans to be undeployed, regardless of whether the bean that it represents remains deployed.
Injecting properties
Using values Once a POJO instance has been created then it can be configured by injecting property values. Like most other features this can be done using either annotations or a deployment descriptor. For each property that you wish to inject the bean must define an appropriate setter method for the microcontainer to call. public class PropertiesBean { public void setTitle(@StringValue("JBoss Microcontainer") String title) { ... } public void setLink(@StringValue("http://www.jboss.org") URL link) { ... } public void setNumber(@StringValue("4") int number) { ... } } <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="title">JBoss Microcontainer</property> <property name="link">http://www.jboss.org</property> <property name="number">4</property> </bean> As you have probably noticed we are required to enter all of our values as strings since we are dealing with text files. These strings are converted into objects of the correct type using JavaBean PropertyEditors. If the property takes an interface or abstract class then you can pass a specific implementation using a type or class attribute depending on whether you're using annotations or XML. public class PropertiesBean { public void setNumber(@StringValue(value="4", type="java.lang.Long") Number number) { ... } } <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="number" class="java.lang.Long">4</property> </bean> Sometimes you may want to pass in a value that isn't of the same type as the property but can be progressed into it. Progression is typically used for converting numbers from one type to another, e.g. Short to Int or Float to Double. JBoss Microcontainer by default will automatically perform progression using a SimpleProgressionConverter implementation. <bean name="SimpleBean" class="org.jboss.test.SimpleBean"> <property name="anInt"> <javabean xmlns="urn:jboss:javabean:2.0" class="java.lang.Double"> <constructor> <property name="aDouble">123.456</property> </constructor> </javabean> </property> <property name="aShort"> <javabean xmlns="urn:jboss:javabean:2.0" class="java.lang.Float"> <constructor> <property name="aFloat">987.6543</property> </constructor> </javabean> </property> <property name="aFloat"> <javabean xmlns="urn:jboss:javabean:2.0" class="java.lang.Integer"> <constructor> <property name="anInt">314159</property> </constructor> </javabean> </property> </bean> You can replace the default progression converter implementation with one of your own by setting the org.jboss.reflect.plugins.progressionConverter system property using a fully-qualified class name. If you want to prevent progression from occuring altogether then you can use the NullProgressionConverter which is also provided. -Dorg.jboss.reflect.plugins.progressionConverter=org.jboss.reflect.plugins.NullProgressionConvertor If you want to use a null value then you need to use the @NullValue annotation or <null/> element. This is so we can differentiate it from the string 'null'. public void setTitle(@NullValue String title) { ... } <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="title"><null/></property> </bean> Similarly if you want to refer to the current object then you should use the @ThisValue annotation or <this/> element. public void setObject(@ThisValue Object target) { ... } <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="target"><this/></property> </bean> Property values can also be defined using a longer form of XML if you prefer. <bean name="PropertiesBean" class="org.jboss.example.microcontainer.properties.PropertiesBean"> <property name="number"> <value class="java.lang.Long">4</value> </property> </bean> This is primarily used when configuring values representing collections such as lists, sets and arrays. Elements of a collection are defined by listing annotations or nesting <value> elements as follows: @CollectionValue(elementClass="java.lang.String", {@Value(string=@StringValue("string1")), @Value(string=@StringValue("string2")), @Value(string=@StringValue("string3")), @Value(string=@StringValue("string4"))}) public void setCollection(Collection collection) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="collection"> <collection elementClass="java.lang.String"> <value>string1</value> <value>string2</value> <value>string3</value> <value>string4</value> </collection> </property> </bean> The elementClass attribute specifies the default class for the values. This can be overriden for individual values using the type or class attributes. @CollectionValue(elementClass="java.lang.String", {@Value(string=@StringValue("string1")), @Value(string=@StringValue("string2")), @Value(string=@StringValue(value="3.0", type="java.lang.Float")), @Value(string=@StringValue(value="4", type="java.lang.Integer"))}) public void setCollection(Collection collection) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="collection"> <collection elementClass="java.lang.String"> <value>string1</value> <value>string2</value> <value class="java.lang.Float">3.0</value> <value class="java.lang.Integer">4</value> </collection> </property> </bean> The type of each value must be specified using either the elementClass or type/class attribute in order for the collection to be created. Lists, sets and arrays take the same form as the collection annotation and XML element. @ListValue(elementClass="java.lang.String", {@Value(string=@StringValue("my first string")), @Value(string=@StringValue("my second string"))}) public void setList(List list) { ... } @SetValue(elementClass="java.lang.Integer", {@Value(string=@StringValue("50")), @Value(string=@StringValue("55"))}) public void setSet(Set set) { ... } @ArrayValue(elementClass="java.lang.Float", {@Value(string=@StringValue("1.0")), @Value(string=@StringValue("2.0"))}) public void setArray(Object[] array) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="list"> <list elementClass="java.lang.String"> <value>my first string</value> <value>my second string</value> </list> </property> <property name="set"> <set elementClass="java.lang.Integer"> <value>50</value> <value>55</value> </set> </property> <property name="array"> <array elementClass="java.lang.Float"> <value>1.0</value> <value>2.0</value> </array> </array> </bean> They can even be nested within one another if required. @ListValue(elementClass="java.lang.String", {@Value(string=@StringValue("my first string")), @Value(string=@SetValue(elementClass="java.lang.Integer", {@Value(string=@StringValue("1")), @Value(string=@StringValue="2"))}) )}) public void setList(List list) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="list"> <list elementClass="java.lang.String"> <value>my first string</value> <value> <set elementClass="java.lang.Integer"> <value>1</value> <value>2</value> </set> </value> </list> </property> </bean> Maps can also be created using multiple entries of key/value pairs. As we now have two types to consider we must use the keyClass and valueClass attributes to specify the default classes for each entry. Again these can be overriden for individual entries if necessary. @MapValue(keyClass="java.lang.String", valueClass="java.lang.String", {@EntryValue(key=@Value(string=@StringValue("foo.bar.key")), value=@Value(string=@StringValue("QWERT"))), @EntryValue(key=@Value(string=@StringValue("xyz.key")), value=@Value(string=@StringValue("QWERTY"))) }) public void setMap(Map<String, String> map) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="map"> <map keyClass="java.lang.String" valueClass="java.lang.String"> <entry> <key>foo.bar.key</key> <value>QWERT</value> </entry> <entry> <key>xyz.key</key> <value>QWERTY</value> </entry> </map> </property> </bean> So far we have defined collections, lists, sets, arrays and maps but all of these have multiple implementations, e.g. java.util.ArrayList, java.util.LinkedList, so which are we using at runtime? By default JBoss Microcontainer will look for an existing instance using the corresponding getter method for the property. If one is found then it is used. If not then the type of the property is analysed and providing that it represents a class (not an interface) then this is used to create a new instance. Failing that a default instance will be created as follows: Collection - java.util.ArrayList List - java.util.ArrayList Set - java.util.HashSet Array - java.lang.Object[] Map - java.util.HashMap If you want to override this behaviour and specify your own class then you can simply add a clazz attribute to your annotation or class attribute to your XML element containing the fully-qualified class name. This causes the microcontainer to create a new instance using the specified class. @SetValue(clazz="java.util.TreeSet", elementClass="java.lang.Integer", {@Value(string=@StringValue("50")), @Value(string=@StringValue("55"))}) public void setSet(Set set) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="set"> <set class="java.util.TreeSet" elementClass="java.lang.Integer"> <value>50</value> <value>55</value> </set> </property> </bean> If you don't specify a clazz/class attribute but you want to ensure that a new instance is created then you can prevent the microcontainer from looking for a existing instance by specifying a preinstantiate attribute in the <property> element. Currently this cannot be achieved using annotations. <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <property name="list" preinstantiate="false"> <list elementClass="java.lang.String"> <value>string1</value> <value>string2</value> </list> </property> </bean> If you want to define a clazz/class attribute for an array then you must use the following syntax: [L<fully-qualified class name>; e.g. an array of strings - [Ljava.lang.String; or an array of integers - [Ljava.lang.Integer;
Calling methods Using PropertyEditors to create instances of objects from strings is fine in many situations but sometimes you need to inject a return value from a method call. As the method is responsible for creating the value we refer to it as a value factory. Hence the @ValueFactory annotation or <value-factory> element can be used in place of @StringValue or <value> to call a method and inject the returned value during deployment. @ValueFactory(bean="SimpleBean", method="getFullName") public void setName(String name) { ... } <bean name="PropHolder" class="org.jboss.test.kernel.config.support.PropHolder"> <property name="name"> <value-factory bean="SimpleBean" method="getFullName"/> </property> </bean> If you need to pass any parameters to the method then you can use multiple @Parameter annotations or nested <parameter> elements. @ValueFactory(bean="SimpleBean", method="getFullName", parameters="{@Parameter(string=@StringValue("Bob")), @Parameter(string=@StringValue("Smith"))}") public void setName(String name) { ... } <bean name="PropHolder" class="org.jboss.test.kernel.config.support.PropHolder"> <property name="name"> <value-factory bean="SimpleBean" method="getFullName"> <parameter>Bob</parameter> <parameter>Smith</parameter> </value-factory> </property> </bean> Alternatively if only one parameter is required then you can use the parameter attribute to create a shorthand version. However this only works for values that can be created from strings. @ValueFactory(bean="SimpleBean", method="getFullName", parameter="@Parameter(string=@StringValue("Bob"))") public void setName(String name) { ... } <bean name="PropHolder" class="org.jboss.test.kernel.config.support.PropHolder"> <property name="name"> <value-factory bean="SimpleBean" method="getFullName" parameter="Bob"/> </property> </bean> It is also possible to specify a default value to use in case the method returns null. This is done using the defaultValue/default attribute which like the parameter attribute only accepts values created using strings. @ValueFactory(bean="SimpleBean", method="getFullName", defaultValue="Mark Newton") public void setName(String name) { ... } <bean name="PropHolder" class="org.jboss.test.kernel.config.support.PropHolder"> <property name="name"> <value-factory bean="SimpleBean" method="getFullName" default="Mark Newton"/> </property> </bean>
Using bean references Injecting string-based properties or the return values of method calls into individual beans allows us to perform simple configurations. To create more complex configurations we need to wire beans together by injecting references using the @Inject annotation or <inject> element. @Inject(bean = "Name1") public void setSimpleBean(SimpleBean bean) { ... } <bean name="SimpleBean" class="org.jboss.test.SimpleBean"> <property name="simpleBean"> <inject bean="Name1"/> </property> </bean> Bean injections can be used anywhere a string value is used but you must ensure that the type of bean being injected is compatible with the type of property being set. It is also possible to inject a property from one bean into another using the property attribute. @Inject(bean = "Name1", property="age") public void setAge(Integer age) { ... } <bean name="SimpleBean" class="org.jboss.test.SimpleBean"> <property name="age"> <inject bean="Name1" property="age"/> </property> </bean> Although injection is simple to use it provides a very powerful way to create arbitrary relationships between POJO instances. The dependencies that are formed by these relationships are discussed in the next chapter 'Defining Dependencies'. Sometimes you may wish to declare a bean simply so that you can inject it into a single property. In this case you can replace the <inject> element with the bean declaration itself to reduce the amount of XML required. This is not possible using annotations as there is no annotation to declare a bean. <bean name="SimpleBean" class="org.jboss.test.SimpleBean"> <property name="testBean"> <bean="TestBean" class="org.jboss.test.TestBean"> <property name="age">25</property> </bean> </property> </bean>
Injecting context information You may recall that inside the microcontainer each bean is represented by a context which holds amongst other things the bean's current state. This context information can be injected into bean properties or constructor/factory-method parameters using the @Inject annotation or <inject> element together with a fromContext attribute. @Inject(bean="otherBean", fromContext="beanInfo") public void setBeanInfo(BeanInfo beanInfo) { ... } <bean name="sndBean" class="org.jboss.test.NameAwareBean"> <property name="beaninfo"> <inject bean="otherBean" fromContext="beaninfo"/> </property> </bean> If you want to inject information about the current bean's context then you can simply omit the bean attribute. @Inject(fromContext="beanInfo") public void setBeanInfo(BeanInfo beanInfo) { ... } <bean name="sndBean" class="org.jboss.test.NameAwareBean"> <property name="beaninfo"> <inject fromContext="beaninfo"/> </property> </bean> The fromContext attribute can take the following values: name - the name of the bean aliases - a list of the bean's other names metadata - information about the bean from annotations or deployment descriptors beaninfo - information about the bean from the bean class scope - the microcontainer scope that the bean belongs to id - the internal id of the bean within the microcontainer context - the bean context All context information is wrapped into unmodifiable objects to prevent the user from changing anything outside of the microcontainer's control.
Auto-wiring Having to write large amounts of configuration information just to wire together sometimes trivial beans can often be frustrating. For this reason JBoss Microcontainer provides the ability to autowire beans. Auto-wiring means that a bean's properties or constructor/factory-method parameters are set by automatically searching for matching beans. The benefit is that you don't have to specify the names of the beans to inject yourself but the drawback is that this only works reliably for small environments. If you have an environment where more than one bean matches the property or parameter being set then it becomes unclear from the configuration information which one will be chosen during deployment. To use auto-wiring you simply need to specify an @Inject annotation or <inject> element without a bean attribute for the parameter or property that you wish to set. @Inject public class Example(ThreadPool pool) { ... } <bean name="paramInj" class="com.acme.Example"> <constructor> <parameter name="threadPool"><inject/></parameter> </constructor> </bean> @Inject public void setThreadPool(ThreadPool pool) { ... } <bean name="propInj" class="com.acme.Example"> <property name="threadPool"><inject/></property> </bean> By default the microcontainer will search for a bean whose class matches that of the parameter/property. However you can change this behaviour when auto-wiring properties so that the microcontainer searches for a bean whose name matches the property name. This is done using the type attribute of the <inject> element. @Inject(type="ByName") public void setThreadPool(ThreadPool pool) { ... } <bean name="propInj" class="com.acme.Example"> <property name="threadPool"><inject type="ByName"/></property> </bean> If no match is found then by default the deployment will fail but for certain properties it may be acceptable for injection to occur after deployment. In these cases you can specify that a property should be set using a callback mechanism whenever a suitable bean becomes available. This is done using the option attribute. @Inject(type="ByName", option="Callback") public void setThreadPool(ThreadPool pool) { ... } <bean name="propInj" class="com.acme.Example"> <property name="threadPool"><inject type="ByName" option="Callback"/></property> </bean> Sometimes you may want to prevent a bean from being injected automatically using auto-wiring. In these situations you can set its autowire-candidate attribute to false so that it's not included in the search for matching beans. This is not currently possible using annotations as there is no annotation to declare a bean. <bean name="ignored" class="com.acme.Example" autowire-candidate="false" />
Defining dependencies
POJO dependencies Dependencies between beans (POJO instances) are created when they are wired together through the use of the @Inject annotation or <inject> element. Specifically a bean which has another bean injected into it is said to be dependent on the other bean. For example here we have a Person bean that is dependent on an Address bean. public class Person { @Inject(bean="AddressBean") public void setAddress(Address address) { ... } } <bean name="Person" class="org.jboss.test.Person"> <property name="address"> <inject bean="AddressBean"/> </property> </bean> The reason for the dependency is because the address property of the Person bean cannot be configured until the Address bean has been deployed. Internally JBoss Microcontainer enforces this by moving each bean through a series of states during deployment. Consequently the Person bean will be prevented from moving to the CONFIGURED state until the Address bean has reached the INSTALLED state representing a deployed bean. By default there are 8 states that a bean can be in during deployment and undeployment: NOT_INSTALLED - Metadata describing the bean has been parsed from annotations or a deployment descriptor. PRE_INSTALL - the scope of the bean within the microcontainer has been discovered and classloading dependencies have been resolved. DESCRIBED - Any AOP dependencies have been added. INSTANTIATED -All dependencies have been resolved to construct the bean. These include; a classloader exists, the class can be found, a constructor or factory method can be found and any parameter injections can be resolved. CONFIGURED - All the property injections can be resolved. This includes any injections within collections. CREATE - All the beans metioned in the @Depends annotation or <depends> element have reached the CREATE state including any parameter injections in the create method. START - All the beans metioned in the @Depends annotation or <depends> element have reached the START state including any parameter injections in the start method. INSTALLED - Any deployment actions have been processed and the bean has been added to the list of items that the controller supplies. You may notice that we refer to injections being resolved in the above list. This is a shorthand way of saying that an injected bean has reached a certain state. In our simple example we can say that the injected Address bean has been resolved when it reaches the INSTALLED state. If necessary you can change the state that an injected bean must reach before being considered resolved by using the dependentState/state attribute. public class Person { @Inject(bean="OtherBean", dependentState="Instantiated") public void setAddress(Address address) { ... } } <bean name="Person" class="org.jboss.test.Person"> <property name="address"> <inject bean="Address" state="Instantiated"/> </property> </bean> Here we are saying the Address bean needs to reach the INSTANTIATED state before the Person bean can use it to configure the address property and thus move to the CONFIGURED state. Be aware that setting the state value to Described in this case would not be appropriate since we must first have an instance of the Address bean before we can inject a reference to it into another bean. The following six values can be used for the dependentState/state attribute to control injection. If no value is specified then by default the Installed state is used. Described Instantiated Configured Create Start Installed The ability to control when injection occurs is especially useful when dealing with circular dependencies. A circular dependency happens when one bean depends on another which in turn depends on the first bean: <bean name="Circular1" class="org.jboss.example.InjectionBean"> <constructor> <parameter>Circular1</parameter> </constructor> <property name="other"> <inject bean="Circular2"/> </property> </bean> <bean name="Circular2" class="org.jboss.example.InjectionBean"> <constructor> <parameter>Circular2</parameter> </constructor> <property name="other"> <inject bean="Circular1"/> </property> </bean> In this configuration the microcontainer is unable to deploy either bean since each one is waiting in the INSTANTIATED state waiting for the other to reach the INSTALLED state. To solve this we can use the state attribute to specify that Circular1 can be injected into Circular2 as soon as it reaches the INSTANTIATED state. <bean name="Circular1" class="org.jboss.example.InjectionBean"> <constructor> <parameter>Circular1</parameter> </constructor> <property name="other"> <inject bean="Circular2"/> </property> </bean> <bean name="Circular2" class="org.jboss.example.InjectionBean"> <constructor> <parameter>Circular2</parameter> </constructor> <property name="other"> <inject bean="Circular1" state="Instantiated"/> </property> </bean> Circular2 can thus progress to the INSTALLED state whereupon Circular1 will inject it into its other property and continue deploying.
Supply and Demand Sometimes dependencies may exist between beans that are not wired together using injections. One example would be a bean representing a service that requires a transaction manager to be present in JNDI before it can start. In these situations we can use a @Demand annotation or <demand> element to specify that we need another bean to be deployed before we can reach a certain state. @Demands(@Demand("TransactionManager")) public class Example { ... } <bean name="TransactionManager" class="com.acme.TransactionManager"/> <bean name="Name2" class="com.acme.Example"> <demand>TransactionManager</demand> </bean> By default the bean declaring the demand will wait until the beans it requires have been deployed before it moves to the INSTANTIATED state. However you can change this using the whenRequired/state attribute to specify a different state that can only be reached once all the beans listed as demands have been deployed. @Demands(@Demand("TransactionManager", whenRequired="Start")) public class Example { ... } <bean name="TransactionManager" class="com.acme.TransactionManager"/> <bean name="Name2" class="com.acme.Example"> <demand state="Start">TransactionManager</demand> </bean> Here we are stating that the TransactionManager bean must be deployed before the Name2 bean can reach the Start state. To specify multiple dependencies on other beans you simply need to list @Demand annotations or nest <demand> elements: @Demands(@Demand("TransactionManager", whenRequired="Start"), @Demand("OtherBean")) public class Example { ... } <bean name="TransactionManager" class="com.acme.SomeSingleton"> <property name="host">http://www.jboss.org</property> </bean> <bean name="Name2" class="com.acme.Example"> <demand state="Start">TransactionManager</demand> <demand>OtherBean</demand> </bean> In addition to specifying dependencies on other beans you can also specify dependencies on arbitrary objects that other beans supply. This can be useful if a bean depends on something that is provided by multiple beans but doesn't necessarily care which one provides it. To create these arbitrary objects you need to use the @Supply annotation or <supply> element. @Supplies(@Supply("SomethingUseful")) public class Provider { ... } @Demands(@Demand("SomethingUseful")) public class Consumer { ... } <bean name="Provider" class="com.acme.Provider"> <supply>SomethingUseful</supply> </bean> <bean name="Consumer" class="com.acme.Consumer"> <demand>SomethingUseful</demand> </bean> A bean can also supply multiple objects if necessary: @Supplies(@Supply("SomethingUseful"), @Supply("SomethingElse")) public class Provider { ... } @Demands(@Demand("SomethingUseful")) public class Consumer { ... } @Demand(@Demand("SomethingElse")) public class OtherConsumer { ... } <bean name="Provider" class="com.acme.Provider"> <supply>SomethingUseful</supply> <supply>SomethingElse</supply> </bean> <bean name="Consumer" class="com.acme.Consumer"> <demand>SomethingUseful</demand> </bean> <bean name="OtherConsumer" class="com.acme.Consumer"> <demand>SomethingElse</demand> </bean> Behind the scenes JBoss Microcontainer creates a bean of type java.lang.Object for each @Supply annotation or <supply> element named after its value. These beans are then moved automatically through all of the states to reach the INSTALLED state and become deployed. From this point onwards the @Demand annotation and <demand> element work in exactly the same way as before, checking to see if the named bean has been deployed before allowing the bean declaring the demand/s to move to a certain state.
Service dependencies So far we have considered how POJOs depend on each other either explictly through injections or implicitly through the use of arbitrary objects supplied during deployment. These dependencies help us to assemble POJOs in a well defined order to create services but what about when one service depends on another? Services typically consist of many individual POJOs wired together in order to perform a well-defined function. Once a service is deployed it can be stopped and started as many times as necessary in order to make best use of valuable resources such as CPU and memory. This is possible thanks to the service lifecycle: create - the service has been deployed start - the service is started stop - the service is stopped destroy - the service is being undeployed If one service depends on another then we need someway to ensure that they are created and started in the correct order. Similarly we also need to ensure that they are stopped and destroyed correctly. This is done by adding a @Depends annotation or <depends> element to the POJO that defines a service's public methods and specifying the name of the bean that represents the other service. @Depends("AnotherBean") public class MyBean { ... } <bean name="AnotherBean" class="org.jboss.test.Example"/> <bean name="MyBean" class="org.jboss.test.Example"> <depends>AnotherBean</depends> </bean> The microcontainer will then ensure that the beans, representing the two services, are deployed in the correct order. Specifically the beans named in the @Depends or <depends> values will reach their CREATE states before the bean declaring the dependencies reaches its CREATE state. The same is true for the START, STOP and DESTROY states. It's possible to define multiple dependencies on other services simply by listing names or nesting <depends> elements: @Depends("AnotherBean", "YetAnotherBean") public class MyBean { ... } <bean name="AnotherBean" class="org.jboss.test.Example"/> <bean name="MyBean" class="org.jboss.test.Example"> <depends>AnotherBean</depends> <depends>YetAnotherBean</depends> </bean>
Adding deployment behaviour
Deployment actions In Part I - Getting Started we covered how to add behaviour to beans during the deployment and undeployment process using AOP lifecycle callbacks. This gave us a powerful way to apply common logic to a number of beans, identified using pointcut expressions, at various points in their lifecycles. However setting up AOP lifecycle callbacks for occasions when an individual bean needs to call arbitrary methods before deployment or after undeployment can be time consuming. Fortunately JBoss Microcontainer provides an alternative way to do this using deployment/undeployment actions. To specify a method within a bean that should be called after the bean reaches the START state you should use the @InstallMethod annotation or <install> element as follows: @InstallMethod public String doSomething() { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <install method="doSomething"/> </bean> Parameters can also be passed in using nested <parameter> elements or by defining values with annotations. @InstallMethod public String doSomething(@StringValue("10") Integer integer, @StringValue("my string") String string) { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <install method="doSomething"> <parameter>10</parameter> <parameter>my string</parameter> </install> </bean> If necessary multiple install methods can be defined. They will be called in the order in which they appear as annotations or in the deployment descriptor. @InstallMethod public String doSomething() { ... } @InstallMethod public String doSomethingElse() { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <install method="doSomething"/> <install method="doSomethingElse"/> </bean> During undeployment uninstall methods can also be defined which will be called before the bean reaches the STOP state. @UninstallMethod public String doSomething() { ... } @UninstallMethod public String doSomethingElse() { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <uninstall method="doSomething"/> <uninstall method="doSomethingElse"/> </bean> If you want a bean to call a method on another bean during deployment or undeployment then you can use the @ExternalInstalls/@ExternalUninstalls annotations or the bean attribute of the <install>/<uninstall> elements. You can also define parameters to pass in if necessary. @ExternalInstalls(@ExternalInstall(bean="OtherBean", method="doWork") @ExternalUninstalls(@ExternalInstall(bean="OtherBean", method="doBye", parameters="{@Value(string=@StringValue("Goodbye")),@Value(string=@StringValue("Saturday"))}")) public class MyBean { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <install bean="OtherBean" method="doWork"/> <uninstall bean="OtherBean" method="doBye"> <parameter name="message">Goodbye</parameter> <parameter name="day">Saturday</parameter> </uninstall> </bean> Currently both the @ExternalInstalls and @ExternalUninstalls annotations take a list of @ExternalInstall annotations. By default the other bean must have reached the INSTALLED state before its method will be called. This can be changed by using the dependentState/state attribute. @ExternalInstalls(@ExternalInstall(bean="OtherBean", method="doWork", dependentState="Configured") public class MyBean { ... } <bean name="SimpleBean" class="org.jboss.example.SimpleBean"> <install bean="OtherBean" method="doWork" state="Configured"/> </bean>
Deployment callbacks Sometimes it is useful for a bean to know when other beans have been deployed. For example a manager bean might want to keep a list of all of the beans it manages. Rather than placing code into each managed bean to register itself with the manager when deployed, it would be better if the manager was automatically called back each time to notify it. JBoss Microcontainer allows such callbacks to occur during deployment and undeployment using the @Install/@Uninstall annotations and <incallback>/<uncallback> elements. <incallback> is an abbreviation of installCallback and <uncallback> is an abbreviation of uninstallCallback. public class Example { @Install public void addEditor(Editor editor) { ... } @Uninstall public void removeEditor(Editor editor) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor"/> <uncallback method="removeEditor"/> </bean> In the above example the addEditor method of the editorHolder bean will be called each time a bean of class Editor is deployed. Similarly the removeEditor method will be called each time a bean of class Editor is undeployed. By default the bean class to look for is determined by the class of the parameter in the callback method. If there are multiple methods with the same name but different parameter types then you can add a signature attribute to the <incallback>/<uncallback> element to specify the correct one. This is not required when using annotations as we simply annotate the method we want. public class Example { public void addEditor(Editor editor) { ... } @Install public void addEditor(DifferentEditor editor) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor" signature="org.jboss.example.DifferentEditor"/> </bean> Multiple callback methods can be defined per bean. They will be called in the order that they appear as annotations or in the deployment descriptor. public class Example { @Install public void addEditor(Editor editor) { ... } @Install public void addViewer(Viewer viewer) { ... } @Uninstall public void removeEditor(Editor editor) { ... } @Uninstall public void removeViewer(Viewer viewer) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor"/> <incallback method="addViewer"/> <uncallback method="removeEditor"/> <uncallback method="removeViewer"/> </bean> By default each callback will be executed when beans matching the parameter types reach the INSTALLED state. This can be changed if necessary using the dependentState/state attribute. public class Example { @Install(dependentState="Configured") public void addEditor(Editor editor) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor" state="Configured"/> </bean> Here we are declaring that the addEditor method of the editorHolder bean should be called when any beans of class Editor reach the CONFIGURED state. It is also possible to configure when the callback methods are executed during the deployment of the bean using the whenRequired attribute. public class Example { @Install(whenRequired="Installed") public void addEditor(Editor editor) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor" whenRequired="Installed"/> </bean> Here we are declaring that the addEditor method will be called before the editorHolder bean reaches the INSTALLED state. By default the callbacks are exceuted before the bean reaches the CONFIGURED state. Finally we can also control when the callback methods are executed depending on how many beans matching the parameter class have been deployed. This is done using the cardinality attribute. public class Example { @Install(cardinality="2..n") public void addEditor(Editor editor) { ... } } <bean name="editorHolder" class="com.acme.Example"> <incallback method="addEditor" cardinality="2..n"/> </bean> Here we are declaring that the addEditor method of the editorHolder bean will only be called when two or more beans of class Editor have been deployed. When using callbacks with collection classes as parameters only the following basic interfaces are currently supported; List, Set and Queue. This is done using the BasicCollectionCallbackItemFactory implementation. You can change this if required by setting the org.jboss.dependency.collectionCallbackItemFactory system property to the fully-qualified class name of your CollectionCallbackItemFactory implementation.
Service lifecycle So far we have discussed how to define deployment/undeployment actions for beans together with callback methods for notification when other beans have been deployed/undeployed. These features are useful for adding behaviours to POJOs but what about adding behaviour to services? As explained in the previous chapter services have a lifecycle consisting of 4 stages; create, start, stop and destroy. The reason for this is because we want the ability to start and stop a deployed service repeatably at runtime to make best use of valuable resources such as CPU and memory. At each point in this lifecycle the microcontainer will look for a method to call in order to perform appropriate actions. For example starting a service may require that an object is bound into JNDI. By default these methods are named after the lifecycle stage that they represent. public class LifecycleBean { public void create() { ... } public void start() { ... } public void stop() { ... } public void destroy() { ... } } If methods like these are defined in your bean then they will be called as the bean is deployed and undeployed. Specifically the create and start methods are called as the bean reaches the CREATE and START states during deployment. The stop and destroy methods are called when the bean passes through the START and CREATE states during undeployment. Only those methods that are defined will be called. For example if you omit the start method then the bean will move to the START state without anything happening. If you want a different method to be called for any of the stages then you can provide an annotation or XML element to specify which one to use. public class Example { @Create public void initialize() { ... } @Start public void go() { ... } @Stop public void halt() { ... } @Destroy public void remove() { ... } } <bean name="Name1" class="com.acme.Example"> <create method="initialize"/> <start method="go"/> <stop method="halt"/> <destroy method="remove"/> </bean> You can also specify parameters if necessary. public class Example { @Start public void go(@StringValue("MyService") String serviceName, @StringValue("5") Integer priority) { ... } } <bean name="Name1" class="com.acme.Example"> <start method="go"> <parameter>MyService</parameter> <parameter>5</parameter> </start> </bean> Sometimes you may want lifecycle methods to be ignored. This can be done using the ignore attribute which if set to true prevents the microcontainer from calling the method when the corresponding lifecycle stage is reached. public class Example { @Stop(ignored="true") public void halt() { ... } } <bean name="Name1" class="com.acme.Example"> <start method="stop" ignored="true"/> </bean>
AOP Development Introduction Configuration Using Aspects Using Lifecycle Callbacks AOP Dependencies The Deployment Framework Introduction JBoss Microcontainer at its core allows POJOs to be deployed into a runtime environment. It does this using a state machine to ensure that any dependencies on classloaders or other POJOs are satisfied before progressing through the various stages of creation and configuration. By design the state machine and dependency mechanisms are generic which means that we can also use them to deploy other types of runtime components such as MBeans or OSGi bundles. In order to do this we need a generic deployment framework to create the relevant metadata, handle different kinds of deployable components, and deal with any nested deployments. To understand why we cannot achieve this using the BasicXMLDeployer let's take a closer look at what it actually does: public class BasicXMLDeployer extends BasicKernelDeployer { ... public KernelDeployment deploy(final URL url) throws Throwable { final boolean trace = log.isTraceEnabled(); if (url == null) throw new IllegalArgumentException("Null url"); if (trace) log.trace("Parsing " + url); long start = System.currentTimeMillis(); Unmarshaller unmarshaller = factory.newUnmarshaller(); KernelDeployment deployment = (KernelDeployment) unmarshaller.unmarshal(url.toString(), resolver); if (deployment == null) throw new RuntimeException("The xml " + url + " is not well formed!"); deployment.setName(url.toString()); if (trace) { long now = System.currentTimeMillis(); log.trace("Parsing " + url + " took " + (now-start) + " milliseconds"); } deploy(deployment); if (trace) { long now = System.currentTimeMillis(); log.trace("Deploying " + url + " took " + (now-start) + " milliseconds"); } return deployment; } ... } Once we call the deploy() method with a URL to the XML deployment descriptor an unmarshaller is created to convert the XML into an object representation of type KernelDeployment. We then process the KernelDeployment using the deploy() method of the superclass BasicKernelDeployer: public class BasicKernelDeployer extends AbstractKernelDeployer { ... public void deploy(KernelDeployment deployment) throws Throwable { ... super.deploy(deployment); deployments.add(deployment); ... } ... public void shutdown() { ListIterator iterator = deployments.listIterator(deployments.size()); while (iterator.hasPrevious()) { KernelDeployment deployment = (KernelDeployment) iterator.previous(); undeploy(deployment); } } } As you can see the BasicKernelDeployer simply calls the deploy() method of its superclass AbstractKernelDeployer before adding the deployment to a list. The reason for having BasicKernelDeployer is that it contains a shutdown() method which undeploys all the deployments in reverse order. This allows the microcontainer to shutdown gracefully. public class AbstractKernelDeployer { ... public void deploy(final KernelDeployment deployment) throws Throwable { if (deployment.isInstalled()) throw new IllegalArgumentException("Already installed " + deployment.getName()); try { deployBeans(controller, deployment); deployment.setInstalled(true); } catch (Throwable t) { undeploy(deployment); throw t; } } ... protected void deployBeans(KernelController controller, KernelDeployment deployment) throws Throwable { List<BeanMetaData> beans = deployment.getBeans(); if (beans != null) { for (BeanMetaData metaData : beans) { KernelControllerContext context = deployBean(controller, deployment, metaData); deployment.addInstalledContext(context); } } } protected KernelControllerContext deployBean(KernelController controller, KernelDeployment deployment, BeanMetaData bean) throws Throwable { KernelControllerContext context = new AbstractKernelControllerContext(null, bean, null); if (requiredState != null) context.setRequiredState(requiredState); if (mode != null) context.setMode(mode); // Use any deployment classloader if present and the bean doesn't have one ClassLoaderMetaData beanClassLoader = bean.getClassLoader(); if (beanClassLoader == null && deployment != null) { ClassLoaderMetaData deploymentClassLoader = deployment.getClassLoader(); if (deploymentClassLoader != null) bean.setClassLoader(deploymentClassLoader); } controller.install(context); return context; } ... } The deploy() method in AbstractKernelDeployer performs a check to see if the deployment has already been installed before calling deployBeans() to split it up into the individual BeanMetaData instances. These are then deployed into the runtime environment using the deployBean() method which creates a KernelControllerContext for each BeanMetaData and installs it into the controller. It also takes care of deciding which classloader to use based on information contained in the KernelDeployment object. For example if the bean doesn't declare a classloader of its own then the deployment classloader (if defined) is used instead. The type hierarchy of BasicXMLDeployer restricts it to processing bean deployments of type KernelDeployment where each bean is represented by an instance of BeanMetaData. If we want to deploy other runtime components such as MBeans or OSGi bundles then we need to deal with other types of metadata and find a generic way to represent deployments containing them. Furthermore we need to find a flexibile way to process these deployments since each would have its own set of actions that need to take place. For example MBeans need to be registered with an MBean server before they can be considered 'deployed'. It turns out that we can use the state machine to meet these requirements by creating a DeploymentControllerContext to represent a deployment in the same way that a KernelControllerContext represents a POJO. This allows us to associate a number of deployment actions to different stages of the deployment process: PARSE - convert one or more deployment descriptors into object representations containing metadata DESCRIBE - determine any dependencies CLASSLOADER - create classloaders POST_CLASSLOADER - apply AOP changes together with any other bytecode manipulations REAL - process the deployment components As the state machine controller takes a DeploymentControllerContext through each of these stages it calls the associated actions to perform the relevant work. For example we could create multiple parsing actions; one to parse XML files and another to parse Java property files. Depending on the file suffix of the deployment descriptor; .xml or .property we can then choose which one to use during the PARSE stage. Deployments are represented by DeploymentContexts which can be formed into a hierarchy to represent nested deployments of any depth. A reference to the top-level DeploymentContext is contained in the DeploymentControllerContext: public class DeploymentControllerContext extends AbstractControllerContext { /** The deployment context */ private DeploymentContext deploymentContext; public DeploymentControllerContext(DeploymentContext context, DeployersImpl deployers) { super(context.getName(), deployers); this.deploymentContext = context; setMode(ControllerMode.MANUAL); } public DeploymentContext getDeploymentContext() { return deploymentContext; } } Be careful not to get confused with the names of these types; DeploymentControllerContext and DeploymentContext, as they are very similar. As deployment descriptors do not always describe runtime components directly, the notion of a deployment component is defined. For example an EJB deployment descriptor may describe a number of EJB containers from which individual EJBs are created. Here we refer to both the EJB containers and EJBs as deployment components but only the EJBs are thought of as runtime components. Deployment components are represented by an implementation of DeploymentContext called ComponentDeploymentContext which allows them to be hierarchical to any depth. For example an EJB container ComponentDeploymentContext could have multiple child ComponentDeploymentContexts representing its EJBs. Deployment components are added/removed to and from their containing deployment or parent deployment component and retrieved for processing using the following methods: public class ComponentDeploymentContext implements DeploymentContext { ... boolean isComponent() { return true; } List<DeploymentContext> getComponents() { return Collections.unmodifiableList(components); } void addComponent(DeploymentContext component) { ... components.add(component); } boolean removeComponent(DeploymentContext component) { ... boolean result = components.remove(component); component.cleanup(); return result; } ... } The deployment framework is therefore a collection of packages and classes that provides a generic way to represent deployments containing arbitrary deployment components. These could be runtime components such as POJOs, MBeans, and EJBs or non-runtime components such as EJB containers which act as factories for the EJBs. Deployments and deployment components can be nested within one another to any depth providing maximum flexibility during deployment. Consequently it's possible to use the deployment framework instead of the BasicXMLDeployer to deploy POJO-based services specified with XML deployment descriptors. So why then do we need a BasicXMLDeployer? The answer is because the deployment framework itself a POJO-based service specified with an XML deployment descriptor (usually called bootstrap-beans.xml). We therefore need the BasicXMLDeployer to deploy it when the microcontainer is booted up. Once deployed then the framework is used to deploy everything else including any other POJO-based services. Now that you understand the reasoning for the deployment framework and how it relates to the BasicXMLDeployer the following sections go on the cover the various parts in more detail. The Virtual File System When you think about it all deployments can be broken down into three types of data: Deployment descriptors - contain configuration information Java classes - contain compiled Java bytecode Resources - any other files that are required at runtime Sometimes only a single deployment descriptor is required although more often you create a deployment archive containing one or more descriptors together with a number of classes. In the case of a Web Archive (WAR) we also include any resources that are to be hosted by the web server. During development it is convenient to be able to deploy such archives in an unpackaged rather than a packaged state. This means that files can be freely edited in their directories and the deployment processed again without having to re-package everything each time. Packaging is usually more appropriate during the test phase or when going to production as a way of keeping everything together. Depending on the layout of the development, test or production system it's helpful to allow the deployment of packaged or unpackaged archives both locally, on the computer's hard drive, or remotely over a network. Support for nested deployments is also important so that related items can be deployed together. To allow all of these concerns to be addressed in a maintainable and extendable way the deployment framework uses a Virtual File System (VFS). This provides a way to represent a deployment as a read-only hierarchical file system regardless of whether it is packaged or not. It also allows deployments to be accessed both locally and remotely using a pluggable design so that new protocols can easily be added to those supplied by default: File - JAR - Memory - Finally the VFS takes care of generating physical URLs for classloading and debugging. Logical URLs can also be generated for configuration purposes, or codebase protection domains. Identifying the deployment structure Before we can begin to process a deployment we must first determine its structure. This means finding out if it contains any deployment descriptors and/or classes, and if so where they are located relative to the deployment's root. Nested deployments must also be detected and their structures determined in the same way. The purpose of this is to help the parsing actions locate the deployment descriptors in a standard way and to assist in the creation of classloaders. Since we wish to use the Virtual File System (VFS) to represent our deployment we must first create a VFSDeployment using the deployment URI or URL: VirtualFile root = VFS.getRoot(deploymentURL); VFSDeploymentFactory deploymentFactory = VFSDeploymentFactory.getInstance(); Deployment deployment = deploymentFactory.createVFSDeployment(root); The deployment framework then determines the structure of the Deployment using classes that implement the StructureDeployer interface: public interface StructureDeployer extends Ordered { boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException; } As a deployment can contain nested deployments the determineStructure() method is meant to be called recursively. The root parameter represents the root of the top-level deployment, the file parameter represents the root of the current (possibly nested) deployment being analyzed and the parent parameter its parent (or null if it is the top-level). The deployers parameter represents a class containing a list of all the StructureDeployer implementations and is needed in order to process any nested deployments. As each deployment is found a ContextInfo object is created to store the paths to any deployment descriptors and/or classes. These are then added to the StructureMetaData parameter so that the structure of the entire deployment is recorded. For example if we had a top-level deployment containing 2 nested deployments then we would create 3 ContextInfo objects, one for each deployment, and add these to the StructureMetaData object.
Deployment Descriptors Deployment descriptors are files containing configuration information for deployments. They are detected using the FileStructure class by matching the file suffix or using a FileMatcher. Default file suffixes include: -beans.xml - contains bean definitions -aop.xml - contains aspect definitions -service.xml - contains mbean definitions -ds.xml - contains JCA datasource definitions Each FileMatcher must implement the following interface: public interface FileMatcher { boolean isDeployable(VirtualFile file); } Default implementations are: BshFileMatcher - checks whether the filename ends with .bsh (Bean Shell) The purpose of the FileStructure class is to detect deployments that consist of a single deployment descriptor. As such it creates a single ContextInfo object when a known file is found and adds this to the StructureMetaData. Since no classes are present the list of classpaths within the ContextInfo is set to null. Currently any top-level deployment that consists of a single file is always identified as a known deployment descriptor. This is done to avoid having to specify all of the known file suffixes in a configuration file. The file suffix and FileMatcher checks are only performed for nested deployments. As the FileStructure class has a relative order of Integer.MAX_VALUE it is always called after any other StructureDeployer implementations such as JARStructure. This means that a deployment consisting of a single JAR file will be detected correctly. Deployment descriptors that form part of a deployment together with other files, such as classes or resources are detected by other implementations of StructureDeployer such asJARStructure which is described next.
Java Archives (JARs) The JARStructure class determines whether a deployment, in the form of a file or a directory, represents a packaged or unpackaged JAR archive. If the deployment is a single file then the filename suffix is checked against a list contained in the JarUtils class: .zip - a standard archive .jar - a java archive (defined by the Java SE specification) .ear - an enterprise archive (defined by the Java EE specification) .rar - a resource archive (defined by the Java EE specification) .war - a web archive (defined by the Java EE specification) .sar - a service archive (defined by JBoss) .har - a hibernate archive (defined by JBoss) .aop - an aspect archive (defined by JBoss) If the deployment is a directory then the same check is performed using the directory name. If a match is found in either case then the deployment is determined to represent a JAR archive. A top-level directory whose name doesn't match any of the file suffixes is still considered an unpackaged JAR archive as this allows it to be used as a container for multiple nested deployments. In order to detect nested JAR deployments we iterate through all subdirectories checking whether their names end in a known suffix or if they contain META-INF directories. The check for a META-INF directory is required otherwise every subdirectory without a known filename would be classified as a nested deployment. For each JAR deployment found we create a new ContextInfo object with its metadata path set to META-INF and the classpath set to the deployment root.
Nested deployments Nested deployments are found by calling the addAllChildren() method in AbstractStructureDeployer and passing in a reference to the deployment root and the current nested deployment along with the StructureMetaData and VFSStructuralDeployers references: public abstract class AbstractStructureDeployer implements StructureDeployer { ... protected void addAllChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers) throws Exception { addChildren(root, parent, metaData, deployers, null); } protected void addChildren(VirtualFile root, VirtualFile parent, StructureMetaData metaData, VFSStructuralDeployers deployers, VisitorAttributes attributes) throws Exception { if (parent == null) throw new IllegalArgumentException("Null parent"); VirtualFileVisitor visitor = candidateStructureVisitorFactory.createVisitor(root, parent, metaData, deployers, attributes); parent.visit(visitor); } ... } This in turn calls the addChildren() method which creates a VirtualFileVisitor that is passed to the virtual file representing the current deployment. Each child file or directory of the current deploment is then visited using the visitor which use the VFSStructuralDeployers object to iterate through the list of StructureDeployers. These then determine whether the child represents a nested deployment. If a nested deployment is found then the process is repeated in order to recurse through the entire directory structure. This happens regardless of whether the deployment is packaged or unpackaged as the Virtual File System takes care of accessing the actual files. Due to this recursive algorithm you can freely nest any type of deployment within any other type of deployment to any level. There is one exection to this with WAR archives which cannot contain nested deployments. All you need to ensure is that you have defined a StructureDeployer implementation capable of recognising your deployment.
Declaring a custom deployment structure JBoss Microcontainer provides two StructureDeployer implementations out-of-the-box to recognise the most common forms of deployments; standalone deployment descriptors and packaged/unpackaged JAR archives. In addition it also includes a third implementation called DeclaredStructure. DeclaredStructure allows you to specify the structure of a deployment, including any nested deployments, using an XML file called jboss-structure.xml placed in the deployment's META-INF directory. The contents of this file are: <structure> <context> <path name=""/> <metaDataPath> <path name="OTHER-DIR"/> </metaDataPath> <classpath> <path name=""/> </classpath> </context> </structure> This describes a top-level deployment and specifies that deployment descriptors can be found in the OTHER-DIR directory and classes in the root directory. If you want to describe nested deployments then you simply need to create additional <context> elements and specify their paths relative to the root deployment: <structure> <context> <path name=""/> <metaDataPath> <path name="OTHER-DIR"/> </metaDataPath> <classpath> <path name=""/> </classpath> </context> <context> <path name="nestedDeployment1"/> <metaDataPath> <path name="descriptors/xml/"/> </metaDataPath> <classpath> <path name="classes"/> <path name="thirdParty/classes"/> </classpath> </context <context> <path name="utils/nestedDeployment2"/> <metaDataPath> <path name="META-INF"/> <path name="config/descs/"/> </metaDataPath> <classpath> <path name="lib"/> </classpath> </context </structure> Here we've added two nested deployments, one directly underneath the top-level deployment and another in a subdirectory called utils. The first nested deployment has deployment descriptors located in its descriptors/xml directory and classes in either the classes or thirdParty/classes directories. The second nested deployment has deployment descriptors in either the META-INF or config/descs directories and classes in the lib directory. In order to ensure that any JAR files that you add META-INF/jboss-structure.xml to are correctly recognised by DeclaredStructure instead of JARStructure the DeclaredStructure has a relativeOrder of 0 and the JARStructure a relativeOrder of 10000. This means that the DeclaredStructure class will be consulted first when determining the structure of a deployment. If you use the DeclaredStructure approach then you must specify all nested deployments in the META-INF/jboss-structure.xml file. This is because no recursion takes place once the structure has been determined. If you want the ability to nest other kinds of deployments within your custom deployment structure then it may be easier to create your own StructureDeployer implementation. Doing so will allow you to call the addAllChildren() method to perform the recursion.
Determining the deployment structure programmatically Using the DeclaredStructure approach is convenient if you have an unusual deployment structure and don't mind adding the META-INF/jboss-structure.xml file to your deployment. However, if you have many deployments and want to avoid adding this file each time, or you want to nest arbitrary deployments inside your custom structure then you are better off creating your own StructureDeployer implementation. The easiest way to do this is by extending the AbstractStructureDeployer class which already implements the StructureDeployer interface: public abstract class AbstractStructureDeployer implements StructureDeployer { ... } This includes helper methods to see if a VirtualFile represents a file or a directory and whether it corresponds to a top-level deployment. It also has methods to recurse through all of the files within a deployment to find nested deployments and to create ContextInfo objects for each one found. The only method that you need to implement is the one defined by the StructureDeployer interface: public interface StructureDeployer extends Ordered { boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException; } If you recognise the structure of the deployment then you must create a ContextInfo object containing the details and add it to the StructureMetaData. If you extend AbstractStructureDeployer then you can use the createContext() and addClassPath() helper methods to help do this. You must then return true to prevent any other StructureDeployer from analysing the deployment again. If you want to control when your StructureDeployer is called you can use the relativeOrder property. By default this is set to Integer.MAX_VALUE in AbstractStructureDeployer. Implementations with a lower value are called before those with a higher value. If two values are the same then the return values of each implementation's toString() method are compared. The relativeOrder values for the out-of-the-box StructureDeployer implementations are: DeclaredStructure - 0 JARStructure - 10000 FileStructure - Integer.MAX_VALUE This means that DeclaredStructure is always called first followed by JARStructure and finally FileStructure.
Creating Deployment Contexts
Introduction Once the structure of a deployment has been determined then the next step is to create a number of DeploymentContext objects. A DeploymentContext is required for each deployment, whether top-level or nested, in order to store information such as: the location of any deployment descriptors - the metadata path the location of any classes - the classpath the relative path to the top-level deployment - the relative path the deployment name the order it should be deployed in relative to other deployments - the relative order a list of deployment types that it represents (including nested deployments) - the types the state of the deployment - whether it is deployed or not the deployment class loader the deployment resource loader dependencies on other deployments or runtime components references to any components that it deploys - POJOs, MBeans etc... references to any nested (child) deployments or the parent deployment Since the StructureMetaData object created using the StructureDeployer implementations already contains some of this information we subsequently pass it to a StructureBuilder together with a reference to the original Deployment to populate the deployment with a tree of DeploymentContexts: public interface StructureBuilder { DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException; } During this method call the information contained within the ContextInfo objects, found inside the StructureMetaData, is transferred to new instances of DeploymentContext that are assembled into a hierarchy. A reference to the top-level DeploymentContext is then returned.
Accessing a deployment The deployment framework uses DeploymentContext objects to access the internal details of a deployment during processing. However, if you wish to access a deployment yourself then you should use a wrapper called DeploymentUnit. This prevents you from getting or setting the deployment state, changing the deployment classloader if it already exists, changing any parent/child relationships between nested deployments and accessing any exceptions that have occurred during deployment. You are also prevented from calling the visit() method that allows you to visit all of the contexts in the hierarchy or the cleanup() method that removes deployment metadata from the metadata repository.
Attaching extra information Since each instance of DeploymentContext contains generic deployment information we need a way to store and retrieve additional information generated during the deployment process. This is done using the DeploymentUnit wrapper which extends the MutableAttachments interface: public interface DeploymentUnit extends MutableAttachments { ... } public interface MutableAttachments extends Attachments { Object addAttachment(String name, Object attachment); <T> T addAttachment(String name, T attachment, Class<T> expectedType); <T> T addAttachment(Class<T> type, T attachment); Object removeAttachment(String name); <T> T removeAttachment(String name, Class<T> expectedType); <T> T removeAttachment(Class<T> type); void setAttachments(Map<String, Object> map); void clear(); int getChangeCount(); void clearChangeCount(); } As you can see the MutableAttachments operations allow you to store arbitrary objects (referred to as attachments) inside a map using a String for the key. For convenience you can pass in the type of the object instead of a string and the return value of type.getName() will be used as the key. If you pass in a type for the key, or you specify an expectedType argument, then the return value will be cast to an object of that type. If you wish to retrieve any objects then you can use operations from the Attachments interface: public interface Attachments extends Serializable { Map<String, Object> getAttachments(); Object getAttachment(String name); <T> T getAttachment(String name, Class<T> expectedType); <T> T getAttachment(Class<T> type); boolean isAttachmentPresent(String name); boolean isAttachmentPresent(String name, Class<?> expectedType); boolean isAttachmentPresent(Class<?> type); boolean hasAttachments(); } Again if you pass a type for the key, or specify an expectedType argument, then the return value will be cast to an object of that type. In the case of the isAttachmentPresent() methods the return value is only true if both the object can be located using the key and it can be cast to the specified type. DeploymentUnit also contains a convenience method that allows you to retrieve all objects of a particular type from the map of attachments: public interface DeploymentUnit extends MutableAttachments { ... <T> Set<? extends T> getAllMetaData(Class<T> type); ... }
Deployment components Deployments usually contain one or more runtime components in addition to configuration information and resource files. By runtime components we mean any classes that require a container in which to run. Containers take care of controlling a component's lifecycle in addition to providing common behaviours so that component developers do not have to do this themselves. By leveraging the work of the container, components allow you to concentrate on developing the business logic of your application without having to continually write code for common tasks. This typically reduces the time needed to develop systems with advanced behaviour. The simplest example of a component is a POJO. In this case the container controls when the POJO is created based on when a client performs a lookup. It can also take care of wiring different POJOs together based on information in a deployment descriptor so that the developer doesn't have to hard-code any relationships. This makes configuration of the runtime environment easier to change. Another example is an MBean. Here the container (an MBeanServer) takes care of routing all method calls through a bus so that clients never reference the MBean directly. This allows MBeans to be replaced at runtime without impacting any clients. It also allows the management interface of an MBean, the attributes and operations exposed to clients, to change at runtime without needing to redeploy it. A further example is an OSGi service bundle. Here the container ensures that the classes required by the bundle are available in the runtime before the service is started. It also takes care of making classes within the bundle available to others when deployed and removing them again when undeployed. This makes the runtime environment easier to construct and maintain with fewer classloading issues. In order to provide support for deploying different types of runtime components, JBoss Microcontainer requires that each one is represented by its own ComponentDeploymentContext: public class ComponentDeploymentContext implements DeploymentContext { ... } This is similer to a normal DeploymentContext implementation but with some important differences: Components always have a relative order of 0 Components do not have a metadata path Components always use the classloader of the containing deployment Components cannot change their parent once constructed Components can contain other components Components are never considered top-level deployments In addition ComponentDeploymentContexts delegate to their parent DeploymentContext for information such as: simple name relative path deployment types deployment state class loader Resource class loader Deployment Resource Loader Dependency Info get/setProblem The reason we use the DeploymentContext interface is so that we can process components together with normal deployments. This ensures that when a deployment is deployed any components that it contains are deployed with it. Similarly undeploying a deployment causes its components to be undeployed at the same time. An additional motivation is that we can easily create separate ControllerContexts for each component which we can then process using the state machine. This allows us to perform a well-defined set of deployment actions to deploy/undeploy each component in and out of the runtime. Having separate ControllerContexts for each component also allows you to manage the components individually, possibly via an Admin console. Furthermore each component can have its own dependencies allowing fine-grained control of how the runtime is constructed and destructed. ComponentDeploymentContexts are added to a DeploymentUnit using the addComponent() method whenever a component is discovered during the deployment process: public class AbstractDeploymentUnit extends AbstractMutableAttachments implements DeploymentUnit { ... public DeploymentUnit addComponent(String name) { DeploymentContext component = createComponentDeploymentContext(name, deploymentContext); DeploymentUnit unit = createComponentDeploymentUnit(component); component.setDeploymentUnit(unit); deploymentContext.addComponent(component); return unit; } ... protected DeploymentContext createComponentDeploymentContext(String name, DeploymentContext parent) { return new ComponentDeploymentContext(name, parent); } ... } As components are usually accessed with the DeploymentUnit interface they can also have attachments just like any other deployment: public interface DeploymentUnit extends MutableAttachments { ... } public interface MutableAttachments extends Attachments { ... Object addAttachment(String name, Object attachment); ... } An attachment may well be metadata associated with the component. In this way the metadata can be processed using deployment actions as the component's ControllerContext passes through the state machine.
Deployment dependencies Sometimes a deployment may have dependencies on other deployments or on a runtime component such as a classloader. In these cases we need to be able to define the dependencies so that the state machine can decide whether or not to progress the deployment to the next stage. This is done using the following methods of the DeploymentUnit interface: public interface DeploymentUnit extends MutableAttachments { ... DependencyInfo getDependencyInfo(); void addIDependOn(DependencyItem dependency); void removeIDependOn(DependencyItem dependency); } AbstractDeploymentUnit delegates these calls to the DeploymentContext implementation that it wraps: public class AbstractDeploymentUnit extends AbstractMutableAttachments implements DeploymentUnit { ... public void addIDependOn(DependencyItem dependency) { getDependencyInfo().addIDependOn(dependency); } public DependencyInfo getDependencyInfo() { return deploymentContext.getDependencyInfo(); } public void removeIDependOn(DependencyItem dependency) { getDependencyInfo().removeIDependOn(dependency); } ... } This in turn delegates them to the corresponding ControllerContext implementation which is stored as an attachment: public class AbstractDeploymentContext extends ManagedObjectsWithTransientAttachmentsImpl implements DeploymentContext { ... public DependencyInfo getDependencyInfo() { ControllerContext controllerContext = getTransientAttachments().getAttachment(ControllerContext.class); if (controllerContext != null) return controllerContext.getDependencyInfo(); else { DeploymentContext parent = getParent(); if (parent == null) throw new IllegalStateException("Deployment ControllerContext has not been set"); return parent.getDependencyInfo(); } } ... } If a ControllerContext object is not found within the deployment's attachments then the parent deployment is tried. In this way DependencyItems are added/removed to the underlying ControllerContext implementation for the deployment.
Processing a deployment
Introduction So far we have established the structure of a deployment using StructureDeployer classes and created a corresponding DeploymentContext using a StructureBuilder. Nested deployments have been dealt with by creating additional DeploymentContexts and adding these as children of the parent DeploymentContext. The next step in the deployment framework is to process the deployment. The objective being to extract any metadata from the deployment descriptors and create a classloader. Components must also be identified during this process and a ComponentDeploymentContext created for each one so that they can be deployed into the runtime. The Deployers interface defines the operations that need to take place: public interface Deployers { ... void process(List<DeploymentContext> deploy, List<DeploymentContext> undeploy); void checkComplete(Collection<DeploymentContext> errors, Collection<Deployment> missingDeployer) throws DeploymentException; void checkComplete(DeploymentContext... contexts) throws DeploymentException; void checkStructureComplete(DeploymentContext... contexts) throws DeploymentException; } In the default implementation DeployersImpl the process() method creates new DeploymentControllerContexts for each DeploymentContext in the deploy list and installs them into the microcontainer controller: public class DeployersImpl implements Deployers, ControllerContextActions { ... public void process(List<DeploymentContext> deploy, List<DeploymentContext> undeploy) { ... // There is something to deploy if (deploy != null && deploy.isEmpty() == false) { // Create the controller contexts for (DeploymentContext context : deploy) { DeploymentControllerContext deploymentControllerContext = new DeploymentControllerContext(context, this); try { controller.install(deploymentControllerContext); context.setState(DeploymentState.DEPLOYING); ... context.getTransientAttachments().addAttachment(ControllerContext.class, deploymentControllerContext); ... } catch (Throwable t) { // Set the error on the parent context.setState(DeploymentState.ERROR); context.setProblem(t); // Set the children to not deployed setState(context, DeploymentState.UNDEPLOYED, DeploymentState.DEPLOYING); } } // Go through the states in order List<ControllerState> states = controller.getStates(); for (ControllerState state : states) { for (DeploymentContext context : deploy) { if (DeploymentState.ERROR.equals(context.getState()) == false) { DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class); try { controller.change(deploymentControllerContext, state); } catch (Throwable t) { context.setState(DeploymentState.ERROR); context.setProblem(t); } } } } } } ... } Notice that a reference to the DeploymentControllerContext is stored as an attachment to the DeploymentContext so that it can be retrieved later and passed to the controller.install() method. Undeployment happens in a similar way. First of all the DeploymentControllerContexts associated with the DeploymentContexts in the undeploy list are extracted into a separate list. The microcontainer controller is then used again to push them through the deployment states in reverse order. Finally the DeploymentControllerContexts are removed from the DeploymentContext attachments where they were initially stored and uninstalled from the controller: public class DeployersImpl implements Deployers, ControllerContextActions { ... public void process(List<DeploymentContext> deploy, List<DeploymentContext> undeploy) { // There is something to undeploy if (undeploy != null && undeploy.isEmpty() == false) { // Build a list in reverse order List<DeploymentControllerContext> toUndeploy = new ArrayList<DeploymentControllerContext>(); for (int i = undeploy.size()-1; i >= 0; --i) { DeploymentContext context = undeploy.get(i); if (DeploymentState.ERROR.equals(context.getState()) == false) context.setState(DeploymentState.UNDEPLOYING); ... DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class); if (deploymentControllerContext == null) { log.debug("DeploymentContext has no DeploymentControllerContext during undeploy request, ignoring: " + context); } else { toUndeploy.add(deploymentControllerContext); } } // Go through the states in reverse order List<ControllerState> states = controller.getStates(); for (int i = states.size()-1; i >= 0; --i) { ControllerState state = states.get(i); for (DeploymentControllerContext deploymentControllerContext : toUndeploy) { DeploymentContext context = deploymentControllerContext.getDeploymentContext(); if (ControllerState.ERROR.equals(context.getState()) == false) { try { controller.change(deploymentControllerContext, state); } catch (Throwable t) { ... context.setState(DeploymentState.ERROR); context.setProblem(t); } } } } // Uninstall the contexts for (DeploymentControllerContext deploymentControllerContext : toUndeploy) { DeploymentContext context = deploymentControllerContext.getDeploymentContext(); context.getTransientAttachments().removeAttachment(ControllerContext.class); try { controller.uninstall(deploymentControllerContext.getName()); setState(context, DeploymentState.UNDEPLOYED, null); ... cleanup(context); ... } catch (Throwable t) { ... context.setState(DeploymentState.ERROR); context.setProblem(t); } } } ... } ... } Undeployments are actually processed before deployments to ensure that we don't end up in a situation where a deployment that depends on a subsequently undeployed deployment has to be undeployed again straight away. You should hopefully see from this breakdown that each deployment is processed by creating a DeploymentControllerContext that is then installed into the microcontainer controller and pushed through a series of deployment stages. What these stages are and how they are created is the subject of the next section.
Deployment stages By default the DeployersImpl class creates the following deployment stages on construction: NOT_INSTALLED - the deployment is ready to be installed or has been uninstalled PARSE - deployment descriptors are parsed into deployment metadata DESCRIBE - dependencies on other deployments or runtime components are determined CLASSLOADER - a classloader for the deployment is created POST_CLASSLOADER - REAL - components are deployed into the runtime INSTALLED - the deployment is fully deployed Each DeploymentStage has a name and indicates which stages it comes before and after: public class DeploymentStage { private String name; private String after; private String before; ... } This allows a new ControllerState to be created for each DeploymentStage which can then be added in the correct place to the list of ControllerStates associated with the controller: public class DeployersImpl implements Deployers, ControllerContextActions { ... public DeployersImpl(AbstractController controller, Set<Deployer> deployers) { if (controller == null) throw new IllegalArgumentException("Null controller"); this.controller = controller; // Add the standard stages addDeploymentStage(DeploymentStages.NOT_INSTALLED); addDeploymentStage(DeploymentStages.PARSE); addDeploymentStage(DeploymentStages.DESCRIBE); addDeploymentStage(DeploymentStages.CLASSLOADER); addDeploymentStage(DeploymentStages.POST_CLASSLOADER); addDeploymentStage(DeploymentStages.REAL); addDeploymentStage(DeploymentStages.INSTALLED); ... } ... protected synchronized void addDeploymentStage(DeploymentStage stage) { if (stage == null) throw new IllegalArgumentException("Null stage"); // Already done? String stageName = stage.getName(); if (stages.containsKey(stageName)) return; ControllerState preceeds = null; String before = stage.getBefore(); String after = stage.getAfter(); if (before != null || after != null) { // Determine where to put the stage List<ControllerState> states = controller.getStates(); for (int i = 0; i < states.size(); ++i) { ControllerState state = states.get(i); String stateName = state.getStateString(); if (before != null && before.equals(stateName)) { preceeds = state; break; } if (after != null && after.equals(stateName)) { if (i < states.size()-1) { preceeds = states.get(i+1); break; } } } } controller.addState(new ControllerState(stageName), preceeds); stages.put(stageName, stage); ... } ... } The DeploymentStages are also stored in a map, using the stage name as a key, to prevent duplicate stages from being added.
Deployment actions
Ordering (Inputs and outputs)
Deploying components
Putting it all together
Introduction
Defining the deployment framework
Defining deployment structures
Defining deployment actions
Managing Deployments Classloading Defining Policies Developing OSGi services Extending the Microcontainer Introduction Guice Extension Identity Extension jBPM Extension Drools Extension Additional Resources
Wiki
Forums
libjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/Legal_Notice.xml0000644000175000017500000000121110717004605031675 0ustar twernertwerner Legal Notice
1801 Varsity Drive Raleigh, NC27606-2072USAPhone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 PO Box 13588Research Triangle Park, NC27709USA
libjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/images/0000755000175000017500000000000011620312213030067 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/images/tuiMenu.png0000644000175000017500000001547310721602372032246 0ustar twernertwernerPNG  IHDR|AiCCPICC ProfilexWy41cu,Q}2} c ތ=$Jٗh%[!ER)IToDyз9={_s$ 8$j f&`D 3h/xD ϼة\E{{ ;oTxX8$TG{cm`=I @^`C|(!9F`W)=388¨t ղW+C?P*@'h?1Yzb?@ݣ:}QK*7*ЯڃH }:oC#( BIҥd~F;)t*+\UljF憶%oj{ ׌L ]?ͤ[X,jf h\2v՝v(gFBu;IY Rz: uM8++R J"z{̮X#qL%jSHIfM^?p]ʋO^JI fZdifoc[:=SPw&l9; Y ]-W\RYjqQBYkyJ}DBUk]R@skM7ܪo]ؒ~HO]-hUﯷ?L|ePQwO^'O?mKx3X57,7Yňs_:x91V4.9ư)婯oޫ:} ̝]">}R48/\ضPUkoEy',.f/q-e`Qbu/:.#BHv$0RYnp 1בſҕ>/.*&/cQmgUTrkjEk,)4Hlc'5u`?h-nzOx;SG_%]Һip{IS>~ag##_Dꌮp.ot&'V7fpfljO%?/}y<7 05_[4\, ]^IYF0 $  y:D3 2XY8ٸ[y6-% d+*т Dj@zHw[l\8ya"/;GvS.bGjςjQuS Rm.J^~ɽ^ʆ+F4L1[4E+?kO6{lڝuuwt qp ]}ݔݖq?rHЦG /K"q̻#3F>k7r(0X=a:'VxXLhdJJD՘wyGqظ GuYǎU$&K&O=ᚢ|ܩi.jYY/3sdrzN-xsuiZՊJJ#.j],{X^aW_9^UvrY[6J@U+מ74\nds~owFZoMw߾ݰCSjCnG=*e{y{מL) :{J<5g?p W `(퀒AM \&g&Š .bx!)iB"3(JD%Qh) :}=ab"1uiqW|!, 1q!F!Fc=& S*"=VX 6SFv0W9NV+)> _u`PH~bVkN 7HReFlʿWhQSo.*{Nƨ%gh,תѾӦ@OF &iξ6z~Vl:L8);L]s>E!$18/;S'BM®S%hبo1q *G%3H:4#m>#6 }>W2)ߨy‰ eU—Sj uW;7޸z~sw Um^q;SK棥ǫOYe4Sמ LFmfq}Ef>w̒2j:vcbnMC>4 |FGcBN#בaJe*P/ќhst*Ç`~03faqF!ƓLLXX&YX?Eqqlp^"rq%+($ i ,'&'6+~E"%|-u[6>YU9vBlk. llOSoS~Aޡn=rUkOo^y7;K\|BߪJ(ؿCGrޕ?~.ٮUMEUkf]vw=wφFFFܦ[sti=ClKlJ[?fAkp+%|#/`:Y2kRLo"aᶎ ;;B Ɖ!A֖dMs+N 4Z+4-oDPXc->J ,L$ *P1 D5z6o.oiqҤߤټ#dv7M<0Jobgm{j0) iNih״u>]N3&M.Vkc.V۵u`eaX ~GWNX#SC[`ƩV,9ۇ۲0 Dj =,GG/W DŽ^ZiDuAMuLo}vk>Kx){Ͷ`2$/S]PGuR;Ϳ pV4~Ngj4Qv4YFK.h/sꂹ#Y6X.V5^4md~KJw,{vJY^ەX#SC1j#۰]ZjˢZDj "@p@ D8 "@p@ @c l,0YƗ &cl l{O^G5M_y3";﻽5_m}̗9uy:X"XzKpz=vz;6l˲~>gIc H4cX~n9Ws-`X8c G71j @z˒[%0:7djnf˥2[3Tfkk?[2^E@ue_kU Go3Wx,eKI>=]*U^KY9\~2*|6*~鴏p҇GAoq* .^jO4P-Z]JRz=*s!_-&#npHη?6W{zW )g6UOnHn3rc$v@JcT [ b@ @T 'ܣatg=5s_b~)ϼamz}ysڷf{Uh>^4oV[=[[Y9Y[ ɒfGdKV3H˴_ZOAmYF+hkom2G)~H1io~K׈OG|yT,-}ړz=\2)MAiR{4V>m/mJPꏆ]m\Uw 7S?wfW}_(ZDj "@p@ D8 "@p@ @ {- _8SJKЕz}rJ^G<#_~Q'_V3jNmYm;ťK}kH`m'}ZcԼSSk۪ 3mòi(Zuw0[ۭ?hyܫ~i=m~K;ez[Sk若?[KN[uj[k%󾧊N*9k~^rjgfN6<׎mVh[ZNjLGmW ǑNjgoF' cqznh:#UimݭgTqT9Ӥt]GSn#-Zw6]QkmW٣&. &{U ZDZw)Q-[-_ [-`[ M#__ ~F[@`#SɬMrÉqD7g\LZyֳKV7\t]#;?pAqۑA@ Sg}yyjpiN38 "@rwY*[.%cR.O0D1%Rg.~<s)ɝ|Ǐ˗/ϟׯ_CJ)_o;o÷okSJ){6Տ?RJ?Q/IENDB`././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/images/deployOutput.pnglibjboss-microcontainer-java-2.0.10.GA.orig/docs/User_Guide/src/main/docbook/images/deployOutput.png0000644000175000017500000002325110721602372033326 0ustar twernertwernerPNG  IHDRdnMzAiCCPICC ProfilexWy41cu,Q}2} c ތ=$Jٗh%[!ER)IToDyз9={_s$ 8$j f&`D 3h/xD ϼة\E{{ ;oTxX8$TG{cm`=I @^`C|(!9F`W)=388¨t ղW+C?P*@'h?1Yzb?@ݣ:}QK*7*ЯڃH }:oC#( BIҥd~F;)t*+\UljF憶%oj{ ׌L ]?ͤ[X,jf h\2v՝v(gFBu;IY Rz: uM8++R J"z{̮X#qL%jSHIfM^?p]ʋO^JI fZdifoc[:=SPw&l9; Y ]-W\RYjqQBYkyJ}DBUk]R@skM7ܪo]ؒ~HO]-hUﯷ?L|ePQwO^'O?mKx3X57,7Yňs_:x91V4.9ư)婯oޫ:} ̝]">}R48/\ضPUkoEy',.f/q-e`Qbu/:.#BHv$0RYnp 1בſҕ>/.*&/cQmgUTrkjEk,)4Hlc'5u`?h-nzOx;SG_%]Һip{IS>~ag##_Dꌮp.ot&'V7fpfljO%?/}y<7 05_[4\, ]^IYF0 $  y:D3 2XY8ٸ[y6-% d+*т Dj@zHw[l\8ya"/;GvS.bGjςjQuS Rm.J^~ɽ^ʆ+F4L1[4E+?kO6{lڝuuwt qp ]}ݔݖq?rHЦG /K"q̻#3F>k7r(0X=a:'VxXLhdJJD՘wyGqظ GuYǎU$&K&O=ᚢ|ܩi.jYY/3sdrzN-xsuiZՊJJ#.j],{X^aW_9^UvrY[6J@U+מ74\nds~owFZoMw߾ݰCSjCnG=*e{y{מL) :{J<5g?p W `(퀒AM \&g&Š .bx!)iB"3(JD%Qh) :}=ab"1uiqW|!, 1q!F!Fc=& S*"=VX 6SFv0W9NV+)> _u`PH~bVkN 7HReFlʿWhQSo.*{Nƨ%gh,תѾӦ@OF &iξ6z~Vl:L8);L]s>E!$18/;S'BM®S%hبo1q *G%3H:4#m>#6 }>W2)ߨy‰ eU—Sj uW;7޸z~sw Um^q;SK棥ǫOYe4Sמ LFmfq}Ef>w̒2j:vcbnMC>4 |FGcBN#בaJe*P/ќhst*Ç`~03faqF!ƓLLXX&YX?Eqqlp^"rq%+($ i ,'&'6+~E"%|-u[6>YU9vBlk. llOSoS~Aޡn=rUkOo^y7;K\|BߪJ(ؿCGrޕ?~.ٮUMEUkf]vw=wφFFFܦ[sti=ClKlJ[?fAkp+%|#/`:Y2kRLo"aᶎ ;;B Ɖ!A֖dMs+N 4Z+4-oDPXc->J ,L$ *P1 Dk[=&'uh>)>d#Q5kb(&WҿV[ţ육j|y|B—ae^5Xϟ4^JخN<Ƕd;kCsd\W=^[,FRT5k+&W3Z0;*1O޳b_qgU1h a_Vk*fT3>/ⶢ9*tG[u[}oѳGߛZQ)TsպUD9JBGL{^{?UNKN^{eXqy~?^}o8PՏ+ȼmkrxQǒy^^kkU\E,B^mPɪ3\>jO[3>9ළm\N1\1|+YR&Bbx<'n I1<w'#۱eQdDm֞ƳKR+"=6t[[DeX-Z^Z\5.qҞʹ(]gj>!O1s-G*N?)D3:Jl-[ve0ҳO.T^~=Y?2r"^{mOK1&xpab[) Jd]qj̝|/y"P,+&3̬|v:GL\wIxbUjO; b'|{6zGVF+AIOviɉ=g7W'*?:^FD獨LTȷ'܄|xu"߯31c[rDӫ_esھ>S%*GћioXĹU_)kJNձ2f-;~dd=㟊x[#6㳬22WmOvXYh+q+PQYihDz'z''*O߮4+myFof=eS"E2&+VdaŜ>0*֭'Q:OEɎ?Y=9QF}Ԯ gr̼32S!ߊ/gӰ}xu"߯31c[rDӫ_esھ>S%*GћioXĹU_)kJNձ2f-;~dd=㟊x[埌">QHyFlj?*:"v*sǕa뿼Z\}bϮU@V2Fg˞"Ԋ>E~ЮgO9gʘX ΢썷LVYӫ yl_k5j;Zl>)~eP5k(}lBye*k,0sugܤhxC9,_ۙ{wI<ĶdP(|Lse_xmXKSAFW^%*n[\eC7kO3#}uXpx蝩?93~;;oOhK (e»*âm |oѳGʈN֭'Q:OE? wm`x[aYxmY9L=Y*Ƙyո>UmP֩,}m_=.8_Y?GtDb2;/ z]X;1bJ;G+==93mWM]Rwp[ћ3oyxOV*٣Q1&gŷ-UPtÓ]h>uoz2t5DH_E!ߣjC[]e`-Y\F%Gg KJҿV* FvP5 W?SY~3䝹VΟD-٪.T9J+wfbm +k¨] 2*iWqwz*"uےMY܁wp͙zWfe+^ޝUž;\Vh 2|ӌ^sœMc[悈ՌbvNEQ~V|WW_])S# eU?vFm~fFmuҼK%gT-<3"gήLɮ@U^E߫9; c;W*˲'bL}c}KT7^%ޢsR]qoH_>3_ߪDlU~i2̳=͑kU祑Qrf^wSb0kSwXw%Wr,ٕ=Gس T|ONDLxSWejC"ܖgf$<{UѬfuϞS3vќm*5g|ԏU5:YTc{2^78'g:c7JfMdŞ7 啩V8(;g_ξ0dY'r|q>^5Xϟ4^Jخ^<[lKdpFRʃ[{`ɹzX,ڥȩ k/E^W[M!Rgj|E\-5bUxge쌌6^E[1Vk*fVNr~UV9*tG[u~oѳGߛ0ZQ)TsպUD9JBGL{^{?UNKN3~dC-gYǫM\Ub~c۶֟*gu,L&/O 3q&*j_Ug1b[Ol f|s Mark Newton Aleš Justin libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/0000755000175000017500000000000011620312220023370 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/pom.xml0000644000175000017500000000137010777350267024737 0ustar twernertwerner org.jboss.microcontainer.docs jboss-microcontainer-docs 2.0.0-SNAPSHOT 4.0.0 org.jboss.microcontainer mc-reference 1.0 pom JBossMC Reference Guide (aggregator) The JBossMC reference guide (aggregator) en-US libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/0000755000175000017500000000000011620312220024317 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/pom.xml0000644000175000017500000000313210777350267025664 0ustar twernertwerner org.jboss.microcontainer.docs jboss-microcontainer-docs 2.0.0-SNAPSHOT 4.0.0 org.jboss.microcontainer microcontainer-reference-${translation} 1.0 jdocbook JBossMC Reference Guide (${translation}) The JBossMC reference guide (${translation}) org.jboss.maven.plugins maven-jdocbook-plugin 2.0.0 true pdf gettingstarted.pdf html index.html master.xml true en_US libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/0000755000175000017500000000000011620312220025106 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/0000755000175000017500000000000011620312220026032 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/0000755000175000017500000000000011620312220027452 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/0000755000175000017500000000000011620312220031122 5ustar twernertwerner././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependency.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependency0000644000175000017500000000212610601663222033175 0ustar twernertwerner Bean Dependency - wiring beans together The POJO controller extends the dependency controller to provide a specific lifecycle for POJOs. KernelController - wiring beans The POJO controller defines the following state operations for describe: determines the dependencies from the bean metadata instantiate: invokes the constructor or factory configure: configures the bean create: invokes any "create()" method start: invokes any "start()" method install: registers the bean with the registry KernelController - demand and supply The POJO controller acts as a Registry plugin to handle demand and supply. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/introduction.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/introducti0000644000175000017500000001326510631631020033243 0ustar twernertwerner Introduction to the JBoss Microcontainer The JBoss Microcontainer (MC) provides an environment to configure and manage POJOs (plain old java objects). It is designed to reproduce the existing JBoss JMX Microkernel but targetted at POJO environments. As such it can be used standalone outside the JBoss Application Server. The 2.0.x release provides a set of features to support POJO deployment in JBossAS-5.0.x, JBossESB, and the bootstrap of services used by standalone projects like embedded EJB3. This document takes you through the design of the microcontainer including design decisions and future directions. JBoss Microcontainer Highlights The primary focus of the MC is as a framework for building server kernels. It replaces the legacy JMX based kernel found in JBossAS4.x and earlier with a POJO based kernel that has been generalized to better support extensibility along the primary aspects required for a server type of environment: aop, metadata, class loading, deployments, state management, lifecycle/dependcies, configuration, and management. The use of the term server should not be correlated with large memory/cpu requirment environments of typical application/web servers. A server in the context of the MC is just a kernel for plugging POJO container models into. The MC can be configured for extremely lightweight application type setups like a junit testcase as well as full feature application servers. Information and Roadmaps A high level roadmap for the MC and status can be found in the wiki page JBossMicrocontainerHighLevelRoadMap. A more detailed roadmap of the issues going into releases can be found in the MC JIRA project page. Design discussion occur in the JBoss POJO Developers Forums. This currently includes 3 sub-forums: Design the new POJO MicroContainer (the core MC projects independent of any particular usage), Design of POJO Server (discussions related to application server environments like JBossAS, JBossESB), Design of OSGi Integration (discussion of how a kernel/framework like OSGi should integrate with the MC). An overview of the MC modules This section introduces the various MC modules aop-mc-int Integration between the JBossAOP and MC projects container A better name would be joinpoint. This module contains: reflection, the integration point for manipulating class information at runtime, e.g. overriding annotations or obtaining an aop instance advisor. joinpoint, the joinpoint model including the join point factory. classadaptor, the integration and configuration spi. metadata, base metadata types and repository dependency Dependency management is handled by the controller. The controller is the core component for keeping track of contexts to make sure the configuration and lifecycle are done in the correct order including dependencies and classloading considerations. deployers Deployers load components from various models, POJOs, JMX, Spring, Java EE, etc. into the MC runtime. kernel The kernel defines the core kernel spi including, boostrap, configuration, POJO deployments, dependency, events, bean metadata, and bean registry. managed The managed module defines the base objects defining the management view of a component. metatype The metatype module defines the base types found in the management view of a component. osgi-int This contains the integration classes that adapt the OSGi model onto the MC. spring-int This contains the integration classes that adapt the spring model onto the MC. ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/registry.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/registry.x0000644000175000017500000000264210601663222033200 0ustar twernertwerner Registering Objects The registry is used to register objects against logical names. Beans can either be registered directly with the registry or KernelRegistryPlugins can be registered to supply objects from other registries, e.g. JNDI. KernelRegistry - retrieving named objects The kernel registry is used to register and retrieve objects against a logical name. When the object registered is an instance of KernelRegistryPlugin it will be asked for an entry if it is not directly registered with the registry. The registry factories are asked in turn in the order they were registered. KernelRegistryPlugin - helpers for the registry A registry factory allows other registry domains (such as JMX or JNDI) to be inserted into the kernel registry. To insert a registry factory into the registry, simply register it like any other object. ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/bootstrap.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/bootstrap.0000644000175000017500000000220210601663222033145 0ustar twernertwerner Bootstrapping the Kernel The bootstrap provides a simple mechanism for bootstrapping the microcontainer. Bootstrap - bootstrapping This bootstrap creates and configures the microcontainer. This involves creating a KernelConfig from which the KernelFactory can be instantiated using the KernelInstantiator. Config - bootstrap configuration This KernelConfig provides the mechanism to configure the bootstrap including how the core kernel services are instantiated and configured. KernelFactory - kernel instantiation The KernelFactory is responsible for initializing and configuring the kernel services using information provided by the KernelConfig. ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependencyinfo.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependency0000644000175000017500000000073510601663222033201 0ustar twernertwerner Dependency Info - describing dependencies WARNING: The dependency controller is subject to change without notice. It is currently under developement as issues with the integration of the JMX microkernel and microcontainer are resolved. ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/events.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/events.xml0000644000175000017500000000364310601663222033167 0ustar twernertwerner Events - notifications from the microcontainer and services The event subsystem allows services to produce and consume events. Event - event abstraction The Event class is intended to abstract the different event mechanisms used by different software. EventEmitter - producting events Event emitters produce events and send them to their registered listeners. Listeners can be registered with a filter to filter the events they are interested in before they are sent. EventListener - consuming events Event listeners consume events from emitters. EventFilter - filtering events A filter allows events to filtered before they are sent. This is can be more efficient than filtering the event in the listener. EventManager - named listening The event manager allows emitters and listeners to be more detached from each other. Instead of direct registration, the names of the objects in the registry are used. ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/reflection.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/reflection0000644000175000017500000000444410601663222033216 0ustar twernertwerner Reflection Model WARNING: The reflection model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The reflection model provides an abstraction over java.lang.reflect. It exists in the container module in package org.jboss.reflect.
Aims
Cache Reflection can be a bottleneck unless the information is cached. This package provides a single stop cache for reflection data rather than repeating this behaviour throughout JBoss.
Abstraction It is anticapted that the reflection model can be improved in different circumstances or environments. This module aims to be the one place where those issues are resolved.
Hide implementation Under AOP, classes can change their characteristics usually through some sort of bytecode manipulation. This module aims to "hide" some of these details from routines that "don't care" about these implementation details.
Issues
Java5 Complete the support for annotations and generics.
Lazy Cache Improve the lazy cache implementation. Details should only be retrieved when accessed.
AOP It is still an open issue whether this implementation can be used by AOP or whether the ClassAdapter is a better place.
Javassist The current implementation just uses simple reflection. Javassist can proably provide a better implementation including supporting annotations before java5?
././@LongLink0000000000000000000000000000014600000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/outline.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/outline.xm0000644000175000017500000000643110631631020033156 0ustar twernertwerner Outline of Reference Guide An outline of the topics/order we should cover. Introduction of the JBoss Microcontainer and its purpose. Overview of the JBoss Microcontainer modules and what the various dependencies between them are. Setup/bootstrap of a kernel. Discussion of various bootstrap coding/configuration to setup a kernel for different environments/purposes. This should be somewhat of a deeper dive overview in that it will reference other modules and SPIs that are used for the setup. Unit testing Embedded J2SE Embedded (EJB3, JBPM, SEAM, ...). How other projects can leverage the JBoss Microcontainer for configuration, IoC, ... JBossAS JBossESB Overview of the JBoss Microcontainer core apis and their relations; container: Configuration, ClassAdapter, ControllerContex, BeanInfo, Joinpoint, MetaDataRepository, MetaData, ... dependency: Controller, ControllerContex, DependencyInfo, DependencyItem, ... kernel: Kernel, KernelFactory, KernelConfigurator, KernelController, KernelControllerContext, KernelDeployment, KernelInitializer, KernelEventManager, KernelMetaDataRepository, KernelBus KernelRegistry ... aop-mc-int: AOPJoinpointFactory, AspectBinding, Aspect, MixinBinding, StackBinding, lifecycle stuff, ... deployers: MainDeployer, Deployer, DeploymentUnit, Attachments, DeploymentContext, StructureMetaData, StructuredDeployers, StructureBuilder, ManagedObjectBuilder, ... managed/metatype: ManagedObject, ManagedProperty, Fields, MetaType, SimpleMetaType, CompositeMetaType, MetaValue, ... ././@LongLink0000000000000000000000000000014500000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/kernel.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/kernel.xml0000644000175000017500000000404010601663222033133 0ustar twernertwerner The Core Kernel Kernel provides access to the kernel services. Kernel - getting access to kernel services The static method Kernel getKernel() provides access to the kernel for the current context. The context is determined by the KernelManager. The services provided by the kernel are: The invocation bus. The kernel configuration. The bean configurator. The kernel controller. The event manager. The registry. KernelManager - controlling context The kernel manager decides which kernel is relevent for the given context. e.g. it could use a singleton kernel or it could provide a different kernel based on classloading domain. ././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/joinpoint.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/joinpoint.0000644000175000017500000000362510577666226033176 0ustar twernertwerner Joinpoint - Accessing a Bean WARNING: The joinpoint model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The joinpoint model provides a mechanism to access class operations in a standard way.
Aims
Stanardize reflection operations There are many places that use reflection within JBoss. The joinpoint provides a mechansim to deal with reflection dispatching without having worry about all the standard error handling, etc.
Overridding Definition The joinpoint allows the mechanism of dispatch to be overridden either through configuration or implementation. Examples would be not using get/set to define a property either because it is a different method name or it should use direct field access.
Issues
javabean versus object Much of the javabean abstraction has moved the BeanInfo model, it is questionable whether the ability to override on a plain object is still required.
Alternative implementations One use of this abstraction would be to precompile reflection objects using javassist for use in environments where dynamic reflection is not supported.
AOP Another potential other use is to "optimize away" reflection when already dispatching requests through AOP.
././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/wikilinks.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/wikilinks.0000644000175000017500000000260610602013252033135 0ustar twernertwerner Wiki Links A collection of useful wiki/forum links to help pull together content. MC High Level Road Map Executive Overview JBossMicrocontainer JBossController JBoss5 High Level Road Map JBossAS5 Virtual Deployment Framework FAQ ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/metadata.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/metadata.x0000644000175000017500000000447510601663222033116 0ustar twernertwerner Decribing Beans The BeanMetaData provides configuration used to deploy beans. This is similar to the -service.xml files in JBoss4. BeanMetaData - deploying a single bean The BeanMetaData provides top level information and access to the more detailed information about the bean deployment. ClassLoaderMetaData - configuring a classloader The classloader metadata is used to configure the classloader for an individual bean or a whole deployment. PropertyMetaData - configuring properties The property metadata is used to configure individual bean property with values. ParameterMetaData - configuring values passed to constructors or methods The parameter metadata is used to pass values to constructors and methods. SupplyMetaData - specifying the bean supplies a demand The supply metadata is used to define what the bean supplies. DemandMetaData - specifying the bean demands a dependency The demand metadata is used to define what the bean demands. ValueMetaData - configuring values The value metadata is used to define values. DependencyValueMetaData - defining named dependencies An extension to the value metadata that treats the underlying value as the name of an entry in the Registry and returns the registry's registered object when asked for the value. ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/deployment.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/deployment0000644000175000017500000001666210601656605033260 0ustar twernertwerner Bean Deployment - deploying beans Scott Stark The bean deployer provides routines for deploying beans. TODO: translate/expand the wiki into this doc. JBoss5DeploymentFramework Design Overview The JBoss5 virtual deployemnt framework takes the aspect oriented design of many of the earlier JBoss containers and applies it to the deployment layer. It is also based on the POJO microntainer rather than JMX as in previous releases. For an overview of the classes as a UML diagram see JBoss5DeploymentFrameworkClasses. The key classes in that diagram are: MainDeployer this interface defines the contract for the MainDeployer. The MainDeployer handles parsing of deployment archives into Deployment instances and deployment of those instances into the microcontainer. This in is an update of the JMX based MainDeployer from earlier versions to a one based on the Microcontainer, JBoss5VirtualFileSystem, and Virtual Deployment Framework(VDF). Deployers are registered with the MainDeployer as an ordered list of deployers. MainDeployer contains two sets of deployers: StructureDeployers : used to analyze the structure of a DeploymentContext when addDeploymentContext(DeploymentContext) is invoked. For each StructureDeployer the determineStructure(DeploymentContext) method is invoked to analyze the deployment. A StructureDeployer? returns true to indicate that the deployment was recognized and no further StructureDeployer should analyze the DeploymentContext. Deployers used to translate a DeploymentUnit into a runtime kernel beans when the MainDeployer.process is run. The Deployer methods are: boolean isRelevant() :does the deployer want to process the unit prepareDeploy() : take the new deployment to the ready stage prepareUndeploy() : get ready to undeploy handoff(new, old) : handover control from new to old commitDeploy() : new deployment is now in control commitUndeploy() : old deployment is out of here getRelativeOrder() : specify the relative order of the deployer in a chain DeploymentUnit a representation of a runtime unit of work a Deployer operates on. DeploymentContext a representation of structural aspects of deployable content. ManagedObject a representation of the manageable properties for a deployment. VFS the api for representing the read-only file system of the deployment. VirtualFile the api for a file in the deployment. DomainClassLoader A generalization of the legacy JMX based unified class loading model. This is still in progress. The org.jboss.vfs.classloding. Current StructureDeployers <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5StructureDeployerClasses">JBoss5StructureDeployerClasses</ulink> org.jboss.deployers.plugins.structure.vfs.AbstractStructureDeployer org.jboss.deployers.plugins.structure.vfs.explicit.DeclaredStructure org.jboss.deployers.plugins.structure.vfs.file.FileStructure org.jboss.deployers.plugins.structure.vfs.jar.JARStructure org.jboss.deployers.plugins.structure.vfs.war.WARStructure org.jboss.deployment.EARStructure Current Deployers org.jboss.deployers.plugins.deployers.kernel.BeanDeployer org.jboss.deployers.plugins.deployers.kernel.KernelDeploymentDeployer org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer ServiceDeployments org.jboss.system.deployers.SARDeployer org.jboss.system.deployers.ServiceClassLoaderDeployer org.jboss.system.deployers.ServiceDeploymentDeployer org.jboss.system.deployers.ServiceDeployer JBoss5WebDeployments org.jboss.deployment.WebAppParsingDeployer org.jboss.deployment.JBossWebAppParsingDeployer org.jboss.web.tomcat.tc6.deployers.TomcatDeployer org.jboss.resource.deployers.RARDeployer org.jboss.resource.deployers.RARParserDeploye Deployer Helper/Base Classes JBoss5BaseDeployerClasses AbstractDeployer ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/configuration.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/configurat0000644000175000017500000000132610601663222033221 0ustar twernertwerner Bean Configuration - instantiating and configuring beans The kernel configurator provides a service to instantiate and configure beans. KernelConfigurator - configuring beans This service is used by the Controller once it knows the dependencies have been satisfied. ControllerContext ././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependencycontroller.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/dependency0000644000175000017500000000071510601663222033177 0ustar twernertwerner Dependency Controller WARNING: The dependency controller is subject to change without notice. It is currently under developement as issues with the integration of the JMX microkernel and microcontainer are resolved. ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/beaninfo.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/beaninfo.x0000644000175000017500000000322710601663222033111 0ustar twernertwerner Describing a Bean The BeanInfo provides a description of a POJO. This information allows the microcontainer to know what can be done with the bean. This is similar to the BeanInfo provided by the java.beans package but some java environments like J2ME do not include this package because it has dependencies on AWT. BeanInfoFactory - retrieveing bean descriptions The BeanInfoFactory is used to create BeanInfos for a given class. BeanInfo getBeanInfo(String className) The default implementation is the IntrospectionBeanInfoFactory which uses reflection. BeanInfo - information about a bean The BeanInfo provides top level information and access to the more detailed information about the bean. PropertyInfo - information about a property The PropertyInfo describes an property, i.e. something that follows the Type getX(); void setX(Type x) javabean pattern. EventInfo - information about an event The EventInfo describes an event. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/classadapter.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/classadapt0000644000175000017500000000327010601663222033177 0ustar twernertwerner ClassAdapter WARNING: The classadapter model is subject to change without notice. It is currently under developement as issues with AOP integration and using the Microcontainer in more constrained environments are investigated. The class adapter abstraction provides a mechanism to override a class or a specific instance of a class in a given context.
Aims
AOP Integration The main of the classadapter is to provide an integration point for AOP and the microcontainer. It represents a class instance before it is constructed or maybe even before the class has been deployed. AOP can override the joinpoints to add extra work during construction.
Overridding annotations The microcontainer allows annotations to be overridden on a specific bean deployment. These are passed to AOP.
Obtaining AOP dependencies The microcontainer uses the classadapter to learn what cross-cutting AOP dependencies are required before any attempt is made to construct the object.
Issues
AOP Integration The AOP integration is currently being finalized as part of AOP2.0
libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/modules/bus.xml0000644000175000017500000000146010601663222032447 0ustar twernertwerner The Invocation Bus The invocation bus provides detyped, named access to the objects in the registry. Bus - invoking objects by name The invocation bus provides Detyped invocations - the beans operations can be invoked by name using Named endpoints - the target bean is specified by a name registered in the registry libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/docbook/master.xml0000644000175000017500000000662610664644321031522 0ustar twernertwerner JBoss Microcontainer Reference A Reference for Developers 2.0.0 Target Audience This reference is aimed at microcontainer developers. It aims at describing how the microcontainer is constructed, the design decisions made and how to extend or develop it. Preface Commercial development support, production support and training for the JBoss Microcontainer is available through JBoss Inc. The JBoss Microcontainer is a project of the JEMS product suite. Authors: Adrian Brock - JBoss Microcontainer Project Lead and Chief Scientist of JBoss Inc. Scott Stark - VP Architecture & Technology Kabir Khan - JBoss AOP Project Lead Ales Justin - JBoss Core Developer libjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/resources/0000755000175000017500000000000011620312220030044 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/resources/shared/0000755000175000017500000000000011620312220031312 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/resources/shared/images/0000755000175000017500000000000011620312220032557 5ustar twernertwerner././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/resources/shared/images/empty.dirlibjboss-microcontainer-java-2.0.10.GA.orig/docs/reference/en-US/src/main/resources/shared/images/em0000644000175000017500000000000010577666226033125 0ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/0000755000175000017500000000000011620312213024464 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/pom.xml0000644000175000017500000000143310777350267026031 0ustar twernertwerner org.jboss.microcontainer.docs jboss-microcontainer-docs 2.0.0-SNAPSHOT 4.0.0 org.jboss.microcontainer.docs microcontainer-getting-started 1.0 pom JBossMC Getting Started Guide (aggregator) The JBossMC getting started guide (aggregator) en-US libjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/0000755000175000017500000000000011620312213025413 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/pom.xml0000644000175000017500000000315410777350267026762 0ustar twernertwerner org.jboss.microcontainer.docs jboss-microcontainer-docs 2.0.0-SNAPSHOT 4.0.0 org.jboss.microcontainer microcontainer-getting-started-${translation} 1.0 jdocbook JBossMC Getting Started Guide (${translation}) The JBossMC Getting Started Guide (${translation}) org.jboss.maven.plugins maven-jdocbook-plugin 2.0.0 true pdf gettingstarted.pdf html index.html master.xml true en_US libjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/0000755000175000017500000000000011620312211026200 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/0000755000175000017500000000000011620312212027125 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/0000755000175000017500000000000011620312212030545 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/0000755000175000017500000000000011620312212032215 5ustar twernertwerner././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/classloader.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/class0000644000175000017500000000450611202312650033254 0ustar twernertwerner Classloader module Introducing fine grained classloading in Micorcontainer's IoC, better aspect integration, new and projects, it was all set to also redo the whole classloding layer for the new Kernel and transitively JBoss5 application server. A whole new Classloder module was created to somehow fix the old API mistakes and to allow a clean and plugable way for existing extensions of default classloading. These extensions range from old concepts of Servlet classloading, runtime AOP weaving, and all the way to new . When designing new API for Classloading, we wanted to expose as little as possible. The concept there was to hide all the "nitty gritty" details and reduce the amount of API users need to apply in order to get the required behaviour. When you were normally dealing with concrete ClassLoader classes, we reduced the implementation detail to only needing to implement your own ClassLoaderPolicy. This includes things like what packages you export, what you import, how to get resources and other things related to defining classes. We'll show the example of the policy later on. Additionally, the idea of a LoaderRepository is replaced with a ClassLoaderDomain and a ClassLoaderSystem acting as a factory and a repository of domains. Each ClassLoaderSystem has a "default domain". ClassLoaderSystem system = ClassLoaderSystem.getInstance(); // Define classloader policy MyClassLoaderPolicy myPolicy = ... // Register with the default domain, // there are other methods to create // and register with different domains ClassLoader cl = system.registerClassLoaderPolicy(myPolicy); This is a simple example of what it comes down to, to create your own Classloader instance that will behave accordingly to the classloader policy. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/modules.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/modul0000644000175000017500000000251210657020413033270 0ustar twernertwerner New subprojects With the new Microcontainer 2.0.0 a lot of new features were added to the Microcontainer core to make integration with new JBoss5 easier and cleaner. Some of the core aspects were entirely re-written. You can see these changes in the subprojects / modules on the figure below.
Module dependency
Here we can see the modules that make the whole Microcontainer architecture. Most of them are part of Microcontainer project as subprojects, where MBeans resides in JBossAS project and VFS is a separate project. AOP-MC-int and Spring-int are extension parts of the Core (Container, Dependency, Kernel). Using AOP-MC-int features is a matter of configuration, where Spring-int is a simple addon. All other modules are optional, but you must satisfy the dependencies presented to you by directed arrows.
././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/packaging.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/packa0000644000175000017500000000360411202312650033224 0ustar twernertwerner Packaging We had a brief discussion on the jboss-beans.xml file in . In this chapter, we will go into more depth on the packaging topic. As we will see later in , the packaging is more of a convention rather than a requirement. The convention is recommended since it allows "deployments" to be used both standalone and inside JBoss AS. The basic structure of Microcontainer deployment is a plain .jar file (see below). The jar archive can also be unpacked in a directory structure that looks the jar file. It contains a META-INF/jboss-beans.xml to describe what you want it to do. The contents of this xml file are described in . Finally, the archive contains the classes and any resources just like any other jar file. example.jar/ example.jar/META-INF/jboss-beans.xml example.jar/com/acme/SomeClass.class If you want to include a .jar file in an .ear deployment, you will need to reference it in META-INF/jboss-app.xml . example.jar ]]> ././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/conclusion.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/concl0000644000175000017500000000133410632011053033240 0ustar twernertwerner Conclusion The Microcontainer is a powerful replacement for the JBoss's JMX microkernel. It brings the loosely coupled configuration environment of JBoss to POJO environments, adding more control and extra features. Both inside and outside the JBoss Application Server. Going forward these additional features will allow even more advances, including aspectized deployment, on demand services, versioned deployments, etc. ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/introduction.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/intro0000644000175000017500000001304411202312650033277 0ustar twernertwerner Introduction to the JBoss Microcontainer The JBoss Microcontainer provides an environment to configure and manage POJOs (plain old java objects). It is designed to reproduce the existing JBoss JMX Microkernel but targeted at POJO environments. As such it can be used standalone outside the JBoss Application Server. As we mention JBoss Application Server, while rewriting its Microkernel to a POJO environment, there were other aspects that also needed to be considered while changing the core functionality. New modules or subprojects were introduced to the Microcontainer project to tightly integrate those aspects with the new POJO approach and to eventually solve some of the basic problems that arose over the years with the changes the application server went through. We will discuss these modules and subprojects later on. At its core, the JBoss Microcontainer is a generic "dependency injection" framework. Its primary function is to instantiate objects, figure out their dependencies (e.g., object A must be instantiated before object B), and then manage the relationship between those objects (e.g., object A is a property of object B). With the JBoss Microcontainer, you can build applications or shared services using simple POJOs. The JBoss Microcontainer is responsible for assembling the POJOs together according to an externally defined XML configuration file. It decouples the components in an application and makes the application easy to unit-test. The JBoss Microcontainer is a big object factory that manages objects. In this sense, it is similar to existing dependency injection frameworks such as the Spring framework and HiveMind framework. However, JBoss Microcontainer also has several important new features that sets it apart from existing frameworks. JBoss Microcontainer supports life cycles for POJO components. It gives you fine-grained control over exactly how the objects are created, instantiated, and destroyed. JBoss Microcontainer manages dependencies between objects. For instance, you can declare that object A must be instantiated before object B can be created. JBoss Microcontainer integrates with the JBoss AOP (Aspect Oriented Programming) framework. In the JBoss Microcontainer configuration file, you can easily wire aspects as services to POJOs. JBoss Microcontainer is used as a replacement for the JMX-based Microkernel in JBoss AS 5.x and above. All the existing features of MBeans are tightly integrated into new Microcontainer based ServiceController. JBoss Microcontainer is embedded in JBoss AS 4.x. It is the ideal choice if you need to develop shared services in JBoss AS. Of course, you can also run JBoss Microcontainer outside of the JBoss AS. For instance, you can run it in a Java SE (e.g., Swing) application or in the Tomcat servlet container. So, JBoss Microcontainer primarily targets three types of developers. Framework developers can use JBoss Microcontainer to assemble custom server frameworks. For instance, the JBoss embeddable EJB3 framework is based on the Microcontainer. JBoss application developers can develop POJO services that nicely integrate into the server and can be shared across applications. Application developers can write lightweight applications that makes use of services from a variety of sources (e.g., transaction service from JBoss, persistence service from Hibernate, and HTTP service from Tomcat). A typical JBoss Microcontainer application or service includes a set of POJOs that complete business tasks, as well as an XML configuration file called META-INF/jboss-beans.xml on the class path. The jboss-beans.xml file tells the JBoss Microcontianer how to assemble those POJOs together. For deployment, you can JAR the POJO classes, as well as the META-INF/jboss-beans.xml file together in a simple .jar archive file (see ). This document takes you through some example deployments into JBoss Microcontainer 2.0 explaining how to configure POJOs and link them together through injection. We will also explain how to use other Microcontainer modules inside JBoss AS 5.x, especially the re-written deployers and classloader modules. Later, we will discuss how to do the same thing outside the application server. ././@LongLink0000000000000000000000000000015300000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/managed.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/manag0000644000175000017500000002527610671616054033257 0ustar twernertwerner Managed module Overview The deployers support a management API based on the org.jboss.managed.api classes, and org.jboss.metatype.api.types, org.jboss.metatype.api.values MetaType/MetaValue classes. org.jboss.managed.api Classes The management API provides an abstraction for editing the metadata of a Deployment. The main management classes include: org.jboss.managed.api.ManagedObject - is the root interface for a manageable element. Its consists of: a name/name type for a registry/references an attachment name to associate the ManagedObject with a deployment attachment annotations from the metadata making up the ManagedObject the attachment instance the ManagedPropertys for the interface the ManagedOperations for the interface org.jboss.managed.api.ManagedProperty is an interface describing a manageable field in a ManagedObject. Its analogous to the JavaBean property/JMX mbean attribute. Its a type safe wrapper around the Fields interface. org.jboss.managed.api.ManagedOperation an interface for representing an operation in a management interface. org.jboss.managed.api.ManagedParameter – a parameter in a ManagedOperation org.jboss.managed.api.Fields is an interface for a collection of named values that are associated with a managed property or operation. org.jboss.managed.api.ManagedDeployment is an interface describing a collection of ManagedComponent and structural information about a deployment. org.jboss.managed.api.ManagedComponent is an interface that extends ManagedObject to define a runtime component associated with a deployment. org.jboss.managed.api.ComponentType – type/subtype qualification of a ManagedComponent org.jboss.managed.api.DeploymentTemplateInfo – named collection of ManagedPropertys needed to create a deployment or component org.jboss.metatype.api.types Classes The types classes define an abstraction for the types of values found in the ManagedProperty and ManagedOperation interfaces. The types are essentially simplified types that only rely on basic JDK types. The main types classes include: org.jboss.metatype.api.types.MetaType<T extends Serializable> - root interface for meta types org.jboss.metatype.api.types.CompositeMetaType - a key/value collection type org.jboss.metatype.api.types.TableMetaType - a table structure with the rows being a CompositeMetaType. org.jboss.metatype.api.types.AbstractMetaType<T extends Serializable> - base abstract class implementing MetaType org.jboss.metatype.api.types.AbstractCompositeMetaType - base abstract class implementing CompositeMetaType org.jboss.metatype.api.types.ArrayMetaType - an array or Collection of MetaType org.jboss.metatype.api.types.EnumMetaType - java enum type or a fixed set of String values. org.jboss.metatype.api.types.GenericMetaType - an opaque pass through wrapper for types that don't fit into another MetaType. org.jboss.metatype.api.types.SimpleMetaType - a wrapper type for primatives; BigDecimal, BigInteger, Boolean/boolean, Byte/byte, Character/char, Date, Double/double, Float/float, Integer/int, Long/long, Short/short, String, Void/void. org.jboss.metatype.api.values Classes The values API provides an value wrappers for the corresponding MetaTypes. The main values classes include: org.jboss.metatype.api.values.MetaValue - the base value interface defining a type accessor and clone method. org.jboss.metatype.api.values.ArrayValue<T extends Serializable> - a representation of an array or collection of MetaValues. It supports an index getter as well as Iterable<T>. org.jboss.metatype.api.values.CompositeValue - A represention of a map of MetaValues keyed by a String. CompositeValueSupport is a concrete implementation of CompositeValue. org.jboss.metatype.api.values.EnumValue - A represention of a java.lang.Enum set of values, or a set of Strings. EnumValueSupport is a concrete implementation of EnumValue that represents a single java.lang.Enum value or java.lang.String value. org.jboss.metatype.api.values.GenericValue - A represention of a GenericMetaType. GenericValueSupport is a concrete implementation of GenericValue that represents a single java.io.Serializable value. org.jboss.metatype.api.values.SimpleValue - the SimpleMetaType value. The org.jboss.metatype.api.values.SimpleValueSupport<T extends Serializable> class provides wrap method for generating the correct SimpleValue from the java value object. org.jboss.metatype.api.values.TableValue - the TableMetaType value. The org.jboss.metatype.api.values.TableValueSupport class provides a concrete implementation of TableValue. org.jboss.metatype.api.values.MetaValueFactory - a factory for converting a java value into the corresponding MetaValue. It support an org.jboss.metatype.spi.values.MetaValueBuilder plugin for controlling how a given java.lang.Class type is converted into a MetaValue. org.jboss.metatype.spi.values.MetaValueBuilder - a plugin for converting a MetaType and object instance into a MetaValue. org.jboss.managed.api.annotation Annotations The annotations available for defining the management interfaces include: org.jboss.managed.api.annotation.ManagementObject - a class level annotation that identifies a metadata class as a ManagedObject. org.jboss.managed.api.annotation.ManagementObjectID - identifies a ManagedObject key/type qualifier source. org.jboss.managed.api.annotation.ManagementObjectRef - indicates a property that references another ManagedObject. org.jboss.managed.api.annotation.ManagementProperty - annotation for describing a ManagedProperty. org.jboss.managed.api.annotation.ManagementComponent - identifies a property as metadata identifying a ManagedComponent. org.jboss.managed.api.annotation.ManagementOperation - An annotation for describing a ManagedOperation. org.jboss.managed.api.annotation.ManagementParameter - Annotation for documenting a ManagementOperation parameter. Annotation Examples Adding ManagedObject Support to Deployers Deployer implementors create ManagedObjects for their associated metadata by having the Deployer implement the ././@LongLink0000000000000000000000000000016200000000000011564 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/reliance_rules.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/relia0000644000175000017500000000175711202312650033250 0ustar twernertwerner Reliance rules Drools... Deployment The deployment element acts as a container for many beans that are deployed together. ]]> ././@LongLink0000000000000000000000000000015100000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/guice.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/guice0000644000175000017500000001340011202312650033234 0ustar twernertwerner Guice integration Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 5 and above, brought to you by Google. We've written a piece of integration code that bridges the two IoC frameworks together. You can inject Guice defined beans into the Microcontainer and/or the other way around. See the examples for more details. In this example we will define a Guice module, binding a simple Singleton class to one of its instances. We will then do a contextual lookup for the Singleton instance in the SingletonHolder class. AbstractBeanMetaData guicePlugin = new AbstractBeanMetaData( "GuicePlugin", GuiceKernelRegistryEntryPlugin.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); AbstractArrayMetaData arrayMetaData = new AbstractArrayMetaData(); final Singleton singleton = new Singleton(); Module module = new AbstractModule() { protected void configure() { bind(Singleton.class).toInstance(singleton); } }; arrayMetaData.add(new AbstractValueMetaData(module)); constructor.setParameters( Collections.singletonList( (ParameterMetaData)new AbstractParameterMetaData(arrayMetaData))); guicePlugin.setConstructor(constructor); public class SingletonHolder { private Singleton singleton; @Constructor public SingletonHolder(@Inject Singleton singleton) { this.singleton = singleton; } public Singleton getSingleton() { return singleton; } } ControllerContext holderContext = controller.getInstalledContext("holder"); assertNotNull(holderContext); SingletonHolder holder = (SingletonHolder)holderContext.getTarget(); assertNotNull(holder); assertEquals(singleton, holder.getSingleton()); The detail that is hidden is in GuiceKernelRegistryEntryPlugin, which acts as a intermediate between the Microcontainer's registry and the Guice Injector. But all you need to do is register GuiceKernelRegistryEntryPlugin as a POJO into Microcontainer, providing Guice Modules with its constructor. We can also go the other way around. Injecting named beans into the Guice Injector. There are a couple of ways to achieve that. Lets look at them. Injector injector = Guice.createInjector(new AbstractModule() { protected void configure() { bind(Controller.class).toInstance(controller); bind(Singleton.class).toProvider( GuiceIntegration.fromMicrocontainer( Singleton.class, "singleton")); bind(Prototype.class).toProvider( GuiceIntegration.fromMicrocontainer( Prototype.class, "prototype")); } }); AbstractBeanMetaData injectorBean = new AbstractBeanMetaData( "injector", GuiceInjectorFactory.class.getName()); AbstractConstructorMetaData constructor = new AbstractConstructorMetaData(); constructor.setFactoryClass(GuiceInjectorFactory.class.getName()); constructor.setFactoryMethod("createInjector"); List<ParameterMetaData> parameters = new ArrayList<ParameterMetaData>(); parameters.add(new AbstractParameterMetaData( new AbstractDependencyValueMetaData(KernelConstants.KERNEL_NAME))); AbstractArrayMetaData array = new AbstractArrayMetaData(); array.add(new AbstractValueMetaData(GuiceObject.ALL)); parameters.add(new AbstractParameterMetaData(array)); constructor.setParameters(parameters); injectorBean.setConstructor(constructor); controller.install(injectorBean); ControllerContext injectorContext = controller.getInstalledContext("injector"); assertNotNull(injectorContext); Injector injector = (Injector)injectorContext.getTarget(); <bean name="injector" class="org.jboss.guice.plugins.GuiceInjectorFactory"> <constructor factoryClass="org.jboss.guice.plugins.GuiceInjectorFactory" factoryMethod="createInjector"> <parameter>jboss.kernel:service=Kernel</parameter> <parameter> <array> <bean name="BindAll" class="org.jboss.guice.plugins.AllGuiceObject"> <constructor factoryClass="org.jboss.guice.plugins.AllGuiceObject" factoryMethod="getInstance"/> </bean> </array> </parameter> </constructor> </bean> Here we saw three ways of using Microcontainer beans to do wiring in Guice. The first and second examples are purely programmatic and you need to provide a Controller instance. The third one is how you would bind all existing installed beans into the Guice Injector via a -beans.xml. Or you can provide a ControllerContextBindFilter instance to the binding methods to filter the beans you want to bind. See the API docs for more details. ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/mbeans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/mbean0000644000175000017500000000422711202312650033231 0ustar twernertwerner MBeans extensions In previous versions (pre 5.x) of JBoss Application Server, core services were implemented as MBeans. To make things a bit easier, not forcing the requrement for a direct implementation of the DynamicMBean interface, we introduced XMBeans. But with the change of the underlying Kernel, moving away from an JMX MBeanServer to a plain POJO Controller, we also let the handling of the existing MBeans to the new Controller. Apart from supporting all of the existing XMBean features, we also ported some of the rich features from the new Microcontainer IoC model to the XBeans. We'll show these features in the examples below. <mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode"> <attribute name="Attribute"> <inject bean="TestName" property="getSomething" state="Instantiated"/> </attribute> </mbean> Here we transparently add a dependency on a bean named TestName, which must be, in order to be injected, in the Instantiated state. Once the dependency is satisfied, we actually don't inject the bean itself into the attribute, but we inject the return value of getSomething method being executed on TestName bean instance. Property and state attributes are optional, by default the dependant state is Installed. <mbean name="jboss.test:type=BasicMBeanName" code="BasicMBeanCode"> <alias>BasicBean</alias> <alias>${system.basic.name}</alias> </mbean> Here we can see that a MBean can also have alias names. When adding alias you can also use System property replacement. ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/reliance.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/relia0000644000175000017500000000354711202312650033247 0ustar twernertwerner Reliance modules In Microcontainer it's all about dependecies. One of the features we promised is the ability to write your own dependency. As a dependency we mean some condition that must be satisfied in order that a state machine lets a node pass to next state. In our case the nodes are our beans, which we eventually want to install into the Microcontainer's registry. Almost all component models impose some sort of authentification or authorization. We've added a simple identity module that relies on plain java.security concepts. On top of this we added an extension module where you can define your security requirements via Drools declarative rules. Drools integration is not limited to just security handling, it can be extended to suite any Drools defined rules. More about the subject in the chapters below. We've also added a jBPM integration to support long lasting state flow definitions. This integration provides a plugable way of notifying state machine nodes that they can move forward to the next state. We'll show a simple human interaction of accepting state change requests to move beans into the next state. ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/aop.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/aop.x0000644000175000017500000002450011202312650033170 0ustar twernertwerner
AOP Configuration and Usage When writing a new version of the Kernel, there was always a need for simple usage of advanced AOP features in the Kernel itself. With version 2.0.0 of the Microcontainer there is an elegant way of binding your aspect to wired POJOs, using all the advantages of full dependency state machine. Meaning that even aspects behave as installed services, having full lifecycle and dependency support in the Microcontainer. And it's all a matter of configuration if you want to use an aspectized Microcontainer or just plain POJO behaviour. To find out more about JBoss AOP, please see the JBoss AOP documentation. Configuration To leverage the JBoss AOP integration in the Microcontainer you need to make sure that jboss-aop-mc-int.jar is available on the classpath. The Microcontainer will decide how whether to use AOP depending on if classes from this jar are present. To use the AOP integration we must include the AspectManager bean. in our configuration. It is included as follows ]]> Using Aspects We can apply aspects to any beans we like. This can either be done by using already woven classes (loadtime or compile-time weaving). If the bean class is not already woven, but should have aspects applied to it, a proxy will be generated. If the class is not woven, field level aspects will not get triggered, you will only get constructor and method-level interception. ]]> In the above example, the elements in the aop namespace follow the same format as in a -aop.xml. Please see the JBoss AOP documentation for more details. Whenever we call the method someMethod() in the Intercepted bean, we will get intercepted by the FooAdvice bean's foo() method. The aspect methods must have the signature shown. The JBoss AOP documentation contains more information about advice methods, and the pointcut expressions used to pick out methods/constructors/fields that should have aspects applied. AOP Lifecycle callbacks We can also aspectize the installs and uninstalls of a bean. The following snippet shows a AOP lifecycle callback handler that gets triggered once StartBean enters the start state upon deployment, and when it leaves the start state upon undeployment. @org.jboss.test.microcontainer.support.Start ]]> The install and uninstall methods are required, and must have the signature shown. The names of these methods can be overridden by passing in the installMethod and uninstallMethod attributes as part of the aop:lifecycle-start tag. We can also intercept the install/uninstall upon entering/leaving other states, by substituting aop:lifecycle-start with one of the following. aop:lifecycle-configure - Triggered when the target beans enter/leave the configure lifecycle state upon deployment/undeployment aop:lifecycle-create - Triggered when the target beans enter/leave the create lifecycle state upon deployment/undeployment aop:lifecycle-describe - Triggered when the target beans enter/leave the describe lifecycle state upon deployment/undeployment aop:lifecycle-install - Triggered when the target beans enter/leave the install lifecycle state upon deployment/undeployment aop:lifecycle-instantiate - Triggered when the target beans enter/leave the instantiate lifecycle state upon deployment/undeployment Aspect dependencies Aspects and AOP lifecycle callbacks configured via the microcontainer can have dependencies just as normal beans can have. Beans which have these aspects applied inherit the aspect's dependencies. @org.jboss.aop.microcontainer.aspects.jmx.JMX @org.acme.Tx ]]> JmxAdvice depends on a bean called MBeanServer having been deployed, and TxAdvice depends on a bean called TxManager having been deployed. BeanWithAspects has been annotated with both @JMX and @Tx. Using this configuration, BeanWithAspects gets both JMXAdvice and TxAdvice applied. BeanWithAspects inherits the dependencies of all applied aspects and AOP lifecycle callbacks, so it cannot be started until JMXAdvice and TxAdvice have their dependencies satisfied. PlainBean on the other hand, has no aspects applied, and so has no extra dependencies from the AOP layer.
././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/glossary.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/gloss0000644000175000017500000000055510643437062033313 0ustar twernertwerner Glossary
A glossary to start The glossary ...
././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/reliance_jbpm.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/relia0000644000175000017500000000175511202312650033246 0ustar twernertwerner Reliance jBPM jBPM ... Deployment The deployment element acts as a container for many beans that are deployed together. ]]> ././@LongLink0000000000000000000000000000016500000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/reliance_identity.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/relia0000644000175000017500000000176711202312650033251 0ustar twernertwerner Reliance identity Identity ... Deployment The deployment element acts as a container for many beans that are deployed together. ]]> ././@LongLink0000000000000000000000000000014700000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/vfs.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/vfs.x0000644000175000017500000005365610642363465033246 0ustar twernertwerner VFS Configuration and Usage The virtual file system module provides a read-only abstraction for a file system accessed using a root URI/URL. Overview The virtual file system module provides a read-only abstraction for a file system accessed using a root URI/URL. The main VFS classes include: org.jboss.virtual.VFS - A factory class for creating and finding VirtualFiles. org.jboss.virtual.VirtualFile - the encapsulation of an entry in a virtual file system. org.jboss.virtual.VirtualFileFilter/VirtualFileFilterWithAttributes - filters that can be used to restrict the VirtualFiles matching a search. org.jboss.virtual.VisitorAttributes - attributes that control how a visitation of a VFS root is performed. org.jboss.virtual.VirtualFileVisitor - a callback interface used with the VFS/VirtualFile.vist methods. org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter - a VirtualFileFilter implementation that accepts any file that ends with one of the filter suffixes. VFS Examples Getting a VFS from a root URL URL rootURL = ...; VFS vfs = VFS.getVFS(rootURL); VirtualFile jar = vfs.findChild("outer.jar"); Getting a VFS from a root URI URI rootURI = ...; VFS vfs = VFS.getVFS(rootURI); VirtualFile jar = vfs.findChild("outer.jar"); Accessing a jar manifest URI rootURI = ...; VFS vfs = VFS.getVFS(rootURI); VirtualFile jar = vfs.findChild("outer.jar"); VirtualFile metaInf = jar.findChild("META-INF/MANIFEST.MF"); InputStream mfIS = metaInf.openStream(); Manifest mf = new Manifest(mfIS); mfIS.close(); Attributes mainAttrs = mf.getMainAttributes(); String version = mainAttrs.getValue(Attributes.Name.SPECIFICATION_VERSION); Finding all .class files under a VFS root classes = vfs.getChildren(classVisitor); int count = 0; for (VirtualFile cf : classes) { ... } ]]> org.jboss.virtual Classes org.jboss.virtual.VFS getChildren() throws IOException { } /** * Get the children * * @param filter to filter the children * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the root is a leaf node */ public List getChildren(VirtualFileFilter filter) throws IOException { } /** * Get all the children recursively

* * This always uses {@link VisitorAttributes#RECURSE} * * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the root is a leaf node */ public List getChildrenRecursively() throws IOException { } /** * Get all the children recursively

* * This always uses {@link VisitorAttributes#RECURSE} * * @param filter to filter the children * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the root is a leaf node */ public List getChildrenRecursively(VirtualFileFilter filter) throws IOException { } /** * Visit the virtual file system from the root * * @param visitor the visitor * @throws IOException for any problem accessing the VFS * @throws IllegalArgumentException if the visitor is null * @throws IllegalStateException if the root is a leaf node */ public void visit(VirtualFileVisitor visitor) throws IOException { ... } } ]]> org.jboss.virtual.VirtualFile streams = Collections.synchronizedSet(new WeakSet()); /** * Create a new VirtualFile. * * @param handler the handler * @throws IllegalArgumentException if the handler is null */ public VirtualFile(VirtualFileHandler handler) { ... } /** * Get the virtual file handler * * @return the handler * @throws IllegalStateException if the file is closed */ public VirtualFileHandler getHandler() { ... } /** * Get the simple VF name (X.java) * * @return the simple file name * @throws IllegalStateException if the file is closed */ public String getName() { ... } /** * Get the VFS relative path name (org/jboss/X.java) * * @return the VFS relative path name * @throws IllegalStateException if the file is closed */ public String getPathName() { ... } /** * Get the VF URL (file://root/org/jboss/X.java) * * @return the full URL to the VF in the VFS. * @throws MalformedURLException if a url cannot be parsed * @throws URISyntaxException if a uri cannot be parsed * @throws IllegalStateException if the file is closed */ public URL toURL() throws MalformedURLException, URISyntaxException { ... } /** * Get the VF URI (file://root/org/jboss/X.java) * * @return the full URI to the VF in the VFS. * @throws URISyntaxException if a uri cannot be parsed * @throws IllegalStateException if the file is closed * @throws MalformedURLException for a bad url */ public URI toURI() throws MalformedURLException, URISyntaxException { ... } /** * When the file was last modified * * @return the last modified time * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public long getLastModified() throws IOException { ... } /** * Returns true if the file has been modified since this method was last called * Last modified time is initialized at handler instantiation. * * @return * @throws IOException */ public boolean hasBeenModified() throws IOException { ... } /** * Get the size * * @return the size * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public long getSize() throws IOException { ... } /** * Tests whether the underlying implementation file still exists. * @return true if the file exists, false otherwise. * @throws IOException - thrown on failure to detect existence. */ public boolean exists() throws IOException { ... } /** * Whether it is a simple leaf of the VFS, * i.e. whether it can contain other files * * @return true if a simple file. * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public boolean isLeaf() throws IOException { ... } /** * Whether it is hidden * * @return true when hidden * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public boolean isHidden() throws IOException { ... } /** * Access the file contents. * * @return an InputStream for the file contents. * @throws IOException for any error accessing the file system * @throws IllegalStateException if the file is closed */ public InputStream openStream() throws IOException { ... } /** * Close the streams */ public void closeStreams() { ... } /** * Close the file resources (stream, etc.) */ public void close() { ... } /** * Get the VFS instance for this virtual file * * @return the VFS * @throws IllegalStateException if the file is closed */ public VFS getVFS() { ... } /** * Get the parent * * @return the parent or null if there is no parent * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public VirtualFile getParent() throws IOException { ... } /** * Get the children * * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public List getChildren() throws IOException { return getChildren(null); } /** * Get the children * * @param filter to filter the children * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed or it is a leaf node */ public List getChildren(VirtualFileFilter filter) throws IOException { ... } /** * Get all the children recursively

* * This always uses {@link VisitorAttributes#RECURSE} * * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed */ public List getChildrenRecursively() throws IOException { return getChildrenRecursively(null); } /** * Get all the children recursively

* * This always uses {@link VisitorAttributes#RECURSE} * * @param filter to filter the children * @return the children * @throws IOException for any problem accessing the virtual file system * @throws IllegalStateException if the file is closed or it is a leaf node */ public List getChildrenRecursively(VirtualFileFilter filter) throws IOException { ... } /** * Visit the virtual file system * * @param visitor the visitor * @throws IOException for any problem accessing the virtual file system * @throws IllegalArgumentException if the visitor is null * @throws IllegalStateException if the file is closed or it is a leaf node */ public void visit(VirtualFileVisitor visitor) throws IOException { ... } /** * Find a child * * @param path the path * @return the child * @throws IOException for any problem accessing the VFS (including the child does not exist) * @throws IllegalArgumentException if the path is null * @throws IllegalStateException if the file is closed or it is a leaf node */ public VirtualFile findChild(String path) throws IOException { ... } } ]]> org.jboss.virtual.VisitorAttributes Adrian Brock * @author Scott.Stark@jboss.org * @version $Revision: 1.1 $ */ public class VisitorAttributes { /** A VirtualFileFilter than accepts any file */ public static final AcceptAnyFilter RECURSE_ALL = new AcceptAnyFilter(); /** The default attributes - visit nothing both leaves, non-leaves, no recursion */ public static final VisitorAttributes DEFAULT = new ImmutableVisitorAttributes(); /** Visit leaves only and do not recurse non-leaf files */ public static final VisitorAttributes LEAVES_ONLY = new ImmutableVisitorAttributes(true, null); /** Recurse and visit all non-leaf files */ public static final VisitorAttributes RECURSE = new ImmutableVisitorAttributes(false, RECURSE_ALL); /** Recurse all non-leaf files but only visit leaves */ public static final VisitorAttributes RECURSE_LEAVES_ONLY = new ImmutableVisitorAttributes(true, RECURSE_ALL); /** Whether to include the root */ private boolean includeRoot; /** Whether to only visit leaves */ private boolean leavesOnly; /** Whether to ignore individual file errors */ private boolean ignoreErrors; /** Whether to include hidden files */ private boolean includeHidden; /** A filter used to control whether a non-leaf is recursive visited */ private VirtualFileFilter recurseFilter; /** * Whether to visit leaves only

* * Default: false * * @return the visit leaves only. */ public boolean isLeavesOnly() { return leavesOnly; } /** * Set the leaves only. * * @param leavesOnly the leaves only * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class */ public void setLeavesOnly(boolean leavesOnly) { this.leavesOnly = leavesOnly; } /** * Whether to recurse into the non-leaf file

. If there is a recurse * filter then the result will by its accepts(file) value. * * Default: false * * @param file the file * @return the recurse flag. */ public boolean isRecurse(VirtualFile file) { boolean recurse = false; if( recurseFilter != null ) recurse = recurseFilter.accepts(file); return recurse; } /** * Get the recurse filter. * @return the current recurse filter. */ public VirtualFileFilter getRecurseFilter() { return recurseFilter; } /** * Set the recurse filter. * * @param filter - the recurse filter. * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class */ public void setRecurseFilter(VirtualFileFilter filter) { this.recurseFilter = filter; } /** * Whether to include the root of the visit

* * Default: false * * @return the includeRoot. */ public boolean isIncludeRoot() { return includeRoot; } /** * Set the includeRoot. * * @param includeRoot the includeRoot. * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class */ public void setIncludeRoot(boolean includeRoot) { this.includeRoot = includeRoot; } /** * Whether to ignore individual errors

* * Default: false * * @return the ignoreErrors. */ public boolean isIgnoreErrors() { return ignoreErrors; } /** * Set the ignoreErrors. * * @param ignoreErrors the ignoreErrors. * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class */ public void setIgnoreErrors(boolean ignoreErrors) { this.ignoreErrors = ignoreErrors; } /** * Whether to include hidden files

* * Default: false * * @return the includeHidden. */ public boolean isIncludeHidden() { return includeHidden; } /** * Set the includeHidden. * * @param includeHidden the includeHidden. * @throws IllegalStateException if you attempt to modify one of the preconfigured static values of this class */ public void setIncludeHidden(boolean includeHidden) { this.includeHidden = includeHidden; } } ]]> Configuration TODO:jboss-vfs.jar ... ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/deployers.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/deplo0000644000175000017500000002732211202312650033253 0ustar twernertwerner Deployers module With re-writing the new application server Kernel from JMX based to POJO oriented, we also re-wrote the whole Deployer architecture which was also based on the old JMX MBeans. Let's first look at the new concepts and then do an example of each new change. StructureDeployers Combined with the previously mentioned new VFS implementation we introduced a new kind of Deployer, the Structure Deployer. The purpose of Structure Deployer is to recognise the deployment type and prepare this information for the actual Deployers. There are already default implementations for standard types such as JAR, WAR, EAR and specific files. You can simply implement your own StructureDeployer or extend the AbstractStructureDeployer. Or you can use the declarative approach by defining your structure with an XML file - META-INF/jboss-structure.xml. This file will be automatically picked up by DeclarativeStructureDeployer. Let's now look at how to use one of the existing StructureDeployer implementations, write our own or use the declarative one. This is how we can add our own new file support. This one defines that -spring.xml files are also treated as metadata files. This is a simple implementation for our own deployment structure which holds metadata information in mydata directory and has Java classes in myclasses directory. Here we simply write a plain XML file defining where to look for ... TODO Deployers With the old style of JBoss Deployers, a single deployer implementation would handle all the processing for the matching top level deployment unit. This behaviour was completely changed in the new Deployers architecture. Here we have a new way of handling deployment unit, we call it an aspectized deployment, meaning that each deployer implementation does just one thing. This way it is easier to control how much it gets done and even easier to swap out the behaviour. But what is that one thing? We are all familiar with parsing, creating ClassLoaders, installing services, etc. So, basically any part of the previous deployment process, can be seen as a separate process, parsing the jboss-service.xml file, creating ServiceMetaData, setting up RepositoryCL and finally registring MBeans into the MBeanServer instance. Let's see this aspectization in the listing below. This is a real example from the current Microcontainer beans deployment. Parsing Deployers Turns XML into metadata model e.g. my-beans.xml -> KernelDeployment ClassLoading Deployers Creates classloaders from metadata e.g. Uses the information from StructureDeployers Component Deployers Splits complicated deployments into units e.g. KernelDeployment -> BeanMetaDatas Real Deployers Does the real work of deployment e.g. BeanMetaData -> controller.install() Attachments Before we start coding the new Deployers there is another concept that we still need to have a look at. What is the way to store the information between different deployers? We keep this information in so-called Attachments. There are two types of attachments, predetermined and transient. e.g. predetermined can be set by the ProfileService, while we would get the transient one's from parsing the XML file. You must be aware that a predetermined attachment overriddes a transient attachment. This is a simple API to get a hold of the Attachments reference from the underlying DeploymentUnit instance. public interface DeploymentUnit extends MutableAttachments { /** * Get all the metadata for the expected type * * @param <T> the type to get * @param type the type * @return a set of metadata matching the type * @throws IllegalArgumentException if the type is null */ <T> Set<? extends T> getAllMetaData(Class<T> type); /** * Get the transient managed objects * * @return the managed objects */ MutableAttachments getTransientManagedObjects(); ... } public interface MutableAttachments extends Attachments { /** * Add attachment * * @param name the name of the attachment * @param attachment the attachment * @return any previous attachment * @throws IllegalArgumentException for a null name or attachment * @throws UnsupportedOperationException when not supported by the implementation */ Object addAttachment(String name, Object attachment); /** * Add attachment * * @param <T> the expected type * @param name the name of the attachment * @param attachment the attachment * @param expectedType the expected type * @return any previous attachment * @throws IllegalArgumentException for a null name, attachment or expectedType * @throws UnsupportedOperationException when not supported by the implementation */ <T> T addAttachment(String name, T attachment, Class<T> expectedType); /** * Add attachment * * @param <T> the expected type * @param attachment the attachment * @param type the type * @return any previous attachment * @throws IllegalArgumentException for a null name, attachment or type * @throws UnsupportedOperationException when not supported by the implementation */ <T> T addAttachment(Class<T> type, T attachment); /** * Remove attachment * * @param name the name of the attachment * @return the attachment or null if not present * @throws IllegalArgumentException for a null name * @throws UnsupportedOperationException when not supported by the implementation */ Object removeAttachment(String name); /** * Remove attachment * * @param <T> the expected type * @param name the name of the attachment * @return the attachment or null if not present * @param expectedType the expected type * @throws IllegalArgumentException for a null name or expectedType * @throws UnsupportedOperationException when not supported by the implementation */ <T> T removeAttachment(String name, Class<T> expectedType); /** * Remove attachment * * @param <T> the expected type * @return the attachment or null if not present * @param type the type * @throws IllegalArgumentException for a null name or type */ <T> T removeAttachment(Class<T> type); /** * Set the attachments * * @param map the new attachments a map of names to attachments * @throws IllegalArgumentException for a null map */ void setAttachments(Map<String, Object> map); /** * Clear the attachments * * @throws UnsupportedOperationException when not supported by the implementation */ void clear(); /** * Get the number of changes that have happened. * * @return number of adds/removes that have happened since creation or * clearChangeCount. */ int getChangeCount(); /** * Reset the change count to zero. */ void clearChangeCount(); } public interface Attachments extends Serializable { /** * Get all the attachments * * @return the unmodifiable attachments */ Map<String, Object> getAttachments(); /** * Get attachment * * @param name the name of the attachment * @return the attachment or null if not present * @throws IllegalArgumentException for a null name */ Object getAttachment(String name); /** * Get attachment * * @param <T> the expected type * @param name the name of the attachment * @param expectedType the expected type * @return the attachment or null if not present * @throws IllegalArgumentException for a null name or expectedType */ <T> T getAttachment(String name, Class<T> expectedType); /** * Get attachment * * @param <T> the expected type * @param type the type * @return the attachment or null if not present * @throws IllegalArgumentException for a null name or type */ <T> T getAttachment(Class<T> type); /** * Is the attachment present * * @param name the name of the attachment * @return true when the attachment is present * @throws IllegalArgumentException for a null name */ boolean isAttachmentPresent(String name); /** * Is the attachment present * * @param name the name of the attachment * @param expectedType the expected type * @return true when the attachment is present * @throws IllegalArgumentException for a null name or expectedType */ boolean isAttachmentPresent(String name, Class<?> expectedType); /** * Is the attachment present * * @param type the type * @return true when the attachment is present * @throws IllegalArgumentException for a null name or type */ boolean isAttachmentPresent(Class<?> type); /** * Are there any attachments * * @return true if there are any attachments, false otherwise. */ boolean hasAttachments(); } Ordering Since we are now familiar with attachments we can talk about the order of our Deployers. What would be the natural order of our Deployers? Probably the first thing it comes to our mind is a plain number ordering. Old and proven way to do the ordering. But since we waited to introduce the attachments before we talked about ordering there must be something better. We can define the order by simply providing the information about Attachment requirements / demands (inputs) and supplies (outputs). Let's explain this in more detail on the actual example. public MyDeployer() { setInputs(SomeMetaData1.class, SomeMetaData2.class); setOutputs(MyOutput.class); } Here we can see that our MyDeployer depends on SomeMetaData1 and SomeMetaData2 instance attachments, and provides a further MyOutput instance attachment for next deployers to use. So any deployer that provides SomeMetaData1 and SomeMetaData2 instance attachments should be before our MyDeployer and any one that uses MyOutput instance attachment should be after. ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/spring.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/sprin0000644000175000017500000001035011202312650033274 0ustar twernertwerner

Spring integration Spring integration allows Spring XML files to be used for IoC without Spring BeanFactory/ApplicationContext. This is possible as JBoss Microcontainer supports the same set of IoC features as Spring. All you need to do is declare the right namespace: urn:jboss:spring-beans:2.0. See the following example for a simple plain Spring XML example. <beans xmlns="urn:jboss:spring-beans:2.0"> <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean"> <constructor-arg index="2"> <value>SpringBean</value> </constructor-arg> <constructor-arg index="0"> <value>1</value> </constructor-arg> <constructor-arg index="1"> <value>3.14159</value> </constructor-arg> <property name="mylist"> <list value-type="java.lang.String"> <value>onel</value> <value>twol</value> <value>threel</value> </list> </property> <property name="myset"> <set value-type="java.lang.String"> <value>ones</value> <value>twos</value> <value>ones</value> </set> </property> <property name="mymap"> <map key-type="java.lang.String"> <entry> <key> <value>test_key</value> </key> <value type="java.lang.String">myvalue</value> </entry> </map> </property> </bean> </beans> But things would be too easy if we just let get away with plain Spring XML. So what you can do is mix and match Microcontainer beans with Spring beans. It doesn't matter which starting element you choose, as long as your beans have the right namespace. Let see this in the next two examples. <deployment xmlns="urn:jboss:bean-deployer:2.0"> <bean name="oldBean" class="org.jboss.test.spring.support.OldBean"> <property name="testBean"> <inject/> </property> </bean> <bean xmlns="urn:jboss:spring-beans:2.0" id="testBean" class="org.jboss.test.spring.support.SimpleBean"> <property name="mylist"> <list value-type="java.lang.String"> <value>onel</value> <value>twol</value> <value>threel</value> </list> </property> </bean> </deployment> In this example we have a Microcontainer beans at the start (deployment element at the start), and we mix them with Spring beans. <beans xmlns="urn:jboss:spring-beans:2.0"> <bean id="testBean" class="org.jboss.test.spring.support.SimpleBean"> <property name="refBean"> <ref bean="oldBean"/> </property> </bean> <bean xmlns="urn:jboss:bean-deployer:2.0" name="oldBean" class="org.jboss.test.spring.support.OldBean"> <property name="javaBeanString">JavaBean</property> </bean> </beans> Here we start with Spring XML and add Microcontainer beans. As you can see, all you need to change from your existing XML, be it Spring or Microcontainer, is the namespace on the staring Spring beans element or bean element.
././@LongLink0000000000000000000000000000015600000000000011567 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/standalone.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/stand0000644000175000017500000001232410632011053033254 0ustar twernertwerner Standalone In , we briefly discussed how to run a Microcontainer application by loading the StandaloneBootstrap class, which in turn wraps the BasicBootstrap and BeanXMLDeployer utility classes. In this chapter, we will look into the source code of StandaloneBootstrap and see exactly how it works. While the StandaloneBootstrap class is sufficient for most use case scenarios, you do not have to use it. You can trivially write your own class that uses the BasicBootstrap and BeanXMLDeployer . package org.jboss.kernel.plugins.bootstrap.standalone; import java.net.URL; import java.util.Enumeration; import java.util.List; import java.util.ListIterator; import org.jboss.kernel.plugins.bootstrap.basic.BasicBootstrap; import org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer; import org.jboss.kernel.spi.deployment.KernelDeployment; import org.jboss.util.collection.CollectionsFactory; public class StandaloneBootstrap extends BasicBootstrap { /** The deployer */ protected BeanXMLDeployer deployer; /** The deployments */ protected List deployments = CollectionsFactory.createCopyOnWriteList(); /** The arguments */ protected String[] args; /** * Bootstrap the kernel from the command line * * @param args the command line arguments * @throws Exception for any error */ public static void main(String[] args) throws Exception { StandaloneBootstrap bootstrap = new StandaloneBootstrap(args); bootstrap.run(); } /** * Create a new bootstrap */ public StandaloneBootstrap(String[] args) throws Exception { super(); this.args = args; } public void bootstrap() throws Throwable { super.bootstrap(); deployer = new BeanXMLDeployer(getKernel()); Runtime.getRuntime().addShutdownHook(new Shutdown()); ClassLoader cl = Thread.currentThread().getContextClassLoader(); for (Enumeration e = cl.getResources(StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } for (Enumeration e = cl.getResources("META-INF/" + StandaloneKernelConstants.DEPLOYMENT_XML_NAME); e.hasMoreElements(); ) { URL url = (URL) e.nextElement(); deploy(url); } // Validate that everything is ok deployer.validate(); } /** * Deploy a url */ protected void deploy(URL url) throws Throwable { log.debug("Deploying " + url); KernelDeployment deployment = deployer.deploy(url); deployments.add(deployment); log.debug("Deployed " + url); } /** * Undeploy a deployment */ protected void undeploy(KernelDeployment deployment) { log.debug("Undeploying " + deployment.getName()); deployments.remove(deployment); try { deployer.undeploy(deployment); log.debug("Undeployed " + deployment.getName()); } catch (Throwable t) { log.warn("Error during undeployment: " + deployment.getName(), t); } } protected class Shutdown extends Thread { public void run() { log.info("Shutting down"); ListIterator iterator = deployments.listIterator(deployments.size()); while (iterator.hasPrevious()) { KernelDeployment deployment = (KernelDeployment) iterator.previous(); undeploy(deployment); } } } } One way to use this class in your own applications would be: import org.jboss.kernel.plugins.bootstrap.standalone.StandaloneBootstrap public MyMainClass { public static void main(String[] args) throws Exception { StandaloneBootstrap.main(args); // Your stuff here... } } So what does the standalone bootstrap do? First it does the plain bootstrap to get the "kernel" ready. You can think of this a sophisticated form of ServerLocator implementation. It then creates a BeanXMLDeployer for deploying XML files. Next it adds a shutdown hook, such that deployments are correctly "undeployed" in reverse order to their deployment. Finally, it scans the classpath for META-INF/jboss-beans.xml and deploys every instance of that file it finds to populate the "kernel". You can of course choose not to use this helper class and instead implement your own processing rules. ././@LongLink0000000000000000000000000000016000000000000011562 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/installation.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/insta0000644000175000017500000000274610632011053033270 0ustar twernertwerner Download and Installation First you need to download JBoss Microcontainer release from http://labs.jboss.com/jbossmc/downloads Unpack the archive which will give you a microcontainer-x.y.z directory with the following subfolders: docs/api - javadocs for the Microcontainer docs/gettingstarted - this getting started documentation docs/licences - the licenses for the software examples - the examples explained in the next chapter lib - the libraries required to run the Microcontainer You will also need a JDK of version 1.4.x+ and a copy of Apache Ant 1.6+ If you want to run the examples inside JBoss AS, you will need to download JBoss AS 5.x http://labs.jboss.com/jbossas/downloads ././@LongLink0000000000000000000000000000015200000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/basics.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/basic0000644000175000017500000014744011202312650033235 0ustar twernertwerner Basic Configuration and Usage The Microcontainer's main purpose is to allow external configuration of POJOs. As we have seen in , the POJOs in a Microcontainer applications are nothing special. The key element that drives the application is the jboss-beans.xml configuration file. So, in this chapter, we will look at the some of the common configurations in jboss-beans.xml . Deployment The deployment element acts as a container for many beans that are deployed together. ]]> Bean The bean element is the main deployment component. It describes a single managed object in the runtime. ]]> The example above from the simple example uses the default constructor of SimpleBean to create a new POJO. new org.jboss.example.microcontainer.simple.SimpleBean(); It is given the name "Simple" such that it can be referenced elsewhere. Construction The example above uses the default constructor. What if you want to use some other constructor? The simplest mechanism just matches the number of parameters in the constructor. The example below is from the constructor example. The jboss-beans.xml element for creating the POJO using the above constructor is as follows. 4 ]]> The microcontainer would just use the following to create the Integer named component. new ConstructorBean (4); Sometimes there are two constructors with the same number of parameters. In this case, you must specify the types to resolve the ambiguity. public class ConstructorBean { public ConstructorBean(String string, int integer) {} public ConstructorBean(String string, long long) {} } The following configuration creates a managed bean instance named StringLong using the second constructor listed above. a string 10 ]]> Behind the scene, the Micorcontainer invokes: new ConstructorBean ("a string", (long) 10); Note that you only have to be explicit enough to resolve the ambiguity. Factories Not all classes have pubic constructors. It is often good practice to use factories when you to have a choice of implementation for an interface. The microcontainer includes support for the several different types of factory. The simplest case is a static factory class with a static factory method like the following from the factory example. The bean configuration tells the microcontainer to the use the StaticFactory.createBean() static method to create an instance of FactoryCreatedBean . ]]> Of course, the factory class itself does not have to be static. The microcontainer can create a non-static factory itself as a managed object, and then use this factory object to create other bean objects. For instance, the factory example contains a singleton factory class example. In the following configuration, we first create an instance of the SingletonFactory class under the name "SingletonFactory" using the SingletonFactory.getInstance() static method. Then, we use this factory object to create a FactoryCreatedBean instance under the name SingletonFactoryCreatedBean . ]]> Like the constructor method we mentioned before, the factory method can also take call parameters via the nested parameter element. Properties It is possible to create all objects using factories and constructors, however many people use the JavaBean or MBean convention where an object is constructed using a default constructor and then configured using properties or attributes (i.e., setter methods). The following class from the properties example is a JavaBean style POJO. The configuration creates the PropertiesBean instance and then uses the setter methods to set its properties. JBoss Microcontainer property example http://www.jboss.org 4 ]]> Here we use the string representation of various objects, including the null value. They will be discussed in more detail in the next section. String Values Now, you probably noticed that we use string values to represent all kinds of objects in the parameter element for the constructors or factory methods, and in the property element for JavaBean properties. In the most generic case, a JavaBean PropertyEditor can be used to convert a string to a specific type. JBoss already provides a large number of property editors for standard types. Please see the example below for the POJO class, the configuration, and the resultant Microcontainer action. http://acme.com/index.html Example example = new com.acme.Example(); PropertyEditor editor = PropertyEditorManager.findEditor(URL.class); editor.setAsText("http://acme.com/index.html"); example.setLink((URL)editor.getValue()); ]]> Often the property takes an interface or abstract class, but you want to pass a specific implementation or a subclass. That is easy. Just specify the implementation class in the property.class attribute as show below. 4 Example example = new com.acme.Example(); example.setNumber(new Long(4)); ]]> There is also a more long-winded form of value that we will see later when configuring collections. 4 Example example = new com.acme.Example(); example.setNumber(new Long(4)); ]]> Finally, the null value is trivial, ]]>. But, it needs to differentiated from the string "null". Please see the example below for the usage. null Example example = new com.acme.Example(); example.setTitle(new String("null")); Example example = new com.acme.Example(); example.setTitle(null); ]]> Sometimes it is still useful to be able to set or inject a value which can be morphed / progressed into the needed type although the existing type is not compatible (normally getting ClassCastException). This is mostly true for java.lang.Number subclasses. Let's see how progression is used in the following example (here we use ]]>, which is actually explained in the next chapter). 123.456 987.6543 314159 ]]> SimpleBean is a plain JavaBean, property names reflect the field type: having adouble property name means that a field is of type double. AFloat corresponds to Float type. Etc. You can change the progression behavior by setting the System property org.jboss.reflect.plugins.progressionConvertor, putting the ProgressionConvertor's implementation fully qualified class name as value. By default the SimpleProgressionConvertor implementation is used. Another existing implementation is NullProgressionConvertor, which doesn't do any actual progression. Injections Objects by themself are not very useful. They need to be linked together to form more complicated data structures. We have already seen one form of injection when using factory instances above. Injections can be used anywhere a string value is used. All the examples that we have previously seen with strings could also be done with injections. The injection example shows how dependency injection works in JBoss Microcontainer. The InjectionBean class has a host property, which is the java.net.URL type. We will inject an URL object into the bean via the microcontainer. The microcontainer creates the URL object first, and then passes the URL object as a property into the InjectionBean1 object when it is instantiated. http://www.jboss.org/index.html InjectionBean1 ]]> The order of the bean elements does not matter. The microcontainer orders the beans into the correct order. For instance, in the above example, the URL object is always created before the InjectionBean1 object since the latter is dependent on the former. But that leaves the problem of how to resolve circular dependencies. These can be resolved by specifying when you want the injection to occur. In the example below we say once Circular1 is "Instantiated" (constructed) it is ok to configure it on Circular2 . Normally, injections wait for the referenced bean to reach the state "Installed" (see later on life cycles). Circular1 Circular2 ]]> Here is the order the microcontainer instantiates those objects. Value Factory Similar to using inject's property attribute, we sometimes want to use other beans to create new values from bean's multi parameter methods. xyz.key xyz foo.bar.key QWERT xyz.key QWERT ]]> For the quick usage there is also shorthand version of the value-factory element, having single parameter as string attribute. ]]> You can also define a default value for the value-factory return value. no.such.key ]]> Collections The collection , list , set and array elements are used to enclose collection of values to pass to the bean components as properties or constructor (factory method) parameters. The default types are: collection: java.util.ArrayList list: java.util.ArrayList set: java.util.HashSet array: java.lang.Object[] They all take the same form. So, only list is shown here in those examples. You just need to nest value elements inside the collection element to specify the contents of the collection. Please note that an "elementClass" attribute is required on the collection element, unless you specify explicit types on all the values. Below is a sample configuration from the collections example. It sets a List with two elements of mixed types to the ObjectPrinter.print property on the PrintList named object. List Value of type elementClass 4 ]]> It is also possible to use a List as an element inside another List . Here is an example. A string http://acme.com/index.html Another string ]]> Below is what happens inside the microcontainer. The other type of collection is a map which also covers Properties and Hashtables. The default is java.util.HashMap . The entry element inside the map differentiates each key and value pair. For maps there are two default types for the elements: the keyClass and valueClass . Below is a map sample from the collections example. Map Key1 of type keyClass Value1 of type valueClass Key2 of type keyClass 4 4 Value of type valueClass ]]> When using collections in your bean configuration, this is the order the Microcontainer will use for new instantiation or using an already existing collection instance. if the collection's class attribute is defined, a new instance of that class will be instantiated if an already instantiated collection exists and is available via getter, this instance will be used - unless you define the preinstantiate attribute on the property to false if the collection references some non interface class, we'll try to instantiate a new instance of that class default collection instance will be used - Collection and List will use ArrayList, Set uses HashSet and Map will use HashMap string1 string2 ]]> Lifecycle Anybody familiar with the JBoss JMX microkernel will know about the lifecycle. The microcontainer extends the lifecycle concept to the managed POJOs. A POJO can have the following lifecycle states. Not Installed: The POJO has not been described or has been uninstalled. Pre Install: The scoping description has been examined and classloader dependencies determined. Described: The POJO's bean description has been examined and dependencies determined. Instantiated: All the dependencies have been resolved to construct the bean. These include: the class exists, the constructor parameter injections can be resolved, any factory can be resolved. Configured: All the property injections can be resolved, this includes all the dependencies in any collections. Create: All the dependent beans have been "created", this includes any injections passed to the create method. Start: All the dependent beans have been "started", this includes any injections passed to the start method. Installed: The lifecycle is complete. *** ERROR ***: Some unexpected error occured, usually due to misconfiguration. At each stage of the lifecycle, the corresponding method in the bean class is automatically called by the Microcontainer, so that you can programatically control how the objects behave throughout its lifecycle. For instance, the start() method in the bean class is called when the bean enters the Start state. Below is the LifecycleBean class from the lifecycle example. The depends element allows two beans to perform two phase startup processing like the JMX microkernel. Lifecycle1 Lifecycle2 Lifecycle2 ]]> The microcontainer resolves the dependency and starts both beans in the appropriate order. Below is the console output when you run the lifecycle example. It shows when various lifecycle methods are called when the bean enters those states. run: [java] LifecycleBean() Lifecycle1 [java] LifecycleBean() Lifecycle2 [java] create: Lifecycle2 [java] create: Lifecycle1 [java] start: Lifecycle2 [java] start: Lifecycle1 [java] stop: Lifecycle1 [java] stop: Lifecycle2 [java] destroy: Lifecycle1 [java] destroy: Lifecycle2 The create() , start() , stop() and destroy() methods can be overridden with parameters passed to them. Below is an example on how to override the create() method via the jboss-beans.xml configuration file. ]]> They can also be ignored. See the jboss-beans.xml with the ignore attribute set to true on the start element. ]]> In this case the Microcontainer would not invoke the start method when passing over Start state. Installation As of 2.0.0, you can provide generic install/uninstall actions. Allowing you to dynamically setup repositories. Note the use of this to pass yourself as a parameter. If you exlude the bean name on the action, the operation is performed on yourself. 100 10000 // Install name1 = new Timer(); name2 = ...; name1.schedule(name2, 100, 10000); // Uninstall name2.cancel(); ]]> ClassLoader The Microcontainer supports configuration of the classloader at either the deployment or bean level. The classloader element has three alternatives. ]]> Annotations via XML With the new Microcontainer 2.0 we've added support for annotations via XML. Meaning you can have annotation support where the annotation is not part of the bean class's bytecode. Each annotation is set per bean instance and you can set annotations on the following types: deployment (all beans inherit this annotations) bean constructor lifecycle install / uninstall callback annotated value Let's see some use cases on the examples below. @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.AnnotationWithAttributes(clazz=java.lang.Integer.class, integer=100, str="Annotations are nice") @org.jboss.test.kernel.deployment.xml.support.Annotation2 @org.jboss.test.kernel.deployment.xml.support.Annotation3 @org.jboss.test.kernel.deployment.xml.support.Annotation3 @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation1 @org.jboss.test.kernel.deployment.xml.support.Annotation1 123 ]]> The only issue with having annotations defined via XML is that they are per instance basis - as already mentioned, not added at compile time. In this case you need an external mechanism in order to do the annotation inspection. In the Microcontainer this is its metadata repository. See how this is done in Reference Manual, TODO. Alias Mostly each bean will have one unique name, but sometimes it is useful to be able to have an extra name. The extra ones are considered aliases. SimpleAlias ]]> As with all String values you can have System property replacement as part of actual alias value. Additionally you can specify if this replacement is ignored. Or you can even convert a final alias String value into any other class supported by PropertyEditors by setting the class attribute on an alias element. Lets see this configuration on the examples below. ${example.cluster.name} X${alias.test.name}X 12345 ]]> Having to specify all aliases when the bean is actually defined is not always adequate however. It is sometimes desirable to introduce an alias for a bean which is defined elsewhere. In XML-based configuration metadata this may be accomplished via the use of the standalone ]]> element. Lock1 Lock2 ]]> A newly added alias defined as a element on the deployment acts as a full dependency item. Meaning it won't get registered (installed) until the original bean is installed. What this means is that you can have original beans defined in one deployment and aliases in another, and the order of deployment doesn't matter. When the original bean is uninstalled, the alias gets unregistered (uninstalled) as well. When the alias gets unregistered, all beans that depend on the alias get undeployed as well, regardless of if the original bean is still present. Supply and Demand There is another useful definition of loosely coupled dependency. Each bean can define which beans should be installed for it to move to certain state. http://www.jboss.org 10 TM SM // Example class public class Example { public void start() { SomeSingleton tm = ...; // should be there! } public void setThreadPool(ThreadPool pool) { AnotherSingleton config = ...; // should be there pool.setThreadSize(config.getThreadSize()); } } ]]> On the other hand each bean can also provide additional information what it supplies, apart from it self. The actual supply doesn't need to be bound to the Microcontainer in any way. More about this feature with the actual example. foobar foobar ]]> Contextual Awareness With existing annoyance of using huge amounts of xml to sometimes wire up trivial beans, IoC containers provide a simpler solution called autowiring. Beans, specially singletons, can often be wired with a simple class type knowledge. But with huge systems you should use this feature with care, since it can easly get broken with addition of another bean that would satisfy contextual dependency. The existing 2.0.0 version supports three ways of autowiring: full bean autowiring property / parameter injection callback injection On the other hand, if you don't want a particular bean to be involved as a candidate for autowiring, you can set the bean element's attribute autowire-candidate to false. ]]> TODO for bean autowiring. ]]> When doing a propery / parameter injection of some existing bean, you can omit the bean attibute, meaning that the Microcontainer will do the injection based on the information from the property / parameter class type. If no such information is available, an exception will be thrown. If no such bean is eventually available, you can define the behavior after validation. For Strict option the deployment will fail, for Callback see the callback injection below. There is also a way of doing contextual injection based on property name. Property name will be matched against newly wired bean's name. public class Example { protected ThreadPool pool; public Example() {} public Example(ThreadPool pool) { this.pool = pool; } public void setThreadPool(ThreadPool pool) { this.pool = pool; } } ]]> Sometimes it is useful to be notified of certain beans being installed / uninstalled by inspecting their class type. In the Microcontainer we call this callbacks. You can define which methods should be used for callback resolution on a particular bean. Usually the method name is sufficient. In the case of having multiple methods with the same name, you can narrow down the exact method by specifying the class type to use for contextual lookup. public class Example { protected Set editors = new HashSet(); public Example() {} public void addEditor(Editor editor) { editors.add(editor); } public void removeEditor(Editor editor) { editors.remove(editor); } } ]]> We can do the same callback injection on a property. And there is also an interesting feature available, though it will probably rarely be used. You can define a Cardinality as a condition when that actual dependency is satisfied and injection can take place. The following examples shows how we need at least 2 Editor instances to satisfy callback dependency. public class Example { protected Set editors; public Example() {} public void setEditors(Set editors) { this.editors = editors; } } ]]> While using callbacks on the Collection subclasses, currently only basic Collection subinterfaces are supported: List, Set and Queue. See BasicCollectionCallbackItemFactory for more details. But you can change the Collection callback behaviour by providing your own CollectionCallbackItemFactory. You do this by setting the System Property org.jboss.dependency.collectionCallbackItemFactory and putting the CollectionCallbackItemFactory implementation fully qualified class name as a value. Injection from Context Even though the Microcontainer is aimed at POJOs, it doesn't mean you are not able to easily get into the underlying architecture of its state machine. Each bean is represented in the Microcontainer's state machine (Controller) as a ControllerContext. The ControllerContext holds various information in order to consistently move between lifecycle states, resolve dependencies, apply instance aspects, annotations, metadata ... With the already known injection concept (]]>), you can also inject some information from the context. This is what you can currently get a hold on from the underlying context: name - ]]> aliases - ]]> metadata - ]]> beaninfo - ]]> scope - ]]> id - ]]> context itself - ]]> All this information is wrapped into unmodifiable objects, preventing the user to add or set additional information outside the Microcontainer's Controller. As we already know, the ]]> element can take a bean attribute. In this case, if the bean attribute is set, we are not obtaining the target bean's underlying context, but the context that coresponds to the bean being injected. ]]> In this example we inject otherBean's beaninfo information into sndBean bean. ././@LongLink0000000000000000000000000000015400000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/examples.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/examp0000644000175000017500000001154211202312650033257 0ustar twernertwerner Starting Examples
A Simple IoC Example The best way to learn the Microcontainer is through examples. The Microcontainer distribution is bundled with several examples, which we will discuss in later this guide. In this section, let us first have a look at the simple example. It shows the structure of a simple Microcontainer application and how to run the application in both standalone and JBoss AS environments. The simple example is located in the examples/simple directory of the Microcontainer distribution. It contains a single class under the src/main directory. The SimpleBean object prints to the system console when it is instantiated via the default constructor. Now, we need to use the Microcontainer to instantiate a SimpleBean POJO. We do this by invoking the Microcontainer with the src/resources/META-INF/jboss-beans.xml configuration file. ]]> This configuration file tells the Microcontainer to create an instance of the SimpleBean POJO and manage it under the name Simple . When other objects in the application need to access this SimpleBean instance, they can simply ask the Microcontainer API for the Simple object. Essentially, we just created a SimpleBean singleton instance here. When we run this application, we are expected to see the "SimpleBean() constructor" printout on the console when the Microcontainer creates the Simple object.
Build and Package the Application To build, package, and run the simple application, we can simply execute the ant command in the examples/simple directory. It runs the build.xml script, which further invokes the examples/build-common.xml script. The compile and dist tasks in the build script builds the application. ]]> The compile target compiles the Java source files into class files under the build directory. Then, the dist target packages the class files and the META-INF/jboss-beans.xml file together in a JAR file named example-simple.jar in the dist directory. In the next two sections, let's discuss how to run the newly created application both as a standalone Java SE application and as a service in the JBoss AS. This just skims the surface of the Microcontainer, showing the most common usecases. Other more complicated examples can be found in the tests (available in the source code repository).
././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/osgi.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/osgi.0000644000175000017500000000435211202312650033165 0ustar twernertwerner OSGi module We can see an increased demand for OSGi technology these days. Developers and users especially like the OSGi kind of Classloader wiring. Being able to have a Class dependency defined as a versioned package dependency is something we've been lacking for while now. There are new JSRs in the making, that will eventually solve this problem, but OSGi is here and now. Looking at the OSGi framework we saw a lot similarity with what we already have with the Microcontainer. Another aspect of OSGi that is a cruical part of the core Framework is the Service Registry. A simple lookup pattern that takes Classloading wiring into consideration when doing Service lookup. While we already have contextual awareness in tje Microcontainer, implementing this was a matter of a simple OSGi Facade over the existing Microcontainer registry. Together with new there is a fully OSGi r4.1 compatible solution available with the 2.0.0 Microcontainer. OSGi usage in Microcontainer falls down to three different aspects: new OSGi Classloader declarative or programmatic OSGi services deployment OBR (OSGi Bundle Repository) usage The new OSGi Classloader is used as a default Classloader, it is backward compatible with the existing UCL. For the existing OSGi declarative services or programmatic usage via BundleActivator, there is a full support of the OSGi core API. But for new service declaration, we encourage people to use the much richer Microcontainer IoC features. The Classloading behavior and Service Registry will take new Microcontainer services into consideration. OBR usage ... ././@LongLink0000000000000000000000000000015500000000000011566 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/javabeans.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/javab0000644000175000017500000001132211202312650033224 0ustar twernertwerner
Java Beans In the Container module there is a simple support for JavaBeans configuration. When we have some existing JavaBeans XML, we can easily port that bean configuration into Microcontainer beans configuration. Or if all we really need is simple configuration, no dependency, JavaBeans configuration is enough. Let see this in the examples below. <javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.javabean.support.SimpleBean"> <property name="AString">StringValue</property> <property name="AByte">12</property> <property name="ABoolean">true</property> <property name="AShort">123</property> <property name="anInt">1234</property> <property name="ALong">12345</property> <property name="AFloat">3.14</property> <property name="ADouble">3.14e12</property> <property name="ADate">Jan 01 00:00:00 CET 2001</property> <property name="ABigDecimal">12e4</property> <property name="ABigInteger">123456</property> <property name="abyte">12</property> <property name="aboolean">true</property> <property name="ashort">123</property> <property name="anint">1234</property> <property name="along">12345</property> <property name="afloat">3.14</property> <property name="adouble">3.14e12</property> <property name="ANumber" class="java.lang.Long">12345</property> <property name="overloadedProperty">StringValue</property> <property name="XYZ">XYZ</property> <property name="abc">abc</property> </javabean> Simple configuration via JavaBean setters. <javabean xmlns="urn:jboss:javabean:2.0" class="org.jboss.test.javabean.support.SimpleBean"> <constructor factoryClass="org.jboss.test.javabean.support.SimpleBeanFactory" factoryMethod="newInstance"> <property name="anObject" class="java.lang.Object">anObjectValue</property> <property name="AString">StringValue</property> <property name="AByte">12</property> <property name="ABoolean">true</property> <property name="ACharacter">x</property> <property name="AShort">123</property> <property name="anInt">1234</property> <property name="ALong">12345</property> <property name="AFloat">3.14</property> <property name="ADouble">3.14e12</property> <property name="ADate">Jan 01 00:00:00 CET 2001</property> <property name="ABigDecimal">12e4</property> <property name="ABigInteger">123456</property> <property name="abyte">12</property> <property name="aboolean">true</property> <property name="achar">y</property> <property name="ashort">123</property> <property name="anint">1234</property> <property name="along">12345</property> <property name="afloat">3.14</property> <property name="adouble">3.14e12</property> <property name="ANumber" class="java.lang.Long">12345</property> <property name="overloadedProperty">StringValue</property> <property name="XYZ">XYZ</property> <property name="abc">abc</property> </constructor> </javabean> Constructor configuration via factory class static method call. <bean xmlns="urn:jboss:bean-deployer:2.0" class="org.jboss.acme.Example"> <property name="PropertyName"> <javabean xmlns="urn:jboss:javabean:1.0" class="org.jboss.test.kernel.deployment.xml.support.SerializableObject"/> </property> </bean> You can use JavaBean with Microcontainer beans in all cases where you could use plain value.
././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/core.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/core.0000644000175000017500000000161110657020413033155 0ustar twernertwerner Microcontainer core Core ... ././@LongLink0000000000000000000000000000015700000000000011570 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/annotations.xmllibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/modules/annot0000644000175000017500000006454011202312650033272 0ustar twernertwerner
Annotations support We learned how to configure our POJOs with Microcontainer's XML elements. In today's development most of the configuration is done with annotations. The Microcontainer is no exception. Almost all of the features available in XML are also present in the Microcontainer's annotations support, except for the classloading configuration, which for obvious reasons doesn't have its equivalent (the class needs to be loaded before we can check for annotations, right). Let's now look at the annotations supported and some of its caveats. Like in most other configurations XML and predetermined bean metadata override annotations. This is the current list of supported annotations and their XML equivalents. Later we will show how you can extend support for your own annotations directly into Microcontainer's configuration. @Aliases - <alias> /** * The aliases. * Equivalent to deployment's alias element. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Aliases { /** * Get aliases array. * * @return the aliases */ String[] value(); /** * Do system property replace. * * @return true to replace system property, false otherwise */ boolean replace() default true; } Example: @Aliases({"MyAlias", "YetAnotherSimpleBean"}) public class AliasSimpleBeanImpl extends SimpleBeanImpl @ArrayValue - <array> @CollectionValue - <collection> @ListValue - <list> @SetValue - <set> /** * Injecting array value. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ArrayValue { /** * Set the array class. * * @return array class name */ String clazz() default ""; /** * Array's element class. * * @return element class name */ String elementClass() default ""; /** * Get the values. * * @return the values */ Value[] value(); } Example: @ArrayValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = "java.lang.String", clazz = "[Ljava.lang.Comparable;" ) public void setArray(Object[] array) { super.setArray(array); } @CollectionValue( value = { @Value(string = @StringValue("string1")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string2")), @Value(string = @StringValue("string1")) }, elementClass = "java.lang.String", clazz = "java.util.ArrayList" ) public void setCollection(Collection collection) { super.setCollection(collection); } @Constructor - <constructor> /** * Mark the constructor used to instantiate bean. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.CONSTRUCTOR}) public @interface Constructor { } Example: @Constructor public TestConstructorBean(@Inject(bean = "testBean") TestBean test) { ... } @Create - <create> @Start - <start> @Stop - <stop> @Destroy - <destroy> /** * Mark lifecycle create method. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Create { /** * Is this lifecycle callback ignored. * * @return ignored */ boolean ignored() default false; } Example: @Create public void notCreate( @Inject(bean = "Name1") SimpleBeanWithLifecycle bean) { super.notCreate(bean); } @Start public void notStart(@Inject(bean = "Name2")SimpleBeanWithLifecycle bean) { super.notStart(bean); } @Stop public void notStop(@Inject(bean = "Name3")SimpleBeanWithLifecycle bean) { super.notStop(bean); } @Destroy public void notDestroy( @Inject(bean = "Name4")SimpleBeanWithLifecycle bean) { super.notDestroy(bean); } @Demands - <demands> /** * The demands. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Demands { /** * Get demands. * * @return the demands */ Demand[] value(); } Example: @Demands({@Demand("WhatIWant")}) public class DemandSimpleBeanImpl extends SimpleBeanImpl @Depends - <depends> /** * The depends values. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Depends { /** * Get the depends values. * * @return the depends */ String[] value(); } Example: @Depends({"Name1"}) public class DependSimpleBeanWithLifecycle extends SimpleBeanWithLifecycle @ExternalInstalls - <install bean="..." method="..."/> @ExternalUninstalls - <uninstall bean="..." method="..."/> /** * Array of external installs. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface ExternalUninstalls { /** * Get external installs. * * @return the external installs */ ExternalInstall[] value(); } Example: @ExternalInstalls({ @ExternalInstall(bean = "Name1", method = "addSimpleBean", parameters = {@Value(thisValue = @ThisValue)})}) @ExternalUninstalls({ @ExternalInstall(bean = "Name1", method = "removeSimpleBean", parameters = {@Value(thisValue = @ThisValue)})}) public class ExternalInstallSimpleBeanImpl implements Serializable, SimpleBean @Factory - <constructor><factory ...> /** * Define constructor factory. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Factory { /** * Get the factory. * * @return the factory value */ Value factory() default @Value(); /** * Get the factory class. * * @return the factory class */ String factoryClass() default ""; /** * Get the factory method. * * @return the factory method */ String factoryMethod(); /** * Get parameters. * * @return the parameters */ Value[] parameters() default {}; } Example: @Factory( factory = @Value(javabean = @JavaBeanValue( "org.jboss.test.kernel.config.support.SimpleBeanFactory")), factoryMethod = "createSimpleBean", parameters = {@Value(string = @StringValue("Factory Value"))} ) public class FromFactoryWithParamSimpleBean extends SimpleBean @FactoryMethod - <constructor><factory factoryMethod="..." ...> /** * Mark static method as factory method. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface FactoryMethod { } Example: @FactoryMethod public static SimpleInject getInstance(@NullValue Object someNull) { return new SimpleInject(); } @Inject - <inject> /** * Beans when injected by class type are by default changed to configured * state - if not yet configured. * You can change this behavior by setting state. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface Inject { /** * Get bean. * Default is no bean. * * @return bean name */ String bean() default ""; /** * Get property. * Default is no property. * * @return property name */ String property() default ""; /** * Get when required. * * @return when required. */ String whenRequired() default ""; /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default "Installed"; /** * Get injection type. * Default is by class. * * @return injection type */ InjectType type() default InjectType.BY_CLASS; /** * Get injection option. * Default is Strict. * * @return injection option */ InjectOption option() default InjectOption.STRICT; /** * Get from context injection. * * @return from context type */ FromContext fromContext() default FromContext.NONE; /** * Is this @Inject valid. * Used with @Value. * * @return is this instance valid */ boolean valid() default true; } Example: @Inject(bean = "Name1") public void setSimpleBean(SimpleBean bean) { super.setSimpleBean(bean); } @Start public void startMeUp( @Inject(bean = "lifecycleBean") TestBean bean, @ValueFactory(bean="valueBean", method = "getValue", parameter = "123") int value) { test = bean; intVF =- value; } @Install - <incallback> @Uninstall - <uncallback> /** * Install callback. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface Install { /** * Get the cardinality. * Default is no cardinality. * * @return cardinality */ String cardinality() default ""; /** * Get when required. * Default is Configured. * * @return when required. */ String whenRequired() default "Configured"; /** * Get dependent state. * Default is Installed. * * @return dependent state. */ String dependentState() default "Installed"; } Example: @Install public void addDeployer(MyDeployer deployer) { if (deployers == null) deployers = new HashSet<MyDeployer>(); deployers.add(deployer); } @Uninstall public void removeDeployer(MyDeployer deployer) { deployers.remove(deployer); } @InstallMethod - <install> Sethod - <uninstall> /** * Internal installation method. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface InstallMethod { /** * Get dependant state. * * @return the dependant state */ String dependantState() default ""; } Example: @InstallMethod public void install() { installed = true; } @UninstallMethod public void uninstall() { installed = false; } @JavaBeanValue - <javabean> /** * Java bean value. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface JavaBeanValue { /** * Get java bean class name. * Must have default constructor. * * @return the class name */ String value() default ""; } Example: @Factory( factory = @Value(javabean = @JavaBeanValue( "org.jboss.test.kernel.config.support.SimpleBeanFactory")), factoryMethod = "createSimpleBean" ) @MapValue - <map> /** * Map value injection. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface MapValue { /** * Get the map class name. * * @return the map class name */ String clazz() default ""; /** * Get the key class name. * * @return the key class name */ String keyClass() default ""; /** * Get the value class name. * * @return the value class name */ String valueClass() default ""; /** * Get the entries. * * @return the entries */ EntryValue[] value(); } Example: @Constructor public AnnotatedLDAPFactory( @MapValue( keyClass = "java.lang.String", valueClass = "java.lang.String", value = { @EntryValue( key = @Value(string = @StringValue("foo.bar.key")), value = @Value(string = @StringValue("QWERT")) ), @EntryValue( key = @Value(string = @StringValue("xyz.key")), value = @Value(string = @StringValue(" QWERT ")) ) } ) Map<String, String> map ) { super(map); } @NullValue - <null> /** * Null value. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface NullValue { /** * Is valid. * Used in @Parameter and @value to define * unused value. * * @return is value valid */ boolean valid() default true; } Example: @UninstallMethod public void withUninstall( @ThisValue SimpleInject me, @NullValue Object plainNull) { System.out.println(me == this); System.out.println("plainNull = " + plainNull); } @StringValue - <value>somestring</value> /** * String value. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface StringValue { /** * Get the value. * * @return the value */ String value(); /** * Get type. * * @return the type */ String type() default ""; /** * Do replace with system properties. * * @return true for replace with system properties, false otherwise */ boolean replace() default true; } Example: @Constructor public ParamIntConstructorAnnBean(@StringValue("7") Integer string) { super(string); } @Supplys - <supply> /** * The supplys. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE}) public @interface Supplys { /** * Get supply values. * * @return the supplys */ String[] value(); } Example: @Supplys({"WhatIWant"}) public class SupplyPlainDependecySimpleBeanImpl extends PlainDependecySimpleBeanImpl @ThisValue - <this/> /** * This value. * Get the underlying target. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ThisValue { /** * Is instance valid. * * @see @org.jboss.beans.metadata.api.annotations.Value * @see @org.jboss.beans.metadata.api.annotations.Parameter * @return true for valid */ boolean valid() default true; } Example: @InstallMethod public void whenInstalled( @ThisValue SimpleInject me, @NullValue Object plainNull) { System.out.println(me == this); System.out.println("plainNull = " + plainNull); } @ValueFactory - <value-factory> /** * The value factory. * * @author <a href="mailto:ales.justin@jboss.com">Ales Justin</a> */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.PARAMETER}) public @interface ValueFactory { /** * Get the bean. * * @return the bean */ String bean(); /** * Get the method. * * @return the method */ String method(); /** * Get single parameter. * * @return the single parameter */ String parameter() default ""; /** * Get parameters. * * @return the parameters */ Parameter[] parameters() default {}; /** * Get default value. * * @return the default value */ String defaultValue() default ""; /** * Get dependant state. * * @return the dependant state */ String dependantState() default "Installed"; /** * Get when required state. * * @return the when required state */ String whenRequiredState() default "Configured"; } Example: @ValueFactory(bean = "ldap", method = "getValue", parameter = "foo.bar.key") public void setValue(String value) { super.setValue(value); } TODO - extending annotations support.
libjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/docbook/master.xml0000644000175000017500000000727110676217217032614 0ustar twernertwerner Getting Started with the JBoss Microcontainer A Guide for POJO Developers 2.0.0 Target Audience This guide is aimed at developers who want to use the Microcontainer to assemble their own applications or use it to develop shared services in the JBoss Application Server. Preface Commercial development support, production support and training for the JBoss Microcontainer is available through JBoss Inc. The JBoss Microcontainer is a project of the JEMS product suite. Authors: Adrian Brock - JBoss Microcontainer Project Lead and Chief Scientist of JBoss Inc. Scott Stark - VP Architecture & Technology Kabir Khan - JBoss AOP Project Lead Ales Justin - JBoss Core Developer libjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/0000755000175000017500000000000011620312212031137 5ustar twernertwernerlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/0000755000175000017500000000000011620312212032405 5ustar twernertwerner././@LongLink0000000000000000000000000000015000000000000011561 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/images/libjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/imag0000755000175000017500000000000011620312213033244 5ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/images/modules.pnglibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/imag0000644000175000017500000010575110634000616033264 0ustar twernertwernerPNG  IHDRhJ0 pHYs.>IDATxE/f٤?uR({a̕ . C%BX@$Sn,DqZkkHfdl7L4U O3ӧ?<EsO9gK.9슴W [h4G Q(As9J%h4G Q(As9J%h4G Q(As9J%h4G Q(As9J%h4G+ƍwB.vIuCs:jhn4sQ(As6ŋ6)XDdTGrͱ~M6zF;P'EDjwΝ;']?)lh O9{2;uꔓ'O644D[չsdddĉXz{{YjJ53ꉎ/\PͲ*Wnc[B^QgZn) >}z!JKxάyppE-"Wɬ:nX[࠭6l,a d[8iH9~4G-$J"}Ϫ=ܭlr_bڵ===r?T#e Yc4ǣ?xkVM[ɓ'9hֿhmw^5PWWwmuuu&sΕyQV6^FΒk<(m,x:;1\9ulwbKl,%uuפ+ *:x6,hI7G}} ?e&nX^gI9.\mFW^ӴxV^O 25Ǵi7'd@ߪj y1깞YUfq>ioo)?qkTBr7ݎNiVv\^R*qa5NvTrWƲhbDODk ;!Yf9s_eNieGڮdFv4戰+#޹wUWExWG*Ȭ7G!;z֭[e̪U>ônݷ;::bziQkuĺo=BmO^W}E^{zӷrj9ktӧ|=U{ci~{.\T>Y8qvohRD0x0'>h$^.A*l`G[(As9͉-*mi"fn^~CСS:] .9f7>uY >UKC ]n 9J`Q%.#短ƅ(qKYq%сPBQEq ŁPBQEq ŁPBQEq ŁPBQEq ŁPBQEq ŁPBQEq ŁPBQEq ŁPBQEq ŁPB]1nܸsOџ#9@(oq:8kn*Ar ŁPBQɬ688<*7FqZ+xcP6Wmj` \v?&g?ơ7@/,\04=\8rFFF3zi:3k: *9wnڴԩӪ5uc\&)p*!ݳ&_dH}Kq+qFUǎ\]qq+ 9>zWԩS~?UCÉLWŁ2((م^Z ׹~t\~t2&ɑzMP+lE- %݊~ ZMԈ#SoCV&k"T#N{1cͩ~#zSqH5~q\}}R55%@f8tqeZ(w{q}[2^N^C}^ȅ|RAq TQGc1|5Rﱦ_P>D=Vq|ZD28yA;UYOKܕApc$)BqP8,y){(/$WFxVo^/磏>&LP&q&vF'=ﺧT={{x{;yrI./蟯E`&UHK*-ub׮zkKpBb=3EAC₩ۻ˖'ˬ^au7HYݻ=^ ̛7]1>hѢK8j"l3԰/a\KqT2Q#œzNMAZ52GQ8hF9̬쿜h*OnђX=U-k-6UbGa>T//v8rW˯ő Ze8G2Xnu8RorZΘqdCJV?~"WQf*Aϑoux(0 e Y Qc_p<8SwMYb5~ժU?Sc'+O71jYY{/Κ5[o}oy|=ܣ__ѷjÇĵ(!{N|W}]={ѣ3gGۜL0)(NL偑uEtQ׭0 VQȚa[֋0<)t*~L$0?)ȜLMGFA}@ުCA Be81xK8a&eUEbD8;p=PLbQɔe&+hRMڢ7mܤou{uzxGϟ`ݺooݺUR_$nsĉWKe8ru8SV.^}5iCd(+8,<Eq TPz>wUwGFOxu'GixhWE,1 8$!bq?osӦc}OeaɁP?6o~[A+2w)OA0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0* 2@0*bګPcT@0* 2[NEVWDBf `TQFe `TQV2[epp0y&*;/$acdF_߁dê_E[$g {2@(!m۶744ľ6Vƍߟ=)uɁ(;tg?O>iFimΜK dL%ߵsMg,tO<)eرcկGFF{q˙:udL6?-Urjor~dDڥ{ /\4Rw/ m5>JL8rd̩SnlimsP.YTzr7c~F' kǎ˗/󯉪ewr?~{K\˴Egڵ[URb+KW >2'yVO7яJ)P)Sm]BiVTx~O*{(r֬Yk$x 2@rQG?6] ׼~tꗘM2CZ'/FT򂖚(SygqoP\Feg&SgE- 'h"GU$MbڂYҩBnvS閅,Rqj],TF!w.yʰ]T^ (XlYʨ,\>4~žJ%QHR**#98t>HzeU8Y f9rС d&7?#2W?_ui(x2-hU+fB୓7nܥK^Y!e2"kAedHv¡2&ʨrC7ϔ?gίj+Xc?e2֖׍~ ,VzG˗{ʰG)jd25Q^M+ツ@in38xppմVk|~*:ό5q0sc_ J8ҬjjBPj"3 ؖtePy\ePDePyd2UIDt4[JsWxgeeUX֧J/磏>?0UW]PgMߡPʠ,bW@*'?wCMn{X 5pO'K رcխܝ0a3J+5Nҍ(ݸdžgμ3u=ó]1ѺCCKطoĉ d||ꉪq0U&V^SO* +?O~k_LXieaz3Fwnk?wY8Wڷ4ϼx*C\ΫQ*C7<gtӔ[) 4gKi=Oɭ3lz) 'I"š*?䡟^}Y8|lr.QTl$ڭEfS 2:ĨPC$p+7Y%#[OZgQI?L^A*]^+#;_eHF*HR*HR*IheL2N9SY~A'kRܘԲeDګe2iVq(#НTJSiD¬zv+# ʢ+CXq_*`2TY UF9}Do߉?<ŋ>kxYEuB_Vg `TQf\msnH]ww͏;e LEɌ-kTYt޽;n[ad<$NZC z 1ʵz]۶=ktӧ5)#A2왲{gSSӪUO}LʸpDz3g/}{7b5^JAUb;i:;;g͚5o<PS: pJTmRR )'^}wlM%B"hBU_p. u-=T2 U_̚%ƻefr麺/_Q,s1cᢅ{zr}&2DJ}פe=?2" -רUΜyG\ e@z~zj=3Z z5\}4*eRÁm\t#[Vợ2bّRclY;~czj.hīSOQ}}0<44L"<U"2!5xٳȺMp!5JpcL(`~Y<5.(]8g2M3L xOU*/6ߥ>*XeU}W{_<=)t7% ?/kFylpǘfڬ^3g>\5Q/Re綷Wڕ35o{LX)TR"zJe;ρ3 C˴a9oƔ!XCzyTrhYzx8;*q3LK(i|}DjdE֐Y-2< 0MK=KLNdo#/FoyP.)Hܠ;PAj}+ ncF]5ɬ*Q__?<:"5r0!)EjN Z*R#j!qDͶCH|ME4:DjASPd\Ԑ1J]yeE3bd.\wՈnL>(Uk„ >]txGI TԀ]Ą?1_ly@jX`jQTɥƴi7'ߠ޻z:/#߻k'>Efg.\jժhIUqH@񬭴Þ{nZ $z1;v37|__/__y>`]]Tӧ.ćQ~{2wwlimU__uϳUz?~=ϘȤA)d`hhHn(Qɋ]*[M&Pꭷ:::C&5܍Y0%;f͚N yHO=k͟??CB֧u(2F;AX:=ENWR1?ѱLLwc}ܱRav"ͨƜ8q_΅&KRC{#w\XjVɭ$*s+[mȻJka]1ק`tX)S78NLxJEؤ~{V$FH 4"RR71m7*U+},W^2R#8rH  :(R.:(R#ft(PxF PQС@-#5Kvaj18|0Ƞ9e^<J wRrbezjx:$0ZL :@5j"59ZKK+U*ljС\@\rS  ١(/bN@rze@ryQ5@좧F9}ĸ*;ċ/Xc2"W^!;r:RRR$Rm܍T__?uT{3>jeRYnyΝTw{[oU46jΞV*J1i\.{GF/k#%b'Gƙr{hgљys<ހϟ[n\[nQO[outt8 njimshhԯhb5zۦ&5U}oyA%wksv<յ/gɘiɋjW:=Vۼ#߻g zl*\{K.EC_RRRRRRRrQ__z  e 0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0Cj0=5c\lL{*{$EO1GM{*U 33333333Iƙ35kM~M6=68ydŋM81F! 'k_\yȑ54FG@Y$,kǎuu7J( !%+nccmۻt1чV5dʞ."+QM5ǎ\-ww=uyHmё{\v'{Ei >NHC{zsqwl'{noo-Os0ξgUPtM1 24KUJ} ơ7ddwN/+^)G HyI7{{9s.]txL/O lIrSyG 2,Pq,t1EaUmٳwٲ$00`75vѱ,!9P($;=^YRU d@<$2ICmRRRjMXW[am"/d@Yh~w(] =ϻ Ϟݤƨ l(S6⾕r&$ =I9T18/YamOy$5? [D%$U7$r$qwUرc9OdTN"ߩfUIA/Ytܹt kNW#Ua?塿{(ӑ!u{/W3U965}NXV+۩_Af{ /l9\??2|2;)6 yvvd%r4!2R;PE K5#G䨳{̙U:2'r{{\e BKEJAF?[fZuBTѶr-^HQjv)ɰ6Qm{;ea=M9uT:wò$%\ϡ@p(gY$-tOD`rkd'VeD}ѓiwV{!2o#+TF=HZ4;kH fH fH fH fH fH fH fzTB]9rIU ñTj(קF/X_MKdHpV Sj8CMQky*;#r/8 {XɚM -[Ty9$!82S,{QGvzj(Eںu1< 5J}\ԼЈ, 5J%!5n+|Bj7yd%+aNv$[Lp}=(R@䅟D$R@,Yl"8Txy1KϊEEH;*67UHZO H fH fH fH ܸq.]Z 8Ejx GHuOLn۶Q "#.F<ξvyq'.]F ƨaP_~jimᦦ !cv=uDjTɓ+W^l}>شiܞ9ҥKd|S!5%![lm6}t=ŸI/) G!5:rx,8~MK"a| 9<ټ#$ԈMccѱl۶pC+yz )R*AN5,1{#1"r333aH !5PG R(#51 2j=5rrc0uMXRQ ݭn2s0񁄑| R#)@p]-%5Pۼހ>FpZt Bd aF煺[ͶZͦódGj68HJy"yF{dGj38H q ّ RyYf)dGj*2 R$"{ |R ؛)^VI{j } ya}3KlcVK@BH?H,/RAv .RɋT^#>?ZQEöbRHw%;*ppbjd!/aCQR#;y5d% ZIE6TÆES ټ,95r]=a -[&F"/ȎxhqR#yu&;V͋<";bwj&/rop55 JN_QGR`yQdG5rNRyV'e>_nQ+!ŋb\J%ж֥Uګ`;V/~E<5- ZCj0Cjd' FRR#[8HA̐BGGjdN)Qؼƙ<-<رӧO6[$)P_TơCC6w7n4{v{zm͚tݿe˓Eg -!XN^zҪ=XIST\eٹ:oĄ R5};yᇓ]Ĝ###MMĉH'N b róSCHL2~ȳ<c)yuJvu=%ko߾ HK=/YL?xeD{]NKNa_@!5~<͵k@N5Rz:شi^teo陹2wʬ]-]e'Z=wqǤ'9-pa+IaդCddwNRsyP0ʯ^'xB ;|T3fpJ;&o)ȅ $#xUzȑ#GZl:[Tܴ6p;,Nm lԩS԰WUTRn KѭwJ0DY 5 A7x@%w$ Lyʱc<;j̹s$Azzz.8SP2 w+y>+=ˬѯ<2(Ƀ9NY>@!g]T)=唵t;׾yH|3 旿[ZZʂo$NrǑ!uTX%Cq&顸b }BF s̩0+${SN{ْæQ= wp!y!)u'J/__dG^b>B \C6l}l]YLܤ'"5kֺGʮҳ|k)@[gS);+t4ySlJ:qKAX'>O#P/%Km۶]ڢ݃pZ9H=/Cv5{6T^G`͞27Ly=q75<]# z #G?8C=3g,_l!gt}u}at1gD5,G;Rة ykaHj#GOǰs+yLw=nŬYQխu|74K6/,X@u P R#r@ 5!52-6Px3F@YA (&4D-e2"t4|9Ai"oQ7.U#F!IX8pH\ 2 Fu.r$'yAJ#/RHy@G#w'#E Rx RMB)É4<|$U@ ]~U R#OfDMu.I%/RGj[l?t.2ȽbDj ȋ"5rxyqS…1GMv¥dZƍ^ hOѹRi"/@:ȋ"5`aUR1AX TX(EaNѿZSH X  aEmIIZVXr1U_wtKkkC/7OSӦ잉d 9CImz^A* ÿ-ZݻOOg͚5a;Ì3Y1% :^jܪp?+^~_}5j{ォ $H:xANI:S{XD{KvPjxrAlݺ5lcP#%h~'믫2} nV=7Nl.}{,ZXrS.qwL<' _p?#߻%WHLMzݺoo?ϝ;wʰ ]g'2אUR? '(hd\ek_RC"#-MyH"c׮:;;4CCCߓwFZMj$AԔ0%~ap7 EK/?cw}w]]][N&RCTեTw)u U旚6zNyݶiI tw1<ӨvYdsW"#)S'?Q~|3a"pek=s|X }E'MSPjHx:rWF:ہ^ uQI*a${>0*[]y;::d~%(jس ,5ԵY?fAe…===RCu=ɫ􄥈=ԀwSɇE`Ȁn }R-.3:nݷ]y>͛WwMrL~W2HC d:3f̸ IɈP Q=̇/*섇I7Wak+ MϗY{L :/#ߑfOF TiGj9ksqFFAX"5PӈH fH fH fH fH fF?Y[^dc6D(zj{ 0m*7<>-#C,R#s*2@jdy!5 :/R#iHyb 5@^HH Ƽf Gt.P`F 5Ԩ'/PkH\6Qe(U?9K{Et>zdVsp% " 5@( r`vSԐpF\@45t.XDjf^eVīQyXU3ڹD!ߩ@ F9N աp%/55ܑA^I_jv1ZS68=44>qmjɶ=o<_m)G  rL/ފL3 %=ɓ'`=RH٤ŝSu78iӟy̶ȀRT,k^uQtw=#݄nDz3z56Oj=5.lN{LSbd伤3z?7ș3gy1=>pnP;rP9e ZksiPr .:4tHG>7["cꔩiPrbvlq^B!{xJ^[/܏vvSOSd$5zJC!p" *Je9so@RQjE0\j;v쬫=sWB](Vm}+)VZfnw_ ]4َ֭{F3DY Ϙ Zrpcj?|$@ǎ\FDƣ?xTn<]g߆ ҳGgKdǿ[D,]D΁tsjddd/_Vi =r$=ǯFΝݲI0GS'j]yVRk֬#P]Ӆ\ik:+W^ѝ! DF2rCyԓ~FJt/w|,Pu?U/Ôiw(djJVRƞ~^hW1rUx+Ӹ# ҉)̹Mm>NwWCŁ9!{i?,9udŬY]wms̛?ob\ '*q1gc2$K~g7r=/mdS}/ Ր8XqJ9)3޸];E=ZZ~'?T8 >hL%Em]]OEay2Zծf8N :|k_}iђ%Ke_1Z-] gtwϪmI?ߞ86o.BUz~(!A&%f)/yW9u2cgׯ6x oɬwcv=CObL8Qm˻wm- ,] gUJHdTr>6lxx+_Iϔ.ʗq K KIb`$(8$Z1Ɉ\T*30bt%/@ c)( 3@fk0l !@ rjוyr~kW}IKR;ݿߧ;I=Q6Y}/|J{!!j@ݸq~QVn2"jz?}z@8D q,k"#j5FD `#Qș@*uhsG |o>˩> (vQVa7Q8࣑ žl- C -shZ 85s;6K}1u=WL#`Fv8.<4֜6ܼ'GH >Ddwܥ]KE å#j8#A;U/J~!D!jEr )H P@҄Dj@b5XDj@5<+H_"I4R2Q@TD jp$!ĀC\^K$v pQ!j% p5RDq="j2ϐ0\"Q#u1ӘN[(ux05dGq/@!j 4.8K$QQH.WU&\"I b啄I"p 5/JQ 4 HУwu>CD $W4\"u*g8?D +K\"A<FJAq߾ٖ9%N4@?Zо. 4WUiD <^B5{ѫW7o: 2xQ<7#jO8ND 8iҤoyeԼa|a!C$gD?-ph_"jlnv i!"GԀ\O$dl)O͍7NRͲ?~CKUlعs/6b_{r~qIq@W 8p@L/^2vlV \Up .lKg͚S[2\i+.[BZZ$SKHPK%g<1U64??_Ǖ+W;g, EEE1lDԀTar#yw?ڨ, @?1"Ozn^^}M:er}{*AYYV߿ba#bQ95$uu pmaCzo>{O47] .T|$'*g9j,9\:6m,78nKlDBB6"jQ ja6 ~D `# QQCa;ܸqgΜٺ=d֬Ç̼'--- ǏsC i?dAI77.]8TGGmʐ+rSN޳[!;;[:oӉGmW)DžcjjCHr;^b3ڮSR\\5jȑ37zjgPyfݟjղ\;:<5]%_WTGh4.,,Z{ԩ`ǔ lv~ȑ#"S^r^SWwG߾*CIRQ<1U`lsznjQ կw?ġ\R/^RTT95lhOܹsx CP.\xwnڴ)̷4=w֭[ ZZZI!;I+W֎-JڐS| ɒ$r4q][Cg@i1ȥ4#IHrCy٨GX9aYK-/AR.҆ƍ3dW2t/ݰ475˨/D2p̽Zٝ.^/-c(=^*WvyEMvʕ޽{2BY.?jm&bI---7oHDhmm8pdD>|X TU:ߓfׯe$ö-Z4z3gJnY>WVV+V;֭ n5’X~_.QYY!D޽g,7Sj# Q#N,YV򬒐,^]iGdCQdj(CBFσ&KI^P,NЧ@WJBQ+mp O=Tss6H766a=z"G~d_WWbDnn"TDK/E222TKy"ڳv|ŋ $F535 X?͚5[_\9SOa2G\Y[SS1eI*5K,DV]]jaXePiS:g1"2رcڴi>aΝ;l2Y9 g>w\}L F 5E#\9ÆI%~M]ݳKDV%}]5GcG⪆W~>ë GأFWWWyQ7.A¡tRdt](l QB$ 5Q؀q+-؋t5=tx5Q؀Q@5x;5dwH$  $Q|E܃~@EK QHlѢE6mtR~µzΝn: w-nkk\zZ"_5{ݻw|5UPxJKJr#A[9s{lΜqG}AmH"[WTTh9{l/:tP< p2s?I濋C~2h]6m@d/D 677k#?U- -cܸqEEEO? /_Kطo_AA|駟fdd|WQ[28q|))A> ]< )ALr|6!%R#ڐ|!cL߾wPn^/\оWV+VQGέ}?U{|466ʁ棏>>|SU9{ɝg^dg?n{{];p-d8~ɓ8=J3fXgGio‘/Ԓz,`ndggGлwoy9Ⱦ'灆IEٳG\{gslQYYY\\ܿロ{*j45WRR=8(QiTTˑTcƌ? öڐ$H CNb+~6rG}D-'ۛYHqNmgvusK7KJ%~ڸ.O2lˮ%eR@~o'#*enۢZ&md_֦Z"/X`ʔGۛhK䌥K~-i J򂒅Z 33w)++5jTnnG^lTļ9V^-a_CWQCgH6^&^js59/|rښ#l(D2iF.]YFFB﬐L6ܐ04ju|˗/0@3i%`Gʫcذajsdܹs!aƆ>=H|o꫏?76WC?s\=1UԐC儬DzurC|{چd%aH#e !EHJJp;?}Fka۶gΜv{ژc+ H]5jDTڤE[N>xh(+VXz'%za૨fTHnc\ x<տTEC xl_WHuNGɁOH'g6&ʆF }Y 'o&똇䋧h-=Ds$={@£>"CT{yB*h.d3fYЯ=Zy@0:\ŮUT%fOz^,^zܼyӑ$6icӦMmS4UP3Cwq=hJΝ;wQ ;Pܐ*j(JͺoBw )ڣTiԠRBj|/:tĉWuxA" @F9ī7\EQp,WW[3kԾ!Coz{ooްaB9r"M5?T%JqŶm\yN8vڄÝ>Ԥ hDkyƫrLj\rjèϬ@ IaHb +hX.gꍗ,b8e0y6jK (v5/!;Ⱦ޽-uÁouA𞑌 /=o J6ًBw:X{:y)D av_hBQRA6"j5FD `#Q[骺#m[OCx$HU>^0@8D *CxV5H(]@wP"j.FD "J4D J|QB܆oS"@"j{(]5.p)JD  %D|tQTF@Qhb2vI`Wi9'gKh;FwಹR U He)^G@B.H(]DԀ @5@`#FtHF !^gl ^@JW!jx=܏5<!gp7P C%\ í,"tB J\lZоb ăIbHQ@ 2D62QTa9R,@m=ki=l R9ro~GD4q]g2bp v\@6"j5FD `#Q؈l䓨Q]S=*3sСLOcnp/]pڕSԽgZT'O8qߗoͽ'GZ[K9x0G:->mɏLڵIbM]} pCΘ1cʔKNXg?Oֽ.??AUU/IP~4mZeyűc "4;;6o?dر׷ׯq8dK+kSdU;&>96k'f 0!nO8tPe?>;[>7o$uM3zLϿ5(/!}vЙ3{/"HH'O|啟oWXÝwI|9rV83n8Dm̮]w#HE}jm~:o@4lWCkO*j8-zK;wLK]-Xr!'O>/0?uʔ@p߹kלYeaE8X_va+{¢hV]S-@í -f۫TҒRjI} MM">|D+*%̑upQwߓP ߰a K.UEt@. 62-#dI2%QSx k{w̛V-*ў0oo*jܜkd-XҢl/y }$l}=0G2п_R6g}mMТ LYnh_07//뾬SxTV; 6D |6[' "2r˚C?u|˗/0@FbnUPTm ~{tZ"*)-@~kjmm\pRNY &deeiHPAߢ +_yZFYŻ/woܰQhgf;,N94+BajߨjE53_ YAH?I/?v/1cO?.:XicҒ34j>FX駺bmׯZ竆 aoQC}x﫪744ܚݩzk%lظQOҭmy$Ҁ,;klGHvEjzGdly̙3]Xg2xG5e6(]< kV͟@u4 KO^I ]}5|5D ߙ"?lȐ!ogVZJ-o#CY[qqɩ.fWWUZR%$L秧Q??6megۿ_FtDM(ծUs]PwrO># MMڻ-l X]ML* 5%SU@'fa6DڤRCCmWQ4 (9(>[TUW'uƲ8] -M%v),d@0LK04 )d3n9ݗ+4 Kja|@.=1YM y'~J0- ٲH>iST#F&K؁>)ut@"j5FD `#Q؈l@h=r$MZ|=Gr DӨj5FD `#Q؈lD6"j5FD `#Q؈lD6"j5FD{~, yKcq'~,iV߄[Zz?iㆍ.;vl~#ZWe/ ~S$ XT O|_5g)SK4;w3k,(ڛZդ`䈑MMr}䱲2%\7=>~WQC]S'qQaZҢl$>˺/kꔩ2Ҙc 7N+|Dx=VUE.\ T1d}[$AWfffey\xv[ԐX d<r eI3{u#)11?ܱ#) eee={T4<tU$hD-KKJ*+dϗ^ ίZ*i姆%51S=P}k(;rH Cr=3kg\k&?2Y4bx $?\<@ڕ*%h\$1c*#Ԭ̪?6me egۿ_FziҢcJP~ CY_lojf070AS |5 (0Q07Sd YTФ)*,f*27$ E͏U.}Y SoE1o:Ӊ)|>^MX쒐) j8&\z܏lD6"j5FD `#Qȑo`U `#Q؈lD6"j5FG)R U `#Q؈lD6"j5FFt7?7o:[\@6"j9C?IENDB`././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/images/modules.pdflibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/imag0000644000175000017500000005733310634000616033266 0ustar twernertwerner%PDF-1.4 %äüöß 2 0 obj <> stream xXn6}߯sd" صoI8->;7V1Gyrfd~qJD9an+m{-ǿ_?2N}?<ͺ~uK _^v]x8LyDF;~q=xGI?C S]gyR:Җ`-YvlWqĽ 䢇WC^."iE)-lmhCI}영 g $=:lO+׹T8 P@Ƶ)qF#oAr<#02Bҫ3TAyj=1G'Fݸ<RH .JtقTpy IʀUvr4zy(0q'ַ=4˄Z-f&Ytu,sJݍ~/Пj p  Fp{n!Z\2/} hۋlҰZOXycƄ2+zJlɁ"H23܍}w`VQR["$Fum.hQb,'Te 6*l;!3 zV%#y)BјaV!|k­9 D'(Cnӂ$6[e \xF$3aC%. ؆/^AD|Lc-2Z9r8=\l/%Ai\| "MGIU!a!Av98Lclڎzۃqcx}g滓9"ς V,ɤ "Hsq"$*XHֈIG)7In$ ]E$}Z%ݜ"^"UHIg/>:kq >G5ߙ18ЮP*_PxpZK/봞X96 G-dzUrԔI*;װ7Gd˂wmY۷`0NG>!{3yi ^tev5HhFf/b"^gL+Zjz@+gi endstream endobj 3 0 obj 1286 endobj 4 0 obj <> stream x353W040U2473s l3#= Q endstream endobj 5 0 obj <> endobj 6 0 obj <> stream x353W053U2473r> endobj 8 0 obj <> stream x3253T053U26^ghdA!2Ҵ HT endstream endobj 9 0 obj <> endobj 10 0 obj <> stream x353W04P2473sls=S V > endstream endobj 11 0 obj <> endobj 12 0 obj <> stream x3123R0\zfP^gbg@T *2ҴBl endstream endobj 13 0 obj <> endobj 14 0 obj <> stream x3243S04P26r,s=S V1  endstream endobj 15 0 obj <> endobj 16 0 obj <> stream x3243S03R26sl3=s  U@ endstream endobj 17 0 obj <> endobj 18 0 obj <> stream x353W03R2473r<SBDWB-g endstream endobj 19 0 obj <> endobj 20 0 obj <> stream x3233V03Q2673r<3= QɕEX endstream endobj 21 0 obj <> endobj 22 0 obj <> stream x353W03U2473r<S=K QǕ!t endstream endobj 23 0 obj <> endobj 24 0 obj <> stream x345ճT0173U223r> endobj 26 0 obj <> stream x313U00ӳT203r <C3= UǕ} endstream endobj 27 0 obj <> endobj 28 0 obj <> stream x313U023Q203r < `R̆RH] endstream endobj 29 0 obj <> endobj 30 0 obj <> stream x313U014ӳP203r > endobj 32 0 obj <> stream x3123R03U253r<S=K QɕDr endstream endobj 33 0 obj <> endobj 34 0 obj <> stream x33V0303T24ӳr > endobj 37 0 obj <> stream xy|T8~ιξܙLfON&L6@D2$= D2$> u UqCR+nUZEоRֺZ+7T9Iھ}ܜsssg;9wȀm]"^@[6 H{5O#*Y׻˰v24"wn]7鶫2 !T8/LUAhzt}[ 7pQ7C~CgO[dŽkһAGHtEg#uoO|`O"Z=zhs"r*'/No0̢ŚfK;.#E.n|4%ߧ4%ڇ1z=BGt=}@*JCؕ< Kwbt%:ؙ]sVۑeEAԌNW tFx(*yS}lrboBh=t;:o>0`'Gwp--ş+Ṋ{OA&-؍bL!=Ni`ĩ6-‡?WeN#Ag+p&sGoX ݈F`+Kp$~ԐF|up}O9,µV'h)6Н#zSXzlG~ +?('sQ,xl&%ANs7spY\UqM\jǸ?n: {>a)ʠi^ѷα=c%ҁn Rg{Hܣs|<_Y7>(y  +#xٜ42,R%}d7"/85\:Z(7mp M$y kAN==Yx^xGSuU ^^nQ߬>~I 4z d6{ Dx-$ dIHE5‹Y>~%YB܀ dܛ?I4ៀ zޢ2+G*:1Ε!yw ;y[RS~ @?1Rs NjC`q)DYRTFN}ίG72|9zZ1EV/IE!Dau8s ][;TW :[܏`'ȏYa ]Vaqx%Ou+^Vla`jPɹbX; د!U#F2:y?=u'oE`v$/wh>-ԋ2As P,$ȫd9s>9؉>ǐ-?(L*hMHPT>NBjeha\%̰ĢT x6 KW|cmIJ0x!w3 :gGR]~SǮZn^7707+,@uz%138f'HcI%܁ں+PKgr"%KWz‚X@9 sljnB͆bt5zi]7 hmkh4Jp&:%&qNdsU;&z]uΘDvw-]5O&ڒ]0 @ĆF7J0DWBW%/%60'бkC+ƽ+mpGNո*OT{MZ~ڵlAWXr_SX_Ȅo2+81Sa8e1Q`DBj`&4@f|0JGb ]LZN'1 ; %D#QɸA} NB|*"SlVXi -Ff~h-dCKWy @PSҚcf(U3޼5| Mp,:f&_TG偆WIuZ64g)P"m*Cx8V BTLۇJV:_t~h8ybD3e˟7=.& `C]tՁ.PxԸ/M97<6&O" $K@"%{GC ݮ]~Wprhm@SzZS3X`Z]o2n10jDTV,41n#s{{4*+1L% Aư̼ 1!zV&HjQS:V' W(,҄PC>5c${E,?VaHaeV3ϵkrV#n8{ѱUz%?i%†|&?| dk> 4\(/aLV}jb5GՎP;&[ʽNW2+E9-g}}4pUBgG-U}UbV^ ~PY"Rdv{YtY*ң>Gn},5Xy╎{aఙ7اkvv.;W/܎GVkra F]Ԇ:bFk'՚:m]W=ޭZRߥNOUjJg1_L$en!1Άf3@*2ϸ>J6 '3$~sgđ*P3窀Z2񗔌P NY*,eҐv\sK e޽W݀՝c70n5Ѕ ^1/>㲺WmH8O^%֑ױxOsiW`+޾h"u^컾!hϷ_0odAcK?AƟM8Cg3sz2[UzUZjadvR*]!n狰w|0Ytf/6' wy+l+͏기1l&f)\ڠڍNk>אknnfݢϳͷ7YҚcXZ,}jq2eۍ,7XoHvn qQۇl7ڒL^o5_c̮OZ9+fhZusr:dŐz]U> mɷ`eVJKV:@A([B.K[ZV^eUP5a eBo.|eżlFs7z7?蜦R~V׆o2bWK )@FiziƜ^iqIs٠h]como:t6Li))|H Ogj2DWư5jreaQֵt*/o]T򟱽g?K7*0v2kB0ލ |>\Ö +Amf=iXbfgc1T;3㎭ao^O̤W-Ga[(WD9|~ԗԒ4io;On<7YߴbOw-]zC{>sx=+.I-@}l 8!J5P !tMnt0CƓL2,&k%#WYoqacƷ[n7݇#,3!r6éy̅+̫Lb|! JԹ}Fd+YvZ,?u^H ,2&ʭeCkt=uGܧ,{;}3w/{>v=A\~#rፇӝi)LUX:ajfI^hř֙i:`s6 ebž%ti.kݹkUQh]bBTi9m&&@}0ZTJ22W`~X8-;DZߎSO=ZDV /1 ;s"ХU p[>n(|&ҳ طv\VXScXJmQN]ױ[ȑ;=pp$ ޴i/8_x_@w Ľ +iJ#ami*:UzcV&tv&lvW6Ȩ3 lg:DN};ۨSbԉSjmN:R(G q9pß~]><<$λ 1'HY=#jz,vYᳰёWt3*&%a1< D9e},\&RNFnajn UNS8LlY=@K]C`ʨaS<$83%MgֻCwaqrmwWͭ/2= fJ8ny^ _NX[{6===U#O۫UNkZO 5O8#u*u]|?ƟUO烟/Mg@r-YiXq/uZ4Z֘fze"6o7X,) , 8:5R l$@*&@ԋgMq"/$r\Y_0~Rlo` ٱK.=gάKm|3ȝW? fؽ K>f]VG-YF-; 1/C4uXK9|r(uֱdjXp =p 3ta:QkTAkxv^gA76{Sy8[M95^?,~yTW್_5`"?uNël/Ǖpjw.zdhzEkN`lH#ӧ}pgsWޘc,7iiދInmw=i6[%wioI{Ow2N>rW٫ ^nd34c3x/֭47z>gq:gÖK 9GOZh [Z-C,HŽДG`S@@-z,D%ԒPnaR''ԧI5ɜtvMh!Yvg۝#JGΰ; ,TFw24RJtOڷWnpKW)>8*hp}kyܮ5Y=Ϟy,pʙt@8! tuzy=65" /-Tv عŗaۮx8i 睛6ױs̙^M>ƔDӱ;%wzSvjY%[WGጦs~v8[*Tg(`ojJ])lGUǯ}u{uw͆vON &۳߾Էg([zVϱ]}VO]Tw?=T(ȝ{Q ӧTuSSb6۔ւr9QaWijQB%Cy5&WK׬t2]yҁEGra=JS<S<Ǹ99쬎zL(esЍB.ǀ,_S椙͋ADݪMҜE{3{iOf}f}fW`O0hg>ׂgMVѭ}j68XJdMtL+0728ٍ\t;&)_eG_>+.e[r/)m_]Wy76ņ0cO3OSTvUg+:j04:$h5&B/oh)+#pvQ+6Z i635%^CKh4eurj%`h6B- CmTDCw~}^ @Hyk%$,H* gA&;[oGMgډ Lƻe2LjF ȗUoxf) nO|@s-1R jV#dtWD$=!n=|:s6f5O`_8ZNׁ}]t;>/!%Gf>2М|KHz8kN*s2|˹&usyץz]L) V%#@N \zP1Mܜ@mN]jie`EN~qi-ܪx q0;s-KqFq{9g*vtkSp)n+_:5` [=y'n,9]ݖL; sɗ-%xD~<œlQ/h*#*e|O;L9xG쨐3"܊{n8N+Cҡajh ByjЩi)RXZ58J} 3ű6RrMm;ҫPhBm 9"CV? "}= df'Ԟz1DYv'5^%ͳ:_Q#&_]5tٵ/v;~E9ںG$Tqogi%6zlT>,@ߠU(gi49-*Y9, ;͂O+8+ IpqĎ%e"| g仸4D>|L)r COaNp&\}H8*ۖj]9lY3jkWfE.ޤ& Z(i(x!x BRs6kͺf}ٸAAAAx(x(L=ezj]=؞7? }{%4ܛ{_σ4}[y2Qh|zEGami|7ʟ_ZzTRV91JLV0NamfM,1 ^b(M)boT1x5^2Az* -xE%VSTf9l.WTp f ZD&r,A< e 7<(+`4h<8/WSx&DSG~h۶mh Gsɢ/)x2l}-rkf߲$ b5O~e+N/n^p.ضh<_h;5/x3te57{񏨟ݖ|OxSx =^6chyϋM{MϘ8!RFز8m#^%^,I[X\sv"29Κצ%p&(oz}6^==ga?;2p9Hդ/͸l:%up.:- _ӣ?Ӯ"PN ӟ;䉱=[?Wcpϧ~Ʃ{ONr9{4;HN =6O:iŗjҰF~La°ʑi*-ܜlm%o~P#zaJŹAIuLouaҥ/TB_TS]\3uy9!(}AM 8~d7ٖ&!%WcLߏ94cESzi9$DhzOe`a."]7c{K^ߋGkljLnlR#S%=+na++wǏ!)׳fN>< 'Ǘ>5FN)ϥ`J͑_Uo><_>[F X-Y|]&? 2"':.Z6H`D f 9ZiD[Niܒßim>5V]k.RRän&Uv1I:-I).켵cۉĝ-Mf:=8|UWuPA™\VEF;3W7M5]7Ow1w- ޤ{{UrfrpKxP#x<'Z]_I4?砡JKB^N 9^u*zqzU]9s3Zm53?$;efZT(wT)-c_.b1~Tnžn႞)ߥ6XlT~!?Ns5 =o~m[2V}-k=͝Qҗ~zRQ!tG eCz!/:Hk)vd; zYa%o}6P^DmFX ; W{x!r[Q7mn|ci!1uOڥil+mSfE3(7ґJV. epE"Nc1XcLXG:<r+X{XXChIuSSh56u*6iQ`j6U NU`tPxө2} +X֊(w#ZT'~:V`=wei'ȭq lBE ) ,P8`+jV~?`- 2A <ʃb0~CX=N?k901(W;bo2=%(+L،(m$S -a%d-x1<]zTZފfN2{`\:^OL(f6-d|AkY/b5Lr"0Y|i\6Fa.`E%)h$Z7k)}Eh.#wz/YGxm 7:[n8c*2ęɫKq(&&*yJ$ %*=PMW(J R6dQJԄL0gdL)?VXMʨ1e&pR:AטBe%1?r\3)dzHZh]oj6*(ocNR4Ev6zV*SxWFoR-0a#WtHmck ,ݬ,[tPܤlw:r;()ce= 2J'Q)$uL%&[mLu:wY!kS\ )v1De!.6ENy- c6Y'RvTߘb3NgDm"&e4ݛ[v|7I)h\t\Py"_GRE'2_]eQZ3J_ǡ\)%[JWGN6j" gcSꯀ ;+*^dK6^F٘;<YdRRK(O Ʊ')EgOUymfȸ9M =AFqzyM.ŢW { Mr.{='xhjdqK<'z3oz$>Fd~~)gGZkzXK^:3*^='GۥX4+KK"RPj\(-^HtKxtsY:(*G6ǺӶ1 mg-t(cm<2k2(=s*#@A RlwH2]+ʮ1KmH,28#-AVm=0]PlbJWtQisl0L{&D6GbQn`k(ݳ)^G#]PE t0ʽh?ºN\a$>`KlN8%f=̿m;RG(#m2&!uEvݱ6@FmQD&wKntE;J8N'+;(Q\ ZJq)Fh ` =¢ `SH]but@&4o{;#[uwts7 Sv@,N;=]=ޙś7o.Rck]5"Zo6(khqsk,^$-.Z0n:f޲u:Ț%1 LV0(5*CyVik mF HK&_Pn@F$IMЬ#bг8o2T:7Sq㢔Ѷ:ļ( {G cx;` H5iAԤ@I1ޘJ)9Y Ln]$f25 Xb@#R7ՕK@n&mm=FeYZh˴Ku`c\R&g3x VndU(t@ M,Zh v-߭_7Cw vmE7+˧x(X 7F3m< (^ݲ)7P^Ɖ ̤+&7bT1uFaIyIV KN-/B>rZQO_*#+czGvȣN9=mF7sRu˙Diks?垄p;+o7W\s͕7W\s͕7W\s͕7W??GKm [g'Iy>7 `H|GLF2rd)[s!#z“8Gx@"F"Bx AP-27Q1jk $ ɛ u`S!o@,aYCl&y G*V_8< `to}P )!/$K B腠e^FCvC B ڼ m^6Ax˨Br 3LNɯ/"y/gX<9K i&ϑgdP!!-z`՗'<>!TCX a !ȓ$@ < <>` osA$g^D{A4 t+@4 ^s@4 ^ ;7D`h\ 70'ٹTc&JJJO6}ӹ@~>PphJo(z-C(mCUxR<C^y> lx1z:_O7C\ a c>,,6C\ WAM#(S|MXb#OC%?3Ds7{9/Lf d?OZ4al<FKn"7 `n%a|ہ㾚t}ɃJ9@q#/yޕ| X;Maߧ3^y|;(y%u_k0Pxgyn;ay^V+.C.l- ͇jk}8yWW%cMmJ` !̇NAø#\ޣ^^.Uj:CQ4V1i FQix -D]aS4Q4,&k%ҸҰ|nHkC kXtuB kjhjV'%*B KV&(M5IZC#c=4~cSr7U;-_*x9σ3{J<є(@2!_gjФin6k2Zͮmjj+_$/ O$$Mw/&բ2<S 'É;8NNñs!P^@2F^nrXAn:6'p2t xpB':'g55^5PК~S31V5)Num[M#DS Zh Jg5Mu3ݏWoGk Ϫ Dj[R^qX׍Uk:[B;+cͫ Z=UAǪc cc!&KVנ9Ms @^[=9vw6Y~畞CPS0BU55 tVT9*-9(40DκX Rq(>PWGj5$7$^_VT^_7<&ALZq㈴i W?8 #h<~31ꚸDfC#SШg5G]C !O)tPR41TB endstream endobj 38 0 obj 16096 endobj 39 0 obj <> endobj 40 0 obj <> stream x]n0 > endobj 42 0 obj << /F1 41 0 R >> endobj 43 0 obj <> endobj 44 0 obj <> endobj 45 0 obj <> endobj 1 0 obj <>/Contents 2 0 R>> endobj 36 0 obj <> endobj 46 0 obj <> endobj 47 0 obj < /Creator /Producer /CreationDate(D:20070613163106+02'00')>> endobj xref 0 48 0000000000 65535 f 0000022636 00000 n 0000000019 00000 n 0000001376 00000 n 0000001397 00000 n 0000001571 00000 n 0000001613 00000 n 0000001789 00000 n 0000001831 00000 n 0000002007 00000 n 0000002049 00000 n 0000002228 00000 n 0000002271 00000 n 0000002453 00000 n 0000002496 00000 n 0000002672 00000 n 0000002715 00000 n 0000002893 00000 n 0000002936 00000 n 0000003117 00000 n 0000003160 00000 n 0000003344 00000 n 0000003387 00000 n 0000003569 00000 n 0000003612 00000 n 0000003793 00000 n 0000003836 00000 n 0000004017 00000 n 0000004060 00000 n 0000004240 00000 n 0000004283 00000 n 0000004464 00000 n 0000004507 00000 n 0000004691 00000 n 0000004734 00000 n 0000004912 00000 n 0000022780 00000 n 0000004955 00000 n 0000021138 00000 n 0000021161 00000 n 0000021350 00000 n 0000021765 00000 n 0000022028 00000 n 0000022062 00000 n 0000022286 00000 n 0000022527 00000 n 0000022880 00000 n 0000022929 00000 n trailer < ] >> startxref 23166 %%EOF ././@LongLink0000000000000000000000000000016100000000000011563 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/images/empty.dirlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/imag0000644000175000017500000000000010577660265033263 0ustar twernertwerner././@LongLink0000000000000000000000000000016300000000000011565 Lustar rootrootlibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/images/modules.odglibjboss-microcontainer-java-2.0.10.GA.orig/docs/gettingstarted/en-US/src/main/resources/shared/imag0000644000175000017500000002626210634000616033263 0ustar twernertwernerPKt6.++mimetypeapplication/vnd.oasis.opendocument.graphicsPKt6Configurations2/statusbar/PKt6'Configurations2/accelerator/current.xmlPKPKt6Configurations2/floater/PKt6Configurations2/popupmenu/PKt6Configurations2/progressbar/PKt6Configurations2/menubar/PKt6Configurations2/toolbar/PKt6Configurations2/images/Bitmaps/PKt6ϣ[[-Pictures/10000000000000200000002000309F1C.pngPNG  IHDR DPLTE3f333f3333f3ffffff3f̙3f3f333f333333333f33333333f33f3ff3f3f3f3333f33̙33333f3333333f3333f3ffffff3f33ff3f3f3f3fff3ffffffffffff3ffff̙fff3fffffff3ffffff3f333f3333f3ffffff3f̙̙3̙f̙̙̙̙3f3f̙333f3̙333f3fff̙fff3f̙̙3f̙3f̙3f333f3333f3ffffff3f̙3f3fOIDATxc'F*U0RU<4IENDB`PKt6 content.xmlZn6Sv)˔e)@aw#Q6JH:IFRLڱ$J>{!#qL:]1Mp>z{~ic4IhP.B9So I3'"ki=*GXgwmlz \ oݟM)uu~OT=+[(\b岳u( @րڮX08@t@͐ )_d9K܉j&JL>V~Ϝ~Gxsic;Uz{7b'ZN_ן7y2g)[K™fimSJkʡ,v 7vAymX//AVf&@ -|tR."%tm̓MιFai'iaSASikmZ/eyP;u%˲zK U)Wr~g ؎bpZ_:)]o}/ 0I1sJpmFVsU?ՌZG䣠? !$>$x&u%ݽzRpM60" ;|S=ctmK.s'X\QӴ=6iQqԇH FMecs-~(P!nk-0n`(k_w6*TjbI-*3rU 2< 609Rں ~s`^zgDnI B('ո2ze9Cj0ndoV-%k dȭזU* @^w?E; dcd/`,o)3"x+}n0,SטBBB ;ThؘBgԜ>gڧǍ)?>5yimLըj}ZMdU_T/;.iF,5[]|9r鷦m~WZ}D)\Ud(7NuS =CJ}k#Ѕ&UtZ,CUTT6&OH@*Pe!% =J:b=G@y:-VFge=$ XDz0>ݜQg@| sBarjua3q Bi1 oǹ8-Q'zՠ GL}Sxrl__hx)]%wrD r|DX<y5 c9V85:Ѝmx} 7La[84х]pB{} tm[^h 0E[{:d߾{Ufݽ7%buUIg;0|&AVg@pu_݄FVZhI6Za6Ƈdll!ہ /)v+(-ˢ^m!.{SPKU/PKt6 styles.xml\ݎ۶?O!蹓cov[ERMr]mDĹ<' )J-yěu }9cگ~O玊fC,[݌>^~+\c)ͤ[mB :g\ oFg$\Fsts5nQ/])۽%C;n/Y Y)۽cA6C;.pjw_]r7iN$۱>aǛZ|yfXyl668R$J+ԵMtA`j${ Z E"O˿VnCs&b)嶫L2)ނPƯD:t,mQ T27-A` K=:$iix;twʒAIHSVaoMFJ{C܌[iI̊P"6[pX`Z}X&iV0}{Sd+ݼ}E^sMd1 0NFW0j/$aV͂-Y0i+j3)ia|-f;d  |/y2]6WQbBȍMW <{I\#HHmOBȁ7ct3Ď3u;467uWH?R7&Ek~g#N؞'A#i,Mh(ؚ#mͰGsw@SGCbiZ`t;hLL㙣ۖ,>E#AT OB28i\RJ^a1Z$*̔2q7 nS1 A Ohh uXnc A• #Z IL1bQS QG%I Zc#`y xjuĵ, go\5x&(ɒk &9/~x ;эOI[ī P\Be 1x"^fR-u ɌoʈyG185o(FXniFAC|Badc$hu&{2U{! jNH-SPlNRՑWwLDﮎqnS;t6t$:r=fw{7~aJt&߫SibB +i \JK'dY2tu2Y2d M%?/O3'chL =8' Ԗ:{}i tF [un3YUTוYe20vg8V(^2>U#/%Ser-xZUMv''a"Ł & JPQBTܛs)Ga %= j7}zTԔ4_;{u,A Fr$DN], ,N9ȺQGih\[?a8P7zyngWcY;VEԩ+2-ֲ.|sUEV.x}JKqDQU'S [ֲxd TzduN̗z) Cz)^JOХz)W]5 @Rg;NG)x L*02̞p 3y~{~|>aH8[q!9k38--n3Gsbܞ_SSáoڮ X< 3vZ  "uo{0҇h䏗S+evL{h/jnKfe)2Dk ?fOfIxDJ ab\9)0pH?>;&b7 U_|cG-yla+$udoHngǥrQ{oz3~3oDI]ȕԅWAG=/c@"qy'l$ѱV7r&N(G$c8|;,u)ҷzda=K}9QH/ʞN}Z ƥhg[cvlYn2 0fv+g?P6[zK1h2'o#my?M5bƗ~'Jά.EE>4G@leS,k }sŸ )U@JQm_W[_ +<Ҳ#d{8\1+)x[^`Oh:T 7 pt ,ހXn~J`Єklsf43{gfӺ(P/ÞŨKĚ:w:3NWCNEY>w"L?jh:p^#ZLVDOAk:b{lRm=;A8Wkkk췉ֹ@-0FvwEU*&9F~L|[`\p盼/S'W!ZCEt={Wg|܏_:ܗuҵsf{}Qo5M]W'],.&1;Ig)>~ nA&31A)rNA^jK=a)zELL셳Lc]4sÇ Oqc8r9!/;<w!Ol!ޠ8h bՊ$TX+Lw罋X-w P{89i>c3E :$j}a-h]y @`~z=/g+*[Q?;%~*l4K:ݦ);y@#v9,6*0o([SCrM>؜4.ffvAn!`2jZcj>c|$ɂ1vG52&`gnNJ)͕əaxkNİUg,76\Flx FǖWa1,%yD6HW}|mF{{Jp}$3q<:) ѹ0Uyw;ж-R+Rh>s:; 6yJ-RKA\.?=E)F i;jkpH٭dDn?e`_ZWN"QjasЭiN!9tHIR8(%U!8]kn+u[lYT8A>A\p.Y)mNl}F]\yRLߑ$t'@ݠelPt/c2FԪ*2(Ͳ;$㏎R6MOw T9 7k"U\&vPKC4M PKt6 settings.xml[[s6~0}hC\ #sٸ M؊Q#KI^ dȸݙK@!.0apػML/ c)ja||ȸ_!GBAAEZ'o281*0U,\>)MEɶ\oeAd%[Amatg_rwm۹Kk3E"(>|zFk$-B+8 rBxrztQZv=TJY938 If+q?O^ʅto%cT6VP(t`T,c3{#B 86-,%2:H)H3]Flqu3wS/Q>H$ pcU?1&P#lmuCM6/UNˆ-ֹpm8Q+*>ӉBu;4H i}Fއ2 ?Á]Vg=o" 9uxu3^fѐw l$:?'s,R>>;E6=qϢEBPC6T΀`7,Na͢<Ff2䚋wEɱa?ؒ%ɐmR6M,~o=zK7Nțᜬ(@J3}Q,_!=l4M4v>7ڧsn<2\Ӕi bdY&@rbFē|#U7d27χ,,M{CA"%3XUšJy뙎i695sHP9=CN#"@gA][!ȶã}V>Pä r *3-1U9c&u{V`!Y J._@("(͢-3A ,>米^xDDgoe YTs ݼ* NE~=x:1eлAc.LЪ8ҵ,:6/ q0uhX40 krM"AٳXmrjMlzukME2i53Qs DDzWTLl$՜r3Gߧ*[/0-~6~A<{7E"7Hx_tRc"Uw.YNdtwӵ;q &~KxWPKyIePKt6.++mimetypePKt6QConfigurations2/statusbar/PKt6'Configurations2/accelerator/current.xmlPKt6Configurations2/floater/PKt6Configurations2/popupmenu/PKt6NConfigurations2/progressbar/PKt6Configurations2/menubar/PKt6Configurations2/toolbar/PKt6Configurations2/images/Bitmaps/PKt6ϣ[[-1Pictures/10000000000000200000002000309F1C.pngPKt6U/ content.xmlPKt6ʟyjI styles.xmlPKt6_ meta.xmlPKt6C4M Thumbnails/thumbnail.pngPKt6Dfޕ*Q0 G settings.xmlPKt6yIe&META-INF/manifest.xmlPKIS(libjboss-microcontainer-java-2.0.10.GA.orig/docs/.project0000644000175000017500000000030510577665577023143 0ustar twernertwerner docs