@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(StatelessEJBLocator.create(componentView.getViewClass(), identifier, Affinity.LOCAL)); return new ValueManagedReference(new ImmediateValue<>(value)); }
} else if (stateful) { try { ejbLocator = EJBClient.createSession(StatelessEJBLocator.create(viewClass, identifier, appclient ? Affinity.NONE : Affinity.LOCAL)); } catch (Exception e) { throw EjbLogger.ROOT_LOGGER.failedToCreateSessionForStatefulBean(e, identifier.toString()); ejbLocator = StatelessEJBLocator.create(viewClass, identifier, appclient ? Affinity.NONE : Affinity.LOCAL);
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) throws Exception { SessionID sessionID = (SessionID) contextData.get(SessionID.class); final StatefulEJBLocator<?> statefulEJBLocator; final StatefulSessionComponent statefulSessionComponent = (StatefulSessionComponent) componentView.getComponent(); if (sessionID == null) { statefulEJBLocator = EJBClient.createSession(StatelessEJBLocator.create(componentView.getViewClass(), identifier, Affinity.LOCAL)); } else { statefulEJBLocator = StatefulEJBLocator.create(componentView.getViewClass(), identifier, sessionID, statefulSessionComponent.getCache().getStrictAffinity()); } final Object ejbProxy = EJBClient.createProxy(statefulEJBLocator); return new ValueManagedReference(new ImmediateValue<Object>(ejbProxy)); }
final EJBModuleIdentifier moduleIdentifier = new EJBModuleIdentifier(appName, moduleName, distinctName); final EJBIdentifier identifier = new EJBIdentifier(moduleIdentifier, beanName); final StatelessEJBLocator<?> statelessLocator = StatelessEJBLocator.create(view, identifier, baseAffinity.get()); final Object proxy; if (stateful) {
final EJBModuleIdentifier moduleIdentifier = new EJBModuleIdentifier(appName, moduleName, distinctName); final EJBIdentifier identifier = new EJBIdentifier(moduleIdentifier, beanName); final StatelessEJBLocator<?> statelessLocator = StatelessEJBLocator.create(view, identifier, baseAffinity.get()); final Object proxy; if (stateful) {
final EJBModuleIdentifier moduleIdentifier = new EJBModuleIdentifier(appName, moduleName, distinctName); final EJBIdentifier identifier = new EJBIdentifier(moduleIdentifier, beanName); final StatelessEJBLocator<?> statelessLocator = StatelessEJBLocator.create(view, identifier, baseAffinity.get()); final Object proxy; if (stateful) {