/** * Set a proxy attachment if it is not already set. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the new value to set (must not be {@code null}) * @param <T> the value type * @return the previous attachment value or {@code null} if the attachment previously did not exist * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T putProxyAttachmentIfAbsent(Object proxy, AttachmentKey<T> attachmentKey, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).putAttachmentIfAbsent(attachmentKey, newValue); }
/** * Set a proxy attachment if it is not already set. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the new value to set (must not be {@code null}) * @param <T> the value type * @return the previous attachment value or {@code null} if the attachment previously did not exist * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T putProxyAttachmentIfAbsent(Object proxy, AttachmentKey<T> attachmentKey, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).putAttachmentIfAbsent(attachmentKey, newValue); }
/** * Set a proxy attachment if it is not already set. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the new value to set (must not be {@code null}) * @param <T> the value type * @return the previous attachment value or {@code null} if the attachment previously did not exist * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> T putProxyAttachmentIfAbsent(Object proxy, AttachmentKey<T> attachmentKey, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).putAttachmentIfAbsent(attachmentKey, newValue); }