• Post Reply Bookmark Topic Watch Topic
  • New Topic

@PostConstruct may be final?

 
Tridib Samanta
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?
 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • 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
 
Lawrence Johnbosco
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!