|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectr01f.ejb.JNDIContextLocator.JNDIContextCacheSingletonHolder
private static final class JNDIContextLocator.JNDIContextCacheSingletonHolder
Clase holder de un singleton. Si a alguien se le ocurre referirse a el JNDIContextCache, el singleton NO SERÁ CREADO hasta que se haga la primera llamada a getInstance En este momento la VM se referirá a la clase JNDIContextCacheSingletonHolder, la cargará y su miembro estático (el singleton) se instanciará. Como se puede ver NO HAY SINCRONIZACIÓN, sin embargo esto es "thread safe". Cuando la VM intenta cargar una clase se garantiza que mientras dure la carga ningún otro thread molestará.
| Field Summary | |
|---|---|
(package private) static JNDIContextLocator |
instance
|
| Constructor Summary | |
|---|---|
private |
JNDIContextLocator.JNDIContextCacheSingletonHolder()
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final JNDIContextLocator instance
| Constructor Detail |
|---|
private JNDIContextLocator.JNDIContextCacheSingletonHolder()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||