/** * Adds an interceptor to the stack for message processing<br> * Interceptors are ordered in the way they are added.<br> * <code>channel.addInterceptor(A);</code><br> * <code>channel.addInterceptor(C);</code><br> * <code>channel.addInterceptor(B);</code><br> * Will result in a interceptor stack like this:<br> * <code>A -> C -> B</code><br> * The complete stack will look like this:<br> * <code>Channel -> A -> C -> B -> ChannelCoordinator</code><br> * * @param interceptor ChannelInterceptorBase */ @Override public void addInterceptor(ChannelInterceptor interceptor) { if (interceptors == null) { interceptors = interceptor; interceptors.setNext(coordinator); interceptors.setPrevious(null); coordinator.setPrevious(interceptors); } else { ChannelInterceptor last = interceptors; while (last.getNext() != coordinator) { last = last.getNext(); } last.setNext(interceptor); interceptor.setNext(coordinator); interceptor.setPrevious(last); coordinator.setPrevious(interceptor); } }
/** * Sets the membership component * * @param membershipService MembershipService */ @Override public void setMembershipService(MembershipService membershipService) { coordinator.setMembershipService(membershipService); }
/** * Sets the channel sender component * * @param clusterSender ChannelSender */ @Override public void setChannelSender(ChannelSender clusterSender) { coordinator.setClusterSender(clusterSender); }
/** * Sets the channel receiver component * * @param clusterReceiver ChannelReceiver */ @Override public void setChannelReceiver(ChannelReceiver clusterReceiver) { coordinator.setClusterReceiver(clusterReceiver); }
/** * Returns the membership service component * * @return MembershipService */ @Override public MembershipService getMembershipService() { return coordinator.getMembershipService(); }
/** * Returns the channel sender component * * @return ChannelSender */ @Override public ChannelSender getChannelSender() { return coordinator.getClusterSender(); }
/** * Returns the channel receiver component * * @return ChannelReceiver */ @Override public ChannelReceiver getChannelReceiver() { return coordinator.getClusterReceiver(); }