类org.springframework.messaging.support.InterceptableChannel源码实例Demo

下面列出了怎么用org.springframework.messaging.support.InterceptableChannel的API类实例代码及写法,或者点击链接到github查看源代码。

@Override
public void start() {
	synchronized (this.lifecycleMonitor) {
		if (logger.isInfoEnabled()) {
			logger.info("Starting...");
		}
		this.clientInboundChannel.subscribe(this);
		this.brokerChannel.subscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).addInterceptor(0, this.unsentDisconnectInterceptor);
		}
		startInternal();
		this.running = true;
		logger.info("Started.");
	}
}
 
@Override
public void stop() {
	synchronized (this.lifecycleMonitor) {
		if (logger.isInfoEnabled()) {
			logger.info("Stopping...");
		}
		stopInternal();
		this.clientInboundChannel.unsubscribe(this);
		this.brokerChannel.unsubscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).removeInterceptor(this.unsentDisconnectInterceptor);
		}
		this.running = false;
		logger.info("Stopped.");
	}
}
 
@Override
public void start() {
	synchronized (this.lifecycleMonitor) {
		logger.info("Starting...");
		this.clientInboundChannel.subscribe(this);
		this.brokerChannel.subscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).addInterceptor(0, this.unsentDisconnectInterceptor);
		}
		startInternal();
		this.running = true;
		logger.info("Started.");
	}
}
 
@Override
public void stop() {
	synchronized (this.lifecycleMonitor) {
		logger.info("Stopping...");
		stopInternal();
		this.clientInboundChannel.unsubscribe(this);
		this.brokerChannel.unsubscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).removeInterceptor(this.unsentDisconnectInterceptor);
		}
		this.running = false;
		logger.info("Stopped.");
	}
}
 
@Override
public void start() {
	synchronized (this.lifecycleMonitor) {
		logger.info("Starting...");
		this.clientInboundChannel.subscribe(this);
		this.brokerChannel.subscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).addInterceptor(0, this.unsentDisconnectInterceptor);
		}
		startInternal();
		this.running = true;
		logger.info("Started.");
	}
}
 
@Override
public void stop() {
	synchronized (this.lifecycleMonitor) {
		logger.info("Stopping...");
		stopInternal();
		this.clientInboundChannel.unsubscribe(this);
		this.brokerChannel.unsubscribe(this);
		if (this.clientInboundChannel instanceof InterceptableChannel) {
			((InterceptableChannel) this.clientInboundChannel).removeInterceptor(this.unsentDisconnectInterceptor);
		}
		this.running = false;
		logger.info("Stopped.");
	}
}
 
 类方法
 同包方法