BeanContextServicesListener
BeanContextServicesListener (서비스 등록 리스너)
BeanContextServiceAvailableEvent 객체를 수신하기 위한 리스너 인터페이스예요. BeanContextServiceAvailableEvent를 처리하는 데 관심이 있는 클래스는 이 인터페이스를 구현해요.
본문
BeanContextServicesListener는 BeanContextServiceRevokedListener와 EventListener를 상속하는 리스너 인터페이스예요. BeanContext 안에서 새 서비스가 등록되어 사용 가능해질 때 발생하는 BeanContextServiceAvailableEvent를 처리하기 위해 사용돼요.
BeanContext에 새 서비스가 등록되면, 서비스 제공 상황에 관심이 있는 BeanContextChild나 다른 객체들은 이 리스너를 통해 등록 사실을 통보받아요. 이를 통해 새로 사용 가능해진 서비스를 감지하고 활용할 수 있어요.
이 인터페이스는 다음 메서드를 정의해요.
void serviceAvailable(BeanContextServiceAvailableEvent bcsae)
serviceAvailable()— 새 서비스가 사용 가능해졌을 때 호출되는 메서드예요. 이벤트 객체로 등록된 서비스에 대한 정보를 전달받아요.
이 인터페이스의 하위 인터페이스로 BeanContextServices가 있고, 주요 구현 클래스로는 BeanContextChildSupport, BeanContextServicesSupport, BeanContextSupport 등이 있어요.