@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); } } }
private void processMissingTarget(final AbstractInvocationContext context) { final URI destination = context.getDestination(); if (destination == null || context.getTargetAffinity() == Affinity.LOCAL) { // some later interceptor cleared it out on us return; } // Oops, we got some wrong information! addBlackListedDestination(context, destination); final EJBLocator<?> locator = context.getLocator(); if (! (locator.getAffinity() instanceof ClusterAffinity)) { // it *was* "none" affinity, but it has been relocated; locate it back again context.setLocator(locator.withNewAffinity(Affinity.NONE)); } // clear the weak affinity so that cluster invocations can be re-targeted. context.setWeakAffinity(Affinity.NONE); context.setTargetAffinity(null); context.setDestination(null); context.requestRetry(); } }
@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); } } }
@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); } } }
private void processMissingTarget(final AbstractInvocationContext context) { final URI destination = context.getDestination(); if (destination == null || context.getTargetAffinity() == Affinity.LOCAL) { // some later interceptor cleared it out on us return; } // Oops, we got some wrong information! addBlackListedDestination(context, destination); final EJBLocator<?> locator = context.getLocator(); if (! (locator.getAffinity() instanceof ClusterAffinity)) { // it *was* "none" affinity, but it has been relocated; locate it back again context.setLocator(locator.withNewAffinity(Affinity.NONE)); } // clear the weak affinity so that cluster invocations can be re-targeted. context.setWeakAffinity(Affinity.NONE); context.setTargetAffinity(null); context.setDestination(null); context.requestRetry(); } }
private void processMissingTarget(final AbstractInvocationContext context) { final URI destination = context.getDestination(); if (destination == null || context.getTargetAffinity() == Affinity.LOCAL) { // some later interceptor cleared it out on us return; } // Oops, we got some wrong information! addBlackListedDestination(context, destination); final EJBLocator<?> locator = context.getLocator(); if (! (locator.getAffinity() instanceof ClusterAffinity)) { // it *was* "none" affinity, but it has been relocated; locate it back again context.setLocator(locator.withNewAffinity(Affinity.NONE)); } // clear the weak affinity so that cluster invocations can be re-targeted. context.setWeakAffinity(Affinity.NONE); context.setTargetAffinity(null); context.setDestination(null); context.requestRetry(); } }