[jboss-dev-forums] [Design of POJO Server] - Re: AS 5 interoperability rules

bstansberry@jboss.com do-not-reply at jboss.com
Thu Oct 4 18:27:59 EDT 2007


Thinking out loud a bit here, so feel free to ignore me... :-)

The JBAS-4802 issue is a simpler aspect of the general problem, since as you say I can just keep the old policy impl around and people can make a config change to revert to the old policy if they want to use older clients.

Trickier is the LoadBalancePolicy interface itself, which unfortunately has this method:

public Object chooseTarget (FamilyClusterInfo clusterFamily, 
                                                org.jboss.invocation.Invocation routingDecision);

That's the legacy invocation class.  Useless method for an AOP-based client. Our standard impls don't currently use this method, but http://jira.jboss.com/jira/browse/JBAS-4455 is a customer feature request that would.  Logically, an AOP-based client should support an analogous method, with org.jboss.aop.joinpoint.Invocation as the param type.

I'd like to refactor this into a base interface, and then an AOP-based subinterface, with the existing legacy interface also a subinterface.  But, can't really do that since the legacy interface is used extensively in EJB3 client code (in @Clustered, in the bean proxy classes, in the cluster interceptor.) Changing the type used there will break older clients.

What I should be able to do is create a subinterface of the existing LoadBalancePolicy adding 

public Object chooseTarget (FamilyClusterInfo clusterFamily, 
                                                org.jboss.aop.joinpoint.Invocation invocation);

The only place that type would be used would be in the ClusterChooserInterceptor, which could do an instanceof check on the lbp and call the overloaded method if available.  That shouldn't break existing clients, since if they have an old version of ClusterChooserInterceptor, they don't have that code.

I'll also deprecate the method with the legacy Invocation class.

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

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



More information about the jboss-dev-forums mailing list