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