/** * Construct a new instance. * * @param viewType the view type (must not be {@code null}) * @param identifier the EJB identifier (must not be {@code null}) * @param sessionId the stateful session ID (must not be {@code null}) * @param affinity the {@link Affinity} for this stateful bean locator * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatefulEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final SessionID sessionId, final Affinity affinity) { return new StatefulEJBLocator<T>(viewType, identifier, sessionId, affinity); }
Object readResolve() { return new StatefulEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, sessionId, affinity); } }
public StatefulEJBLocator<T> withSession(final SessionID sessionId) { Assert.checkNotNullParam("sessionId", sessionId); return new StatefulEJBLocator<T>(this, sessionId); }
public StatefulEJBLocator<T> withSession(final SessionID sessionId) { Assert.checkNotNullParam("sessionId", sessionId); if (sessionId.equals(this.sessionId)) { return this; } else { return new StatefulEJBLocator<T>(this, sessionId); } }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return new StatefulEJBLocator<T>(this, sessionId, affinity); }
public StatefulEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatefulEJBLocator<T>(this, affinity); }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) && getSessionId().equals(sessionId) ? this : new StatefulEJBLocator<T>(this, sessionId, affinity); }
@Override public EJBObject run() { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), getCache().getStrictAffinity())); } });
@SuppressWarnings("unchecked") @Override public EJBObject getEJBObject(final InterceptorContext ctx) throws IllegalStateException { if (getEjbObjectViewServiceName() == null) { throw EjbLogger.ROOT_LOGGER.beanComponentMissingEjbObject(getComponentName(), "EJBObject"); } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(getEjbObjectViewServiceName()); final ComponentView view = (ComponentView) serviceController.getValue(); final String locatorAppName = getEarApplicationName() == null ? "" : getEarApplicationName(); if(WildFlySecurityManager.isChecking()) { //need to use doPrivileged rather than doUnchecked, as this can run user code in the proxy constructor return AccessController.doPrivileged(new PrivilegedAction<EJBObject>() { @Override public EJBObject run() { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), getCache().getStrictAffinity())); } }); } else { return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), this.getCache().getStrictAffinity())); } }
/** * Construct a new instance. * * @param viewType the view type (must not be {@code null}) * @param identifier the EJB identifier (must not be {@code null}) * @param sessionId the stateful session ID (must not be {@code null}) * @param affinity the {@link Affinity} for this stateful bean locator * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatefulEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final SessionID sessionId, final Affinity affinity) { return new StatefulEJBLocator<T>(viewType, identifier, sessionId, affinity); }
/** * Construct a new instance. * * @param viewType the view type (must not be {@code null}) * @param identifier the EJB identifier (must not be {@code null}) * @param sessionId the stateful session ID (must not be {@code null}) * @param affinity the {@link Affinity} for this stateful bean locator * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatefulEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final SessionID sessionId, final Affinity affinity) { return new StatefulEJBLocator<T>(viewType, identifier, sessionId, affinity); }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return new StatefulEJBLocator<T>(this, sessionId, affinity); }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return new StatefulEJBLocator<T>(this, sessionId, affinity); }
public StatefulEJBLocator<T> withSession(final SessionID sessionId) { Assert.checkNotNullParam("sessionId", sessionId); if (sessionId.equals(this.sessionId)) { return this; } else { return new StatefulEJBLocator<T>(this, sessionId); } }
public StatefulEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatefulEJBLocator<T>(this, affinity); }
public StatefulEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatefulEJBLocator<T>(this, affinity); }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) && getSessionId().equals(sessionId) ? this : new StatefulEJBLocator<T>(this, sessionId, affinity); }
public StatefulEJBLocator<T> withSessionAndAffinity(final SessionID sessionId, final Affinity affinity) { Assert.checkNotNullParam("sessionId", sessionId); Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) && getSessionId().equals(sessionId) ? this : new StatefulEJBLocator<T>(this, sessionId, affinity); }
@Override protected <T> StatefulEJBLocator<T> openSession(EJBReceiverContext context, Class<T> viewType, String appName, String moduleName, String distinctName, String beanName) throws IllegalArgumentException { final EjbDeploymentInformation ejbInfo = findBean(appName, moduleName, distinctName, beanName); final EJBComponent component = ejbInfo.getEjbComponent(); if (!(component instanceof StatefulSessionComponent)) { throw MESSAGES.notStatefulSessionBean(beanName, appName, moduleName, 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()); }
@SuppressWarnings("unchecked") @Override public EJBObject getEJBObject(final InterceptorContext ctx) throws IllegalStateException { if (getEjbObjectViewServiceName() == null) { throw MESSAGES.beanComponentMissingEjbObject(getComponentName(), "EJBObject"); } final ServiceController<?> serviceController = currentServiceContainer().getRequiredService(getEjbObjectViewServiceName()); final ComponentView view = (ComponentView) serviceController.getValue(); final String locatorAppName = getEarApplicationName() == null ? "" : getEarApplicationName(); return EJBClient.createProxy(new StatefulEJBLocator<EJBObject>((Class<EJBObject>) view.getViewClass(), locatorAppName, getModuleName(), getComponentName(), getDistinctName(), getSessionIdOf(ctx), this.getCache().getStrictAffinity())); }