クラス ServerEndpointExporter
java.lang.ObjectSE
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.socket.server.standard.ServerEndpointExporter
- 実装されたすべてのインターフェース:
Aware
、InitializingBean
、SmartInitializingSingleton
、ApplicationContextAware
、ServletContextAware
public class ServerEndpointExporter
extends WebApplicationObjectSupport
implements InitializingBean, SmartInitializingSingleton
型
ServerEndpointConfig
EE の Bean を検出し、標準の Jakarta WebSocket ランタイムに登録します。また、ServerEndpoint
EE でアノテーションが付けられた Bean を検出し、それらも登録します。必須ではありませんが、アノテーション付きエンドポイントの configurator
プロパティを SpringConfigurator
に設定する必要があります。 このクラスを使用する場合は、Spring 構成で宣言することにより、WebSocket エンドポイントに対するサーブレットコンテナーのスキャンをオフにすることができるはずです。これは、web.xml
の <absolute-ordering>
要素を使用して行うことができます。
- 導入:
- 4.0
- 作成者:
- Rossen Stoyanchev, Juergen Hoeller
- 関連事項:
フィールドサマリー
クラス org.springframework.context.support.ApplicationObjectSupport から継承されたフィールド
logger
コンストラクターのサマリー
メソッドのサマリー
修飾子と型メソッド説明void
void
シングルトン事前インスタンス化フェーズの終わりに呼び出され、すべての通常のシングルトン Bean がすでに作成されていることを保証します。protected ServerContainerEE
エンドポイントの登録に使用する JSR-356ServerContainer
EE を返します。protected void
initServletContext
(ServletContextEE servletContext) サブクラスは、このアプリケーションオブジェクトが実行される ServletContext に基づいて、カスタム初期化のためにこれをオーバーライドできます。protected boolean
基本クラスの動作をオーバーライドして、ApplicationContext での実行を強制します。protected void
実際にエンドポイントを登録します。void
setAnnotatedEndpointClasses
(ClassSE<?>... annotatedEndpointClasses) 起動時に登録する必要があるアノテーション付きエンドポイント型を明示的にリストします。void
setServerContainer
(ServerContainerEE serverContainer) エンドポイントの登録に使用するように JSR-356ServerContainer
EE を設定します。クラス org.springframework.web.context.support.WebApplicationObjectSupport から継承されたメソッド
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, setServletContext
クラス org.springframework.context.support.ApplicationObjectSupport から継承されたメソッド
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
コンストラクターの詳細
ServerEndpointExporter
public ServerEndpointExporter()
メソッドの詳細
setAnnotatedEndpointClasses
起動時に登録する必要がある、アノテーション付きのエンドポイント型を明示的に一覧表示します。これは、クラスパス内のすべてのサードパーティ jar を通過するサーブレットコンテナーのエンドポイントのスキャンをオフにし、代わりに Spring 構成に依存する場合に実行できます。- パラメーター:
annotatedEndpointClasses
-ServerEndpoint
EE - アノテーション付き型
setServerContainer
エンドポイントの登録に使用するように JSR-356ServerContainer
EE を設定します。設定されていない場合、コンテナーはServletContext
を介して取得されます。getServerContainer
エンドポイントの登録に使用する JSR-356ServerContainer
EE を返します。initServletContext
クラスからコピーされた説明:WebApplicationObjectSupport
サブクラスは、このアプリケーションオブジェクトが実行される ServletContext に基づいて、カスタム初期化のためにこれをオーバーライドできます。デフォルトの実装は空です。
WebApplicationObjectSupport.initApplicationContext(org.springframework.context.ApplicationContext)
およびWebApplicationObjectSupport.setServletContext(jakarta.servlet.ServletContext)
によって呼び出されます。- オーバーライド:
- クラス
WebApplicationObjectSupport
のinitServletContext
- パラメーター:
servletContext
- このアプリケーションオブジェクトが実行される ServletContext (非null
)
isContextRequired
protected boolean isContextRequired()クラスからコピーされた説明:WebApplicationObjectSupport
基本クラスの動作をオーバーライドして、ApplicationContext での実行を強制します。コンテキストで実行されていない場合、すべてのアクセサーは IllegalStateException をスローします。- オーバーライド:
- クラス
WebApplicationObjectSupport
のisContextRequired
- 関連事項:
afterPropertiesSet
public void afterPropertiesSet()インターフェースからコピーされた説明:InitializingBean
すべての Bean プロパティを設定し、BeanFactoryAware
、ApplicationContextAware
などを満たした後、包含BeanFactory
によって呼び出されます。このメソッドにより、Bean インスタンスは、すべての Bean プロパティが設定されたときに、その全体的な構成の検証と最終的な初期化を実行できます。
- 次で指定:
- インターフェース
InitializingBean
のafterPropertiesSet
afterSingletonsInstantiated
public void afterSingletonsInstantiated()インターフェースからコピーされた説明:SmartInitializingSingleton
シングルトン事前インスタンス化フェーズの終わりに呼び出され、すべての通常のシングルトン Bean がすでに作成されていることを保証します。このメソッド内のListableBeanFactory.getBeansOfType(java.lang.Class<T>)
呼び出しは、ブートストラップ中に偶発的な副作用を引き起こしません。注意 : このコールバックは、
BeanFactory
ブートストラップ後にオンデマンドで遅延初期化されたシングルトン Bean ではトリガーされず、他の Bean スコープでもトリガーされません。意図されたブートストラップセマンティクスのみを使用する Bean には慎重に使用してください。- 次で指定:
- インターフェース
SmartInitializingSingleton
のafterSingletonsInstantiated
registerEndpoints
protected void registerEndpoints()実際にエンドポイントを登録します。afterSingletonsInstantiated()
によって呼び出されます。