クラス AbstractPollingEndpoint
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.AbstractPollingEndpoint
- 実装されているすべてのインターフェース:
Aware、BeanClassLoaderAware、BeanFactoryAware、BeanNameAware、DisposableBean、InitializingBean、ApplicationContextAware、Lifecycle、Phased、SmartLifecycle、ComponentSourceAware、ExpressionCapable、NamedComponent、ManageableLifecycle、ManageableSmartLifecycle
- 既知の直属サブクラス
PollingConsumer,SourcePollingChannelAdapter
public abstract class AbstractPollingEndpoint
extends AbstractEndpoint
implements BeanClassLoaderAware
コンシューマーパターンの基本をポーリングするための
AbstractEndpoint 拡張。標準のポーリングロジックは、提供されている Trigger に従った定期的なタスクスケジューリングに基づいています。このエンドポイントが isReactive() として扱われる場合、ポーリングロジックは SimpleTriggerContext 状態に基づいて Flux.generate(java.util.function.Consumer) と Mono.delay(Duration) の組み合わせに変換されます。- 作成者:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan, Andreas Baer, Christian Tzolov, Ngoc Nhan
フィールドのサマリー
フィールドクラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
lifecycleLockクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクターの概要
コンストラクター方法の概要
修飾子と型メソッド説明protected voidreceiveMessage()呼び出しに応答するコンポーネントにアドバイスチェーンを追加します。protected voiddonePollingTask(@Nullable Message<?> message) ポーリングタスクが完了した後に受信したメッセージ (ある場合) をコールバックします。protected voiddoStart()サブクラスは、開始動作でこのメソッドを実装する必要があります。protected voiddoStop()サブクラスは、停止動作でこのメソッドを実装する必要があります。protected ClassLoaderSE@Nullable MessageChannelエラーハンドラーが明示的に提供され、それがMessagePublishingErrorHandlerである場合は、デフォルトのエラーチャネルを返します。longprotected @Nullable reactor.core.publisher.Flux<Message<?>> protected @Nullable ObjectSEprotected @Nullable StringSEリソースがIntegrationResourceHolderの属性として使用可能になるキーを返します。protected @Nullable ObjectSEトランザクション同期を使用するときにバインドするリソース (MessageSource など) を返します。protected ExecutorSEprotected abstract voidhandleMessage(Message<?> message) メッセージを処理します。protected booleanprotected booleanisReceiveOnlyAdvice(Advice advice) このアドバイスをポーリング全体ではなくreceiveMessage()操作にのみ適用する必要がある場合は、true を返します。protected booleanprotected voidmessageReceived(@Nullable IntegrationResourceHolder holder, Message<?> message) protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。protected abstract @Nullable Message<?> 次のメッセージを取得します(利用可能な場合)。voidsetAdviceChain(@Nullable ListSE<Advice> adviceChain) voidsetBeanClassLoader(ClassLoaderSE classLoader) voidsetErrorHandler(@Nullable ErrorHandler errorHandler) voidsetMaxMessagesPerPoll(long maxMessagesPerPoll) スケジューリングサイクルごとに送信元からポーリングするメッセージの上限を設定します。protected voidsetReceiveMessageSource(ObjectSE source) voidsetTaskExecutor(@Nullable ExecutorSE taskExecutor) voidsetTransactionSynchronizationFactory(@Nullable TransactionSynchronizationFactory transactionSynchronizationFactory) voidsetTrigger(@Nullable Trigger trigger) クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたメソッド
destroy, doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getComponentTypeインターフェース org.springframework.context.SmartLifecycle から継承されたメソッド
isPauseable
フィールドの詳細
DEFAULT_POLLING_PERIOD
コンストラクターの詳細
AbstractPollingEndpoint
public AbstractPollingEndpoint()
メソッドの詳細
setTaskExecutor
getTaskExecutor
isSyncExecutor
protected boolean isSyncExecutor()setTrigger
setAdviceChain
setMaxMessagesPerPoll
スケジュールサイクルごとにソースからポーリングするメッセージの上限を設定します。負の数を指定すると、MessageSourceがnullを返すまで無制限にメッセージを取得します。ゼロを指定すると、レコードをポーリングしません。後で 'maxMessagesPerPoll' がゼロ以外の値に変更された場合、ポーリングは一時停止とみなされます。ソースが現在のreceive呼び出しに対して null を返した場合、ポーリングサイクルは早期に終了する可能性があります。- パラメーター:
maxMessagesPerPoll- スケジュールごとにポーリングするメッセージの数。
getMaxMessagesPerPoll
public long getMaxMessagesPerPoll()setErrorHandler
setBeanClassLoader
- 次で指定:
- インターフェース
BeanClassLoaderAwareのsetBeanClassLoader
setTransactionSynchronizationFactory
public void setTransactionSynchronizationFactory(@Nullable TransactionSynchronizationFactory transactionSynchronizationFactory) getDefaultErrorChannel
エラーハンドラーが明示的に提供され、それがMessagePublishingErrorHandlerである場合は、デフォルトのエラーチャネルを返します。- 戻り値:
- チャネルまたは null。
- 導入:
- 4.3
getBeanClassLoader
isReceiveOnlyAdvice
このアドバイスをポーリング全体ではなくreceiveMessage()操作にのみ適用する必要がある場合は、true を返します。- パラメーター:
advice- 助言。- 戻り値:
receive操作のみを通知する場合は true。
applyReceiveOnlyAdviceChain
receiveMessage()呼び出しに応答するコンポーネントにアドバイスチェーンを追加します。- パラメーター:
chain- アドバイスチェーンCollection。
isReactive
protected boolean isReactive()getPollingFlux
getReceiveMessageSource
setReceiveMessageSource
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
AbstractEndpointのonInit
doStart
protected void doStart()クラスからコピーされた説明:AbstractEndpointサブクラスは、開始動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLockを保持しているときに呼び出されます。- 次で指定:
- クラス
AbstractEndpointのdoStart
messageReceived
donePollingTask
ポーリングタスク完了後に受信メッセージ(存在する場合)をコールバックします。トランザクションが有効な場合は、この時点でコミットされます。- パラメーター:
message- ポーリングタスクからのメッセージ結果。
doStop
protected void doStop()クラスからコピーされた説明:AbstractEndpointサブクラスは、停止動作でこのメソッドを実装する必要があります。このメソッドは、AbstractEndpoint.lifecycleLockを保持しているときに呼び出されます。- 次で指定:
- クラス
AbstractEndpointのdoStop
receiveMessage
次のメッセージを取得します(利用可能な場合)。すぐに利用できるメッセージがない場合は、null を返す場合があります。- 戻り値:
- メッセージまたは null。
handleMessage
getResourceToBind
トランザクション同期を使用するときにバインドするリソース (MessageSource など) を返します。- 戻り値:
- リソース。トランザクションの同期が不要な場合は null。
getResourceKey
リソースがIntegrationResourceHolderの属性として使用可能になるキーを返します。デフォルトのExpressionEvaluatingTransactionSynchronizationProcessorは、この属性を SpEL 式の変数として使用できるようにします。- 戻り値:
- キー。リソースを属性として使用できない場合は null (デフォルト)。