Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## groovy.lang
Annotation Type Singleton

    @Retention(value=SOURCE)
    @Target(value=TYPE)
    public @interface Singleton

Class annotation to make class singleton. Singleton can be initialized in static initialization of the class or lazily (on first access) To make singleton lazy it is enough to use `@Singleton(lazy=true)` Lazy singletons implemented with double check locking and volatile field

Author:
  Alex Tkachman

Optional Element Summary
Modifier and Type | Optional Element and Description
--- | ---
`boolean` | `lazy`

### lazy

    public abstract boolean lazy

  Returns:
    if this singleton should be lazy
  Default:
    false

Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2003-2010 The Codehaus. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT