Class NullChannel
java.lang.Object
org.springframework.integration.channel.NullChannel
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,IntegrationPattern,NamedComponent,IntegrationManagement,org.springframework.messaging.MessageChannel,org.springframework.messaging.PollableChannel
@IntegrationManagedResource public class NullChannel extends java.lang.Object implements org.springframework.messaging.PollableChannel, org.springframework.beans.factory.BeanNameAware, IntegrationManagement, IntegrationPattern
A channel implementation that essentially behaves like "/dev/null".
All
receive() calls will return null,
and all send(org.springframework.messaging.Message<?>, long) calls will return true although no action is performed.
Unless the payload of a sent message is a Publisher implementation, in
which case the Publisher.subscribe(Subscriber) is called to initiate
the reactive stream, although the data is discarded by this channel.
An error thrown from a reactive stream processing (see Subscriber.onError(Throwable))
is logged under the warn level.
Note however that the invocations are logged at debug-level.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME -
Constructor Summary
Constructors Constructor Description NullChannel() -
Method Summary
Modifier and Type Method Description voiddestroy()java.lang.StringgetBeanName()java.lang.StringgetComponentName()java.lang.StringgetComponentType()IntegrationPatternTypegetIntegrationPatternType()Return a pattern type this component implements.IntegrationManagement.ManagementOverridesgetOverrides()Return the overrides.booleanisLoggingEnabled()Return whether logging is enabled.org.springframework.messaging.Message<?>receive()org.springframework.messaging.Message<?>receive(long timeout)voidregisterMetricsCaptor(MetricsCaptor registry)Inject aMetricsCaptorbooleansend(org.springframework.messaging.Message<?> message)booleansend(org.springframework.messaging.Message<?> message, long timeout)voidsetBeanName(java.lang.String beanName)voidsetLoggingEnabled(boolean loggingEnabled)Enable logging or not.java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
-
Constructor Details
-
NullChannel
public NullChannel()
-
-
Method Details
-
setBeanName
public void setBeanName(java.lang.String beanName)- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
isLoggingEnabled
public boolean isLoggingEnabled()Description copied from interface:IntegrationManagementReturn whether logging is enabled.- Specified by:
isLoggingEnabledin interfaceIntegrationManagement- Returns:
- true if enabled.
-
setLoggingEnabled
public void setLoggingEnabled(boolean loggingEnabled)Description copied from interface:IntegrationManagementEnable logging or not.- Specified by:
setLoggingEnabledin interfaceIntegrationManagement- Parameters:
loggingEnabled- dalse to disable.
-
getBeanName
@Nullable public java.lang.String getBeanName()- Specified by:
getBeanNamein interfaceNamedComponent
-
getComponentName
@Nullable public java.lang.String getComponentName()- Specified by:
getComponentNamein interfaceNamedComponent
-
getComponentType
public java.lang.String getComponentType()- Specified by:
getComponentTypein interfaceNamedComponent
-
getIntegrationPatternType
Description copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
getIntegrationPatternTypein interfaceIntegrationPattern- Returns:
- the
IntegrationPatternTypethis component implements.
-
registerMetricsCaptor
Description copied from interface:IntegrationManagementInject aMetricsCaptor- Specified by:
registerMetricsCaptorin interfaceIntegrationManagement- Parameters:
registry- the captor.
-
getOverrides
Description copied from interface:IntegrationManagementReturn the overrides.- Specified by:
getOverridesin interfaceIntegrationManagement- Returns:
- the overrides.
-
send
public boolean send(org.springframework.messaging.Message<?> message, long timeout)- Specified by:
sendin interfaceorg.springframework.messaging.MessageChannel
-
send
public boolean send(org.springframework.messaging.Message<?> message)- Specified by:
sendin interfaceorg.springframework.messaging.MessageChannel
-
receive
public org.springframework.messaging.Message<?> receive()- Specified by:
receivein interfaceorg.springframework.messaging.PollableChannel
-
receive
public org.springframework.messaging.Message<?> receive(long timeout)- Specified by:
receivein interfaceorg.springframework.messaging.PollableChannel
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
destroy
public void destroy()- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Specified by:
destroyin interfaceIntegrationManagement
-