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