Upgrade Spring Dependencies
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springintegration;
|
||||
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
/**
|
||||
@@ -29,13 +29,15 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
public class NotificationListener {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:/META-INF/spring/integration/remote-monitor-context.xml");
|
||||
ConfigurableApplicationContext ctx =
|
||||
new ClassPathXmlApplicationContext("classpath:/META-INF/spring/integration/remote-monitor-context.xml");
|
||||
Gateway gw = ctx.getBean(Gateway.class);
|
||||
int cmd = 0;
|
||||
while (cmd != 'q') {
|
||||
cmd = System.in.read();
|
||||
gw.send((char) cmd);
|
||||
}
|
||||
ctx.close();
|
||||
}
|
||||
|
||||
public static interface Gateway {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,7 @@ import org.springframework.jmx.export.annotation.ManagedOperation;
|
||||
import org.springframework.jmx.export.annotation.ManagedResource;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.ChannelInterceptorAdapter;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.util.StopWatch;
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ import org.springframework.util.StopWatch;
|
||||
*
|
||||
*/
|
||||
@ManagedResource
|
||||
public class PayloadAwareTimingInterceptor extends ChannelInterceptorAdapter {
|
||||
public class PayloadAwareTimingInterceptor implements ChannelInterceptor {
|
||||
|
||||
private final ThreadLocal<StopWatchHolder> stopWatchHolder = new ThreadLocal<PayloadAwareTimingInterceptor.StopWatchHolder>();
|
||||
|
||||
@@ -60,7 +60,7 @@ public class PayloadAwareTimingInterceptor extends ChannelInterceptorAdapter {
|
||||
StopWatch stopWatch = new StopWatch();
|
||||
stopWatch.start();
|
||||
this.stopWatchHolder.set(new StopWatchHolder(stopWatch, message.getPayload().getClass()));
|
||||
return super.preSend(message, channel);
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user