Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

page 461 exercise

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Seems that way dosen't it ?
 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic