|
(resending...used wrong email account...)
Hi, what would appear to be marker interfaces org.apache.camel.IsSingleton[1] and org.apache.camel.MultipleConsumersSupport[2] have seemingly redundant isSingleton() and isMultipleConsumersSupported() methods -- wouldn't it be better to remove those methods and make them pure marker/tagging interfaces (removing them from those objects for which the above methods would return false), and rely on instanceof() instead of calling those boolean methods (a la org.apache.camel.ServicePoolAware[3]?) I don't know the reason for those boolean methods--a coding error or performance decision (assuming there would be one) to have them. I can supply a patch if desired. Regards, Glen [1] http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/IsSingleton.java?view=markup [2] http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/MultipleConsumersSupport.java?view=markup [3] http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ServicePoolAware.java?view=markup -- Glen Mazza Talend Community Coders http://coders.talend.com blog: http://www.jroller.com/gmazza |
|
Hi
When you have a boolean method it gives more power, for example we use this with the IsSingleton, to provide a sensitive default in the DefaultEndpoint. And then custom endpoints can override and return another value instead. Also the JMS endpoint has a case where depending whether its a topic or queue, its either singleton or not. I think its sort of the same case of the MultipleConsumerSupport as you can configure this per endpoint, eg ?multipleConsumers=true|false. On Fri, Dec 9, 2011 at 3:33 PM, Glen Mazza <[hidden email]> wrote: > (resending...used wrong email account...) > > Hi, what would appear to be marker interfaces > org.apache.camel.IsSingleton[1] and > org.apache.camel.MultipleConsumersSupport[2] have seemingly redundant > isSingleton() and isMultipleConsumersSupported() methods -- wouldn't it be > better to remove those methods and make them pure marker/tagging interfaces > (removing them from those objects for which the above methods would return > false), and rely on instanceof() instead of calling those boolean methods (a > la org.apache.camel.ServicePoolAware[3]?) I don't know the reason for those > boolean methods--a coding error or performance decision (assuming there > would be one) to have them. I can supply a patch if desired. > > Regards, > Glen > > [1] > http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/IsSingleton.java?view=markup > > [2] > http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/MultipleConsumersSupport.java?view=markup > > [3] > http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ServicePoolAware.java?view=markup > > -- > Glen Mazza > Talend Community Coders > http://coders.talend.com > blog: http://www.jroller.com/gmazza > -- Claus Ibsen ----------------- FuseSource Email: [hidden email] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/ |
| Powered by Nabble | Edit this page |
