There are problems with the current implementation. The dispatcher must not own args 
but the invocation should. The problem is that dispatcher is not thread-safe and 
concurrent threads override each other's parameters.

The consequences are:
- different threads associated with the same transaction;
- faulty re-entered method calls;
- concurrent method calls on stateful session beans;
- unexpected UndeclaredThrowableException's invoking MBeans;
- many many other very weird behaviours.

This is the diff of the fix. Is it ok to commit or do you have any remarks?


  | M mx/server/AttributeDispatcher.java
  | [EMAIL PROTECTED] server]$ cvs diff AttributeDispatcher.java
  | [EMAIL PROTECTED]'s password:
  | Index: AttributeDispatcher.java
  | ===================================================================
  | RCS file: 
/cvsroot/jboss/jmx/src/main/org/jboss/mx/server/AttributeDispatcher.java,v
  | retrieving revision 1.1.2.1
  | diff -r1.1.2.1 AttributeDispatcher.java
  | 30c30
  | <    public Object dispatch() throws InvocationException
  | ---
  | >    public Object dispatch(Object[] args) throws InvocationException
  | 
  | 
  | M mx/server/Dispatcher.java
  | [EMAIL PROTECTED] server]$ cvs diff Dispatcher.java
  | [EMAIL PROTECTED]'s password:
  | Index: Dispatcher.java
  | ===================================================================
  | RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/Dispatcher.java,v
  | retrieving revision 1.4.2.1
  | diff -r1.4.2.1 Dispatcher.java
  | 18,23c18
  | <
  | <    public void setArgs(Object[] args);
  | <
  | <    public Object[] getArgs();
  | <
  | <    public Object dispatch() throws InvocationException;
  | ---
  | >    public Object dispatch(Object[] args) throws InvocationException;
  | 
  | M mx/server/Invocation.java
  | [EMAIL PROTECTED] server]$ cvs diff Invocation.java
  | [EMAIL PROTECTED]'s password:
  | Index: Invocation.java
  | ===================================================================
  | RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/Invocation.java,v
  | retrieving revision 1.5.2.1
  | diff -r1.5.2.1 Invocation.java
  | 23c23,24
  | <
  | ---
  | >    private Object[] args;
  | >
  | 38a40,49
  | >
  | >    public void setArgs(Object[] args)
  | >    {
  | >       this.args = args;
  | >    }
  | >
  | >    public Object[] getArgs()
  | >    {
  | >       return args;
  | >    }
  | 41a53,57
  | >       return dispatch(args);
  | >    }
  | >
  | >    public Object dispatch(Object[] args) throws InvocationException
  | >    {
  | 45c61
  | <       return dispatcher.dispatch();
  | ---
  | >       return dispatcher.dispatch(args);
  | 
  | M mx/server/InvocationContext.java
  | [EMAIL PROTECTED] server]$ cvs diff InvocationContext.java
  | [EMAIL PROTECTED]'s password:
  | Index: InvocationContext.java
  | ===================================================================
  | RCS file: /cvsroot/jboss/jmx/src/main/org/jboss/mx/server/InvocationContext.java,v
  | retrieving revision 1.7.2.2
  | diff -r1.7.2.2 InvocationContext.java
  | 120,124d119
  | <    public void setArgs(Object[] args)
  | <    {
  | <       this.dispatcher.setArgs(args);
  | <    }
  | <
  | 128a124
  | >
  | 134,138d129
  | <    public Object[] getArgs()
  | <    {
  | <       return this.dispatcher.getArgs();
  | <    }
  | <
  | 199,211c190
  | <       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
  | 
  | M mx/server/ReflectedDispatcher.java
  | [EMAIL PROTECTED] server]$ cvs diff ReflectedDispatcher.java
  | [EMAIL PROTECTED]'s password:
  | Index: ReflectedDispatcher.java
  | ===================================================================
  | RCS file: 
/cvsroot/jboss/jmx/src/main/org/jboss/mx/server/ReflectedDispatcher.java,v
  | retrieving revision 1.4.2.3
  | diff -r1.4.2.3 ReflectedDispatcher.java
  | 38d37
  | <    protected Object[] args = null;
  | 54,64c53
  | <    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
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3831852#3831852

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3831852


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to