4 Replies Latest reply on Jan 4, 2006 10:45 AM by Christophe Gierski

    JMX Invocation Value

    Paul Weinberg Newbie


      Sorry for being an ignoramus, but what is the status of that particular task? If it is still outstanding, I'd like a crack at it..

      Thanks and happy new year,


        • 1. Re: JMX Invocation Value
          Bill Burke Master

          What are you talking about? Invocation Valve you mean?

          • 2. Re: JMX Invocation Value
            Paul Weinberg Newbie


            I thought I saw that in the V4.0 'Vision', you had a need to hold the invocations in a queue while an Mbean is being inloaded/loaded or whatever...


            • 3. Re: JMX Invocation Value
              Juha Lindfors Master

              Have a look at org.jboss.mx.server.Suspendable interface. This is extended by MBeanInvoker and in turn implemented by org.jboss.mx.server.AbstractMBeanInvoker class (with empty implementation).

              The methods provided by the interface are:

              public void suspend() {}

              public void suspend(long wait) throws TimeoutException{}

              public void suspend(boolean force) {}

              public boolean isSuspended() { return false; }

              public void setInvocationTimeout(long time) {}

              public long getInvocationTimeout() { return 0l; }

              public void resume() {}

              So these are available per registered MBean. You can provide policy implementations and then have these methods delegate to your policy for requested functionality.

              What you need to do in the policy/invoker level is keep track of the invocation objects going into the interceptor stack to be able to cleanly suspend a service (and possible recycle it). Simple counter should do. Method suspend() should block until all existing invocations are returned from the service. Invocations arriving in the mean time can be either queued (with or without timeout), redirected, or plain denied from the client via an exception. If queued (and assuming not timed out), resume() should release the invocations objects from the queue and send them down the interceptor stack.

              Suspend(long ms) only allows x ms for the existing invocations to be serviced. After that -- depending on the policy -- the service can be forcibly shut down or the server may just give up on the suspend() effort.

              Suspend(boolean force) obviously allows a forced suspend of all invocations.

              set/getTimeout on the invocation allows the invocations that have been queued to timeout -- if the service has not been resumed in the given time the invocations may be redirected or denied by throwing an exception to the client.

              In addition you need to add a mechanism to expose the suspend/resume operations as part of the management interface. That means each invoker is available through a central management component (some type of xxxManager object) that exposes the suspend(ObjectName) operations.

              • 4. Re: JMX Invocation Value
                Christophe Gierski Newbie


                I didn't understand how to implement policy for these methods. Do you have a short example ?