/** * Replace a proxy attachment if it is already present. * * @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 replaceProxyAttachment(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).replaceAttachment(attachmentKey, newValue); }
/** * Replace a proxy attachment if it is already present. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the old value to replace (must not be {@code null}) * @param <T> the value type * @return {@code true} if the attachment value was replaced, {@code false} otherwise * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> boolean replaceProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey, T oldValue, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("oldValue", oldValue); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).replaceAttachment(attachmentKey, oldValue, newValue); } }
/** * Replace a proxy attachment if it is already present. * * @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 replaceProxyAttachment(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).replaceAttachment(attachmentKey, newValue); }
/** * Replace a proxy attachment if it is already present. * * @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 replaceProxyAttachment(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).replaceAttachment(attachmentKey, newValue); }
/** * Replace a proxy attachment if it is already present. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the old value to replace (must not be {@code null}) * @param <T> the value type * @return {@code true} if the attachment value was replaced, {@code false} otherwise * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> boolean replaceProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey, T oldValue, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("oldValue", oldValue); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).replaceAttachment(attachmentKey, oldValue, newValue); } }
/** * Replace a proxy attachment if it is already present. * * @param proxy the proxy (must not be {@code null}) * @param attachmentKey the attachment key to use (must not be {@code null}) * @param newValue the old value to replace (must not be {@code null}) * @param <T> the value type * @return {@code true} if the attachment value was replaced, {@code false} otherwise * @throws IllegalArgumentException if a required parameter is {@code null} or if the object is not a valid EJB client proxy */ public static <T> boolean replaceProxyAttachment(Object proxy, AttachmentKey<T> attachmentKey, T oldValue, T newValue) throws IllegalArgumentException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("attachmentKey", attachmentKey); Assert.checkNotNullParam("oldValue", oldValue); Assert.checkNotNullParam("newValue", newValue); return EJBInvocationHandler.forProxy(proxy).replaceAttachment(attachmentKey, oldValue, newValue); } }