public Object getObject() throws NamingException {
if (reference != null){
return reference.getObject();
}
SystemInstance systemInstance = SystemInstance.get();
EjbResolver resolver = systemInstance.getComponent(EjbResolver.class);
String deploymentId = resolver.resolve(info, moduleUri);
if (deploymentId == null) {
String key = "lazyEjbRefNotResolved";
if (info.getHome() != null){
key += ".home";
}
String message = messages.format(key, info.getName(), info.getEjbLink(), info.getHome(), info.getInterface());
throw new NameNotFoundException(message);
}
ContainerSystem containerSystem = systemInstance.getComponent(ContainerSystem.class);
BeanContext beanContext = containerSystem.getBeanContext(deploymentId);
if (beanContext == null) {
String message = messages.format("deploymentNotFound", info.getName(), deploymentId);