public class JettyResourceFactory extends ObjectSE implements InitializingBean, DisposableBean
ApplicationContext
のライフサイクル内で Jetty リソース、つまり Executor
SE、ByteBufferPool
、Scheduler
を管理するファクトリ。 このファクトリは InitializingBean
および DisposableBean
を実装し、通常、Spring 管理の Bean として宣言されることが期待されています。
コンストラクターと説明 |
---|
JettyResourceFactory() |
修飾子と型 | メソッドと説明 |
---|---|
void | afterPropertiesSet() |
void | destroy() Bean の破棄時に、包含 BeanFactory によって呼び出されます。 |
org.eclipse.jetty.io.ByteBufferPool | getByteBufferPool() 設定された ByteBufferPool を返します。 |
ExecutorSE | getExecutor() 設定された Executor SE を返します。 |
org.eclipse.jetty.util.thread.Scheduler | getScheduler() 設定された Scheduler を返します。 |
void | setByteBufferPool(org.eclipse.jetty.io.ByteBufferPool byteBufferPool) 使用する ByteBufferPool を構成します。 |
void | setExecutor(ExecutorSE executor) 使用する Executor SE を構成します。 |
void | setScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler) 使用する Scheduler を構成します。 |
void | setThreadPrefix(StringSE threadPrefix) QueuedThreadPool executor を初期化するためのスレッド接頭辞を構成します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public void setExecutor(@Nullable ExecutorSE executor)
Executor
SE を構成します。 デフォルトでは、QueuedThreadPool
で初期化されます。
executor
- 使用するエグゼキュータ public void setByteBufferPool(@Nullable org.eclipse.jetty.io.ByteBufferPool byteBufferPool)
ByteBufferPool
を構成します。 デフォルトでは、MappedByteBufferPool
で初期化されます。
byteBufferPool
- 使用する ByteBuffer
SE プール public void setScheduler(@Nullable org.eclipse.jetty.util.thread.Scheduler scheduler)
Scheduler
を構成します。 デフォルトでは、ScheduledExecutorScheduler
で初期化されます。
scheduler
- 使用する Scheduler
public void setThreadPrefix(StringSE threadPrefix)
QueuedThreadPool
executor を初期化するためのスレッド接頭辞を構成します。これは、Executor
SE インスタンスが provided
ではない場合にのみ使用されます。デフォルトでは "jetty-http" に設定されています。
threadPrefix
- 使用するスレッド接頭辞 @Nullable public ExecutorSE getExecutor()
Executor
SE を返します。@Nullable public org.eclipse.jetty.io.ByteBufferPool getByteBufferPool()
ByteBufferPool
を返します。@Nullable public org.eclipse.jetty.util.thread.Scheduler getScheduler()
Scheduler
を返します。public void afterPropertiesSet() throws ExceptionSE
InitializingBean
BeanFactoryAware
、ApplicationContextAware
などを満たした後、包含 BeanFactory
によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
InitializingBean
の afterPropertiesSet
ExceptionSE
- 構成の誤り(必須プロパティの設定の失敗など)の場合、またはその他の理由で初期化が失敗した場合 public void destroy() throws ExceptionSE
DisposableBean
BeanFactory
によって呼び出されます。DisposableBean
の destroy
ExceptionSE
- シャットダウンエラーの場合。例外はログに記録されますが、再スローされず、他の Bean もリソースを解放できます。