/** * 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 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> StatelessEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final Affinity affinity) { return new StatelessEJBLocator<T>(viewType, identifier, affinity); }
/** * Construct a new instance. This method uses the location from the original locator, but with the given * session ID and affinity. * * @param original the original locator (must not be {@code null}) * @param newAffinity the new affinity * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatelessEJBLocator<T> create(final EJBLocator<T> original, final Affinity newAffinity) { return new StatelessEJBLocator<T>(original, newAffinity); }
Object readResolve() { return new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, affinity); } }
/** * Get a copy of this stateful EJB locator, but without any session ID. * * @return the stateless EJB locator (not {@code null}) */ public StatelessEJBLocator<T> withoutSession() { return new StatelessEJBLocator<T>(this, getAffinity()); }
/** * Create a new EJB session. * * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final Class<T> viewType, final String appName, final String moduleName, final String beanName) throws Exception { return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, Affinity.NONE)); }
/** * Create a new EJB session. * * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param distinctName the module distinct name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final Class<T> viewType, final String appName, final String moduleName, final String beanName, final String distinctName) throws Exception { return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, Affinity.NONE)); }
/** * Create a new EJB session. * * @param affinity the affinity specification for the session * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final Affinity affinity, final Class<T> viewType, final String appName, final String moduleName, final String beanName) throws Exception { return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, affinity == null ? Affinity.NONE : affinity)); }
/** * Create a new EJB session. * * @param affinity the affinity specification for the session * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param distinctName the module distinct name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final Affinity affinity, final Class<T> viewType, final String appName, final String moduleName, final String beanName, final String distinctName) throws Exception { return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, affinity == null ? Affinity.NONE : affinity)); }
/** * Create a new EJB session. * * @param uri a URI at which EJBs may be obtained * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final URI uri, final Class<T> viewType, final String appName, final String moduleName, final String beanName) throws Exception { final Affinity affinity = uri == null ? Affinity.NONE : Affinity.forUri(uri); return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, affinity)); }
/** * Create a new EJB session. * * @param uri a URI at which EJBs may be obtained * @param viewType the view type class * @param appName the application name * @param moduleName the module name * @param beanName the EJB name * @param distinctName the module distinct name * @param <T> the view type * @return the new EJB locator * @throws CreateException if an error occurs */ public static <T> StatefulEJBLocator<T> createSession(final URI uri, final Class<T> viewType, final String appName, final String moduleName, final String beanName, final String distinctName) throws Exception { final Affinity affinity = uri == null ? Affinity.NONE : Affinity.forUri(uri); return createSession(new StatelessEJBLocator<T>(viewType, appName, moduleName, beanName, distinctName, affinity)); }
public StatelessEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatelessEJBLocator<T>(this, affinity); }
/** * Construct a new instance. This method uses the location from the original locator, but with the given * session ID and affinity. * * @param original the original locator (must not be {@code null}) * @param newAffinity the new affinity * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatelessEJBLocator<T> create(final EJBLocator<T> original, final Affinity newAffinity) { return new StatelessEJBLocator<T>(original, newAffinity); }
/** * 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 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> StatelessEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final Affinity affinity) { return new StatelessEJBLocator<T>(viewType, identifier, 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 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> StatelessEJBLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final Affinity affinity) { return new StatelessEJBLocator<T>(viewType, identifier, affinity); }
/** * Construct a new instance. This method uses the location from the original locator, but with the given * session ID and affinity. * * @param original the original locator (must not be {@code null}) * @param newAffinity the new affinity * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T> StatelessEJBLocator<T> create(final EJBLocator<T> original, final Affinity newAffinity) { return new StatelessEJBLocator<T>(original, newAffinity); }
/** * Get a copy of this stateful EJB locator, but without any session ID. * * @return the stateless EJB locator (not {@code null}) */ public StatelessEJBLocator<T> withoutSession() { return new StatelessEJBLocator<T>(this, getAffinity()); }
/** * Get a copy of this stateful EJB locator, but without any session ID. * * @return the stateless EJB locator (not {@code null}) */ public StatelessEJBLocator<T> withoutSession() { return new StatelessEJBLocator<T>(this, getAffinity()); }
public StatelessEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatelessEJBLocator<T>(this, affinity); }
public StatelessEJBLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new StatelessEJBLocator<T>(this, affinity); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(new StatelessEJBLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName)); return new ValueManagedReference(new ImmediateValue(value)); }