private static Logger logger = Logger.getInstance(LogCategory.OPENEJB_SERVER_REMOTE, "org.apache.openejb.server.util.resources");
public Object resolve(EJBHomeHandler handler) {
try {
EJBMetaDataImpl ejb = handler.getEjb();
InterfaceType interfaceType = (ejb.getRemoteInterfaceClass() == null)? InterfaceType.BUSINESS_REMOTE_HOME : InterfaceType.EJB_HOME;
ArrayList<Class> interfaces = new ArrayList<Class>();
if (interfaceType.isBusiness()){
interfaces.addAll(ejb.getBusinessClasses());
} else {
interfaces.add(ejb.getRemoteInterfaceClass());
}
ContainerSystem containerSystem = SystemInstance.get().getComponent(ContainerSystem.class);
BeanContext beanContext = containerSystem.getBeanContext(ejb.getDeploymentID());
return EjbHomeProxyHandler.createHomeProxy(beanContext, interfaceType, interfaces, ejb.getMainInterface());
} catch (Exception e) {
logger.error("ServerSideResolver.resolve() failed, falling back to ClientSideResolver: "+e.getClass().getName()+": "+e.getMessage(), e );
return new EJBHomeProxyHandle.ClientSideResovler().resolve(handler);
}
}