• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubts in @Remote and @Local

 
gaurav singhal
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While preparing for SCBCD 5 I came across a note which says

An stateless session bean doesn't have a home interface anymore�in fact, no EJB type requires it. The bean class may or may not implement a business interface. If it does not implement any business interfaces, a business interface will be generated using all the public methods. If only certain methods should be exposed in the business interface, all of those methods can be marked with the @BusinessMethod annotation. By default, all generated interfaces are local, but the @Remote annotation can be used to indicate that a remote interface should be generated.


I have the following doubts

1) If it is autogenerated what will be the name of the interface.
2) Is it true for all stateless, stateful and for entity also.


Thanks
Gaurav
 
Mani vannan
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gaurav singhal:


1) If it is autogenerated what will be the name of the interface.
2) Is it true for all stateless, stateful and for entity also.




1. The interface name will be derived from bean's name.
2. Interfaces are optional for entity bean.
Please refer to this article for more: http://www.theserverside.com/tt/articles/article.tss?l=SimplifyingEJB3
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't find any annotation called @BusinessMethod in EJB 3. Where did you get this?

Thanks
Tridib
 
gaurav singhal
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tridib,

Refer to the last paragraph of first page in the following site
http://www.javaworld.com/javaworld/jw-08-2004/jw-0809-ejb.html


Even I am not able to find @BusinessMethod in the EJB specification
so dont know from where the author of that article took it from.
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you read the EJB-simplified spec, you will find that session beans & mdbs must implement at least one business intf
 
Tridib Samanta
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,
This article seems to be a older one. The final spec of EJB 3.0 has been released on May'2006. It's better to follow the spec.

Thanks
Tridib
 
Morten Franorge
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a lot of old ejb 3.0 articles floating around the web, probably based on some of the early drafts. Some of them are on sun.com as well.

I have found a couple of articles refering to @Inject which I believe was an early name for the @Resource and @EJB annotations.

They ought to clear this up, remove or update articles based on early drafts.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic