Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page 461 exercise

 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 2 of the exercise on page 461 of HF asks
List two things a stateful bean can call on its SessionContext that a message-driven bean can never call on its MesageDrivenContext

The solution on page 461 lists the following two methods
isCallerInRole()
getEJBHome()
Does this mean that those are the only two methods that should be included?
What about
getCallerPrincipal()
getEJBLocalHome()
I suppose the question was just asking for two of the four methods.
Thanks.
 
Goan Balchao
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems that way dosen't it ?
 
Prasad Kuppa
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
all the four methods are shown in Page 456. But what is the exception that is thrown at runtime if any of these methods are called from a MDB?
Prasad
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Prasad Kuppa:
all the four methods are shown in Page 456. But what is the exception that is thrown at runtime if any of these methods are called from a MDB?
Prasad

Howdy -- good question: the answer to that is on page 560 of the book
-- the Container is supposed to throw an IllegalStateException if any of these methods are invoked on the context of a message-driven bean.
This is also covered on pages 320 and 321 of the spec.
cheers,
Kathy
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic