-
1. Re: JMX Invocation Value
bill.burke Jan 2, 2003 8:36 AM (in response to pweinberg)What are you talking about? Invocation Valve you mean?
-
2. Re: JMX Invocation Value
pweinberg Jan 2, 2003 9:54 AM (in response to pweinberg)hi,
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...
Paul -
3. Re: JMX Invocation Value
juhalindfors Jan 7, 2003 11:33 AM (in response to pweinberg)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
cgierski Jan 4, 2006 10:45 AM (in response to pweinberg)Hi,
I didn't understand how to implement policy for these methods. Do you have a short example ?
thanks,
--Christophe.