Object readResolve() { return new EJBHomeLocator<T>(viewType, appName, moduleName, beanName, distinctName, affinity); } }
/** * Determine whether this object is equal to another. * * @param other the other object * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(EJBHomeHandle<?> other) { return this == other || other != null && locator.equals(other.locator); }
public EJBHomeLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new EJBHomeLocator<T>(this, affinity); }
/** * Get the home interface class. * * @return the home interface */ public Class<H> getHomeInterfaceClass() { return homeLocator.getViewType(); }
/** * Get the hash code for this EJB home handle. * * @return the hash code */ public int hashCode() { return locator.hashCode() ^ 1; }
ejbLocator = EJBHomeLocator.create(viewClass.asSubclass(EJBHome.class), identifier, appclient ? Affinity.NONE : Affinity.LOCAL); } else if (stateful) { try {
@SuppressWarnings("unchecked") public <S extends EJBHome> EJBHomeLocator<? extends S> narrowAsHome(final Class<S> type) { if (type.isAssignableFrom(getViewType())) { return (EJBHomeLocator<? extends S>) this; } throw new ClassCastException(type.toString()); }
/** * Get the hash code for this EJB home handle. * * @return the hash code */ public int hashCode() { return locator.hashCode() ^ 1; }
/** * 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 affinity * @param <T> the remote view type * @return the new instance (not {@code null}) */ public static <T extends EJBHome> EJBHomeLocator<T> create(final Class<T> viewType, final EJBIdentifier identifier, final Affinity affinity) { return new EJBHomeLocator<T>(viewType, identifier, affinity); }
public EJBHomeLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new EJBHomeLocator<T>(this, affinity); }
/** * Determine whether this object is equal to another. * * @param other the other object * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return other instanceof EJBHomeLocator && equals((EJBHomeLocator<?>) other); }
/** * Get the home interface class. * * @return the home interface */ public Class<H> getHomeInterfaceClass() { return homeLocator.getViewType(); }
/** * Get the hash code for this EJB home handle. * * @return the hash code */ public int hashCode() { return locator.hashCode() ^ 1; }
private static <T extends EJBHome> EJBHomeLocator<T> createHomeLocator(Class<T> viewClass, String appName, String moduleName, String beanName, String distinctName) { return new EJBHomeLocator<T>(viewClass, appName, moduleName, beanName, distinctName, Affinity.LOCAL); }
public EJBHomeLocator<T> withNewAffinity(final Affinity affinity) { Assert.checkNotNullParam("affinity", affinity); return getAffinity().equals(affinity) ? this : new EJBHomeLocator<T>(this, affinity); }
/** * Determine whether this object is equal to another. * * @param other the other object * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final EJBLocator<?> other) { return other instanceof EJBHomeLocator && equals((EJBHomeLocator<?>) other); }
/** * Get the home interface class. * * @return the home interface */ public Class<H> getHomeInterfaceClass() { return homeLocator.getViewType(); }
@Override public ManagedReference createViewInstance(final ComponentView componentView, final Map<Object, Object> contextData) { Object value = EJBClient.createProxy(new EJBHomeLocator(componentView.getViewClass(), applicationName, moduleName, beanName, distinctName, Affinity.LOCAL)); return new ValueManagedReference(new ImmediateValue(value)); }
/** * Determine whether this object is equal to another. * * @param other the other object * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(final Object other) { return other instanceof EJBHomeLocator && equals((EJBHomeLocator<?>) other); }
@SuppressWarnings("unchecked") public <S extends EJBHome> EJBHomeLocator<? extends S> narrowAsHome(final Class<S> type) { if (type.isAssignableFrom(getViewType())) { return (EJBHomeLocator<? extends S>) this; } throw new ClassCastException(type.toString()); }