[Design of EJB 3.0] - javax.ejb.EJB Annotations Outside EJB3 Components
by richard.opalka@jboss.com
This post relates to: JBWS-2634
Hi EJB3 Team,
I need your help. I'm working on the above issue at the moment and there are many issues regarding the EJB specification defaults I'm dealing with.
Here's my usecase:
ad1) I defined EJB3 bean:
package org.jboss.test.ws.jaxws.jbws2634.shared;
import javax.ejb.Stateless;
@Stateless
public class BeanImpl implements BeanIface
{
public String printString()
{
return "Injected hello message";
}
}
---
package org.jboss.test.ws.jaxws.jbws2634.shared;
public interface BeanIface
{
String printString();
}
ad2) Then I defined POJO webservice injecting the EJB3 bean:
package org.jboss.test.ws.jaxws.jbws2634.webservice;
import javax.ejb.EJB;
import javax.jws.WebService;
import org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface;
@WebService
(
serviceName = "EndpointService",
targetNamespace = "http://jbossws.org/JBWS2634",
endpointInterface="org.jboss.test.ws.jaxws.jbws2634.webservice.POJOIface"
)
public class POJOBean implements POJOIface
{
@EJB
private BeanIface testBean;
public String getMessage()
{
return testBean.printString();
}
}
---
package org.jboss.test.ws.jaxws.jbws2634.webservice;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface POJOIface
{
@WebMethod
String getMessage();
}
Issue I'm dealing with:
* Above usecase doesn't work because I don't know how to construct/obtain injected EJB3 JNDI name. Is it possible to do it outside EJB3 components (in my case from webservice code)?
I'm able to workaround this problem with specifying name attribute:
@EJB(name = "jaxws-jbws2634/BeanImpl/local-org.jboss.test.ws.jaxws.jbws2634.shared.BeanIface")
private BeanIface testBean;
but I'd like to support both usecases i.e. with/out name EJB annotation attribute.
Also javax.ejb.EJB annotation is really confusing me. What's the difference between name and mappedName? Where in the EJB spec I can find exhausting description of this annotation?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227690#4227690
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227690
15 years, 8 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Another security configuration issue
by gaohoward
Suppose we have the following permission config
| <!-- any user can have full control of generic topics -->
| <security match="jms.topic.#">
| <permission type="createDurableQueue" roles="user"/>
| <permission type="deleteDurableQueue" roles="user"/>
| <permission type="createTempQueue" roles="user"/>
| <permission type="deleteTempQueue" roles="user"/>
| <permission type="send" roles="user"/>
| <permission type="consume" roles="user"/>
| </security>
|
| <security match="jms.topic.news.europe.#">
| <permission type="send" roles="europe-user"/>
| <permission type="consume" roles="news-user"/>
| </security>
|
| <security match="jms.topic.news.us.#">
| <permission type="send" roles="us-user"/>
| <permission type="consume" roles="news-user"/>
| </security>
|
There are three security 'match'es. The last two have all 'create*' and 'delete*' permissions omitted. In that case, I assume that the 'create*' and 'delete*' permission settings for 'jms.topic.news.us.#' and 'jms.topic.news.europe.#' should be inherited from 'jms.topic.#'. But test shows that there is no such inheritance exists. Is it so designed?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227688#4227688
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4227688
15 years, 8 months