You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(544) |
May
(1715) |
Jun
(1059) |
Jul
(886) |
Aug
(1214) |
Sep
(1375) |
Oct
(1664) |
Nov
(1153) |
Dec
(1084) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(1630) |
Feb
(1634) |
Mar
(1979) |
Apr
(1119) |
May
(1850) |
Jun
(1231) |
Jul
(1168) |
Aug
(1840) |
Sep
(1038) |
Oct
(1127) |
Nov
(1458) |
Dec
(854) |
2004 |
Jan
(1145) |
Feb
(1064) |
Mar
(2242) |
Apr
(1728) |
May
(1346) |
Jun
(1280) |
Jul
(1681) |
Aug
(2388) |
Sep
(2233) |
Oct
(3246) |
Nov
(3248) |
Dec
(1775) |
2005 |
Jan
(3407) |
Feb
(3049) |
Mar
(2402) |
Apr
(3687) |
May
(3289) |
Jun
(5731) |
Jul
(3905) |
Aug
(5843) |
Sep
(5149) |
Oct
(6866) |
Nov
(4051) |
Dec
(4646) |
2006 |
Jan
(7356) |
Feb
(4713) |
Mar
(9447) |
Apr
(6553) |
May
(6206) |
Jun
(4301) |
Jul
(1160) |
Aug
(23) |
Sep
(11) |
Oct
(19) |
Nov
(26) |
Dec
(15) |
2007 |
Jan
(28) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Robert S. <ra...@gm...> - 2006-07-10 15:41:35
|
User: rawb Date: 06/07/10 11:41:31 Modified: as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core JBossServerCore.java Log: Removed outdated variable (consoleListeners). Revision Changes Path 1.5 +0 -2 jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCore.java (In the diff below, changes in quantity of whitespace are not shown.) Index: JBossServerCore.java =================================================================== RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/JBossServerCore.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- JBossServerCore.java 27 Jun 2006 07:07:31 -0000 1.4 +++ JBossServerCore.java 10 Jul 2006 15:41:31 -0000 1.5 @@ -52,7 +52,6 @@ private ModuleModel moduleModel; private ServerProcessModel processModel; private String[] jbossFactories; - private ArrayList consoleListeners; public static JBossServerCore getDefault() { if( instance == null ) { @@ -105,7 +104,6 @@ moduleModel = ModuleModel.getDefault(); processModel = ServerProcessModel.getDefault(); - consoleListeners = new ArrayList(); } |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:27:14
|
User: kkhan Date: 06/07/10 11:27:11 Modified: jboss-aop build.xml Log: Exclude copied jdk15 tests Revision Changes Path 1.152 +2 -2 jboss-aop/build.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: build.xml =================================================================== RCS file: /cvsroot/jboss/jboss-aop/build.xml,v retrieving revision 1.151 retrieving revision 1.152 diff -u -b -r1.151 -r1.152 --- build.xml 5 Jul 2006 12:18:02 -0000 1.151 +++ build.xml 10 Jul 2006 15:27:11 -0000 1.152 @@ -14,7 +14,7 @@ <!-- --> <!-- ====================================================================== --> -<!-- $Id: build.xml,v 1.151 2006/07/05 12:18:02 kkhan Exp $ --> +<!-- $Id: build.xml,v 1.152 2006/07/10 15:27:11 kkhan Exp $ --> <project default="main" name="JBoss/AOP"> @@ -612,7 +612,7 @@ <src path="${source.tests.java}"/> <classpath refid="test.classpath"/> <include name="**/*.java"/> - <exclude name="org/jboss/test/aop/jdk15/**/*.java"/> + <exclude name="org/jboss/test/aop/jdk15*/**/*.java"/> <exclude name="org/jboss/test/aop/memoryleaks/**/*.java"/> </javac> </target> |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:32
|
User: kkhan Date: 06/07/10 11:00:23 Added: src/test/org/jboss/test/aop/jdk15annotated CFlowAspect.java AnotherPOJO.java Interceptions.java PrecedenceAspect1.java CountingInterceptorFactory.java SimpleDynamicCFlow.java PrecedenceInterceptor2.java AnnotatedTestCase.java PreparePOJO.java AspectPerVM.java NoInterfacesPOJO2.java IntroducedAnnotationPOJO.java CountingInterceptor.java EmptyInterface.java AspectPerInstance.java VariaPOJO.java IntroducedAnnotationInterceptor.java PrecedenceInterceptor1.java TypedefAspect.java AspectFromFactory.java Precedence1.java ExternalizableMixin.java Precedence2.java PreparedPOJO.java POJO2.java AspectPerClass.java AnnotatedAspectFactory.java POJO.java MyAnnotation.java NoInterfacesPOJO.java IntroductionAspect.java Log: Make a start migrating to jboss retro Revision Changes Path 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/CFlowAspect.java Index: CFlowAspect.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.*; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.*; import org.jboss.aop.pointcut.CFlowStack; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ * */ @Aspect(scope = Scope.PER_VM) public class CFlowAspect { public static int cflowAccess; @CFlowStackDef (cflows={@CFlowDef(expr = "void org.jboss.test.aop.jdk15annotated.VariaPOJO->cflowMethod1()", called=true), @CFlowDef(expr = "void org.jboss.test.aop.jdk15annotated.VariaPOJO->cflowMethod2()", called=true)}) public static CFlowStack cf1And2Stack; @CFlowStackDef (cflows={@CFlowDef(expr = "void org.jboss.test.aop.jdk15annotated.VariaPOJO->cflowMethod1()", called=false), @CFlowDef(expr = "void org.jboss.test.aop.jdk15annotated.VariaPOJO->cflowMethod2()", called=true)}) public static CFlowStack cfNot1And2Stack; @org.jboss.aop.Bind (pointcut="execution(void org.jboss.test.aop.jdk15annotated.VariaPOJO*->privateMethod())", cflow="(org.jboss.test.aop.jdk15annotated.CFlowAspect.cf1And2Stack OR org.jboss.test.aop.jdk15annotated.CFlowAspect.cfNot1And2Stack)") public Object cflowAdvice(Invocation invocation) throws Throwable { System.out.println("CFlowAspect.cflowAdvice"); cflowAccess++; return invocation.invokeNext(); } @org.jboss.aop.Bind (pointcut="execution(void org.jboss.test.aop.jdk15annotated.VariaPOJO*->dynamicCFlowMethod())", cflow="org.jboss.test.aop.jdk15annotated.SimpleDynamicCFlow") public Object dynamicCFlowAdvice(Invocation invocation) throws Throwable { System.out.println("CFlowAspect.dynamicCFlowAdvice"); cflowAccess++; return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/AnotherPOJO.java Index: AnotherPOJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * Created by IntelliJ IDEA. * User: Kab * Date: 15-Sep-2004 * Time: 21:18:26 * To change this template use File | Settings | File Templates. */ public class AnotherPOJO { public AnotherPOJO() { System.out.println("AnotherPOJO someMethod()"); } public int field; public void someMethod() { System.out.println("AnotherPOJO someMethod()"); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/Interceptions.java Index: Interceptions.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import java.util.ArrayList; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class Interceptions { static ArrayList intercepted = new ArrayList(); public static void add(String name) { System.out.println("Adding (a) " + name); intercepted.add(name); } public static ArrayList getIntercepted() { return intercepted; } public static void reset() { intercepted = new ArrayList(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/PrecedenceAspect1.java Index: PrecedenceAspect1.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.joinpoint.Invocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @Aspect (scope=org.jboss.aop.advice.Scope.PER_VM) public class PrecedenceAspect1 { @Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO->precedenceMethod())") public Object advice1(Invocation invocation) throws Throwable { Interceptions.add("PrecedenceAspect1.advice1"); System.out.println("PrecedenceAspect1.advice1"); return invocation.invokeNext(); } @Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO->precedenceMethod())") public Object advice2(Invocation invocation) throws Throwable { Interceptions.add("PrecedenceAspect1.advice2"); System.out.println("PrecedenceAspect1.advice2"); return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/CountingInterceptorFactory.java Index: CountingInterceptorFactory.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Advisor; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AspectFactory; import org.jboss.aop.joinpoint.Joinpoint; /** * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @org.jboss.aop.InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) @org.jboss.aop.Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO*->methodWithInterceptorFactory())") public class CountingInterceptorFactory implements AspectFactory { public Object createPerVM() { return new CountingInterceptor(); } public Object createPerClass(Advisor advisor) { return new CountingInterceptor(); } public Object createPerInstance(Advisor advisor, InstanceAdvisor instanceAdvisor) { return new CountingInterceptor(); } public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { return new CountingInterceptor(); } public Object createPerJoinpoint(Advisor advisor, InstanceAdvisor instanceAdvisor, Joinpoint jp) { return new CountingInterceptor(); } public String getName() { return getClass().getName(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/SimpleDynamicCFlow.java Index: SimpleDynamicCFlow.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.DynamicCFlowDef; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.pointcut.DynamicCFlow; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @DynamicCFlowDef public class SimpleDynamicCFlow implements DynamicCFlow { public static boolean execute = false; public boolean shouldExecute(Invocation invocation) { return execute; } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/PrecedenceInterceptor2.java Index: PrecedenceInterceptor2.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) @Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO->precedenceMethod())") public class PrecedenceInterceptor2 implements Interceptor { public String getName() { return "PrecedenceInterceptor2"; } public Object invoke(Invocation invocation) throws Throwable { Interceptions.add("PrecedenceInterceptor2"); System.out.println("PrecedenceInterceptor2"); return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/AnnotatedTestCase.java Index: AnnotatedTestCase.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.jboss.aop.Advised; import org.jboss.aop.Advisor; import org.jboss.aop.AspectManager; import org.jboss.aop.InstanceAdvisor; import org.jboss.aop.advice.AdviceBinding; import org.jboss.aop.advice.AdviceFactory; import org.jboss.aop.advice.AspectDefinition; import org.jboss.test.aop.AOPTestWithSetup; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public class AnnotatedTestCase extends AOPTestWithSetup { public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("AnnotatedTester"); suite.addTestSuite(AnnotatedTestCase.class); return suite; } public AnnotatedTestCase(String name) { super(name); } protected void setUp() throws Exception { super.setUp(); //This should go in the startService() method of the injboss testsuite // testBinding(); // testCompostition(); // testMixin(); // testIntroduction(); // testInterceptorDef(); // testTypedef(); // testCFlow(); // testPrepare(); // testPrepareAtClassLevel(); // testDynamicCFlow(); // testAnnotationIntroduction(); // testAspectFactory(); } public void testBinding() throws Exception { System.out.println("***** testBinding() ****"); AspectPerVM vm = null; AspectPerClass perClass = null; AspectPerClass perClass2 = null; try { System.out.println("---- POJO ---"); POJO pojo = new POJO(); pojo.field++; pojo.someMethod(); System.out.println("---- POJO2 ---"); POJO2 pojo2 = new POJO2(); pojo2.field++; pojo2.someMethod(); System.out.println("-- get stats --"); vm = (AspectPerVM) AspectManager.instance().getPerVMAspect("org.jboss.test.aop.jdk15annotated.AspectPerVM"); System.out.println("perVM stats: " + vm.constructorCalled + " " + vm.methodCalled + " " + vm.fieldRead + " " + vm.fieldWrite); assertEquals(2, vm.constructorCalled); assertEquals(2, vm.methodCalled); assertEquals(2, vm.fieldRead); assertEquals(2, vm.fieldWrite); Advisor advisor = ((Advised) pojo)._getAdvisor(); perClass = (AspectPerClass) advisor.getPerClassAspect("org.jboss.test.aop.jdk15annotated.AspectPerClass"); System.out.println("POJO perClass stats: " + perClass.constructorCalled + " " + perClass.methodCalled + " " + perClass.fieldRead + " " + perClass.fieldWrite); assertEquals(1, perClass.constructorCalled); assertEquals(1, perClass.methodCalled); assertEquals(1, perClass.fieldRead); assertEquals(1, perClass.fieldWrite); advisor = ((Advised) pojo2)._getAdvisor(); perClass2 = (AspectPerClass) advisor.getPerClassAspect("org.jboss.test.aop.jdk15annotated.AspectPerClass"); System.out.println("POJO2 perClass stats: " + perClass.constructorCalled + " " + perClass.methodCalled + " " + perClass.fieldRead + " " + perClass.fieldWrite); assertEquals(1, perClass2.constructorCalled); assertEquals(1, perClass2.methodCalled); assertEquals(1, perClass2.fieldRead); assertEquals(1, perClass2.fieldWrite); InstanceAdvisor ia = ((Advised) pojo)._getInstanceAdvisor(); AspectPerInstance perInstance = (AspectPerInstance) ia.getPerInstanceAspect("org.jboss.test.aop.jdk15annotated.AspectPerInstance"); System.out.println("pojo perInstance stats: " + perInstance.methodCalled + " " + perInstance.fieldRead + " " + perInstance.fieldWrite); assertEquals(1, perInstance.methodCalled); assertEquals(1, perInstance.fieldRead); assertEquals(1, perInstance.fieldWrite); ia = ((Advised) pojo2)._getInstanceAdvisor(); perInstance = (AspectPerInstance) ia.getPerInstanceAspect("org.jboss.test.aop.jdk15annotated.AspectPerInstance"); System.out.println("pojo2 perInstance stats: " + perInstance.methodCalled + " " + perInstance.fieldRead + " " + perInstance.fieldWrite); assertEquals(1, perInstance.methodCalled); assertEquals(1, perInstance.fieldRead); assertEquals(1, perInstance.fieldWrite); } finally { if (vm != null) vm.reset(); if (perClass != null) perClass.reset(); if (perClass2 != null) perClass2.reset(); } } public void testCompostition() throws Exception { AspectPerVM vm = null; try { System.out.println("***** testCompostition() ****"); System.out.println("---- AnotherPOJO ---"); AnotherPOJO apojo = new AnotherPOJO(); apojo.field++; apojo.someMethod(); vm = (AspectPerVM) AspectManager.instance().getPerVMAspect("org.jboss.test.aop.jdk15annotated.AspectPerVM"); assertEquals(4, vm.anotherPOJOAccess); } finally { if (vm != null) vm.reset(); } } public void testMixin() throws Exception { System.out.println("***** testMixin() ****"); ExternalizableMixin.write = false; ExternalizableMixin.read = false; NoInterfacesPOJO pojo = new NoInterfacesPOJO(); pojo.stuff = "hello world"; java.rmi.MarshalledObject mo = new java.rmi.MarshalledObject(pojo); pojo = (NoInterfacesPOJO)mo.get(); System.out.println("deserialized pojo2.stuff2: " + pojo.stuff); assertTrue("writeExternal was not called", ExternalizableMixin.write); assertTrue("readExternal was not called", ExternalizableMixin.read); ExternalizableMixin.write = false; ExternalizableMixin.read = false; NoInterfacesPOJO2 pojo2 = new NoInterfacesPOJO2(); pojo2.stuff = "whatever"; java.rmi.MarshalledObject mo2 = new java.rmi.MarshalledObject(pojo2); pojo2 = (NoInterfacesPOJO2)mo2.get(); System.out.println("deserialized pojo2.stuff2: " + pojo2.stuff); assertTrue("writeExternal was not called for pojo2", ExternalizableMixin.write); assertTrue("readExternal was not called for pojo2", ExternalizableMixin.read); } public void testIntroduction() throws Exception { System.out.println("***** testIntroduction() ****"); NoInterfacesPOJO pojo = new NoInterfacesPOJO(); try { EmptyInterface eif = (EmptyInterface)pojo; } catch(Exception e) { throw new RuntimeException("pojo does not implement EmptyInterface"); } NoInterfacesPOJO2 pojo2 = new NoInterfacesPOJO2(); try { EmptyInterface eif = (EmptyInterface)pojo2; } catch(Exception e) { throw new RuntimeException("pojo2 does not implement EmptyInterface"); } } public void testInterceptorDef()throws Exception { System.out.println("***** testInterceptorDef() ****"); CountingInterceptor.count = 0; VariaPOJO pojo = new VariaPOJO(); pojo.methodWithInterceptor(); System.out.println("Count: " + CountingInterceptor.count); assertEquals("execution of POJO.methodWithInterceptor() was not intercepted", 1, CountingInterceptor.count); CountingInterceptor.count = 0; pojo.methodWithInterceptorFactory(); System.out.println("Count: " + CountingInterceptor.count); assertEquals("execution of POJO.methodWithInterceptorFactory() was not intercepted", 1, CountingInterceptor.count); } public void testTypedef()throws Exception { System.out.println("***** testTypedef() ****"); VariaPOJO pojo = new VariaPOJO(); pojo.methodWithTypedef(); System.out.println("Intercepted: " + TypedefAspect.intercepted); assertTrue("execution of POJO.methodWithTypedef() was not intercepted", TypedefAspect.intercepted); } public void testCFlow()throws Exception { System.out.println("***** testCFlow() ****"); CFlowAspect.cflowAccess = 0; VariaPOJO pojo = new VariaPOJO(); pojo.cflowMethod1(); assertEquals("Wrong number of interceptions 1) for cflow Advice", 1, CFlowAspect.cflowAccess); CFlowAspect.cflowAccess = 0; pojo.cflowMethod2(); System.out.println("ints: " + CFlowAspect.cflowAccess); assertEquals("Wrong number of interceptions 2) for cflow Advice", 1, CFlowAspect.cflowAccess ); } public void testPrepare()throws Exception { System.out.println("***** testPrepare() ****"); PreparePOJO pojo = new PreparePOJO(); pojo.someMethod(); Advised advised = (Advised)pojo; Advisor advisor = advised._getAdvisor(); } public void testPrepareAtClassLevel() throws Exception { System.out.println("***** testPrepareAtClassLevel() ****"); PreparedPOJO pojo = new PreparedPOJO(); pojo.someMethod(); Advised advised = (Advised)pojo; Advisor advisor = advised._getAdvisor(); } public void testDynamicCFlow()throws Exception { System.out.println("***** testDynamicCFlow() ****"); CFlowAspect.cflowAccess = 0; VariaPOJO pojo = new VariaPOJO(); pojo.dynamicCFlowMethod(); assertEquals("Wrong number of interceptions for dynamic cflow Advice", 0, CFlowAspect.cflowAccess); SimpleDynamicCFlow.execute = true; pojo.dynamicCFlowMethod(); assertEquals("Wrong number of interceptions for dynamic cflow Advice", 1, CFlowAspect.cflowAccess); SimpleDynamicCFlow.execute = false; pojo.dynamicCFlowMethod(); assertEquals("Wrong number of interceptions for dynamic cflow Advice (2)", 1, CFlowAspect.cflowAccess); } public void testAnnotationIntroduction() throws Exception { System.out.println("***** testAnnotationIntroduction() ****"); IntroducedAnnotationPOJO pojo = new IntroducedAnnotationPOJO(); assertNull("IntroducedAnnotationPOJO should not have had a constructor annotation", IntroducedAnnotationInterceptor.lastMyAnnotation); pojo.annotationIntroductionMethod(); MyAnnotation annotation = IntroducedAnnotationInterceptor.lastMyAnnotation; assertNotNull("IntroducedAnnotationPOJO.annotationIntroductionMethod() should have had a method annotation", annotation); assertEquals("Wrong value for MyAnnotation.string()", "hello", annotation.string()); assertEquals("Wrong value for MyAnnotation.integer()", 5, annotation.integer()); assertEquals("Wrong value for MyAnnotation.bool()", true, annotation.bool()); pojo.noAnnotationIntroductionMethod(); assertNull("IntroducedAnnotationPOJO.noAnnotationIntroductionMethod() should not have had a method annotation", IntroducedAnnotationInterceptor.lastMyAnnotation); } public void testPrecedence() throws Exception { System.out.println("***** testPrecedence() ****"); VariaPOJO pojo = new VariaPOJO(); pojo.precedenceMethod(); String[] expected = {"PrecedenceInterceptor1", "PrecedenceAspect1.advice1", "PrecedenceAspect1.advice2", "PrecedenceInterceptor2"}; java.util.ArrayList intercepted = Interceptions.intercepted; assertEquals("Wrong number of interceptions", expected.length ,intercepted.size()); for (int i = 0 ; i < expected.length ; i++) { assertEquals("Wrong interception at index " + i, expected[i], (String)intercepted.get(i)); } } /** * Tests the annotation of an aspect factory as @Aspect. */ public void testAspectFactory() throws Exception { AdviceBinding binding = new AdviceBinding( "execution(void *PreparedPOJO->someMethod(..))", null); AspectDefinition aspectDefinition = AspectManager.instance() .getAspectDefinition(AnnotatedAspectFactory.class.getName()); assertNotNull(aspectDefinition); binding.addInterceptorFactory(new AdviceFactory(aspectDefinition, "advice")); AspectManager.instance().addBinding(binding); PreparedPOJO pojo = new PreparedPOJO(); pojo.someMethod(); assertTrue(AnnotatedAspectFactory.isAspectCreated()); assertTrue(AnnotatedAspectFactory.getAspectCreated().isAdvised()); AspectManager.instance().removeBinding(binding.getName()); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/PreparePOJO.java Index: PreparePOJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class PreparePOJO { public void someMethod() { System.out.println("PreparePOJO someMethod()"); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/AspectPerVM.java Index: AspectPerVM.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.*; import org.jboss.aop.Prepare; import org.jboss.aop.pointcut.Pointcut; import org.jboss.aop.pointcut.CFlowStack; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.*; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ @Aspect(scope = Scope.PER_VM) public class AspectPerVM { public int constructorCalled; public int methodCalled; public int fieldRead; public int fieldWrite; public int anotherPOJOAccess; @PointcutDef("execution(org.jboss.test.aop.jdk15annotated.AnotherPOJO->new(..))") public static Pointcut anotherPOJOConstructors; @PointcutDef("get(* org.jboss.test.aop.jdk15annotated.AnotherPOJO->field)") public static Pointcut anotherPOJOFieldReads; @PointcutDef("set(* org.jboss.test.aop.jdk15annotated.AnotherPOJO->field)") public static Pointcut anotherPOJOFieldWrites; @PointcutDef("execution(* org.jboss.test.aop.jdk15annotated.AnotherPOJO->*(..))") public static Pointcut anotherPOJOPublicMethods; @PointcutDef("org.jboss.test.aop.jdk15annotated.AspectPerVM.anotherPOJOFieldWrites OR org.jboss.test.aop.jdk15annotated.AspectPerVM.anotherPOJOFieldReads") public static Pointcut anotherPOJOFields; @Prepare ("all(org.jboss.test.aop.jdk15annotated.PreparePOJO)") public static Pointcut preparePOJO; @Bind(pointcut = "execution(org.jboss.test.aop.jdk15annotated.POJO*->new())") public Object constructorAdvice(ConstructorInvocation invocation) throws Throwable { System.out.println("AspectPerVM.constructorAdvice accessing: " + invocation.getConstructor().toString()); constructorCalled++; return invocation.invokeNext(); } @Bind(pointcut = "execution(void org.jboss.test.aop.jdk15annotated.POJO*->someMethod())") public Object methodAdvice(MethodInvocation invocation) throws Throwable { System.out.println("AspectPerVM.methodAdvice accessing: " + invocation.getMethod().toString()); methodCalled++; return invocation.invokeNext(); } @Bind(pointcut = "set(* org.jboss.test.aop.jdk15annotated.POJO*->field)") public Object fieldAdvice(FieldWriteInvocation invocation) throws Throwable { System.out.println("AspectPerVM.fieldAdvice writing to field: " + invocation.getField().getName()); fieldWrite++; return invocation.invokeNext(); } @Bind(pointcut = "get(* org.jboss.test.aop.jdk15annotated.POJO*->field)") public Object fieldAdvice(FieldReadInvocation invocation) throws Throwable { System.out.println("AspectPerVM.fieldAdvice reading field: " + invocation.getField().getName()); fieldRead++; return invocation.invokeNext(); } @Bind(pointcut = "org.jboss.test.aop.jdk15annotated.AspectPerVM.anotherPOJOFields OR org.jboss.test.aop.jdk15annotated.AspectPerVM.anotherPOJOConstructors OR org.jboss.test.aop.jdk15annotated.AspectPerVM.anotherPOJOPublicMethods") public Object anotherPOJOAdvice(Invocation invocation) throws Throwable { System.out.println("AspectPerVM.anotherPOJOAdvice"); anotherPOJOAccess++; return invocation.invokeNext(); } public void reset() { constructorCalled = 0; methodCalled = 0; fieldRead = 0; fieldWrite = 0; anotherPOJOAccess = 0; } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/NoInterfacesPOJO2.java Index: NoInterfacesPOJO2.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class NoInterfacesPOJO2 extends NoInterfacesPOJO { public void pojoInterfaces2Method() { } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/IntroducedAnnotationPOJO.java Index: IntroducedAnnotationPOJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class IntroducedAnnotationPOJO { public IntroducedAnnotationPOJO() { System.out.println("IntroducedAnnotationPOJO constructor"); } public void annotationIntroductionMethod() { System.out.println("IntroducedAnnotationPOJO annotationIntroductionMethod"); } public void noAnnotationIntroductionMethod() { System.out.println("IntroducedAnnotationPOJO noAnnotationIntroductionMethod"); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/CountingInterceptor.java Index: CountingInterceptor.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import java.lang.reflect.Field; import java.lang.reflect.Method; import org.jboss.aop.joinpoint.FieldReadInvocation; import org.jboss.aop.joinpoint.FieldWriteInvocation; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @org.jboss.aop.InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) @org.jboss.aop.Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO*->methodWithInterceptor())") public class CountingInterceptor implements org.jboss.aop.advice.Interceptor { public String getName() { return "CountingInterceptor"; } public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { System.out.println("CountingInterceptor interception: " + invocation.getClass().getName()); count++; System.out.println("CountingInterceptor.count:" + count); return invocation.invokeNext(); } public static int count; } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/EmptyInterface.java Index: EmptyInterface.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public interface EmptyInterface { } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/AspectPerInstance.java Index: AspectPerInstance.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.advice.Scope; import org.jboss.aop.joinpoint.FieldReadInvocation; import org.jboss.aop.joinpoint.FieldWriteInvocation; import org.jboss.aop.joinpoint.MethodInvocation; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ @Aspect(scope = Scope.PER_INSTANCE) public class AspectPerInstance { public int methodCalled; public int fieldRead; public int fieldWrite; @Bind(pointcut = "execution(void org.jboss.test.aop.jdk15annotated.POJO*->someMethod())") public Object methodAdvice(MethodInvocation invocation) throws Throwable { System.out.println("AspectPerInstance.methodAdvice accessing: " + invocation.getMethod().toString()); methodCalled++; return invocation.invokeNext(); } @Bind(pointcut = "set(* org.jboss.test.aop.jdk15annotated.POJO*->field)") public Object fieldAdvice(FieldWriteInvocation invocation) throws Throwable { System.out.println("AspectPerInstance.fieldAdvice writing to field: " + invocation.getField().getName()); fieldWrite++; return invocation.invokeNext(); } @Bind(pointcut = "get(* org.jboss.test.aop.jdk15annotated.POJO*->field)") public Object fieldAdvice(FieldReadInvocation invocation) throws Throwable { System.out.println("AspectPerInstance.fieldAdvice reading field: " + invocation.getField().getName()); fieldRead++; return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/VariaPOJO.java Index: VariaPOJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class VariaPOJO { public void methodWithInterceptor() { System.out.println("POJO methodWithInterceptor"); } public void methodWithInterceptorFactory() { System.out.println("POJO methodWithInterceptorFactory"); } public void methodWithTypedef() { System.out.println("POJO methodWithTypedef"); } public void cflowMethod1() { System.out.println("POJO cflowMethod1"); cflowMethod2(); } public void cflowMethod2() { System.out.println("POJO cflowMethod2"); privateMethod(); } public void dynamicCFlowMethod() { System.out.println("POJO dynamicCFlowMethod"); } private void privateMethod() { System.out.println("POJO privateMethod"); } public void precedenceMethod() { System.out.println("POJO precedenceMethod"); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/IntroducedAnnotationInterceptor.java Index: IntroducedAnnotationInterceptor.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import org.jboss.aop.AnnotationIntroductionDef; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.annotation.AnnotationElement; import org.jboss.aop.introduction.AnnotationIntroduction; import org.jboss.aop.joinpoint.ConstructorInvocation; import org.jboss.aop.joinpoint.Invocation; import org.jboss.aop.joinpoint.MethodInvocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) @Bind (pointcut="all(org.jboss.test.aop.jdk15annotated.IntroducedAnnotationPOJO)") public class IntroducedAnnotationInterceptor implements Interceptor { @AnnotationIntroductionDef (expr="method(* org.jboss.test.aop.jdk15annotated.IntroducedAnnotationPOJO->annotationIntroductionMethod())", invisible=false, annotation="@org.jboss.test.aop.jdk15annotated.MyAnnotation (string='hello', integer=5, bool=true)") public static AnnotationIntroduction annotationIntroduction; public static MyAnnotation lastMyAnnotation; public String getName() { return "TestAnnotationInterceptor"; } public Object invoke(Invocation invocation) throws Throwable { System.out.println("IntroducedInterceptor"); if (invocation instanceof MethodInvocation) { Method method = ((MethodInvocation)invocation).getMethod(); System.out.println("executing method " + method.toString()); MyAnnotation myAnn = (MyAnnotation)AnnotationElement.getAnyAnnotation(method, MyAnnotation.class); lastMyAnnotation = myAnn; } else if (invocation instanceof ConstructorInvocation) { Constructor constructor = ((ConstructorInvocation)invocation).getConstructor(); System.out.println("executing constructor " + constructor); MyAnnotation myAnn = (MyAnnotation)AnnotationElement.getAnyAnnotation(constructor, MyAnnotation.class); lastMyAnnotation = myAnn; } return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/PrecedenceInterceptor1.java Index: PrecedenceInterceptor1.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Bind; import org.jboss.aop.InterceptorDef; import org.jboss.aop.advice.Interceptor; import org.jboss.aop.joinpoint.Invocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @InterceptorDef (scope=org.jboss.aop.advice.Scope.PER_VM) @Bind (pointcut="execution(* org.jboss.test.aop.jdk15annotated.VariaPOJO->precedenceMethod())") public class PrecedenceInterceptor1 implements Interceptor { public String getName() { return "PrecedenceInterceptor1"; } public Object invoke(Invocation invocation) throws Throwable { Interceptions.add("PrecedenceInterceptor1"); System.out.println("PrecedenceInterceptor1"); return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/TypedefAspect.java Index: TypedefAspect.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.Aspect; import org.jboss.aop.Bind; import org.jboss.aop.TypeDef; import org.jboss.aop.pointcut.Typedef; import org.jboss.aop.joinpoint.Invocation; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @Aspect (scope=org.jboss.aop.advice.Scope.PER_VM) public class TypedefAspect { public static boolean intercepted; @TypeDef ("class(org.jboss.test.aop.jdk15annotated.VariaPOJO)") public static Typedef myTypedef; @Bind (pointcut="execution(* $typedef{org.jboss.test.aop.jdk15annotated.TypedefAspect.myTypedef}->methodWithTypedef())") public Object typedefAdvice(Invocation invocation) throws Throwable { intercepted = true; return invocation.invokeNext(); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotated/AspectFromFactory.java Index: AspectFromFactory.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotated; import org.jboss.aop.joinpoint.Invocation; /** * Aspect generated by AnnotatedAspectFactory. * @author Flavia Rainone *... [truncated message content] |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:30
|
User: kkhan Date: 06/07/10 11:00:24 Added: src/test/org/jboss/test/aop/jdk15base AnnotatedPOJO.java traceable.java SomeIntroduction.java complex.java single.java trace.java MyEnum.java AOPTester.java SimpleInterceptor.java Introduction.java Log: Make a start migrating to jboss retro Revision Changes Path 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/AnnotatedPOJO.java Index: AnnotatedPOJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ @trace @traceable public class AnnotatedPOJO { @trace public int field; public int nontraceable; @trace public AnnotatedPOJO() { } public AnnotatedPOJO(String s) { System.out.println("POJO Constructor: " + s); } @trace public void someMethod() { System.out.println("POJO.someMethod"); } public void nontraceableMethod() { System.out.println("POJO.anotherMethod"); } } 1.1 date: 2006/07/10 15:00:23; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/traceable.java Index: traceable.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public @interface traceable { } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/SomeIntroduction.java Index: SomeIntroduction.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public class SomeIntroduction implements Introduction { public SomeIntroduction(Object objIntroduced) { } public String helloWorld(String str) { return "hello " + str; } } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/complex.java Index: complex.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Comment * * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface complex { char ch(); String string(); float flt(); double dbl(); short shrt(); long lng(); int integer(); boolean bool(); single annotation(); String[] array(); Class clazz(); MyEnum enumVal(); } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/single.java Index: single.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * Comment * * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public @interface single { String value(); } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/trace.java Index: trace.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ @Retention(RetentionPolicy.RUNTIME) public @interface trace { } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/MyEnum.java Index: MyEnum.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * Comment * * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public enum MyEnum { ONE, TWO; } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/AOPTester.java Index: AOPTester.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; import org.jboss.aop.annotation.AnnotationCreator; import org.jboss.test.aop.AOPTestWithSetup; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public class AOPTester extends AOPTestWithSetup { public static void main(String[] args) { TestRunner.run(suite()); } private void printComplex(complex c) { System.out.print("@complex (ch='" + c.ch() + "', "); System.out.print("\"" + c.string() + "\", "); System.out.print("flt=" + c.flt() + ", "); System.out.print("enumVal=" + c.enumVal() + ", "); System.out.println("dbl=" + c.dbl() + ", ...blah blah blah YOU GET THE IDEA..."); } public static Test suite() { TestSuite suite = new TestSuite("AOPTester"); suite.addTestSuite(AOPTester.class); return suite; } public AOPTester(String name) { super(name); } // Public ------------------------------------------------------- public void testCreateAnnotation() throws Exception { String expr = "@org.jboss.test.aop.jdk15base.complex (ch='a', string=\"hello world\", flt=5.5, dbl=6.6, shrt=5, lng=6, integer=7, bool=true, annotation=@org.jboss.test.aop.jdk15base.single(\"hello\"), array={\"hello\", \"world\"}, clazz=java.lang.String, enumVal=org.jboss.test.aop.jdk15base.MyEnum.ONE)"; complex c = (complex) AnnotationCreator.createAnnotation(expr, complex.class); if (c == null) throw new RuntimeException("failed to get @complex"); if (c.ch() != 'a') throw new RuntimeException("@complex.ch has wrong value"); if (!c.string().equals("hello world")) throw new RuntimeException("@complex.string has wrong value"); if (c.flt() != 5.5) throw new RuntimeException("@complex.flt has wrong value"); if (c.dbl() != 6.6) throw new RuntimeException("@complex.dbl has wrong value"); if (c.shrt() != 5) throw new RuntimeException("@complex.shrt has wrong value"); if (c.lng() != 6) throw new RuntimeException("@complex.lng has wrong value"); if (c.integer() != 7) throw new RuntimeException("@complex.integer has wrong value"); if (c.bool() == false) throw new RuntimeException("@complex.bool has wrong value"); single s = c.annotation(); if (s == null) throw new RuntimeException("@complex.annotation is null"); if (!s.value().equals("hello")) throw new RuntimeException("@complex.annotation has wrong value"); if (!c.array()[0].equals("hello")) throw new RuntimeException("@complex.array[0] has wrong value"); if (!c.array()[1].equals("world")) throw new RuntimeException("@complex.array[1] has wrong value"); if (!java.lang.String.class.equals(c.clazz())) throw new RuntimeException("@complex.clazz has wrong value"); if (c.enumVal() != MyEnum.ONE) throw new RuntimeException("@complex.enumVal has wrong value"); } public void testAnnotation() { System.out.println("RUNNING TEST BASIC"); SimpleInterceptor.intercepted = false; AnnotatedPOJO pojo = new AnnotatedPOJO(); if (!SimpleInterceptor.intercepted) throw new RuntimeException("failed to intercept tagged constructor"); complex c = (complex) AnnotatedPOJO.class.getAnnotation(complex.class); printComplex(c); SimpleInterceptor.intercepted = false; pojo = new AnnotatedPOJO("no interception"); if (SimpleInterceptor.intercepted) throw new RuntimeException("should not intercept non-tagged constructor"); pojo.someMethod(); if (!SimpleInterceptor.intercepted) throw new RuntimeException("failed to intercept tagged method"); SimpleInterceptor.intercepted = false; pojo.nontraceableMethod(); if (SimpleInterceptor.intercepted) throw new RuntimeException("should not intercept non-tagged method"); pojo.field = 5; if (!SimpleInterceptor.intercepted) throw new RuntimeException("failed to intercept tagged field"); SimpleInterceptor.intercepted = false; pojo.nontraceable = 25; if (SimpleInterceptor.intercepted) throw new RuntimeException("should not intercept non-tagged field"); Introduction intro = (Introduction) pojo; intro.helloWorld("hello"); } } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/SimpleInterceptor.java Index: SimpleInterceptor.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public class SimpleInterceptor implements org.jboss.aop.advice.Interceptor { public String getName() { return "SimpleInterceptor"; } public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable { intercepted = true; return invocation.invokeNext(); } public static boolean intercepted; } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15base/Introduction.java Index: Introduction.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15base; /** * @author <a href="mailto:bi...@jb...">Bill Burke</a> * @version $Revision: 1.1 $ */ public interface Introduction { public String helloWorld(String str); } |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:30
|
User: kkhan Date: 06/07/10 11:00:24 Modified: src/test/org/jboss/test/aop/regression/jbaop217typedefredeploy TypeDefRedeployTestCase.java Log: Make a start migrating to jboss retro Revision Changes Path 1.4 +2 -2 jboss-aop/src/test/org/jboss/test/aop/regression/jbaop217typedefredeploy/TypeDefRedeployTestCase.java (In the diff below, changes in quantity of whitespace are not shown.) Index: TypeDefRedeployTestCase.java =================================================================== RCS file: /cvsroot/jboss/jboss-aop/src/test/org/jboss/test/aop/regression/jbaop217typedefredeploy/TypeDefRedeployTestCase.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- TypeDefRedeployTestCase.java 29 Jun 2006 15:05:05 -0000 1.3 +++ TypeDefRedeployTestCase.java 10 Jul 2006 15:00:24 -0000 1.4 @@ -19,7 +19,7 @@ * Tests that static is used correctly * * @author <a href="mailto:bi...@jb...">Bill Burke</a> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class TypeDefRedeployTestCase extends AOPTestWithSetup { @@ -62,7 +62,7 @@ URL url = this.getClass().getProtectionDomain().getCodeSource().getLocation(); System.out.println("class url: " + url); String location = url.toString(); - int index = location.indexOf("/output/tests.classes"); + int index = location.indexOf("/output/"); location = location.substring(0, index); location = location + "/src/resources/test/regression/jboss-aop.xml"; |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:30
|
User: kkhan Date: 06/07/10 11:00:24 Added: src/resources/test/jdk15base jboss-aop.xml Log: Make a start migrating to jboss retro Revision Changes Path 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/resources/test/jdk15base/jboss-aop.xml Index: jboss-aop.xml =================================================================== <?xml version="1.0" encoding="UTF-8"?> <aop> <bind pointcut="all(@org.jboss.test.aop.jdk15base.trace)"> <interceptor class="org.jboss.test.aop.jdk15base.SimpleInterceptor"/> </bind> <introduction class="@org.jboss.test.aop.jdk15base.traceable"> <mixin> <interfaces> org.jboss.test.aop.jdk15base.Introduction </interfaces> <class>org.jboss.test.aop.jdk15base.SomeIntroduction</class> <construction>new org.jboss.test.aop.jdk15base.SomeIntroduction(this)</construction> </mixin> </introduction> <annotation-introduction expr="class(org.jboss.test.aop.jdk15base.AnnotatedPOJO)" invisible="false"> @org.jboss.test.aop.jdk15base.complex (ch='a', string="hello world", flt=5.5, dbl=6.6, shrt=5, lng=6, integer=7, bool=true, annotation=@org.jboss.test.aop.jdk15base.single("hello"), array={"hello", "world"}, clazz=java.lang.String, enumVal=org.jboss.test.aop.jdk15base.MyEnum.ONE) </annotation-introduction> </aop> |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:30
|
User: kkhan Date: 06/07/10 11:00:24 Added: src/test/org/jboss/test/aop/jdk15annotateddeclare SystemOutDecorator.java DeclareAspect.java AnnotatedDeclareTestCase.java POJO.java Log: Make a start migrating to jboss retro Revision Changes Path 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotateddeclare/SystemOutDecorator.java Index: SystemOutDecorator.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotateddeclare; import java.io.OutputStream; import java.io.PrintStream; import java.util.ArrayList; /** * Wraps calls to System.out.println(String), and stores all Strings beginning * with "WARNING:" * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class SystemOutDecorator extends PrintStream { static PrintStream sysout = null; ArrayList warnings = new ArrayList(); public SystemOutDecorator(OutputStream out) { super(out); sysout = System.out; } public ArrayList getWarnings() { return warnings; } public void println(String msg) { super.println(msg); if (msg.startsWith("WARNING:")) { System.out.println(">>>>>"); super.println(msg); System.out.println("<<<<<"); warnings.add(msg); } } public static SystemOutDecorator initialise() { SystemOutDecorator sys = new SystemOutDecorator(System.out); System.setOut(sys); return sys; } public void kill() { System.setOut(sysout); } String getRidOfAllWhiteSpace(String msg) { StringBuffer sb = new StringBuffer(); for (int i = 0 ; i < msg.length() ; i++) { char ch = msg.charAt(i); if (ch != '\n' && ch != '\t' && ch != ' ' && ch != '\r') { sb.append(ch); } } return sb.toString(); } } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotateddeclare/DeclareAspect.java Index: DeclareAspect.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotateddeclare; import org.jboss.aop.pointcut.Pointcut; import org.jboss.aop.Aspect; import org.jboss.aop.DeclareError; import org.jboss.aop.DeclareWarning; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ @Aspect (scope=org.jboss.aop.advice.Scope.PER_VM) public class DeclareAspect { @DeclareError (expr="call(* org.jboss.test.aop.jdk15annotated.declare.POJO->someMethod()) AND withincode(* org.jboss.test.aop.jdk15annotated.declare.POJO->otherMethod())", msg="Should not happen") Pointcut error; @DeclareWarning (expr="call(* org.jboss.test.aop.jdk15annotated.declare.POJO->otherMethod()) AND withincode(* org.jboss.test.aop.jdk15annotated.declare.POJO->someMethod())", msg="Expected annotated warning") Pointcut warning; } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotateddeclare/AnnotatedDeclareTestCase.java Index: AnnotatedDeclareTestCase.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotateddeclare; import java.util.ArrayList; import org.jboss.test.aop.AOPTestWithSetup; import junit.framework.Test; import junit.framework.TestSuite; import junit.textui.TestRunner; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class AnnotatedDeclareTestCase extends AOPTestWithSetup { SystemOutDecorator out = null; public static void main(String[] args) { TestRunner.run(suite()); } public static Test suite() { TestSuite suite = new TestSuite("AnnotatedDeclareTestCase"); suite.addTestSuite(AnnotatedDeclareTestCase.class); return suite; } public AnnotatedDeclareTestCase(String name) { super(name); } protected void setUp() throws Exception { out = SystemOutDecorator.initialise(); super.setUp(); } public void testLoadtimeAnnotatedDeclare()throws Exception { System.out.println("*** testLoadtimeAnnotatedDeclare"); POJO pojo = new POJO(); pojo.someMethod(); ArrayList actual = out.getWarnings(); assertEquals("Wrong number of warnings generated", 1, actual.size()); String s = (String)actual.get(0); assertTrue("Warning does not end with the expected \"Expected annotated warning\"", s.endsWith("Expected annotated warning\n")); } } 1.1 date: 2006/07/10 15:00:24; author: kkhan; state: Exp;jboss-aop/src/test/org/jboss/test/aop/jdk15annotateddeclare/POJO.java Index: POJO.java =================================================================== /* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, 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.jdk15annotateddeclare; /** * * @author <a href="mailto:kab...@jb...">Kabir Khan</a> * @version $Revision: 1.1 $ */ public class POJO { void someMethod() { otherMethod(); } void otherMethod() { } } |
From: Kabir K. <kk...@jb...> - 2006-07-10 15:00:29
|
User: kkhan Date: 06/07/10 11:00:24 Modified: src/test/org/jboss/test/aop/regression/jbaop194_undeploy UndeployTester.java Log: Make a start migrating to jboss retro Revision Changes Path 1.4 +2 -2 jboss-aop/src/test/org/jboss/test/aop/regression/jbaop194_undeploy/UndeployTester.java (In the diff below, changes in quantity of whitespace are not shown.) Index: UndeployTester.java =================================================================== RCS file: /cvsroot/jboss/jboss-aop/src/test/org/jboss/test/aop/regression/jbaop194_undeploy/UndeployTester.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- UndeployTester.java 29 Jun 2006 15:05:21 -0000 1.3 +++ UndeployTester.java 10 Jul 2006 15:00:24 -0000 1.4 @@ -29,7 +29,7 @@ /** * * @author <a href="kab...@jb...">Kabir Khan</a> - * @version $Revision: 1.3 $ + * @version $Revision: 1.4 $ */ public class UndeployTester extends AOPTestWithSetup { @@ -58,7 +58,7 @@ URL url = pojo.getClass().getProtectionDomain().getCodeSource().getLocation(); System.out.println("class url: " + url); String location = url.toString(); - int index = location.indexOf("/output/tests.classes"); + int index = location.indexOf("/output/"); location = location.substring(0, index); location = location + "/src/resources/test/regression/jboss-aop.xml"; |
From: Manik S. <msu...@jb...> - 2006-07-10 14:58:55
|
User: msurtani Date: 06/07/10 10:58:53 Modified: src/org/jboss/cache/config Option.java Log: merged in changes from 1.4.0 Revision Changes Path 1.7 +9 -7 JBossCache/src/org/jboss/cache/config/Option.java (In the diff below, changes in quantity of whitespace are not shown.) Index: Option.java =================================================================== RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/config/Option.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- Option.java 1 Jun 2006 19:04:52 -0000 1.6 +++ Option.java 10 Jul 2006 14:58:53 -0000 1.7 @@ -9,7 +9,7 @@ import org.jboss.cache.optimistic.DataVersion; /** - * Used to override characteristics of specific calls to the cache. + * Used to override characteristics of specific calls to the cache. The javadocs of each of the setters below detail functionality and behaviour. * * @author <a href="mailto:ma...@jb...">Manik Surtani (ma...@jb...)</a> * @since 1.3.0 @@ -18,6 +18,7 @@ { private boolean failSilently; private boolean cacheModeLocal; + private DataVersion dataVersion; private boolean suppressLocking; private boolean forceDataGravitation; @@ -31,7 +32,7 @@ } /** - * + * Suppresses acquiring locks for the given invocation. Used with pessimistic locking only. Use with extreme care, may lead to a breach in data integrity! * @since 1.4.0 */ public void setSuppressLocking(boolean suppressLocking) @@ -39,7 +40,6 @@ this.suppressLocking = suppressLocking; } - private DataVersion dataVersion; /** * @@ -51,7 +51,7 @@ } /** - * + * suppress any failures in your cache operation, including version mismatches with optimistic locking, timeouts obtaining locks, transaction rollbacks. If this is option is set, the method invocation will __never fail or throw an exception__, although it may not succeed. With this option enabled the call will <b>not</b> participate in any ongoing transactions even if a transaction is running. * @since 1.3.0 */ public void setFailSilently(boolean failSilently) @@ -69,7 +69,7 @@ } /** - * only applies to put() and remove() methods on the cache. + * overriding CacheMode from REPL_SYNC, REPL_ASYNC, INVALIDATION_SYNC, INVALIDATION_ASYNC to LOCAL. Only applies to put() and remove() methods on the cache. * @since 1.3.0 * @param cacheModeLocal */ @@ -88,7 +88,7 @@ } /** - * + * Passing in an {@link org.jboss.cache.optimistic.DataVersion} instance when using optimistic locking will override the default behaviour of internally generated version info and allow the caller to handle data versioning. * @since 1.3.0 */ public void setDataVersion(DataVersion dataVersion) @@ -106,7 +106,9 @@ } /** - * + * Enables data gravitation calls if a cache miss is detected when using <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheBuddyReplicationDesign">Buddy Replication</a>. + * Enabled only for a given invocation, and only useful if <code>autoDataGravitation</code> is set to <code>false</code>. + * See <a href="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheBuddyReplicationDesign">Buddy Replication</a> documentation for more details. * @since 1.4.0 */ public void setForceDataGravitation(boolean enableDataGravitation) |
From: Manik S. <msu...@jb...> - 2006-07-10 14:58:55
|
User: msurtani Date: 06/07/10 10:58:53 Modified: src/org/jboss/cache/interceptors TxInterceptor.java Log: merged in changes from 1.4.0 Revision Changes Path 1.50 +25 -18 JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java (In the diff below, changes in quantity of whitespace are not shown.) Index: TxInterceptor.java =================================================================== RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -b -r1.49 -r1.50 --- TxInterceptor.java 6 Jul 2006 16:57:07 -0000 1.49 +++ TxInterceptor.java 10 Jul 2006 14:58:53 -0000 1.50 @@ -703,20 +703,27 @@ } catch (Throwable e) { - log.error("Commit failed. Issuing a commit on the local tx to clear stale locks.", e); + log.warn("Commit failed. Clearing stale locks."); try { - tx.commit(); + cleanupStaleLocks(gtx); } - catch (Exception e2) + catch (Throwable e2) { - log.error("Unable to re-run commit again to clear locks", e2); + log.error("Unable to clear stale locks", e2); throw new RuntimeException(e2); } - throw new RuntimeException("Commit failed, marking tx to be rolled back.", e); + throw new RuntimeException("Commit failed.", e); } } + + private void cleanupStaleLocks(GlobalTransaction gtx) throws Throwable + { + TransactionEntry entry = txTable.get(gtx); + entry.releaseAllLocksLIFO(gtx); + } + /** * creates a rollback() MethodCall and feeds it to handleCommitRollback(); * @param gtx |
From: Kabir K. <kk...@jb...> - 2006-07-10 14:55:47
|
User: kkhan Date: 06/07/10 10:55:44 Log: Directory /cvsroot/jboss/jboss-aop/src/resources/test/jdk15base added to the repository |
From: Kabir K. <kk...@jb...> - 2006-07-10 14:55:47
|
User: kkhan Date: 06/07/10 10:55:44 Log: Directory /cvsroot/jboss/jboss-aop/src/test/org/jboss/test/aop/jdk15annotated added to the repository |
From: Kabir K. <kk...@jb...> - 2006-07-10 14:55:46
|
User: kkhan Date: 06/07/10 10:55:45 Log: Directory /cvsroot/jboss/jboss-aop/src/test/org/jboss/test/aop/jdk15annotateddeclare added to the repository |
From: Kabir K. <kk...@jb...> - 2006-07-10 14:55:46
|
User: kkhan Date: 06/07/10 10:55:45 Log: Directory /cvsroot/jboss/jboss-aop/src/test/org/jboss/test/aop/jdk15base added to the repository |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:10
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/TreeCache/en master.xml Log: merged in changes from 1.4.0 Revision Changes Path 1.37 +9 -11 JBossCache/docs/TreeCache/en/master.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: master.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/master.xml,v retrieving revision 1.36 retrieving revision 1.37 diff -u -b -r1.36 -r1.37 --- master.xml 23 Jun 2006 06:22:42 -0000 1.36 +++ master.xml 10 Jul 2006 14:50:02 -0000 1.37 @@ -22,9 +22,8 @@ <subtitle>User Documentation</subtitle> - <releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo> - <pubdate>May 2006</pubdate> - +<releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo> + <pubdate>July 2006</pubdate> <author> <firstname>Bela</firstname> @@ -94,21 +93,20 @@ threads is presumed. No prior knowledge of JBoss Application Server is expected or required.</para> - <para>If you have questions, use the user <ulink - url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=157">forum</ulink> - linked on the JBoss Cache website. We also provide a mechanism for + <para>If you have questions, use the <ulink + url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=157">user forum</ulink> + linked on the <ulink url="http://labs.jboss.com/jbosscache">JBoss Cache website</ulink>. We also provide a mechanism for tracking bug reports and feature requests on the <ulink url="http://jira.jboss.com">JBoss JIRA issue tracker</ulink>. If you are interested in the development of JBoss Cache or in translating this documentation into other languages, we'd love to hear from you. Please - post a message on the user forum or contact us on the developer mailing - list.</para> + post a message on the user forum or contact us on the <ulink url="http://lists.jboss.org">developer mailing + list</ulink>.</para> <para>JBoss Cache is an open-source product based on LGPL. Commercial development support, production support and training for JBoss Cache is - available through JBoss Inc. (see <ulink url="http://www.jboss.com">JBoss - web site</ulink> ). JBoss Cache is a product in JBoss Professional Open - Source JEMS (JBoss Enterprise Middleware Suite).</para> + available through <ulink url="http://www.jboss.com">JBoss Inc.</ulink> JBoss Cache is a product in JBoss Professional Open + Source <ulink url="http://www.jboss.com/products/index">JEMS</ulink> (JBoss Enterprise Middleware Suite).</para> </preface> &introduction; |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:08
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/TreeCache/en/modules architecture.xml basic_api.xml compatibility.xml eviction_policies.xml introduction.xml replication.xml transactions.xml treecache_marshaller.xml Log: merged in changes from 1.4.0 Revision Changes Path 1.3 +1 -1 JBossCache/docs/TreeCache/en/modules/architecture.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: architecture.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/architecture.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- architecture.xml 1 Feb 2006 13:31:14 -0000 1.2 +++ architecture.xml 10 Jul 2006 14:50:02 -0000 1.3 @@ -12,7 +12,7 @@ </figure> <para>The architecture is shown above. The example shows 2 Java VMs, each - has created an instance of TreeCache. These VMs can be located on the same + has created an instance of <literal>TreeCache</literal>. These VMs can be located on the same machine, or on 2 different machines. The setup of the underlying group communication subsystem is done using <ulink url="http://www.jgroups.org">JGroups</ulink>.</para> 1.3 +17 -17 JBossCache/docs/TreeCache/en/modules/basic_api.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: basic_api.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/basic_api.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- basic_api.xml 1 Feb 2006 13:31:14 -0000 1.2 +++ basic_api.xml 10 Jul 2006 14:50:02 -0000 1.3 @@ -17,19 +17,19 @@ tree.destroyService(); // not necessary, but is same as MBean lifecycle </programlisting> - <para>The sample code first creates a TreeCache instance and then + <para>The sample code first creates a <literal>TreeCache</literal> instance and then configures it. There is another constructor which accepts a number of - configuration options. However, the TreeCache can be configured entirely + configuration options. However, the <literal>TreeCache</literal> can be configured entirely from an XML file (shown later) and we don't recommend manual configuration as shown in the sample.</para> <para>The cluster name, properties of the underlying JGroups stack, and cache mode (synchronous replication) are configured first (a list of - configuration options is shown later). Then we start the TreeCache. If - replication is enabled, this will make the TreeCache join the cluster, and acquire initial state from an existing node.</para> + configuration options is shown later). Then we start the <literal>TreeCache</literal>. If + replication is enabled, this will make the <literal>TreeCache</literal> join the cluster, and acquire initial state from an existing node.</para> <para>Then we add 2 items into the cache: the first element creates a node - "a" with a child node "b" that has a child node "c". (TreeCache by default + "a" with a child node "b" that has a child node "c". (<literal>TreeCache</literal> by default creates intermediary nodes that don't exist). The key "name" is then inserted into the "/a/b/c" node, with a value of "Ben".</para> @@ -49,8 +49,8 @@ </mediaobject> </figure> - <para>The TreeCache has 4 nodes "a", "b", "c" and "d". Nodes "/a/b/c" has - values "name" associated with "Ben" in its hashmap, and node "/a/b/c/d" + <para>The <literal>TreeCache</literal> has 4 nodes "a", "b", "c" and "d". Nodes "/a/b/c" has + values "name" associated with "Ben" in its map, and node "/a/b/c/d" has values "uid" and 322649.</para> <para>Each node can be retrieved by its absolute name (e.g. "/a/b/c") or @@ -64,9 +64,9 @@ recursively from the cache. In this case, nodes "/a/b/c/d", "/a/b/c" and "/a/b" will be removed, leaving only "/a".</para> - <para>Finally, the TreeCache is stopped. This will cause it to leave the + <para>Finally, the <literal>TreeCache</literal> is stopped. This will cause it to leave the cluster, and every node in the cluster will be notified. Note that - TreeCache can be stopped and started again. When it is stopped, all + <literal>TreeCache</literal> can be stopped and started again. When it is stopped, all contents will be deleted. And when it is restarted, if it joins a cache group, the state will be replicated initially. So potentially you can recreate the contents.</para> @@ -86,8 +86,8 @@ <para>In this example, we want to access a node that has information for employee with id=322649 in department with id=300. The string version - needs 2 hashmap lookups on Strings, whereas the Fqn version needs to - hashmap lookups on Integer. In a large hashtable, the hashCode() method + needs two map lookups on Strings, whereas the Fqn version needs two + map lookups on Integers. In a large hashtable, the hashCode() method for String may have collisions, leading to actual string comparisons. Also, clients of the cache may already have identifiers for their objects in Object form, and don't want to transform between Object and Strings, @@ -100,18 +100,18 @@ <para>Plus their equivalent helper methods taking a String as node name.</para> </footnote> : <literal>put(Fqn node, Object key, Object key)</literal> - and <literal>put(Fqn node, Hashmap values)</literal>. The former takes the + and <literal>put(Fqn node, Map values)</literal>. The former takes the node name, creates it if it doesn't yet exist, and put the key and value - into the node's hashmap, returning the previous value. The latter takes a - hashmap of keys and values and adds them to the node's hashmap, + into the node's map, returning the previous value. The latter takes a + map of keys and values and adds them to the node's map, overwriting existing keys and values. Content that is not in the new - hashmap remains in the node's hashmap.</para> + map remains in the node's map.</para> <para>There are 3 remove() methods: <literal>remove(Fqn node, Object key)</literal>, <literal>remove(Fqn node)</literal> and <literal>removeData(Fqn node)</literal>. The first removes the given key from the node. The second removes the entire node and all subnodes, and - the third removes all elements from the given node's hashmap.</para> + the third removes all elements from the given node's map.</para> <para>The get methods are: <literal>get(Fqn node)</literal> and <literal>get(Fqn node, Object key)</literal>. The former returns a @@ -121,7 +121,7 @@ </footnote> object, allowing for direct navigation, the latter returns the value for the given key for a node.</para> - <para>Also, the TreeCache has a number of getters and setters. Since the + <para>Also, the <literal>TreeCache</literal> has a number of getters and setters. Since the API may change at any time, we recommend the Javadoc for up-to-date information.</para> </chapter> \ No newline at end of file 1.2 +10 -10 JBossCache/docs/TreeCache/en/modules/compatibility.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: compatibility.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/compatibility.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- compatibility.xml 21 Feb 2006 22:45:39 -0000 1.1 +++ compatibility.xml 10 Jul 2006 14:50:02 -0000 1.2 @@ -2,14 +2,14 @@ <title>Version Compatibility and Interoperability</title> <para>While this is not absolutely guaranteed, generally speaking within a - major version releases of JBossCache are meant to be compatible and + major version, releases of JBoss Cache are meant to be compatible and interoperable. Compatible in the sense that it should be possible to upgrade an application from one version to another by simply replacing the jars. Interoperable in the sense that if two different versions of - JBossCache are used in the same cluster, they should be able to exchange + JBoss Cache are used in the same cluster, they should be able to exchange replication and state transfer messages. Note however that interoperability requires use of the same JGroups version in all nodes in the cluster. - In most cases, the version of JGroups used by a version of JBossCache can + In most cases, the version of JGroups used by a version of JBoss Cache can be upgraded.</para> <para>In the 1.2.4 and 1.2.4.SP1 releases, API compatibility and @@ -22,22 +22,22 @@ order to be sure you have no issues.</para> <para>Beginning in 1.2.4.SP2, a new configuration attribute - "ReplicationVersion" has been added. This attribute needs to be set in + <literal>ReplicationVersion</literal> has been added. This attribute needs to be set in order to allow interoperability with previous releases. The value should be set to the release name of the version with which interoperability is desired, e.g. "1.2.3". If this attribute is set, the wire format of replication and state transfer messages will conform to that understood - by the indicated release. This mechanism allows us to improve JBossCache by + by the indicated release. This mechanism allows us to improve JBoss Cache by using more efficient wire formats while still providing a means to preserve interoperability.</para> - <para>In a rare usage scenario, multiple different TreeCaches may + <para>In a rare usage scenario, multiple different JBoss Cache instances may be operating on each node in a cluster, but not all need to interoperate with a version 1.2.3 cache, and thus some caches will not be configured - with "ReplicationVersion" set to 1.2.3. This can cause problems with + with <literal>ReplicationVersion</literal> set to 1.2.3. This can cause problems with serialization of Fqn objects. If you are using this kind of configuration, - are having problems and are unwilling to set "ReplicationVersion" to - "1.2.3" on all caches, a workaround is to set system property - "jboss.cache.fqn.123compatible" to "true".</para> + are having problems and are unwilling to set <literal>ReplicationVersion</literal> to + <literal>1.2.3</literal> on all caches, a workaround is to set system property + <literal>jboss.cache.fqn.123compatible</literal> to <literal>true</literal>.</para> </chapter> \ No newline at end of file 1.4 +4 -4 JBossCache/docs/TreeCache/en/modules/eviction_policies.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: eviction_policies.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/eviction_policies.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- eviction_policies.xml 15 Feb 2006 14:07:29 -0000 1.3 +++ eviction_policies.xml 10 Jul 2006 14:50:02 -0000 1.4 @@ -9,19 +9,19 @@ <para>The design of the JBoss Cache eviction policy framework is based on the loosely coupled observable pattern (albeit still synchronous) - where the eviction region manager will register a TreeCacheListener to + where the eviction region manager will register a <literal>TreeCacheListener</literal> to handle cache events and relay them back to the eviction policies. Whenever a cached node is added, removed, evicted, or visited, the - eviction registered TreeCacheListener will maintain state statistics and + eviction registered <literal>TreeCacheListener</literal> will maintain state statistics and information will be relayed to each individual Eviction Region. - Each Region can define a different EvictionPolicy implementation that + Each Region can define a different <literal>EvictionPolicy</literal> implementation that will know how to correlate cache add, remove, and visit events back to a defined eviction behavior. It's the policy provider's responsibility to decide when to call back the cache "evict" operation.</para> <para>There is a single eviction thread (timer) that will run at a configured interval. This thread will make calls into each of the policy - providers and inform it of any TreeCacheListener aggregated adds, + providers and inform it of any <literal>TreeCacheListener</literal> aggregated adds, removes and visits (gets) to the cache during the configured interval. The eviction thread is responsible for kicking off the eviction policy processing (a single pass) for each configured eviction cache 1.5 +17 -17 JBossCache/docs/TreeCache/en/modules/introduction.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: introduction.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/introduction.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- introduction.xml 22 Mar 2006 04:02:00 -0000 1.4 +++ introduction.xml 10 Jul 2006 14:50:02 -0000 1.5 @@ -3,42 +3,42 @@ <title>Introduction</title> <section> - <title>What is a TreeCache?</title> + <title>What is a <literal>TreeCache</literal>?</title> <para> - A TreeCache is a structured, replicated, transactional cache from JBossCache. TreeCache is the backbone for many fundamental JBoss Application Server clustering services, including - in certain versions - clustering JNDI, HTTP and EJB sessions, and clustering JMS. + A <literal>TreeCache</literal> is a tree-structured, replicated, transactional cache from JBoss Cache. <literal>TreeCache</literal> is the backbone for many fundamental JBoss Application Server clustering services, including - in certain versions - clustering JNDI, HTTP and EJB sessions, and clustering JMS. </para> <para> - In addition to this, TreeCache can be used as a standalone transactional and replicated cache or even an object oriented data store, may be embedded in other J2EE compliant application servers such as BEA WebLogic or IBM WebSphere, servlet containers such as Tomcat, or even in Java applications that do not run from within an application server. + In addition to this, <literal>TreeCache</literal> can be used as a standalone transactional and replicated cache or even an object oriented data store, may be embedded in other J2EE compliant application servers such as BEA WebLogic or IBM WebSphere, servlet containers such as Tomcat, or even in Java applications that do not run from within an application server. </para> </section> <section> - <title>TreeCache Basics</title> + <title><literal>TreeCache</literal> Basics</title> - <para>The structure of a TreeCache is a tree with nodes. Each node has a + <para>The structure of a <literal>TreeCache</literal> is a tree with nodes. Each node has a name and zero or more children. A node can only have 1 parent; there is currently no support for graphs. A node can be reached by navigating from the root recursively through children, until the requested node is found. It can also be accessed by giving a fully qualified name (FQN), which consists of the concatenation of all node names from the root to the node in question.</para> - <para>A TreeCache can have multiple roots, allowing for a number of + <para>A <literal>TreeCache</literal> can have multiple roots, allowing for a number of different trees to be present in a single cache instance. Note that a one level tree is - essentially a HashMap. Each node in the tree has a HashMap of keys and + essentially a <literal>HashMap</literal>. Each node in the tree has a map of keys and values. For a replicated cache, all keys and values have to be - serializable. Serializability is not a requirement for PojoCache, where - reflection and AOP is used to replicate any type.</para> + <literal>Serializable</literal>. Serializability is not a requirement for <literal>PojoCache</literal>, where + reflection and aspect-oriented programming is used to replicate any type.</para> - <para>A TreeCache can be either local or replicated. Local trees exist - only inside the VM in which they are created, whereas replicated trees + <para>A <literal>TreeCache</literal> can be either local or replicated. Local trees exist + only inside the Java VM in which they are created, whereas replicated trees propagate any changes to all other replicated trees in the same cluster. A cluster may span different hosts on a network or just different JVMs on a single host.</para> - <para>The first version of JBossCache was a HashMap. However, the decision + <para>The first version of <literal>TreeCache</literal> was essentially a single <literal>HashMap</literal> that replicated. However, the decision was taken to go with a tree structured cache because (a) it is more - flexible and efficient and (b) a tree can always be reduced to a HashMap, + flexible and efficient and (b) a tree can always be reduced to a map, thereby offering both possibilities. The efficiency argument was driven by concerns over replication overhead, and was that a value itself can be a rather sophisticated object, with aggregation pointing to other objects, @@ -46,11 +46,11 @@ therefore trigger the entire object (possibly the transitive closure over the object graph) to be serialized and propagated to the other nodes in the cluster. With a tree, only the modified nodes in the tree need to be - serialized and propagated. This is not necessarily a concern for TreeCache, but is a - vital requirement for PojoCache (as we will see in the separate PojoCache + serialized and propagated. This is not necessarily a concern for <literal>TreeCache</literal>, but is a + vital requirement for <literal>PojoCache</literal> (as we will see in the separate <literal>PojoCache</literal> documentation).</para> - <para>When a change is made to the TreeCache, and that change is done in + <para>When a change is made to the <literal>TreeCache</literal>, and that change is done in the context of a transaction, then we defer the replication of changes until the transaction commits successfully. All modifications are kept in a list associated with the transaction for the caller. When the transaction commits, we replicate the @@ -65,7 +65,7 @@ rollback. In this sense, running without a transaction can be thought of as analogous as running with auto-commit switched on in JDBC terminology, where each operation is committed automatically.</para> <para>There is an API for plugging in different transaction managers: all - it requires is to get the transaction associated with the caller's thread. Several TransactionManagerLookup classes are provided for popular transaction managers, including a DummyTransactionManager for testing.</para> + it requires is to get the transaction associated with the caller's thread. Several <literal>TransactionManagerLookup</literal> implementations are provided for popular transaction managers, including a <literal>DummyTransactionManager</literal> for testing.</para> <para>Finally, we use pessimistic locking of the cache by default, with optimistic locking as a configurable option. With pessimistic locking, we can configure the local locking policy corresponding to database-style 1.6 +36 -49 JBossCache/docs/TreeCache/en/modules/replication.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: replication.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/replication.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- replication.xml 11 May 2006 14:36:14 -0000 1.5 +++ replication.xml 10 Jul 2006 14:50:02 -0000 1.6 @@ -1,7 +1,7 @@ <chapter id="replication"> <title>Clustered Caches</title> - <para>The TreeCache can be configured to be either local (standalone) or clustered. If + <para>The <literal>TreeCache</literal> can be configured to be either local (standalone) or clustered. If in a cluster, the cache can be configured to replicate changes, or to invalidate changes. A detailed discussion on this follows.</para> @@ -18,7 +18,7 @@ <title>Clustered Cache - Using Replication</title> <para>Replicated caches replicate all changes to the - other TreeCache instances in the cluster. Replication can either happen + other <literal>TreeCache</literal> instances in the cluster. Replication can either happen after each modification (no transactions), or at the end of a transaction (commit time).</para> @@ -27,7 +27,7 @@ the caller (e.g. on a put()) until the modifications have been replicated successfully to all nodes in a cluster. Asynchronous replication performs replication in the background (the put() returns - immediately). TreeCache also offers a replication queue, where + immediately). <literal>TreeCache</literal> also offers a replication queue, where modifications are replicated periodically (i.e. interval-based), or when the queue size exceeds a number of elements, or a combination thereof.</para> @@ -39,7 +39,7 @@ successfully, the caller knows for sure that all modifications have been applied at all nodes, whereas this may or may not be the case with asynchronous replication. With asynchronous replication, errors are - simply written to a log. Even when using transactions, a transaction may succeed but replication may not succeed on all TreeCache instances.</para> + simply written to a log. Even when using transactions, a transaction may succeed but replication may not succeed on all <literal>TreeCache</literal> instances.</para> <section> <title>Buddy Replication</title> @@ -51,7 +51,7 @@ </para> <para> One of the most common use cases of Buddy Replication is when a replicated cache is used by a servlet - containerto store HTTP session data. One of the pre-requisites to buddy replication working well and being + container to store HTTP session data. One of the pre-requisites to buddy replication working well and being a real benefit is the use of <emphasis>session affinity</emphasis>, also known as <emphasis>sticky sessions</emphasis> in HTTP session replication speak. What this means is that if certain data is frequently accessed, it is desirable that this is always accessed on one instance rather than in a round-robin fashion as this helps @@ -85,11 +85,11 @@ Also known as replication groups, a buddy pool is an optional construct where each instance in a cluster may be configured with a buddy pool name. Think of this as an 'exclusive club membership' where when selecting buddies, <literal>BuddyLocator</literal>s would try and select buddies sharing the same - buddy pool name. This allows system administrators a degree of fleibility and control over how buddies + buddy pool name. This allows system administrators a degree of flexibility and control over how buddies are selected. For example, a sysadmin may put two instances on two separate physical servers that - may be on two separate physical racks in the same buddy pool. So ratehr than picking an - instance on a different host on the same rack, <literal>BuddyLocator</literal>s would ratehr pick - the instance in the same buddy pool, on a separate rack which may adda degree of redundancy. + may be on two separate physical racks in the same buddy pool. So rather than picking an + instance on a different host on the same rack, <literal>BuddyLocator</literal>s would rather pick + the instance in the same buddy pool, on a separate rack which may add a degree of redundancy. </para> </section> <section> @@ -114,20 +114,13 @@ just <emphasis>taken ownership</emphasis> of this data. </para> <para> - Data Gravitation is implemented as a special type of <literal>CacheLoader</literal>, - <literal>org.jboss.cache.buddyreplication.DataGravitator</literal>. To use Data Gravitation (and it - is recommended that you do when using Buddy Replication!) you should enable the <literal>DataGravitator</literal> - as a <literal>CacheLoader</literal>. If you already have a cache loader defined, use <emphasis>cache loader chaining</emphasis> - and make sure the <literal>DataGravitator</literal> is last in the cache loader chain. - </para> - <para> - As a cache loader, the <literal>DataGravitator</literal> takes a few (all optional) configuration properties. + Data Gravitation is implemented as an interceptor. The following (all optional) configuration properties pertain to data gravitation. <itemizedlist> - <listitem><literal>removeOnFind</literal> - forces all remote caches that own the data or hold backups for the data to remove that data, + <listitem><literal>dataGravitationRemoveOnFind</literal> - forces all remote caches that own the data or hold backups for the data to remove that data, thereby making the requesting cache the new data owner. If set to <literal>false</literal> an evict is broadcast instead of a remove, so any state persisted in cache loaders will remain. This is useful if you have a shared cache loader configured. Defaults to <literal>true</literal>.</listitem> - <listitem><literal>searchBackupSubtrees</literal> - Asks remote instances to search through their backups as well as main data trees. Defaults to <literal>true</literal>.</listitem> - <listitem><literal>timeout</literal> - A timeout that defines how long it should wait for responses from instances in the cluster before assuming that they do not have the data requested. Defaults to 10,000 ms</listitem> + <listitem><literal>dataGravitationSearchBackupTrees</literal> - Asks remote instances to search through their backups as well as main data trees. Defaults to <literal>true</literal>. The resulting effect is that if this is <literal>true</literal> then backup nodes can respond to data gravitation requests in addition to data owners.</listitem> + <listitem><literal>autoDataGravitation</literal> - Whether data gravitation occurs for every cache miss. My default this is set to <literal>false</literal> to prevent unnecessary network calls. Most use cases will know when it may need to gravitate data and will pass in an <literal>Option</literal> to enable data gravitation on a per-invocation basis. If <literal>autoDataGravitation</literal> is <literal>true</literal> this <literal>Option</literal> is unnecessary.</listitem> </itemizedlist> </para> </section> @@ -150,36 +143,16 @@ <title>Configuration</title> <para> <programlisting><![CDATA[ - <!-- DataGravitator is a type of clustered cache loader used in conjuction with buddy replication to - provide failover. --> - <attribute name="CacheLoaderConfiguration"> - <config> - <passivation>false</passivation> - <preload>/</preload> - <shared>false</shared> - - <cacheloader> - <class>org.jboss.cache.buddyreplication.DataGravitator</class> - <properties> - timeout=1000 - removeOnFind=true - searchBackupSubtrees=true - </properties> - <async>false</async> - <fetchPersistentState>false</fetchPersistentState> - <!-- determines whether this cache loader ignores writes - defaults to false. --> - <ignoreModifications>false</ignoreModifications> - </cacheloader> - </config> - </attribute> - <!-- Buddy Replication config --> <attribute name="BuddyReplicationConfig"> <config> - <!-- enables buddy replication. This is the ONLY mandatory configuration element here. --> + + <!-- Enables buddy replication. This is the ONLY mandatory configuration element here. --> <buddyReplicationEnabled>true</buddyReplicationEnabled> - <!-- these are the default values anyway --> + + <!-- These are the default values anyway --> <buddyLocatorClass>org.jboss.cache.buddyreplication.NextMemberBuddyLocator</buddyLocatorClass> + <!-- numBuddies is the number of backup nodes each node maintains. ignoreColocatedBuddies means that each node will *try* to select a buddy on a different physical host. If not able to do so though, it will fall back to colocated nodes. --> @@ -187,14 +160,28 @@ numBuddies = 1 ignoreColocatedBuddies = true </buddyLocatorProperties> + <!-- A way to specify a preferred replication group. If specified, we try and pick a buddy why shares the same pool name (falling back to other buddies if not available). This allows the sysdmin to hint at backup buddies are picked, so for example, nodes may be hinted topick buddies on a different physical rack or power supply for added fault tolerance. --> <buddyPoolName>myBuddyPoolReplicationGroup</buddyPoolName> - <!-- communication timeout for inter-buddy group organisation messages (such as assigning to and removing + + <!-- Communication timeout for inter-buddy group organisation messages (such as assigning to and removing from groups, defaults to 1000. --> <buddyCommunicationTimeout>2000</buddyCommunicationTimeout> + + <!-- Whether data is removed from old owners when gravitated to a new owner. Defaults to true. --> + <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind> + + <!-- Whether backup nodes can respond to data gravitation requests, or only the data owner is supposed to respond. + defaults to true. --> + <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees> + + <!-- Whether all cache misses result in a data gravitation request. Defaults to false, requiring callers to + enable data gravitation on a per-invocation basis using the Options API. --> + <autoDataGravitation>false</autoDataGravitation> + </config> </attribute> ]]> 1.3 +13 -13 JBossCache/docs/TreeCache/en/modules/transactions.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: transactions.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/transactions.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- transactions.xml 1 Feb 2006 13:31:14 -0000 1.2 +++ transactions.xml 10 Jul 2006 14:50:02 -0000 1.3 @@ -15,9 +15,9 @@ <para>Lock owners are either transactions (call is made within the scope of an existing transaction) or threads (no transaction associated with the call). Regardless, a transaction or a thread is internally transformed into - an instance of GlobalTransaction, which is used as a globally unique ID + an instance of <literal>GlobalTransaction</literal>, which is used as a globally unique ID for modifications across a cluster. E.g. when we run a two-phase commit - protocol (see below) across the cluster, the GlobalTransaction uniquely + protocol (see below) across the cluster, the <literal>GlobalTransaction</literal> uniquely identifies the unit of work across a cluster.</para> <para>Locks can be read or write locks. Write locks serialize read and @@ -117,7 +117,7 @@ <section><title>Optimistic locking</title> <para>The motivation for optimistic locking is to improve concurrency. When a lot of threads have a lot of contention for access to the data tree, it can be inefficient to lock portions of the tree - for reading or writing - for the entire duration of a transaction as we do in pessimistic locking. Optimistic locking allows for greater concurrency of threads and transactions by using a technique called data versioning, explained here. Note that isolation levels (if configured) are ignored if optimistic locking is enabled.</para> <section><title>Architecture</title> - <para>Optimistic locking treats all method calls as transactional<footnote><para>Because of this requirement, you must always have a transaction manager configured when using optimistic locking.</para></footnote>. Even if you do not invoke a call within the scope of an ongoing transaction, JBoss Cache creates an implicit transaction and commits this transaction when the invocation completes. Each transaction maintains a transaction workspace, which contains a copy of the data used within the transaction.</para><para>For example, if a transaction calls get("/a/b/c"), nodes a, b and c are copied from the main data tree and into the workspace. The data is versioned and all calls in the transaction work on the copy of the data rather than the actual data. When the transaction commits, it's workspace is merged back into the underlying tree by matching versions. If there is a version mismatch - such as when the actual data tree has a higher version than the workspace, per! haps if another transaction were to access the same data, change it and commit before the first transaction can finish - the transaction throws a RollbackException when committing and the commit fails.</para> + <para>Optimistic locking treats all method calls as transactional<footnote><para>Because of this requirement, you must always have a transaction manager configured when using optimistic locking.</para></footnote>. Even if you do not invoke a call within the scope of an ongoing transaction, JBoss Cache creates an implicit transaction and commits this transaction when the invocation completes. Each transaction maintains a transaction workspace, which contains a copy of the data used within the transaction.</para><para>For example, if a transaction calls get("/a/b/c"), nodes a, b and c are copied from the main data tree and into the workspace. The data is versioned and all calls in the transaction work on the copy of the data rather than the actual data. When the transaction commits, it's workspace is merged back into the underlying tree by matching versions. If there is a version mismatch - such as when the actual data tree has a higher version than the workspace, per! haps if another transaction were to access the same data, change it and commit before the first transaction can finish - the transaction throws a <literal>RollbackException</literal> when committing and the commit fails.</para> <para>Optimistic locking uses the same locks we speak of above, but the locks are only held for a very short duration - at the start of a transaction to build a workspace, and when the transaction commits and has to merge data back into the tree.</para> <para> So while optimistic locking may occasionally fail if version validations fail or may run slightly slower than pessimistic locking due to the inevitable overhead and extra processing of maintaining workspaces, versioned data and validating on commit, it does buy you a near-SERIALIZABLE degree of data integrity while maintaining a very high level of concurrency. @@ -158,11 +158,11 @@ </orderedlist> <para> In order to do this, the cache has - to be configured with an instance of a TransactionManagerLookup which - returns a javax.transaction.TransactionManager.</para> + to be configured with an instance of a <literal>TransactionManagerLookup</literal> which + returns a <literal>javax.transaction.TransactionManager</literal>.</para> - <para>JBoss Cache ships with JBossTransactionManagerLookup and GenericTransactionManagerLookup. The JBossTransactionManagerLookup is able to bind to a running JBoss Application Server and retrieve a TransactionManager while the GenericTransactionManagerLookup is able to bind to most popular JEE application servers and provide the same functionality. A dummy implementation - DummyTransactionManagerLookup - is also provided, which may be used for standalone JBoss Cache applications and unit tests running outside a JEE Application Server. Being a dummy, however, this is just for demo and testing purposes and is not recommended for production use.</para> -<para>The implementation of the JBossTransactionManagerLookup is as follows:</para> + <para>JBoss Cache ships with <literal>JBossTransactionManagerLookup</literal> and <literal>GenericTransactionManagerLookup</literal>. The <literal>JBossTransactionManagerLookup</literal> is able to bind to a running JBoss Application Server and retrieve a <literal>TransactionManager</literal> while the <literal>GenericTransactionManagerLookup</literal> is able to bind to most popular Java EE application servers and provide the same functionality. A dummy implementation - <literal>DummyTransactionManagerLookup</literal> - is also provided, which may be used for standalone JBoss Cache applications and unit tests running outside a Java EE Application Server. Being a dummy, however, this is just for demo and testing purposes and is not recommended for production use.</para> +<para>The implementation of the <literal>JBossTransactionManagerLookup</literal> is as follows:</para> <programlisting>public class JBossTransactionManagerLookup implements TransactionManagerLookup { @@ -174,14 +174,14 @@ } }</programlisting> - <para>The implementation looks up the JBoss TransactionManager from the + <para>The implementation looks up the JBoss Transaction Manager from JNDI and returns it.</para> - <para>When a call comes in, the TreeCache gets the current transaction and + <para>When a call comes in, the <literal>TreeCache</literal> gets the current transaction and records the modification under the transaction as key. (If there is no transaction, the modification is applied immediately and possibly replicated). So over the lifetime of the transaction all modifications - will be recorded and associated with the transaction. Also, the TreeCache + will be recorded and associated with the transaction. Also, the <literal>TreeCache</literal> registers with the transaction to be notified of transaction committed or aborted when it first encounters the transaction.</para> @@ -217,8 +217,8 @@ <section> <title>Example</title> - <para>Let's look at an example of how to use the standalone (e.g. - outside an appserver) TreeCache with dummy transactions:</para> + <para>Let's look at an example of how to use JBoss Cache in a standalone (i.e. + outside an application server) fashion with dummy transactions:</para> <programlisting>Properties prop = new Properties(); prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.cache.transaction.DummyContextFactory"); @@ -254,7 +254,7 @@ associate it with the current thread internally). Any methods invoked on the cache will now be collected and only applied when the transaction is committed. In the above case, we create a node "/classes/cs-101" and add - 2 elements to its HashMap. Assuming that the cache is configured to use + 2 elements to its map. Assuming that the cache is configured to use synchronous replication, on transaction commit the modifications are replicated. If there is an exception in the methods (e.g. lock acquisition failed), or in the two-phase commit protocol applying the 1.4 +15 -0 JBossCache/docs/TreeCache/en/modules/treecache_marshaller.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: treecache_marshaller.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/TreeCache/en/modules/treecache_marshaller.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- treecache_marshaller.xml 11 May 2006 00:01:00 -0000 1.3 +++ treecache_marshaller.xml 10 Jul 2006 14:50:02 -0000 1.4 @@ -429,4 +429,19 @@ is disabled by passing in the <literal>-Dserialization.jboss=false</literal> environment variable into your JVM. </para> </section> + + <section> + <title>Backward compatibility</title> + <para> + Marshalling in JBoss Cache is now versioned. All communications between caches contain a version <literal>short</literal> which allows JBoss Cache instances of different versions to communicate with each other. Up until JBoss Cache 1.4.0, all versions were able to communicate with each other anyway since they all used simple serialization of <literal>org.jgroups.MethodCall</literal> objects, provided they all used the same version of JGroups. This requirement (more a requirement of the JGroups messaging layer than JBoss Cache) still exists, even though with JBoss Cache 1.4.0, we've moved to a much more efficient and sophisticated marshalling mechanism. + </para> + <para> + JBoss Cache 1.4.0 and future releases of JBoss Cache will always be able to unmarshall data from previous versions of JBoss Cache. For JBoss Cache 1.4.0 and future releases to marshall data in a format that is compatible with older versions, however, you would have to start JBoss Cache with the following configuration attribute: + <programlisting><![CDATA[ + <!-- takes values such as 1.2.3, 1.2.4 and 1.3.0 --> + <attribute name="ReplicationVersion">1.2.4</attribute> + ]]> + </programlisting> + </para> + </section> </chapter> \ No newline at end of file |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:07
|
User: msurtani Date: 06/07/10 10:50:03 Modified: etc/META-INF buddyreplication-service.xml Log: merged in changes from 1.4.0 Revision Changes Path 1.5 +4 -3 JBossCache/etc/META-INF/buddyreplication-service.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: buddyreplication-service.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/etc/META-INF/buddyreplication-service.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- buddyreplication-service.xml 1 Jun 2006 19:04:52 -0000 1.4 +++ buddyreplication-service.xml 10 Jul 2006 14:50:03 -0000 1.5 @@ -131,13 +131,14 @@ from groups --> <buddyCommunicationTimeout>2000</buddyCommunicationTimeout> - <!-- the following three elements, all relating to data gravitation, default to true --> + <!-- the following three elements, all relating to data gravitation, default to false --> <!-- Should data gravitation be attempted whenever there is a cache miss on finding a node? If false, data will only be gravitated if an Option is set enabling it --> - <autoDataGravitation>true</autoDataGravitation> + <autoDataGravitation>false</autoDataGravitation> <!-- removes data on remote caches' trees and backup subtrees when gravitated to a new data owner --> <dataGravitationRemoveOnFind>true</dataGravitationRemoveOnFind> - <!-- search backup subtrees as well for data when gravitating --> + <!-- search backup subtrees as well for data when gravitating. Results in backup nodes being able to + answer data gravitation requests. --> <dataGravitationSearchBackupTrees>true</dataGravitationSearchBackupTrees> </config> |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:07
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/tutorial/en master.xml Log: merged in changes from 1.4.0 Revision Changes Path 1.14 +68 -71 JBossCache/docs/tutorial/en/master.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: master.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/tutorial/en/master.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -b -r1.13 -r1.14 --- master.xml 29 Apr 2006 07:31:51 -0000 1.13 +++ master.xml 10 Jul 2006 14:50:02 -0000 1.14 @@ -2,9 +2,8 @@ <article lang="en"> <articleinfo> <title>JBossCache TreeCache and PojoCache Tutorial</title> - <releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo> - <pubdate>May 2006</pubdate> - +<releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo> + <pubdate>July 2006</pubdate> <author> <firstname>Ben</firstname> <surname>Wang</surname> @@ -27,8 +26,8 @@ In this tutorial, we will demonstrate the usage of both cache features. For details of the usage and APIs, please refer to the user manuals for <ulink - url="http://www.jboss.org/products/jbosscache/docs">TreeCache</ulink> and <ulink - url="http://www.jboss.org/products/jbosscache/docs">PojoCache</ulink>.</para> + url="http://labs.jboss.org/portal/jbosscache/docs/index.html">TreeCache</ulink> and <ulink + url="http://labs.jboss.org/portal/jbosscache/docs/index.html">PojoCache</ulink>.</para> </section> <section> @@ -57,7 +56,7 @@ <title>Configuration</title> <para>First download the standalone TreeCache code from <ulink - url="http://www.jboss.com/products/jbosscache/downloads">here</ulink>. + url="http://labs.jboss.org/portal/jbosscache/download/index.html">here</ulink>. Unzip it, and you will get a root directory (jboss-cache in our example).</para> @@ -67,13 +66,13 @@ <itemizedlist> <listitem> - <para>log4j.xml. Logging output. You can turn on logging level or + <para><literal>log4j.xml</literal>. Logging output. You can turn on logging level or change log file directory (default is - <literal>/tmp/test.log</literal>).</para> + <literal>/tmp/jbosscache.log</literal>).</para> </listitem> <listitem> - <para>replSync-service.xml. Tree cache configuration file (file name + <para><literal>replSync-service.xml</literal>. Tree cache configuration file (file name is not fixed. You specify the file to be read in in <literal>PropertyConfigurator</literal>). The settings are for a replicated, synchronous, and transactional cache. The default @@ -86,7 +85,7 @@ </listitem> <listitem> - <para>jboss-aop.xml. AOP pointcut and advice definition for the + <para><literal>jboss-aop.xml</literal>. AOP pointcut and advice definition for the example POJO classes, Person and Address, respectively. For details of how to put your own class under AOP, please refer to the <ulink url="http://www.jboss.org/products/jbosscache/docs">PojoCache</ulink>. This file is read in @@ -103,7 +102,7 @@ <itemizedlist> <listitem> - <para>build.sh (or build.bat for DOS). Simple build script that wraps + <para><literal>build.sh</literal> (or <literal>build.bat</literal> for DOS/Windows). Simple build script that wraps around ant. Users can simply type <literal>sh build.sh</literal> for help. Note from now on, we will only refer to the Unix version with the understanding that there is a corresponding DOS counterpart. The @@ -111,24 +110,24 @@ </listitem> <listitem> - <para>runDemoShell.sh. Simple run script that wraps around BeanShell. + <para><literal>runDemoShell.sh</literal>. Simple run script that wraps around BeanShell. This is used to operate the replicated cache through interactive command line.</para> </listitem> <listitem> - <para>plain.bsh. Java codes that instantiate and configure the cache. + <para><literal>plain.bsh</literal>. Java code that instantiate and configure the cache. It also creates an example cache entry.</para> </listitem> <listitem> - <para>aop.bsh. Java codes that instantiate and configure the aop + <para><literal>aop.bsh</literal>. Java codes that instantiate and configure the aop cache. In addition, it also sets up the example POJO (plaing old Java object) classes (e.g., Person and Address).</para> </listitem> <listitem> - <para>aopWithTx.bsh. Same with aop.bsh except it also instantiates a + <para><literal>aopWithTx.bsh</literal>. Same with aop.bsh except it also instantiates a transaction context.</para> </listitem> </itemizedlist> @@ -185,9 +184,6 @@ <itemizedlist> <listitem>For each demo example, it'd be best if you re-start the whole setup.</listitem> - <listitem>IMPORTANT: When you do an update on the BSH window, you will need to refresh the GUI manually. This is - usually done by clicking on other node in the GUI and then click back to the one that you are interested - in</listitem> <listitem>While you can modify the cache content on the GUI window and it will show up on the BSH cache content (e.g., through <literal>cache.printDetails()</literal>), this won't work on PojoCache demo. That is, you can only modify the cache content on the BSH window.</listitem> @@ -377,7 +373,8 @@ </programlisting> <para>Then start the beanshell and source <literal>oodb.bsh</literal> - into it:</para> + into it. Note that <literal>oodb.bsh</literal> already contains code to create and retrieve POJO + from the cache. So remember to comment them out if you decide to create the Person instance yourself.</para> <programlisting>bela@laptop /cygdrive/c/jboss-cache $ ./runShellDemo.sh |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:06
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/TreeCache/en/images PackageOverview-BuddyReplication.png Log: merged in changes from 1.4.0 Revision Changes Path 1.2 +60 -72 JBossCache/docs/TreeCache/en/images/PackageOverview-BuddyReplication.png <<Binary file>> |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:05
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/faq/en master.xml Log: merged in changes from 1.4.0 Revision Changes Path 1.36 +136 -144 JBossCache/docs/faq/en/master.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: master.xml =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/faq/en/master.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -b -r1.35 -r1.36 --- master.xml 6 Jul 2006 16:50:08 -0000 1.35 +++ master.xml 10 Jul 2006 14:50:02 -0000 1.36 @@ -6,7 +6,7 @@ <articleinfo> <title>Frequently Asked Questions about JBoss Cache</title> <releaseinfo>Release 1.4.0 "Jalapeno"</releaseinfo> - <pubdate>May 2006</pubdate> + <pubdate>July 2006</pubdate> <author> <firstname>Ben</firstname> @@ -41,12 +41,10 @@ <para>These are frequently asked questions regarding JBoss Cache.</para> - <qandaset defaultlabel="qanda"> - <qandadiv> + <qandaset defaultlabel="GeneralInformation"> <title>General Information</title> - <qandaentry> - <question> + <question id="1"> <para>What is JBoss Cache?</para> </question> @@ -71,7 +69,7 @@ </qandaentry> <qandaentry> - <question> + <question id="2"> <para>Who are the JBoss Cache developers?</para> </question> @@ -82,7 +80,7 @@ </qandaentry> <qandaentry> - <question> + <question id="3"> <para>What is the license for JBoss Cache?</para> </question> @@ -92,7 +90,7 @@ </qandaentry> <qandaentry> - <question> + <question id="4"> <para>Where can I download JBoss Cache?</para> </question> @@ -102,7 +100,7 @@ </qandaentry> <qandaentry> - <question> + <question id="5"> <para>How do I build JBoss Cache from CVS sources?</para> </question> @@ -118,7 +116,7 @@ </qandaentry> <qandaentry> - <question> + <question id="6"> <para>Which JVMs are supported by JBoss Cache?</para> </question> @@ -130,7 +128,7 @@ </qandaentry> <qandaentry> - <question> + <question id="7"> <para>From JBoss Cache 1.3.0 onwards, there is a new directory <code>lib-50</code>, what is it?</para> </question> @@ -146,7 +144,7 @@ </qandaentry> <qandaentry> - <question> + <question id="8"> <para>How do I know the version of JBoss Cache that I am using?</para> </question> @@ -157,7 +155,7 @@ </qandaentry> <qandaentry> - <question> + <question id="9"> <para>Can I run JBoss Cache outside of JBoss Application Server?</para> </question> @@ -171,16 +169,16 @@ </listitem> <listitem> - <para>Standalone, that can run in any JEE server such + <para>Standalone, that can run in any Java EE server such as BEA WebLogic or IBM Websphere. Of course, it can also run in - a standalone Java process (i.e., outside JEE context).</para> + a standalone Java process (i.e., outside Java EE context).</para> </listitem> </itemizedlist> </answer> </qandaentry> <qandaentry> - <question> + <question id="10"> <para>Where can I report bugs or problems?</para> </question> @@ -190,13 +188,13 @@ User Forum</ulink>.</para> </answer> </qandaentry> - </qandadiv> + </qandaset> - <qandadiv> + <qandaset defaultlabel="TreeCache"> <title>JBoss Cache in general and TreeCache</title> <qandaentry> - <question> + <question id="11"> <para>How do I deploy JBoss Cache as a MBean service?</para> </question> @@ -212,7 +210,7 @@ </qandaentry> <qandaentry> - <question> + <question id="12"> <para>How do I know if my JBoss Cache MBean has been deployed?</para> </question> @@ -225,7 +223,7 @@ </qandaentry> <qandaentry> - <question> + <question id="13"> <para>How do I access the JBoss Cache MBean?</para> </question> @@ -277,7 +275,7 @@ </qandaentry> <qandaentry> - <question> + <question id="14"> <para>Can I run JBoss Cache on JBoss AS 3.2.x releases?</para> </question> @@ -289,7 +287,7 @@ </qandaentry> <qandaentry> - <question> + <question id="15"> <para>Can I run multiple JBoss Cache instances on the same VM?</para> </question> @@ -303,7 +301,7 @@ </qandaentry> <qandaentry> - <question> + <question id="16"> <para>Can TreeCache run as a second level cache inside Hibernate?</para> </question> @@ -320,7 +318,7 @@ </qandaentry> <qandaentry> - <question> + <question id="17"> <para>What about using PojoCache as a Hibernate cache?</para> </question> @@ -333,7 +331,7 @@ </qandaentry> <qandaentry> - <question> + <question id="18"> <para>How can I configure JBoss Cache?</para> </question> @@ -345,7 +343,7 @@ </qandaentry> <qandaentry> - <question> + <question id="19"> <para>In the configuration xml file, there are tags such as <literal>class</literal>, <literal> MBean</literal>, etc. What are these?</para> @@ -361,7 +359,7 @@ </qandaentry> <qandaentry> - <question> + <question id="20"> <para>What is the difference between the different cache modes?</para> </question> @@ -383,7 +381,7 @@ </qandaentry> <qandaentry> - <question> + <question id="21"> <para>How does JBoss Cache's replication mechanism work?</para> </question> @@ -403,7 +401,7 @@ </qandaentry> <qandaentry> - <question> + <question id="22"> <para>I run a 2 node cluster. If the network dies, do the caches continue to run?</para> </question> @@ -416,7 +414,7 @@ <qandaentry> - <question> + <question id="23"> <para>Can I plug in library X instead of JGroups to handle remote calls and group communications?</para> </question> @@ -428,7 +426,7 @@ </qandaentry> <qandaentry> - <question> + <question id="24"> <para>Does the cache need to replicate to every other instance in the cluster? Isn't this slow if the cluster is large?</para> </question> @@ -443,7 +441,7 @@ </qandaentry> <qandaentry> - <question> + <question id="25"> <para>If I have the need for different TreeCache properties (e.g., <literal>CacheMode</literal> and <literal>IsolationLevel</literal>), do I simply need to create multiple TreeCache instances with the appropriate configuration?</para> @@ -457,7 +455,7 @@ </qandaentry> <qandaentry> - <question> + <question id="26"> <para>Does the Tree Cache config <literal>ClusterName</literal> have any relation to the JBoss AS cluster <literal>PartitionName</literal>?</para> @@ -471,7 +469,7 @@ </qandaentry> <qandaentry> - <question> + <question id="27"> <para>When using multiple JGroups based components [cluster-service.xml, treecache (multiple instances)], what is the correct/valid way to configure those components to make sure my @@ -489,7 +487,7 @@ </qandaentry> <qandaentry> - <question> + <question id="28"> <para>Does JBoss Cache currently support cache persistence storage?</para> </question> @@ -501,7 +499,7 @@ </qandaentry> <qandaentry> - <question> + <question id="29"> <para>Does JBoss Cache currently support cache passivation/ overflow to a data store?</para> </question> @@ -514,7 +512,7 @@ </qandaentry> <qandaentry> - <question> + <question id="30"> <para>Is JBoss Cache thread safe?</para> </question> @@ -524,7 +522,7 @@ </qandaentry> <qandaentry> - <question> + <question id="31"> <para>Does JBoss Cache support XA (2PC) transactions now?</para> </question> @@ -536,7 +534,7 @@ </qandaentry> <qandaentry> - <question> + <question id="32"> <para>Which TransactionManagers are supported by JBoss Cache?</para> </question> @@ -555,7 +553,7 @@ </qandaentry> <qandaentry> - <question> + <question id="33"> <para>How do I set up the cache to be transactional?</para> </question> @@ -587,7 +585,7 @@ </qandaentry> <qandaentry> - <question> + <question id="34"> <para>How do I control the cache locking level?</para> </question> @@ -607,7 +605,7 @@ </qandaentry> <qandaentry> - <question> + <question id="35"> <para>How does JBoss Cache lock data for concurrent access?</para> </question> @@ -618,7 +616,7 @@ <qandaentry> - <question> + <question id="36"> <para>How do I enable Optimistic Locking in JBoss Cache?</para> </question> @@ -629,8 +627,8 @@ <qandaentry> - <question> - <para>How does the write lock apply to a fqn node, say, + <question id="37"> + <para>How does the write lock apply to an Fqn node, say, "/org/jboss/test"?</para> </question> @@ -650,7 +648,7 @@ </qandaentry> <qandaentry> - <question> + <question id="38"> <para>Can I use the cache locking level even without a transaction context?</para> </question> @@ -666,7 +664,7 @@ </qandaentry> <qandaentry> - <question> + <question id="39"> <para>With replication (REPL_SYNC/REPL_ASYNC) or invalidation (INVALIDATION_SYNC/INVALIDATION_ASYNC), how often does the cache broadcast messages over the network?</para> </question> @@ -683,7 +681,7 @@ </qandaentry> <qandaentry> - <question> + <question id="40"> <para>How can I do a mass removal?</para> </question> @@ -694,7 +692,7 @@ </qandaentry> <qandaentry> - <question> + <question id="41"> <para>Can I monitor and manage the JBoss Cache?</para> </question> @@ -704,7 +702,7 @@ </qandaentry> <qandaentry> - <question> + <question id="42"> <para>Can I disable JBoss Cache management attributes in JBoss Cache 1.3.0?</para> </question> @@ -714,7 +712,7 @@ </qandaentry> <qandaentry> - <question><para>What is jboss-serialization.jar, introduced in JBoss Cache 1.4.x and do I need this?</para></question> + <question id="43">><para>What is jboss-serialization.jar, introduced in JBoss Cache 1.4.x and do I need this?</para></question> <answer><para>jboss-serialization.jar is the <ulink url="http://labs.jboss.org/portal/index.html?ctrl:id=page.default.info&project=serialization">JBoss Serialization</ulink> library, which is much more efficient in terms of speed and CPU usage as well as the generated byte stream size than standard Java serialization. This very significantly improves replication performance of custom objects placed in the cache.</para> @@ -725,7 +723,7 @@ </qandaentry> <qandaentry> - <question> + <question id="44"> <para>Can I disable JBoss Serialization and revert back to standard Java serialization?</para> </question> @@ -736,7 +734,7 @@ <qandaentry> - <question> + <question id="45"> <para>Does JBoss Cache support partitioning?</para> </question> @@ -749,7 +747,7 @@ </qandaentry> <qandaentry> - <question> + <question id="46"> <para>Does JBoss Cache handle the concept of application classloading inside, say, a J2EE container?</para> </question> @@ -838,7 +836,7 @@ </qandaentry> <qandaentry> - <question> + <question id="47"> <para>Does JBoss Cache currently support pre-event and post-event notification?</para> </question> @@ -853,7 +851,7 @@ </qandaentry> <qandaentry> - <question> + <question id="48"> <para>How do I implement a custom listener to listen to <literal>TreeCache</literal> events?</para> </question> @@ -885,13 +883,13 @@ </programlisting> </answer> </qandaentry> - </qandadiv> + </qandaset> - <qandadiv> + <qandaset defaultlabel="PojoCache"> <title>PojoCache</title> <qandaentry> - <question> + <question id="49"> <para>What is PojoCache?</para> </question> @@ -920,7 +918,7 @@ </qandaentry> <qandaentry> - <question> + <question id="50"> <para>What's the relationship between PojoCache and TreeCacheAop classes?</para> </question> @@ -931,7 +929,7 @@ </qandaentry> <qandaentry> - <question> + <question id="51"> <para>Does PojoCache have all the functional capabilities of TreeCache?</para> </question> @@ -944,7 +942,7 @@ </qandaentry> <qandaentry> - <question> + <question id="52"> <para>What is the difference between TreeCache and PojoCache?</para> </question> @@ -966,7 +964,7 @@ </qandaentry> <qandaentry> - <question> + <question id="53"> <para>What are the steps to use the PojoCache feature?</para> </question> @@ -975,13 +973,13 @@ in order to use PojoCache, you will need to:</para> <itemizedlist> - <listitem>prepare POJO. You can do either via xml declaration or annotation. For annotation, you can + <listitem><para>prepare POJO. You can do either via xml declaration or annotation. For annotation, you can use either the JDK1.4 style or JDK50 one (of which is part of JVM spec). If you use JDK14, you will also need - a annotation pre-compiler (annoc) to pre-process it.</listitem> - <listitem>instrumentation. You will need to instrument your POJO either at compile-time or load-time. + a annotation pre-compiler (annoc) to pre-process it.</para></listitem> + <listitem><para>instrumentation. You will need to instrument your POJO either at compile-time or load-time. If you do it during compile-time, you use so-called aop pre-compiler (aopc) to do bytecode manipulation. If you do it via load-time, however, you need either a special system class loader or, in JDK50, you can - use the javaagent option.</listitem> + use the javaagent option.</para></listitem> </itemizedlist> <para>So if you use JDK50, for example, with annotation and load-time instrumentation, then you won't need any pre-processing step to use PojoCache. For a full example, please refer to the distro examples directory. @@ -990,7 +988,7 @@ </qandaentry> <qandaentry> - <question> + <question id="54"> <para>Can I run PojoCache in JBoss AS 3.2.x application server?</para> </question> @@ -1004,31 +1002,23 @@ </qandaentry> <qandaentry> - <question> + <question id="55"> <para>Can PojoCache run as a MBean as well?</para> </question> <answer> - - <para>Yes. It is almost the same as TreeCache MBean. The only difference is the object name and the class name. E.g., instead - of</para> - - - + of <programlisting><mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache"></programlisting> - you will have: - <programlisting><mbean code="org.jboss.cache.aop.PojoCache" name="jboss.cache:service=PojoCache"></programlisting> - - in the xml configuration file. + in the xml configuration file.</para> </answer> </qandaentry> <qandaentry> - <question> + <question id="56"> <para>Can I pre-compile the aop classes such that I don't need to use the system classloader and jboss-aop configuration xml?</para> </question> @@ -1043,13 +1033,16 @@ class loader.</para> <para>For an example of how to use <literal>aopc</literal>, please - see the <literal>build.xml</literal> in the standalone package (look - for the aopc Ant target).</para> + see 1) <literal>tools</literal> directory for PojoCacheTasks14.xml + and PojoCacheTasks50.xml. Both contain Ant tasks that you can + import to your regular project for <literal>annoc</literal> and + <literal>aopc</literal>. In addition, please also check out the + <literal>examples</literal> directory for concrete examples.</para> </answer> </qandaentry> <qandaentry> - <question> + <question id="57"> <para>How do I use aopc on multiple module directories?</para> </question> @@ -1061,7 +1054,7 @@ </qandaentry> <qandaentry> - <question> + <question id="58"> <para>What's in the <literal>jboss-aop.xml</literal> configuration?</para> </question> @@ -1083,7 +1076,7 @@ </qandaentry> <qandaentry> - <question> + <question id="59"> <para>Can I use annotation instead of the xml declaration?</para> </question> @@ -1094,8 +1087,8 @@ </qandaentry> <qandaentry> - <question> - <para>What are the pro and con of xml vs annotation?</para> + <question id="60"> + <para>What are the pro and con of xml vs. annotation?</para> </question> <answer> @@ -1107,7 +1100,7 @@ </qandaentry> <qandaentry> - <question> + <question id="61"> <para>What are the <literal>@org.jboss.cache.aop.annotation.Transient</literal> and <literal>@org.jboss.cache.aop.annotation.Serializable</literal> field level annotations?</para> </question> @@ -1123,7 +1116,7 @@ </qandaentry> <qandaentry> - <question> + <question id="62"> <para>What about compile-time vs. load-time instrumentation then?</para> </question> @@ -1135,9 +1128,9 @@ </qandaentry> <qandaentry> - <question> + <question id="63"> <para>Is it possible to store the same object multiple times but - with different FQN paths? Like /foo/byName and /foo/byId ?</para> + with different Fqn paths? Like /foo/byName and /foo/byId ?</para> </question> <answer> @@ -1148,7 +1141,7 @@ </qandaentry> <qandaentry> - <question> + <question id="64"> <para>Do I need to declare all my objects "prepared" in <literal>jboss-aop.xml</literal>?</para> </question> @@ -1163,7 +1156,7 @@ </qandaentry> <qandaentry> - <question> + <question id="65"> <para>Can the cache aop intercept update via reflection?</para> </question> @@ -1175,7 +1168,7 @@ </qandaentry> <qandaentry> - <question> + <question id="66"> <para>When I declare my POJO to be "aspectized", what happens to the fields with transient, static, and final modifiers?</para> </question> @@ -1188,7 +1181,7 @@ </qandaentry> <qandaentry> - <question> + <question id="67"> <para>What are those keys such as <literal>JBoss:internal:class</literal> and <literal>AOPInstance</literal>?</para> @@ -1201,7 +1194,7 @@ </qandaentry> <qandaentry> - <question> + <question id="68"> <para>What about Collection classes? Do I need to declare them "prepared"?</para> </question> @@ -1226,7 +1219,7 @@ </qandaentry> <qandaentry> - <question> + <question id="69"> <para>How do I use <literal>List</literal>, <literal>Set</literal>, and <literal>Map</literal> dynamic proxy?</para> </question> @@ -1252,7 +1245,7 @@ </qandaentry> <qandaentry> - <question> + <question id="70"> <para>What is the proper way of assigning two different keys with Collection class object?</para> </question> @@ -1277,7 +1270,7 @@ </qandaentry> <qandaentry> - <question> + <question id="71"> <para>OK, so I know I am supposed to use proxy when manipulating the Collection classes once they are managed by the cache. But what happens to Pojos that share the Collection objects, e.g., a @@ -1294,7 +1287,7 @@ </qandaentry> <qandaentry> - <question> + <question id="72"> <para>What happens when my "aspectized" POJO has field members that are of Collection class ?</para> </question> @@ -1314,7 +1307,7 @@ <qandaentry> - <question> + <question id="73"> <para>What are the limitation of Collection classes in PojoCache?</para> </question> @@ -1339,43 +1332,43 @@ <qandaentry> - <question> + <question id="74"> <para>What are the pros and cons of PojoCache?</para> </question> <answer> <para>As mentioned in the reference doc, PojoCache has the following advantages:</para> <itemizedlist> - <listitem>Fine-grained replication and/or persistency. If you use a distributed PojoCache + <listitem><para>Fine-grained replication and/or persistency. If you use a distributed PojoCache and once your POJO is put in the cache store, there is no need to use another API to trigger your changes. Furthermore, the replication are fine-grained field level. Note this - also applies to persistency.</listitem> - <listitem>Fine-grained replication can have potential performance gain if your POJO is big and - the changes are fine-grained, e.g., only to some selected fields.</listitem> - <listitem>POJO can posses object relationship, e.g., multiple referenced. Distributed - PojoCache will handle this transparently for you.</listitem> + also applies to persistency.</para></listitem> + <listitem><para>Fine-grained replication can have potential performance gain if your POJO is big and + the changes are fine-grained, e.g., only to some selected fields.</para></listitem> + <listitem><para>POJO can posses object relationship, e.g., multiple referenced. Distributed + PojoCache will handle this transparently for you.</para></listitem> </itemizedlist> <para>And here are some cases that you may not want to use PojoCache:</para> <itemizedlist> - <listitem>You use only cache. That is you don't need replication or persistency. Then since - everything is operated on the in-memory POJO reference, there is no need for PojoCache.</listitem> - <listitem>You have simple and small POJOs. Your POJO is small in size and also there is no - object relationship, then PojoCache possess not clear advantage to plain cache.</listitem> - <listitem>Your application is bounded by memory usage. Because PojoCache need almost twice as much + <listitem><para>You use only cache. That is you don't need replication or persistency. Then since + everything is operated on the in-memory POJO reference, there is no need for PojoCache.</para></listitem> + <listitem><para>You have simple and small POJOs. Your POJO is small in size and also there is no + object relationship, then PojoCache possess not clear advantage to plain cache.</para></listitem> + <listitem><para>Your application is bounded by memory usage. Because PojoCache need almost twice as much of memory (the original POJO in-memory space and also the additional cache store for the - primitive fields), you may not want to use PojoCache.</listitem> - <listitem>Your POJO lifetime is short. That is, you need to create and destroy your POJO often. - Then you need to do "pubObject" and "removeObject" often, it will be slow in performance.</listitem> + primitive fields), you may not want to use PojoCache.</para></listitem> + <listitem><para>Your POJO lifetime is short. That is, you need to create and destroy your POJO often. + Then you need to do "pubObject" and "removeObject" often, it will be slow in performance.</para></listitem> </itemizedlist> </answer> </qandaentry> - </qandadiv> + </qandaset> - <qandadiv> + <qandaset defaultlabel="EvictionPolicies"> <title>Eviction Policies</title> <qandaentry> - <question> + <question id="75"> <para>Does JBoss Cache support eviction policies?</para> </question> @@ -1393,7 +1386,7 @@ </qandaentry> <qandaentry> - <question> + <question id="76"> <para>Why can't I use <literal>org.jboss.cache.eviction.LRUPolicy</literal> for PojoCache as well?</para> @@ -1408,7 +1401,7 @@ </qandaentry> <qandaentry> - <question> + <question id="77"> <para>Does JBoss Cache's implemented LRU eviction policy operates in replication mode?</para> </question> @@ -1439,7 +1432,7 @@ </qandaentry> <qandaentry> - <question> + <question id="78"> <para>Does JBoss Cache support <literal>Region</literal>?</para> </question> @@ -1459,7 +1452,7 @@ </qandaentry> <qandaentry> - <question> + <question id="79"> <para>What are the <literal>EvictionPolicyConfig</literal> tag parameters for <literal>org.jboss.cache.eviction.LRUPolicy</literal>?</para> @@ -1508,7 +1501,7 @@ </qandaentry> <qandaentry> - <question> + <question id="80"> <para>I have turned on the eviction policy, why do I still get "out of memory" (OOM) exception?</para> </question> @@ -1529,13 +1522,13 @@ configurable in the next release.</para> </answer> </qandaentry> - </qandadiv> + </qandaset> - <qandadiv> + <qandaset defaultlabel="CacheLoaders"> <title>Cache Loaders</title> <qandaentry> - <question> + <question id="81"> <para>What is a CacheLoader?</para> </question> @@ -1591,7 +1584,7 @@ </qandaentry> <qandaentry> - <question> + <question id="82"> <para>Can writing to CacheLoaders be asynchronous?</para> </question> @@ -1604,7 +1597,7 @@ </qandaentry> <qandaentry> - <question> + <question id="83"> <para>Can I write my own CacheLoader ?</para> </question> @@ -1617,7 +1610,7 @@ </qandaentry> <qandaentry> - <question> + <question id="84"> <para>Does a CacheLoader have to use a persistent store ?</para> </question> @@ -1632,7 +1625,7 @@ </qandaentry> <qandaentry> - <question> + <question id="85"> <para>What can I use a CacheLoader for?</para> </question> @@ -1675,7 +1668,7 @@ </qandaentry> <qandaentry> - <question> + <question id="86"> <para>How do I configure JBossCache with a CacheLoader?</para> </question> @@ -1688,7 +1681,7 @@ </qandaentry> <qandaentry> - <question> + <question id="87"> <para>Do I have to pay to use Sleepycat's CacheLoader?</para> </question> @@ -1701,7 +1694,7 @@ </qandaentry> <qandaentry> - <question> + <question id="88"> <para>Can I use more than one cache loader?</para> </question> @@ -1718,7 +1711,7 @@ </qandaentry> <qandaentry> - <question> + <question id="89"> <para>Why do cache loaders go into an inconsistent state when I use transactions, pessimistic locking, and I attempt to read a node after removing it from within the same transaction scope?</para> </question> @@ -1732,19 +1725,18 @@ - </qandadiv> + </qandaset> - <qandadiv> + <qandaset defaultlabel="Troubleshooting"> <title>Troubleshooting</title> <qandaentry> - <question> + <question id="90"> <para>I am having problems getting JBoss Cache to work, where can I get information on troubleshooting?</para> </question> <answer> - <para>Troubleshooting section can be found in the following <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheTroubleshooting">wiki link</ulink> + <para>Troubleshooting section can be found in the following <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossCacheTroubleshooting">wiki link</ulink>. </para> </answer> </qandaentry> - </qandadiv> </qandaset> </article> |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:05
|
User: msurtani Date: 06/07/10 10:50:02 Modified: docs/design todo.txt Log: merged in changes from 1.4.0 Revision Changes Path 1.2 +14 -1 JBossCache/docs/design/todo.txt (In the diff below, changes in quantity of whitespace are not shown.) Index: todo.txt =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/design/todo.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- todo.txt 31 Mar 2005 10:10:39 -0000 1.1 +++ todo.txt 10 Jul 2006 14:50:02 -0000 1.2 @@ -1,5 +1,18 @@ +====================================================================================================================== -$Id: todo.txt,v 1.1 2005/03/31 10:10:39 belaban Exp $ +NOTE: + + This file is DEPRECATED and will not be updated in future. Please see http://jira.jboss.com/jira/browse/JBCACHE +for roadmaps, open tasks, and todo's. + +- +Manik Surtani +Lead, JBoss Cache + +====================================================================================================================== + + +$Id: todo.txt,v 1.2 2006/07/10 14:50:02 msurtani Exp $ |
From: Manik S. <msu...@jb...> - 2006-07-10 14:50:04
|
User: msurtani Date: 06/07/10 10:50:03 Modified: docs Changelog.txt Log: merged in changes from 1.4.0 Revision Changes Path 1.21 +70 -48 JBossCache/docs/Changelog.txt (In the diff below, changes in quantity of whitespace are not shown.) Index: Changelog.txt =================================================================== RCS file: /cvsroot/jboss/JBossCache/docs/Changelog.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -u -b -r1.20 -r1.21 --- Changelog.txt 12 Jun 2006 21:27:00 -0000 1.20 +++ Changelog.txt 10 Jul 2006 14:50:03 -0000 1.21 @@ -1,10 +1,61 @@ -$Id: Changelog.txt,v 1.20 2006/06/12 21:27:00 msurtani Exp $ +$Id: Changelog.txt,v 1.21 2006/07/10 14:50:03 msurtani Exp $ -Release 1.4.0.CR1 (June 12, 2006) +Release 1.4.0.GA (July 10, 2006) A new feature release containing very significant performance enhancements in replication, pojo operations and cache loaders, as well as features such as buddy replication. +** Sub-task + * [ JBCACHE-77 ] Create an eviction policy based on number of elements instead of nodes + * [ JBCACHE-458 ] Improve documentation on the configuration of state transfer + * [ JBCACHE-509 ] OOM during perf test under repl_sync mode + * [ JBCACHE-511 ] JBossCache payload size + * [ JBCACHE-520 ] JBossCache thruput I + * [ JBCACHE-521 ] Optimize modification list over the wire + * [ JBCACHE-553 ] JBossCache throughput II + * [ JBCACHE-556 ] Validate the original and the new api classes work under AS integration test + * [ JBCACHE-557 ] Make sure tutorial and PojoCache examples work with new PojoCache class name + * [ JBCACHE-558 ] Updated JBossCache documentation for PojoCache + * [ JBCACHE-560 ] Renamed PojoCache eviction policy + * [ JBCACHE-574 ] Optimize PojoCache in local mode + * [ JBCACHE-575 ] Optimize PojoCache in replicated mode + * [ JBCACHE-580 ] Refactored Collection interceptor impl + * [ JBCACHE-601 ] Use bulk update and remove for putObject + * [ JBCACHE-607 ] PojoCache uses _get to bypass lock and tx interceptors during putObject and removeObject + * [ JBCACHE-630 ] Modify ExtendedCacheLoader.storeState(byte[], Fqn) contract to support storage under _BUDDY_BACKUP_ subtree + * [ JBCACHE-631 ] If Buddy replication is used, cache loader must implement ExtendedCacheLoader + * [ JBCACHE-640 ] Collection class add/remove POJO needs to go through transaction as well + +** Feature Request + * [ JBCACHE-61 ] Buddy Replication + * [ JBCACHE-76 ] Create an eviction interceptor + * [ JBCACHE-198 ] ReplicationInterceptor: replace remote method calls with message ids + * [ JBCACHE-451 ] Support @Transient annotation + * [ JBCACHE-454 ] Support @Serialize annotation + * [ JBCACHE-490 ] Create a new class name POJOCache to replace TreeCacheAop + * [ JBCACHE-504 ] Optimise marshalling of Fqn, GlobalTransaction, etc + * [ JBCACHE-505 ] Optimise references when streaming data on the wire + * [ JBCACHE-516 ] putObject() should check for "__jboss::internal__" keys + * [ JBCACHE-525 ] Add JDBM cache loader support to TreeCache + * [ JBCACHE-526 ] Timed and/or batched synchronization of Async CacheLoader operations + * [ JBCACHE-528 ] Make eviction a configurable option without passivation + * [ JBCACHE-535 ] CacheLoaderInterceptor fetches data overwritten by CacheLoader.put(Fqn n, Map m) + * [ JBCACHE-537 ] state transfer code to exclude under /_buddy_backup_ when marshalling the tree + * [ JBCACHE-538 ] overloading the local state transfer method with a root under which state would be stored + * [ JBCACHE-555 ] Reduce memory and increase basic performance + * [ JBCACHE-559 ] If setUseMarshalling is not set on one node, get unhelpful EOFException + * [ JBCACHE-564 ] Improve region matching algorithm in RegionManager + * [ JBCACHE-581 ] Performance of Method.equals + * [ JBCACHE-613 ] Provide skipLockInterceptor option for get and put + * [ JBCACHE-620 ] Max Age attribute on LRU cache policy + * [ JBCACHE-624 ] PojoCache add an option to handle non-instrumented POJO and non-Serializable replication + * [ JBCACHE-628 ] Expose PojoCache.getCachedType() in PojoCacheMBean + * [ JBCACHE-632 ] ChainingCacheLoader implements ExtendedCacheLoader + * [ JBCACHE-637 ] OPtion to bypass data gravitation + * [ JBCACHE-642 ] Flag to remove the FileCacheLoader content upon startup + * [ JBCACHE-652 ] create a special LRUAlgorithm with a inUse requirement + * [ JBCACHE-670 ] Create a tools directory in the dist to provide example Ant scripts for PojoCache pre-compiler. + ** Bug * [ JBCACHE-352 ] Doing cache.remove() when a tx is running and a cacheloader is present, and doing a cache.get() within the same tx causes the cache to load the value from the cacheloader again * [ JBCACHE-435 ] Multiple attempts to remove an AOP object on putObject() @@ -31,8 +82,10 @@ * [ JBCACHE-606 ] TimeoutException (and lock ownership problem) under load test * [ JBCACHE-608 ] Cache loader does not load data for cache.get(Fqn fqn) calls * [ JBCACHE-612 ] Race condition with 2-PC and pessimistic locking + * [ JBCACHE-614 ] AS4.0.4 integration error * [ JBCACHE-615 ] Test failure - org.jboss.cache.buddyreplication.BuddyPoolBroadcastTest * [ JBCACHE-616 ] Package org.jboss.cache.data missing in distribution (JBossCache 1.4.0.Beta) + * [ JBCACHE-622 ] TreeCache.getChildrenNames(fqn), in certain circumstances, wipes cache tree nodes that are children of fqn * [ JBCACHE-626 ] PojoCache bug in annotation checking optimization * [ JBCACHE-634 ] Using optimistic locking and setting UseMarshalling to true causes replication exceptions. * [ JBCACHE-635 ] Illegal characters in buddy backup node names @@ -43,42 +96,26 @@ * [ JBCACHE-647 ] Interop tests failure (JBossCache 1.4.0.Beta2) * [ JBCACHE-648 ] Exception during addNode in sensor example * [ JBCACHE-649 ] IdentityLock.getFqn() always returns Fqn.ROOT + * [ JBCACHE-653 ] Classloader leakage during re-deployment * [ JBCACHE-655 ] Cache under transaction should allow mix of LOCAL or REPL mode option - -** Feature Request - * [ JBCACHE-61 ] Buddy Replication - * [ JBCACHE-76 ] Create an eviction interceptor - * [ JBCACHE-198 ] ReplicationInterceptor: replace remote method calls with message ids - * [ JBCACHE-451 ] Support @Transient annotation - * [ JBCACHE-454 ] Support @Serialize annotation - * [ JBCACHE-490 ] Create a new class name POJOCache to replace TreeCacheAop - * [ JBCACHE-504 ] Optimise marshalling of Fqn, GlobalTransaction, etc - * [ JBCACHE-505 ] Optimise references when streaming data on the wire - * [ JBCACHE-516 ] putObject() should check for "__jboss::internal__" keys - * [ JBCACHE-525 ] Add JDBM cache loader support to TreeCache - * [ JBCACHE-526 ] Timed and/or batched synchronization of Async CacheLoader operations - * [ JBCACHE-528 ] Make eviction a configurable option without passivation - * [ JBCACHE-535 ] CacheLoaderInterceptor fetches data overwritten by CacheLoader.put(Fqn n, Map m) - * [ JBCACHE-537 ] state transfer code to exclude under /_buddy_backup_ when marshalling the tree - * [ JBCACHE-538 ] overloading the local state transfer method with a root under which state would be stored - * [ JBCACHE-555 ] Reduce memory and increase basic performance - * [ JBCACHE-564 ] Improve region matching algorithm in RegionManager - * [ JBCACHE-581 ] Performance of Method.equals - * [ JBCACHE-613 ] Provide skipLockInterceptor option for get and put - * [ JBCACHE-624 ] PojoCache add an option to handle non-instrumented POJO and non-Serializable replication - * [ JBCACHE-628 ] Expose PojoCache.getCachedType() in PojoCacheMBean - * [ JBCACHE-632 ] ChainingCacheLoader implements ExtendedCacheLoader - * [ JBCACHE-637 ] OPtion to bypass data gravitation - * [ JBCACHE-642 ] Flag to remove the FileCacheLoader content upon startup - * [ JBCACHE-652 ] create a special LRUAlgorithm with a inUse requirement + * [ JBCACHE-659 ] Evictions with Optimistic Locking not working + * [ JBCACHE-661 ] Serious concurrency issue with empty Cache & CacheLoader + * [ JBCACHE-662 ] missing synchronization on TreeCache "members" + * [ JBCACHE-668 ] Failure in synchronous remote commit() call leads to unreleased locks. + * [ JBCACHE-669 ] With buddy replication, PojoCache cannot find shared objects from a secondary pojo + * [ JBCACHE-682 ] AbortionTest extension to close channel in beforeCompletion() fails + * [ JBCACHE-683 ] PojoTxSynchronizationHandler produces NPE during rollback ** Task * [ JBCACHE-7 ] PojoCache benchmark and performance tuning * [ JBCACHE-197 ] Review: can Node.data and Node.children bu a ConcurrentHashMap (efficiency) * [ JBCACHE-203 ] PojoCache get/put/remove object apis needs to be atomic + * [ JBCACHE-333 ] Remove NestedRuntimeException (requires JDK 1.4 to be the baseline) + * [ JBCACHE-367 ] Remove dependency on eviction RegionManager from a direct reference AOP packages. * [ JBCACHE-449 ] PojoCache when using CacheLoader is slow during putObject * [ JBCACHE-488 ] Switch to JBoss Serialization for replication/storage * [ JBCACHE-501 ] Need customized serialization to minimize PojoCache payload + * [ JBCACHE-508 ] JBossCache bechmark and performance tuning * [ JBCACHE-517 ] Create a default marshaller for JBossCache * [ JBCACHE-540 ] Be consistent between Node.getDataKeys and Tree.getKeys behavior * [ JBCACHE-550 ] Properly handle marshalling for the _buddy_backup_ region @@ -87,25 +124,10 @@ * [ JBCACHE-605 ] Node to re-throw lock exception with proper fqn * [ JBCACHE-610 ] prepare methodcall has a bigger payload size * [ JBCACHE-621 ] PojoCache to optimize Collection classes with value as primitive such as String - -** Sub-task - * [ JBCACHE-77 ] Create an eviction policy based on number of elements instead of nodes - * [ JBCACHE-481 ] Release 1.4.0.alpha - * [ JBCACHE-482 ] Release 1.4.0.beta - * [ JBCACHE-511 ] JBossCache payload size - * [ JBCACHE-520 ] JBossCache thruput I - * [ JBCACHE-556 ] Validate the original and the new api classes work under AS integration test - * [ JBCACHE-557 ] Make sure tutorial and PojoCache examples work with new PojoCache class name - * [ JBCACHE-558 ] Updated JBossCache documentation for PojoCache - * [ JBCACHE-560 ] Renamed PojoCache eviction policy - * [ JBCACHE-574 ] Optimize PojoCache in local mode - * [ JBCACHE-575 ] Optimize PojoCache in replicated mode - * [ JBCACHE-580 ] Refactored Collection interceptor impl - * [ JBCACHE-601 ] Use bulk update and remove for putObject - * [ JBCACHE-607 ] PojoCache uses _get to bypass lock and tx interceptors during putObject and removeObject - * [ JBCACHE-630 ] Modify ExtendedCacheLoader.storeState(byte[], Fqn) contract to support storage under _BUDDY_BACKUP_ subtree - * [ JBCACHE-631 ] If Buddy replication is used, cache loader must implement ExtendedCacheLoader - * [ JBCACHE-640 ] Collection class add/remove POJO needs to go through transaction as well + * [ JBCACHE-666 ] Refactored PojoCache examples directory to allow easier use of the ant tasks for users projects + * [ JBCACHE-672 ] PojoCache uses registered classloader during failover + * [ JBCACHE-678 ] Adding Troubleshooting to FAQ + * [ JBCACHE-680 ] TreeCache demo gui to update view instanteously Release 1.3.0.SP2 (May 08, 2006) ================================ |
From: Heiko W. R. <hw...@pi...> - 2006-07-10 14:43:05
|
User: pilhuhn Date: 06/07/10 10:42:59 Added: src/main/org/jboss/test/snmp Tag: Branch_4_0 ComparableSnmpOidTestCase.java Log: Unit Test for the ComparableSnmpObjectId. JBAS-3178. Revision Changes Path No revision No revision 1.1.2.2 +189 -0 jbosstest/src/main/org/jboss/test/snmp/ComparableSnmpOidTestCase.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ComparableSnmpOidTestCase.java =================================================================== RCS file: ComparableSnmpOidTestCase.java diff -N ComparableSnmpOidTestCase.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ComparableSnmpOidTestCase.java 10 Jul 2006 14:42:59 -0000 1.1.2.2 @@ -0,0 +1,189 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2005, JBoss Inc., and individual contributors as indicated + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * This is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this software; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA, or see the FSF site: http://www.fsf.org. + */ +package org.jboss.test.snmp; + +import java.util.SortedSet; +import java.util.TreeSet; + +import org.jboss.jmx.adaptor.snmp.agent.ComparableSnmpObjectId; + +import junit.framework.TestCase; + +/** + * Tests for the ComparableSnmpObjectId, a Subclass of SnmpObjectId from + * the joesnmp package. Most tests are trivial. + * @author <a href="mailto:hw...@pi...">Heiko W. Rupp</a> + * @version $Revision: 1.1.2.2 $ + */ +public class ComparableSnmpOidTestCase extends TestCase +{ + + /** + * Make sure, that the passed oid which does not end in .0 + * is not detected as leaf. + */ + public void testIsNotLeaf() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId(".1.2.3.4"); + boolean res = coid.isLeaf(); + assertFalse(res); + } + + /** + * Make sure that the passed oid ending in .0 is detected as leaf. + */ + public void testIsLeaf() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId(".1.2.3.4.0"); + boolean res = coid.isLeaf(); + assertTrue(res); + } + + /** + * Make sure that the passed oid ending in .0 is detected as leaf. + */ + public void testIsLeaf2() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.0"); + boolean res = coid.isLeaf(); + assertTrue(res); + } + + + /** + * See if the last part of an oid is correctly chopped of. + * + */ + public void testRemoveLastPart() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.0"); + ComparableSnmpObjectId res = coid.removeLastPart(); + assertEquals(".1.2.3.4",res.toString()); + } + + /** + * See if compareTo from Comparable works as expected. + * This is needed for use of the ComparableSnmpObjectId in SortedSets etc. + * @see java.lang.Comparable + */ + public void testCompareTo1() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.0"); + ComparableSnmpObjectId coid2 = new ComparableSnmpObjectId(".1.2.3.4.0"); + int res = coid.compareTo(coid2); + assertEquals(0,res); + } + + /** + * See if compareTo from Comparable works as expected. + * This is needed for use of the ComparableSnmpObjectId in SortedSets etc. + * @see java.lang.Comparable + */ + public void testCompareTo2() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4"); + ComparableSnmpObjectId coid2 = new ComparableSnmpObjectId("1.2.3.4.0"); + int res = coid.compareTo(coid2); + assertTrue(res!=0); + } + + /** + * See if compareTo from Comparable works as expected. + * This is needed for use of the ComparableSnmpObjectId in SortedSets etc. + * @see java.lang.Comparable + */ + public void testCompareTo3() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.1"); + ComparableSnmpObjectId coid2 = new ComparableSnmpObjectId("1.2.3.4.2"); + int res = coid.compareTo(coid2); + assertTrue(res<0); + } + + /** + * See if compareTo from Comparable works as expected. + * This is needed for use of the ComparableSnmpObjectId in SortedSets etc. + * @see java.lang.Comparable + */ + public void testCompareTo4() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.2"); + ComparableSnmpObjectId coid2 = new ComparableSnmpObjectId("1.2.3.4.1"); + int res = coid.compareTo(coid2); + assertTrue(res>0); + } + + /** + * See if compareTo from Comparable works as expected. + * This is needed for use of the ComparableSnmpObjectId in SortedSets etc. + * @see java.lang.Comparable + */ + public void testCompareTo5() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.2"); + Object coid2 = new Object(); + int res = coid.compareTo(coid2); + assertTrue(res == -1); + } + + + public void testGetNextArc() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4"); + ComparableSnmpObjectId res = coid.getNextArc(); + assertEquals(".1.2.4",res.toString()); + } + + public void testGetNextArc2() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId(".1.2.3.4.5"); + ComparableSnmpObjectId res = coid.getNextArc(); + assertEquals(".1.2.3.5",res.toString()); + } + + public void testGetNextArc3() + { + ComparableSnmpObjectId coid = new ComparableSnmpObjectId(".1.2.3.4.0"); + ComparableSnmpObjectId res = coid.getNextArc(); + assertEquals(".1.2.4",res.toString()); + } + + + public void testGetSubtree() + { + SortedSet s = new TreeSet(); + ComparableSnmpObjectId coid = new ComparableSnmpObjectId("1.2.3.4.0"); + s.add(coid); + coid = new ComparableSnmpObjectId("1.2.3.5.0"); + s.add(coid); + coid = new ComparableSnmpObjectId("1.2.3.6.0"); + s.add(coid); + + ComparableSnmpObjectId c2 = new ComparableSnmpObjectId("1.2.3.4.1"); + SortedSet subset = s.tailSet(c2); + assertEquals(2,subset.size()); + + subset = s.headSet(c2); + assertEquals(1,subset.size()); + } + +} \ No newline at end of file |
From: Heiko W. R. <hw...@pi...> - 2006-07-10 14:41:51
|
User: pilhuhn Date: 06/07/10 10:41:46 Modified: varia/src/resources/services/snmp/deploy Tag: Branch_4_0 attributes.xml Log: Finally SNMP-nodes can have an index larger than 9. See JBAS-3178. Revision Changes Path No revision No revision 1.1.2.3 +2 -1 contrib/varia/src/resources/services/snmp/deploy/attributes.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: attributes.xml =================================================================== RCS file: /cvsroot/jboss/contrib/varia/src/resources/services/snmp/deploy/attributes.xml,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -b -r1.1.2.2 -r1.1.2.3 --- attributes.xml 7 May 2006 16:38:28 -0000 1.1.2.2 +++ attributes.xml 10 Jul 2006 14:41:46 -0000 1.1.2.3 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!-- - $Id: attributes.xml,v 1.1.2.2 2006/05/07 16:38:28 dimitris Exp $ + $Id: attributes.xml,v 1.1.2.3 2006/07/10 14:41:46 pilhuhn Exp $ This configuration file controls the mapping of JMX mbean attributes to SNMP OIDs accessible through the snmp-adapter. @@ -37,6 +37,7 @@ <!-- DefaultDS statistics --> <mbean name="jboss.jca:name=DefaultDS,service=ManagedConnectionPool" oid-prefix=".1.2.3.4.1"> <attribute name="InUseConnectionCount" oid=".9"/> + <attribute name="MaxConnectionsInUseCount" oid=".10"/> </mbean> <!-- system information group see RFC-1213 --> |
From: Heiko W. R. <hw...@pi...> - 2006-07-10 14:40:51
|
User: pilhuhn Date: 06/07/10 10:40:42 Modified: varia/src/main/org/jboss/jmx/adaptor/snmp/agent Tag: Branch_4_0 ReadOnlyException.java Log: Fix keyword expansion. Revision Changes Path No revision No revision 1.1.2.9 +0 -0 contrib/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/ReadOnlyException.java (In the diff below, changes in quantity of whitespace are not shown.) Index: ReadOnlyException.java =================================================================== RCS file: /cvsroot/jboss/contrib/varia/src/main/org/jboss/jmx/adaptor/snmp/agent/ReadOnlyException.java,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -b -r1.1.2.8 -r1.1.2.9 --- ReadOnlyException.java 10 Jul 2006 14:37:39 -0000 1.1.2.8 +++ ReadOnlyException.java 10 Jul 2006 14:40:42 -0000 1.1.2.9 @@ -28,7 +28,7 @@ * a client wants to write to it. * * @author <a href="mailto:hw...@pi...">Heiko W. Rupp</a> - * @version $Revision: 1.1.2.8 $ + * @version $Revision: 1.1.2.9 $ */ public class ReadOnlyException extends Exception { |