[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by ataylor
anonymous wrote : How can you add a mapping for each allowable address if there are no allowable addresses? .....
|
| Perhaps there is a terminology mix up here?
By allowable address I'm assuming you mean a destination!
so in SimpleAddressManager we would have
| public boolean addDestination(final SimpleString address)
| {
| Bindings bindings = new BindingsImpl();
| mappings.putIfAbsent(address, bindings);
| return destinations.addIfAbsent(address);
| }
this means that all destinations exist in the mappings object, except that they may have an empty Bindings object. This also means that when i check for matching addresses i don't have to check both the destinations and the mappings only the mappings. Taking this further if they exist in both destinations and mappings we don't need destinations, we can just check in the mappings, if theres an entry then its an allowable address, i.e. it has a mapping, empty or not.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199744#4199744
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199744
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by ataylor
anonymous wrote : Allowable addresses are only used if checkAllowable = true.
|
| It's valid for the postoffice to have no allowable addresses, and wildcards must work then too.
|
| Checkallowable is really only true for JMS, where we have to trap sends to non-existent topics.
it will still work when there are no allowable addresses. Their calculated from the mappings not the addresses. If we add a mapping for each allowable address, even if the bindings object is empty then we don't need to maintain allowable addresses. the contains destination method just checks the the keyset of mappings instead.
anonymous wrote : That works if the queue already exists at the time the wildcard subscription is added. But what if the queue is added *after* the subscription is added?
It does i have a test to cover this.
anonymous wrote : Only if we only allow routing to allowable addresses at all times (I.e. effectively force checkAllowable to always be true)
see earlier response.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199741#4199741
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199741
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by timfox
"ataylor" wrote : ok, so instead of adding a mapping for an address when the first binding is added we do this for each allowable address.
|
Allowable addresses are only used if checkAllowable = true.
It's valid for the postoffice to have no allowable addresses, and wildcards must work then too.
Checkallowable is really only true for JMS, where we have to trap sends to non-existent topics.
anonymous wrote :
| for queues this is no different as its always added anyway, but for topics there'll be a mapping which contains an empty bindings object. This means that when a new consumer registers with a wildcard queue i can garauntee that theres always a mapping to check. so lets say the wildcard topic is topicjms.topic.* i can search the mappings to make sure that binding topicjms.topic.A also gets this binding registered with it.
|
That works if the queue already exists at the time the wildcard subscription is added. But what if the queue is added *after* the subscription is added?
anonymous wrote :
| Before i couldn't do this which is why i was pre calculating the whole map.
|
| actually come to think of it, we could remove allowable destinations completely and for containsDestination we could just use the keyset of the mappings.
Only if we only allow routing to allowable addresses at all times (I.e. effectively force checkAllowable to always be true)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199736#4199736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199736
15 years, 3 months
[Design of AOP on JBoss (Aspects/JBoss)] - Using ClassInfo in AOP
by kabir.khan@jboss.com
Ståle,
I think the first thing to do is to fix jboss-reflect (alternatively hack together a prototype in aop before fixing this in jboss-reflect). http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199605#4199605.
I have not looked at the AOP side of this for a while, but the most important initial thing is to unify the duplicate code in the pointcut matchers so that they come in one version all using ClassInfo. I would concentrate on the weaving part first:
Weaving
======
1) Create a javassist Type/ClassInfo for the class being woven in the instrumentor from the CtClass and ClassLoader.
2) Modify the instrumentor, transformers and pointcut matchers to use ClassInfo instead of CtClass. We still want to use the raw CtClass when adding wrapper methods, inner classes etc. to the class being woven since ClassInfo does not support that. So the minimum required for this step is probably to use ClassInfo for what is passed into the matchers.
Runtime
======
1) When recaclulating the advisor chains use the reflect version of ClassInfo and modify the matchers to use that.
Once this is done, we can look at other places to add ClassInfo.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199716#4199716
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199716
15 years, 3 months