private synchronized void init(WebModule wm) {
if (initialized) {
return;
}
ServerContext serverContext = wm.getServerContext();
if (serverContext == null) {
String msg = _rb.getString("webmodule.noservercontext");
msg = MessageFormat.format(msg, wm.getName());
throw new IllegalStateException(msg);
}
im = serverContext.getDefaultHabitat().getByContract(
InvocationManager.class);
tm = serverContext.getDefaultHabitat().getByContract(
JavaEETransactionManager.class);
injectionMgr = serverContext.getDefaultHabitat().getByContract(
InjectionManager.class);
initialized = true;
securityContext = serverContext.getDefaultHabitat().getByContract(AppServSecurityContext.class);
if (securityContext != null) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Obtained securityContext implementation class " + securityContext);
}
} else {