From: Alexey L. <lou...@us...> - 2004-04-22 21:07:06
|
User: loubyansky Date: 04/04/22 14:06:59 Modified: src/main/org/jboss/mx/server Tag: Branch_3_2 AttributeDispatcher.java Dispatcher.java Invocation.java InvocationContext.java ReflectedDispatcher.java Log: moved args from the Dispatcher to the Invocation to void concurrent threads sharing the same Dispatcher overriding each other's invocation args Revision Changes Path No revision No revision 1.1.2.2 +2 -2 jmx/src/main/org/jboss/mx/server/AttributeDispatcher.java Index: AttributeDispatcher.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/AttributeDispatcher.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- AttributeDispatcher.java 16 Feb 2004 02:10:24 -0000 1.1.2.1 +++ AttributeDispatcher.java 22 Apr 2004 21:06:59 -0000 1.1.2.2 @@ -6,7 +6,7 @@ * getter and setter dispatch. * * @author Sco...@jb... - * @version $Revision: 1.1.2.1 $ + * @version $Revision: 1.1.2.2 $ */ public class AttributeDispatcher extends ReflectedDispatcher @@ -27,7 +27,7 @@ * @return the result of the attribute accessor invocation * @throws InvocationException */ - public Object dispatch() throws InvocationException + public Object dispatch(Object[] args) throws InvocationException { Object value = null; try 1.4.2.2 +2 -7 jmx/src/main/org/jboss/mx/server/Dispatcher.java Index: Dispatcher.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/Dispatcher.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -u -r1.4.2.1 -r1.4.2.2 --- Dispatcher.java 2 Jan 2004 22:57:07 -0000 1.4.2.1 +++ Dispatcher.java 22 Apr 2004 21:06:59 -0000 1.4.2.2 @@ -10,17 +10,12 @@ /** * * @author <a href="mailto:ju...@jb...">Juha Lindfors</a>. - * @version $Revision: 1.4.2.1 $ + * @version $Revision: 1.4.2.2 $ * */ public interface Dispatcher { - - public void setArgs(Object[] args); - - public Object[] getArgs(); - - public Object dispatch() throws InvocationException; + public Object dispatch(Object[] args) throws InvocationException; } 1.5.2.2 +19 -3 jmx/src/main/org/jboss/mx/server/Invocation.java Index: Invocation.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/Invocation.java,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -u -r1.5.2.1 -r1.5.2.2 --- Invocation.java 2 Jan 2004 22:57:07 -0000 1.5.2.1 +++ Invocation.java 22 Apr 2004 21:06:59 -0000 1.5.2.2 @@ -13,14 +13,15 @@ /** * * @author <a href="mailto:ju...@jb...">Juha Lindfors</a>. - * @version $Revision: 1.5.2.1 $ + * @version $Revision: 1.5.2.2 $ * */ public class Invocation extends InvocationContext implements Dispatcher { - + private Object[] args; + // Constructors -------------------------------------------------- public Invocation() {} @@ -36,13 +37,28 @@ { super.copy(ctx); } + + public void setArgs(Object[] args) + { + this.args = args; + } + + public Object[] getArgs() + { + return args; + } public Object dispatch() throws InvocationException { + return dispatch(args); + } + + public Object dispatch(Object[] args) throws InvocationException + { if (dispatcher == null) return Void.TYPE; - return dispatcher.dispatch(); + return dispatcher.dispatch(args); } 1.7.2.3 +3 -24 jmx/src/main/org/jboss/mx/server/InvocationContext.java Index: InvocationContext.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/InvocationContext.java,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -r1.7.2.2 -r1.7.2.3 --- InvocationContext.java 4 Jan 2004 08:48:42 -0000 1.7.2.2 +++ InvocationContext.java 22 Apr 2004 21:06:59 -0000 1.7.2.3 @@ -17,7 +17,7 @@ /** * @author <a href="mailto:ju...@jb...">Juha Lindfors</a>. * @author <a href="mailto:d_j...@us...">David Jencks</a> - * @version $Revision: 1.7.2.2 $ + * @version $Revision: 1.7.2.3 $ * */ @@ -117,25 +117,16 @@ return attributeType; } - public void setArgs(Object[] args) - { - this.dispatcher.setArgs(args); - } - public boolean isWritable() { return isWritable; } + public void setWritable(boolean writable) { this.isWritable = writable; } - public Object[] getArgs() - { - return this.dispatcher.getArgs(); - } - public void setInterceptors(List interceptors) { // FIXME: make a copy @@ -196,19 +187,7 @@ class NullDispatcher implements Dispatcher { - private Object[] args = null; - - public Object[] getArgs() - { - return args; - } - - public void setArgs(Object[] args) - { - this.args = args; - } - - public Object dispatch() throws InvocationException + public Object dispatch(Object[] args) throws InvocationException { return null; } 1.4.2.4 +2 -13 jmx/src/main/org/jboss/mx/server/ReflectedDispatcher.java Index: ReflectedDispatcher.java =================================================================== RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/ReflectedDispatcher.java,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -u -r1.4.2.3 -r1.4.2.4 --- ReflectedDispatcher.java 17 Apr 2004 17:30:58 -0000 1.4.2.3 +++ ReflectedDispatcher.java 22 Apr 2004 21:06:59 -0000 1.4.2.4 @@ -20,7 +20,7 @@ /** * * @author <a href="mailto:ju...@jb...">Juha Lindfors</a>. - * @version $Revision: 1.4.2.3 $ + * @version $Revision: 1.4.2.4 $ * */ public class ReflectedDispatcher @@ -35,7 +35,6 @@ protected Method method = null; protected Object target = null; - protected Object[] args = null; // Constructors -------------------------------------------------- @@ -51,17 +50,7 @@ // Dispatcher implementation ------------------------------------- - public void setArgs(Object[] args) - { - this.args = args; - } - - public Object[] getArgs() - { - return args; - } - - public Object dispatch() throws InvocationException + public Object dispatch(Object[] args) throws InvocationException { if (method == null) return Void.TYPE; |