[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Valve on HAAspect (Repost)

clebert.suconic@jboss.com do-not-reply at jboss.com
Sun Dec 17 00:06:09 EST 2006


I have just committed ValveAspect, as an extension of HAAspect.

I want to have a design session with developers about this. if something
is not right I can refactor it later.


I could change this to use the aspect's XML, but from my point of view
it would complicate another side of things (like how to get the
ConnectinDelegate from any Delegate, and how to get the proper Valve in
place). Right now I'm adding the Aspect to the stack using the API. This is to control the instantiation of ValveAspect, and also we will only install the aspect on clustered connection factories.

We could play with two stacks, but the instantiation needs also to be taken in consideration. If we use plain pointcuts it will require us to aways navigate to ConnectionState/ConnectionDelegate from any given Delegate what would probably make the aspect use some ifdefs. (we can discuss this over a design session)

As you can see I have also created an abstract type Valve, which
encapsulates synchronized blocks and notifies. It's a very simple class
but I liked the way I did, encapsulating the logic over there.
(org.jboss.jms.util.Valve). It's a functionality so basic that I
wondered if anyone else ever implemented such thing (probably yes).

Another point is about ValveAspect extending HAAspect. I could move
everything to HAAspect but it looked too messy when I had it only in one
class. First because HAAspect exists per ConnectionFactory, while
ValveAspect exists per Connection, and the use cases are a little bit
different. ValveAspect will call failover in a connection, but it will
block simultaneous calls.

I have also moved the ConnectionListener into ValveAspect as I don't
want simultaneous failover calls captured by try..catch or Remoting
Lease.

I still have a failure on ValveTest, but it's not caused by the Valve
itself. The multi-thread has made the case a little bit worse, so we
will have to investigate this independently of the valve development.
Something about the Message is not on the channel (Paging support)


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

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



More information about the jboss-dev-forums mailing list