|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Documented @Target(value=TYPE) @Retention(value=SOURCE) @Copyright(value="Copyright © 2008, Iparelan Solutions, LLC. All rights reserved.") public @interface Singleton
Marks a class as implementing the Singleton pattern.
There are several ways to implement the singleton pattern, but all of them strive to prohibit multiple instantiations of the singleton type by implementing an instantiation constraint.
Usually this constraint is implemented by creating only private
constructors. However, this constraint cannot be enforced at compile-time in
all situations. Some runtime constraint must be employed when a
compile-time constraint cannot be specified. Examples are such situations
are:
public
no-arg constructor. This is often the case
when using ServiceLoader
access$000
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |