public class SmartLifecycleRoleController extends ObjectSE implements ApplicationListener<AbstractLeaderEvent>, ApplicationContextAware
SmartLifecycle
を一括開始 / 停止します。コンストラクターと説明 |
---|
SmartLifecycleRoleController(ListSE<StringSE> roles, ListSE<SmartLifecycle> lifecycles) 提供されたロールとライフサイクルのリストを使用してインスタンスを作成します。これらは同じ長さでなければなりません。 |
SmartLifecycleRoleController(MultiValueMap<StringSE, SmartLifecycle> lifecycles) 提供されたロール / インスタンスのマップを使用してインスタンスを構築します。 |
修飾子と型 | メソッドと説明 |
---|---|
void | addLifecyclesToRole(StringSE role, ListSE<StringSE> lifecycleBeanNames) 名前を使用して、 SmartLifecycle Bean をロールに追加します。 |
void | addLifecycleToRole(StringSE role, SmartLifecycle lifecycle) ロールに SmartLifecycle を追加します。 |
void | addLifecycleToRole(StringSE role, StringSE lifecycleBeanName) 名前を使用して、 SmartLifecycle Bean をロールに追加します。 |
boolean | allEndpointsRunning(StringSE role) ロール内のすべてのエンドポイントが実行されている場合は true を返します。 |
MapSE<StringSE, BooleanSE> | getEndpointsRunningStatus(StringSE role) ロールの各エンドポイントの実行ステータスを返します。 |
CollectionSE<StringSE> | getRoles() このコントローラーによって現在管理されているロールのコレクションを返します。 |
boolean | noEndpointsRunning(StringSE role) ロールのエンドポイントが実行されていない場合、またはロールのエンドポイントがない場合は、true を返します。 |
void | onApplicationEvent(AbstractLeaderEvent event) |
boolean | removeLifecycle(SmartLifecycle lifecycle) たとえば、SmartLifecycle Bean が破棄された場合など、提供された SmartLifecycle をすべてのロールから削除します。 |
void | setApplicationContext(ApplicationContext applicationContext) |
void | startLifecyclesInRole(StringSE role) ロールに登録されているすべての SmartLifecycle を開始します。 |
void | stopLifecyclesInRole(StringSE role) ロールに登録されているすべての SmartLifecycle を停止します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
forPayload
public SmartLifecycleRoleController(ListSE<StringSE> roles, ListSE<SmartLifecycle> lifecycles)
roles
- ロール。lifecycles
- ロールに対応するライフサイクル。public SmartLifecycleRoleController(MultiValueMap<StringSE,SmartLifecycle> lifecycles)
lifecycles
- ロール内の Bean の MultiValueMap
。public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
ApplicationContextAware
の setApplicationContext
BeansException
public final void addLifecycleToRole(StringSE role, SmartLifecycle lifecycle)
SmartLifecycle
を追加します。role
- ロール。lifecycle
- SmartLifecycle
public final void addLifecycleToRole(StringSE role, StringSE lifecycleBeanName)
SmartLifecycle
Bean をロールに追加します。role
- ロール。lifecycleBeanName
- SmartLifecycle
の Bean 名。public void addLifecyclesToRole(StringSE role, ListSE<StringSE> lifecycleBeanNames)
SmartLifecycle
Bean をロールに追加します。role
- ロール。lifecycleBeanNames
- SmartLifecycle
の Bean 名。public void startLifecyclesInRole(StringSE role)
SmartLifecycle
を開始します。role
- ロール。public void stopLifecyclesInRole(StringSE role)
SmartLifecycle
を停止します。role
- ロール。public CollectionSE<StringSE> getRoles()
public boolean allEndpointsRunning(StringSE role)
role
- ロール。public boolean noEndpointsRunning(StringSE role)
role
- ロール。public MapSE<StringSE,BooleanSE> getEndpointsRunningStatus(StringSE role)
role
- ロール。public void onApplicationEvent(AbstractLeaderEvent event)
ApplicationListener<AbstractLeaderEvent>
の onApplicationEvent
public boolean removeLifecycle(SmartLifecycle lifecycle)
lifecycle
- 削除する SmartLifecycle。