This content has been marked as final.
Show 2 replies
-
1. Re: how to inject dependency on an mbean
ajay662 Jan 26, 2007 12:55 PM (in response to ajay662)Ok. I found the answer in ejb3 trailblazer. The trail on JMX Service Objects talk about how to annotate a service that depends on other services using @Depends tag. I guess the same holds true for EJBs as well, i.e. if an EJB depends on a service, use @Depends tag. I used following to make it work in my case:
ClusterStatusMBean clusterStatusMbean = null; @Depends ("myapp:service=ClusterStatus") public void setClusterStatusMbean (ClusterStatusMBean mbean) { this.clusterStatusMbean = mbean; }
-
2. Re: how to inject dependency on an mbean
alrubinger Jan 26, 2007 1:18 PM (in response to ajay662)In @Resource injection, the value "mappedName" attribute should be the JNDI name of the resource, not the service name. :)
Like:@Resource(mappedName = "java:/jdbc/myapp/myDs") private DataSource myDs;
S,
ALR