Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to make Singleton Class secure

807606Jun 6 2007 — edited Jun 7 2007
I have a Singleton class which I instantiate using reflection by a call to a public getInstance method that return the object from a private constructor. I have to use reflection as I dont have any other options since my class instantiation is decided on runtime. How will I secure other form instantiating the same class again by using reflection on my private constructor? Any ideas?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 5 2007
Added on Jun 6 2007
28 comments
387 views