-
1. Re: Depending on a MBean
starksm64 Mar 27, 2007 10:23 PM (in response to bill.burke)Carlo brought this up before and it looks like the canonical name should be used. Still need to track down where a toString is slipping in.
-
2. Re: Depending on a MBean
bill.burke Mar 28, 2007 9:40 AM (in response to bill.burke)NO, what I'm saying is that the string that is specified in the XML should be used as the kernel name. Otherwise, users won't know what the freakin problem is when they create a dependency.
-
3. Re: Depending on a MBean
adrian.brock Mar 28, 2007 9:49 AM (in response to bill.burke)NO! :-)
What I told Carlo is to do what is done in the system-jmx xml parsing.
e.g. when you "parse" the @Dependency or where-ever else
you are creating dependencies that might be JMX or POJO.
i.e.String iDepend = ... Object other = iDependOn; try { other = new ObjectName(iDependOn).getCanonicalName(); } catch (MalformedObjectNameException ignored) { // Not a JMX object name }
-
4. Re: Depending on a MBean
bill.burke Mar 28, 2007 10:12 AM (in response to bill.burke)NO! That doesn't work either because of our propensity to use object name strings in bean names.
-
5. Re: Depending on a MBean
bill.burke Mar 28, 2007 10:14 AM (in response to bill.burke)What i'm saying is:
@Depends("jboss.something:service=blah,name=Foo")
@Stateless
public class MyBean {}
The depends could be a Jmx mbean or ajust a regular MC bean that is using an string that looks like an object name as its key/name. I don't want to introduce a @JmxDepends or a<jmx-depends>
then again, maybe we have to. -
6. Re: Depending on a MBean
adrian.brock Mar 28, 2007 10:53 AM (in response to bill.burke)If you're going to use a JMX like object name as a pojo name
then you should really make it canonical form.
We could hack the AbstractController[Context] such that it also
converts ObjectName like strings to canonical form even if they aren't actually a
JMX deployment -
7. Re: Depending on a MBean
bill.burke Mar 28, 2007 11:07 AM (in response to bill.burke)you'd have to do it for everything. Demands, Dependency, etc...
-
8. Re: Depending on a MBean
bill.burke Mar 28, 2007 11:14 AM (in response to bill.burke)btw, what is a canoical name? alphabetical sorting of key fields?
-
9. Re: Depending on a MBean
bill.burke Mar 28, 2007 11:31 AM (in response to bill.burke)created issue here. Assigned to Ales. Made it critical feature as I believe many people will run into it. Especially with MDBs.
-
-
11. Re: Depending on a MBean
adrian.brock Mar 28, 2007 11:35 AM (in response to bill.burke)"bill.burke@jboss.com" wrote:
btw, what is a canoical name? alphabetical sorting of key fields?
Nearly. The "type=" property is treated specially in the spec. It always
comes first in the canonical form. -
12. Re: Depending on a MBean
adrian.brock Mar 28, 2007 11:36 AM (in response to bill.burke)"bill.burke@jboss.com" wrote:
http://jira.jboss.com/jira/browse/JBMICROCONT-166
I'm just writing some testcases so we can understand the problem
and make sure it gets fixed. So I'll take it. -
13. Re: Depending on a MBean
starksm64 Mar 28, 2007 11:45 AM (in response to bill.burke)"bill.burke@jboss.com" wrote:
btw, what is a canoical name? alphabetical sorting of key fields?
Yes, from the ObjectName javadoc:'jdk5 javadoc" wrote:
public String getCanonicalName()
Returns the canonical form of the name; that is, a string representation where the properties are sorted in lexical order.
More precisely, the canonical form of the name is a String consisting of the domain part, a colon (:), the canonical key property list, and a pattern indication.
The canonical key property list is the same string as described for getCanonicalKeyPropertyListString().
The pattern indication is:
* empty for an ObjectName that is not a property pattern;
* an asterisk for an ObjectName that is a property pattern with no keys; or
* a comma and an asterisk (,*) for an ObjectName that is a property pattern with at least one key.
Returns:
The canonical form of the name.