[jboss-user] [JBoss Seam] - Re: @Service / @Management bean injection

rhomber do-not-reply at jboss.com
Thu Sep 20 23:34:38 EDT 2007


Perhaps I should rephrase my question. Assuming I implemented a service following the tutorial: http://docs.jboss.com/ejb3/app-server/tutorial/service/service.html - How would I inject that service into my Seam component? Would I need to inject it by a remote or local interface, or by the management interface?

I currently have the following:

Management Interface:
@Management
  | public interface GAJServiceMBean extends ServiceMBean {
  | ....
  | }

Local Interface:
@Local
  | public interface GAJServiceLocal {
  | ....
  | }


Remote Interface:
@Remote
  | public interface GAJServiceRemote {
  | ....
  | }


Implementation:
@Service(objectName = "utiba:service=GAJ")
  | public class GAJService extends ServiceMBeanSupport implements GAJServiceMBean, GAJServiceLocal, GAJServiceRemote, Serializable {
  |     // Serial Version
  |     protected static final long serialVersionUID = 10234234234L;
  | 
  |     ......
  | }

I have tried some of the following injection combinations:

@In GAJServiceMBean gajService;
  | 
  | @EJB GAJServiceMBean gajService;
  | @EJB GAJServiceLocal gajService;
  | @EJB GAJServiceRemote gajService;

The first results in the not-null condition, the rest result in the object remaining null.

Cheers,

David

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4087012#4087012

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4087012



More information about the jboss-user mailing list