final EJBComponent component = ejbInfo.getEjbComponent();
if (!(component instanceof StatefulSessionComponent)) {
throw new IllegalArgumentException("EJB " + beanName + " is not a Stateful Session bean in app: " + appName + " module: " + moduleName + " distinct name:" + distinctName);
}
final StatefulSessionComponent statefulComponent = (StatefulSessionComponent) component;
final SessionID sessionID = statefulComponent.createSession();
return new StatefulEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, sessionID, statefulComponent.getCache().getStrictAffinity(), this.getNodeName());
}