This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in EJB3.0 specification-business interface

 
gaurav singhal
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello frends,

I came across a point in EJB specification which states that

� A bean class is permitted to have more than one interface. If a bean class has more than one interface�excluding the interfaces listed below�any business interface of the bean class must be explicitly designated as a business interface of the bean by means of the Local or Remote
annotation on the bean class or interface or by means of the deployment descriptor.

But I want to understand one thing:

I have 3 interface for helloWorld bean assume hello1,hello2,hello3.

So I will write the bean as either


is this program compile

Then what are the remote and Local interface

According to my understanding it should be

Remote hello1 and hello2
Local hello3 by default.

Please tell me am i correct.
and if the above program is changed as



then the local interfaces are hello1, hello2,hello3. But the above statement says If a bean class has more than one interface�excluding the interfaces listed below�any business interface of the bean class must be explicitly designated as a business interface of the bean by means of the Local or Remote annotation on the bean class or interface or by means of the deployment descriptor. there is contradiction here by default the interface are local or to explicitly mark them as Local or remote
 
Rajan Murugan
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the contradiction? Your question is not clear.
 
gaurav singhal
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
If by default interfaces which are implemented are local.

If i implement more than one interface why i explicitly need to define business interface using @Remote or @Local annotation. All by default should be considered as local business interface.
 
Rajan Murugan
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understanding is that a bean can also implement other interfaces which are not business interfaces.Hence to mark those interfaces which are business intgerfaces as business interfaces you need to mention it with @Local or @Remote annotation.The container or someone else may be doing certain things additional by knowing which are the ones which are business interfaces.
[ December 15, 2006: Message edited by: Rajan Murugan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic