formatting
This commit is contained in:
@@ -13,73 +13,77 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.channel.interceptor;
|
||||
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.channel.ChannelInterceptor;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
* @since 2.0
|
||||
*/
|
||||
public class GlobalChannelInterceptorWrapper implements ChannelInterceptor, Ordered{
|
||||
private ChannelInterceptor channelInterceptor;
|
||||
private String[] patterns;
|
||||
private int order;
|
||||
|
||||
public GlobalChannelInterceptorWrapper(ChannelInterceptor channelInterceptor){
|
||||
public class GlobalChannelInterceptorWrapper implements ChannelInterceptor, Ordered {
|
||||
|
||||
private final ChannelInterceptor channelInterceptor;
|
||||
|
||||
private volatile String[] patterns;
|
||||
|
||||
private volatile int order;
|
||||
|
||||
|
||||
public GlobalChannelInterceptorWrapper(ChannelInterceptor channelInterceptor) {
|
||||
Assert.notNull(channelInterceptor, "channelInterceptor must not be null");
|
||||
this.channelInterceptor = channelInterceptor;
|
||||
// will set initial order for this interceptor wrapper to be the same as the
|
||||
// underlying interceptor. Could be overridden with setOrder() method
|
||||
if (channelInterceptor instanceof Ordered){
|
||||
order = ((Ordered)channelInterceptor).getOrder();
|
||||
// will set initial order for this interceptor wrapper to be the same as
|
||||
// the underlying interceptor. Could be overridden with setOrder() method
|
||||
if (channelInterceptor instanceof Ordered) {
|
||||
order = ((Ordered) channelInterceptor).getOrder();
|
||||
}
|
||||
}
|
||||
|
||||
public int getOrder() {
|
||||
return order;
|
||||
|
||||
public ChannelInterceptor getChannelInterceptor() {
|
||||
return this.channelInterceptor;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param order
|
||||
*/
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public ChannelInterceptor getChannelInterceptor() {
|
||||
return channelInterceptor;
|
||||
}
|
||||
|
||||
public String[] getPatterns() {
|
||||
return patterns;
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
public void setPatterns(String[] patterns) {
|
||||
this.patterns = patterns;
|
||||
}
|
||||
|
||||
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
|
||||
return channelInterceptor.postReceive(message, channel);
|
||||
}
|
||||
|
||||
public void postSend(Message<?> message, MessageChannel channel,
|
||||
boolean sent) {
|
||||
channelInterceptor.postSend(message, channel, sent);
|
||||
}
|
||||
|
||||
public boolean preReceive(MessageChannel channel) {
|
||||
return channelInterceptor.preReceive(channel);
|
||||
public String[] getPatterns() {
|
||||
return this.patterns;
|
||||
}
|
||||
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
return channelInterceptor.preSend(message, channel);
|
||||
return this.channelInterceptor.preSend(message, channel);
|
||||
}
|
||||
|
||||
public void postSend(Message<?> message, MessageChannel channel, boolean sent) {
|
||||
this.channelInterceptor.postSend(message, channel, sent);
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return channelInterceptor.toString();
|
||||
|
||||
public boolean preReceive(MessageChannel channel) {
|
||||
return this.channelInterceptor.preReceive(channel);
|
||||
}
|
||||
|
||||
public Message<?> postReceive(Message<?> message, MessageChannel channel) {
|
||||
return this.channelInterceptor.postReceive(message, channel);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.channelInterceptor.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user