Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

@PostConstruct may be final?

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to Java EE API (java doc), a method annotated with @PostConstruct may be final. But, according to EJB 3.0 specification (page 305)

A lifecycle callback interceptor method must not be declared as final or static

. Which one is correct?
 
Bartender
Posts: 3655
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right. There is some inconsistency.

I would use EJB 3.0 specification as the trusted source
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I can say both are right, since @PostConstruct is part of "javax.annotation" -- it means it can be used for any kind of callback implementation (not just for EJB). But when to comes to EJB, the specification further restricts the callback by saying it should not be final.


Regards..Lawrence J
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic