/** * Change the strong affinity of a proxy. All subsequent invocations against the proxy will use the new affinity. * Subsequent calls to {@link #getLocatorFor(Object)} for the given proxy will return the updated locator. * * @param proxy the proxy (may not be {@code null}) * @param newAffinity the new affinity (may not be {@code null}) * @throws IllegalArgumentException if the given proxy is not a valid client proxy instance * @throws SecurityException if a security manager is present and the caller does not have the {@code changeStrongAffinity} {@link EJBClientPermission} */ public static void setStrongAffinity(Object proxy, Affinity newAffinity) throws IllegalArgumentException, SecurityException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("newAffinity", newAffinity); final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(EJBClientPermission.CHANGE_STRONG_AFFINITY); } EJBInvocationHandler.forProxy(proxy).setStrongAffinity(newAffinity); }
invocationHandler.setStrongAffinity(getLocator().getAffinity());
/** * Change the strong affinity of a proxy. All subsequent invocations against the proxy will use the new affinity. * Subsequent calls to {@link #getLocatorFor(Object)} for the given proxy will return the updated locator. * * @param proxy the proxy (may not be {@code null}) * @param newAffinity the new affinity (may not be {@code null}) * @throws IllegalArgumentException if the given proxy is not a valid client proxy instance * @throws SecurityException if a security manager is present and the caller does not have the {@code changeStrongAffinity} {@link EJBClientPermission} */ public static void setStrongAffinity(Object proxy, Affinity newAffinity) throws IllegalArgumentException, SecurityException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("newAffinity", newAffinity); final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(EJBClientPermission.CHANGE_STRONG_AFFINITY); } EJBInvocationHandler.forProxy(proxy).setStrongAffinity(newAffinity); }
/** * Change the strong affinity of a proxy. All subsequent invocations against the proxy will use the new affinity. * Subsequent calls to {@link #getLocatorFor(Object)} for the given proxy will return the updated locator. * * @param proxy the proxy (may not be {@code null}) * @param newAffinity the new affinity (may not be {@code null}) * @throws IllegalArgumentException if the given proxy is not a valid client proxy instance * @throws SecurityException if a security manager is present and the caller does not have the {@code changeStrongAffinity} {@link EJBClientPermission} */ public static void setStrongAffinity(Object proxy, Affinity newAffinity) throws IllegalArgumentException, SecurityException { Assert.checkNotNullParam("proxy", proxy); Assert.checkNotNullParam("newAffinity", newAffinity); final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(EJBClientPermission.CHANGE_STRONG_AFFINITY); } EJBInvocationHandler.forProxy(proxy).setStrongAffinity(newAffinity); }
invocationHandler.setStrongAffinity(getLocator().getAffinity());
invocationHandler.setStrongAffinity(getLocator().getAffinity());