/** * Get a value attached to the proxy. * * @param key the attachment key * @param <T> the value type * @return the value, or {@code null} if there is none */ public <T> T getProxyAttachment(AttachmentKey<T> key) { return invocationHandler.getAttachment(key); }
@Override public <T> void setLocator(EJBLocator<T> locator) { super.setLocator(locator); Affinity affinity = locator.getAffinity(); if (affinity instanceof ClusterAffinity) { ClusterAffinityInterest interest = invocationHandler.getAttachment(ClusterAffinityInterest.KEY); if (interest != null) { interest.notifyAssignment((ClusterAffinity)affinity); } } }
/** * Get a proxy attachment. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param <T> the value type * @return the attachment value or {@code null} if the attachment is not present * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T getProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); return EJBInvocationHandler.forProxy(proxy).getAttachment(attachmentKey); }
/** * Get a value attached to the proxy. * * @param key the attachment key * @param <T> the value type * @return the value, or {@code null} if there is none */ public <T> T getProxyAttachment(AttachmentKey<T> key) { return invocationHandler.getAttachment(key); }
/** * Get a value attached to the proxy. * * @param key the attachment key * @param <T> the value type * @return the value, or {@code null} if there is none */ public <T> T getProxyAttachment(AttachmentKey<T> key) { return invocationHandler.getAttachment(key); }
@Override public <T> void setLocator(EJBLocator<T> locator) { super.setLocator(locator); Affinity affinity = locator.getAffinity(); if (affinity instanceof ClusterAffinity) { ClusterAffinityInterest interest = invocationHandler.getAttachment(ClusterAffinityInterest.KEY); if (interest != null) { interest.notifyAssignment((ClusterAffinity)affinity); } } }
/** * Get a proxy attachment. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param <T> the value type * @return the attachment value or {@code null} if the attachment is not present * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T getProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); return EJBInvocationHandler.forProxy(proxy).getAttachment(attachmentKey); }
@Override public <T> void setLocator(EJBLocator<T> locator) { super.setLocator(locator); Affinity affinity = locator.getAffinity(); if (affinity instanceof ClusterAffinity) { ClusterAffinityInterest interest = invocationHandler.getAttachment(ClusterAffinityInterest.KEY); if (interest != null) { interest.notifyAssignment((ClusterAffinity)affinity); } } }
/** * Get a proxy attachment. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param <T> the value type * @return the attachment value or {@code null} if the attachment is not present * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T getProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); return EJBInvocationHandler.forProxy(proxy).getAttachment(attachmentKey); }