.getLogger(BeanManagerLookup.class.getName());
public static final String BEAN_MANAGER_JNDI = "java:comp/BeanManager";
- private static BeanManager mgr = null;
+ private static BeanManager BEAN_MANAGER = null;
/**
* Sets the bean manager (mainly for testability).
* Bean manager.
*/
public static void setBeanManager(BeanManager aMgr) {
- mgr = aMgr;
+ BEAN_MANAGER = aMgr;
}
/**
* @return Bean manager.
*/
public static BeanManager lookup() {
- if (mgr == null) {
+ if (BEAN_MANAGER == null) {
try {
InitialContext ctx = new InitialContext();
- mgr = (BeanManager) ctx.lookup(BEAN_MANAGER_JNDI);
+ BEAN_MANAGER = (BeanManager) ctx.lookup(BEAN_MANAGER_JNDI);
LOGGER.info("Beanmanager successfully located");
} catch (NamingException e) {
LOGGER.warning("No beanmanager was found, using null");
- mgr = null;
+ BEAN_MANAGER = null;
}
}
- return mgr;
+ return BEAN_MANAGER;
}
}
import org.wamblee.inject.InjectorFactory;
/**
- * Factory that creates CDI injectors. This class may be subclassed for testing to
- * override the injectors that are returned.
+ * Factory that creates CDI injectors. This class may be subclassed for testing
+ * to override the injectors that are returned.
*
* @author Erik Brakkee
*/
.getLogger(CdiInjectorFactory.class.getName());
private BeanManager beanManager;
-
+
/**
- * Constructs the factory using a default bean manager.
+ * Constructs the factory using a default bean manager.
*
- * @throws IllegalArgumentException If bean manager is null.
+ * @throws IllegalArgumentException
+ * If bean manager is null.
*/
public CdiInjectorFactory() {
this(BeanManagerLookup.lookup());
* Constructs the factory using an explicit bean manager.
*
* @param aBeanManager
- * @throws IllegalArgumentException If bean manager is null.
+ * @throws IllegalArgumentException
+ * If bean manager is null.
*/
public CdiInjectorFactory(BeanManager aBeanManager) {
- if ( aBeanManager == null ) {
+ if (aBeanManager == null) {
throw new IllegalArgumentException("Bean manager is null");
}
beanManager = aBeanManager;