r01f.ejb
Class JNDIContextLocator.JNDIContextCacheSingletonHolder

java.lang.Object
  extended by r01f.ejb.JNDIContextLocator.JNDIContextCacheSingletonHolder
Enclosing class:
JNDIContextLocator

private static final class JNDIContextLocator.JNDIContextCacheSingletonHolder
extends java.lang.Object

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

instance

static final JNDIContextLocator instance
Constructor Detail

JNDIContextLocator.JNDIContextCacheSingletonHolder

private JNDIContextLocator.JNDIContextCacheSingletonHolder()