bind("app", moduleName + beanName, ref, contexts);
bind("module", beanName, ref, contexts);
}
private void bind(String context, String name, Object object, Map<JndiKey, Map<String, Object>> contexts) throws NamingException {
JndiKey jndiKey = JndiScope.valueOf(context);
Map<String, Object> scope = contexts.get(jndiKey);
if (scope == null) {
scope = new HashMap<String, Object>();
contexts.put(jndiKey, scope);
}