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);
DeploymentInfo deploymentInfo = containerSystem.getDeploymentInfo(ejb.getDeploymentID());
return EjbHomeProxyHandler.createHomeProxy(deploymentInfo, interfaceType, interfaces);
} catch (Exception e) {
logger.error("ServerSideResolver.resolve() failed, falling back to ClientSideResolver: "+e.getClass().getName()+": "+e.getMessage(), e );
return new EJBHomeProxyHandle.ClientSideResovler().resolve(handler);