T
- 項目のタイプ public class MultiResourceItemWriter<T> extends AbstractItemStreamItemWriter<T>
setItemCountLimitPerResource(int)
を超えると、ResourceAwareItemWriterItemStream
をラップして新しい出力リソースを作成します。サフィックスの作成は setResourceSuffixCreator(ResourceSuffixCreator)
でカスタマイズできます。新しいリソースはチャンクの境界でのみ作成されることに注意してください。つまり、1 つのリソースに書き込まれるアイテムの数は、setItemCountLimitPerResource(int)
によって設定された制限と(制限 + チャンクサイズ)の間です。コンストラクターと説明 |
---|
MultiResourceItemWriter() |
修飾子と型 | メソッドと説明 |
---|---|
void | close() ノーオペレーション。 |
void | open(ExecutionContext executionContext) ノーオペレーション。 |
void | setDelegate(ResourceAwareItemWriterItemStream<? super T> delegate) 出力の実際の書き込みに使用されるデリゲート。 |
void | setItemCountLimitPerResource(int itemCountLimitPerResource) この制限を超えると、次のチャンクが新しく作成されたリソースに書き込まれます。 |
void | setResource(org.springframework.core.io.Resource resource) 出力リソースのプロトタイプ。 |
void | setResourceSuffixCreator(ResourceSuffixCreator suffixCreator) インデックスに基づいて、作成されたリソースのサフィックスをカスタマイズできます。 |
void | setSaveState(boolean saveState) 各コミット後にリーダーの状態が保存されることを示します。 |
void | update(ExecutionContext executionContext) 空の ExecutionContext を返します。 |
void | write(java.util.List<? extends T> items) 指定されたデータ要素を処理します。 |
getExecutionContextKey, setExecutionContextName, setName
public void write(java.util.List<? extends T> items) throws java.lang.Exception
ItemWriter
items
- 書かれる項目 java.lang.Exception
- エラーがある場合。フレームワークは例外をキャッチし、必要に応じて変換または再スローします。public void setResourceSuffixCreator(ResourceSuffixCreator suffixCreator)
suffixCreator
- ライターが使用する ResourceSuffixCreator
。public void setItemCountLimitPerResource(int itemCountLimitPerResource)
itemCountLimitPerResource
- 新しいリソースを作成するタイミングを決定するために使用される int アイテムのしきい値。public void setDelegate(ResourceAwareItemWriterItemStream<? super T> delegate)
delegate
- 出力の書き込みに使用される ResourceAwareItemWriterItemStream
。public void setResource(org.springframework.core.io.Resource resource)
setResourceSuffixCreator(ResourceSuffixCreator)
による)。resource
- プロトタイプリソース。public void setSaveState(boolean saveState)
saveState
- true 状態が保存されます。public void close() throws ItemStreamException
ItemStreamSupport
ItemStream
の close
ItemStreamSupport
の close
ItemStreamException
ItemStream.close()
public void open(ExecutionContext executionContext) throws ItemStreamException
ItemStreamSupport
ItemStream
の open
ItemStreamSupport
の open
executionContext
- 現在のステップの ExecutionContext
再起動時のステップの最後の実行からの executionContext になります。ItemStreamException
ItemStream.open(ExecutionContext)
public void update(ExecutionContext executionContext) throws ItemStreamException
ItemStreamSupport
ExecutionContext
を返します。ItemStream
の update
ItemStreamSupport
の update
executionContext
- 更新される ItemStreamException
ItemStream.update(ExecutionContext)