|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
public class NotificationBroadcasterSupport
NotificationEmitter 인터페이스의 구현을 제공합니다. 이것은, 통지를 송신하는 MBean 의 슈퍼 클래스로서 사용 가능합니다.
디폴트에서는, 통지 발송모델은 동기적입니다. 즉, thread가 sendNotification 를 호출하면(자), 그 thread내에서 각 청취자의 NotificationListener.handleNotification 메소드가 불려 갑니다. 이 디폴트를 오버라이드(override) 하려면 , 서브 클래스내에서 handleNotification 를 오버라이드(override) 하는지, executor 를 생성자 에 건네줍니다.
필터 또는 청취자의 메소드 호출에 의해 Exception 가 throw 되는 경우, 다른 청취자의 호출이 그 예외에 의해 방해할 수 있을 것은 없습니다. 다만, 필터,Executor.execute, 또는 handleNotification (Excecutor 가 지정되어 있지 않은 경우)의 메소드 호출에 의해 Error 가 throw 되는 경우, 이 Error 는 sendNotification 의 호출 측에 보내집니다.
일반적으로, JMX Remote API ( 「JMXConnector」를 참조)를 사용해 추가된 원격 청취자는, 동기적으로는 불려 가지 않습니다. 즉, sendNotification 의 종료시점에서는, 원격 청취자가 통지를 받았는지 어떠했는지는 보증되지 않습니다.
| 생성자 의 개요 | |
|---|---|
NotificationBroadcasterSupport ()
NotificationBroadcasterSupport 를 구축합니다. |
|
NotificationBroadcasterSupport (Executor executor)
NotificationBroadcasterSupport 를 구축합니다. |
|
NotificationBroadcasterSupport (Executor executor,
MBeanNotificationInfo ... info)
송신 가능한 통지에 관한 정보를 사용해, NotificationBroadcasterSupport 을 구축합니다. |
|
NotificationBroadcasterSupport (MBeanNotificationInfo ... info)
송신 가능한 통지에 관한 정보를 사용해, NotificationBroadcasterSupport 를 구축합니다. |
|
| 메소드의 개요 | |
|---|---|
void |
addNotificationListener (NotificationListener listener,
NotificationFilter filter,
Object handback)
청취자를 추가합니다. |
MBeanNotificationInfo [] |
getNotificationInfo ()
이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열을 돌려줍니다. |
protected void |
handleNotification (NotificationListener listener,
Notification notif,
Object handback)
이 메소드는, 청취자에게 통지를 송신하기 위해(때문에), sendNotification 에 의해 불려 갑니다. |
void |
removeNotificationListener (NotificationListener listener)
이 MBean 로부터 청취자를 삭제합니다. |
void |
removeNotificationListener (NotificationListener listener,
NotificationFilter filter,
Object handback)
이 MBean 로부터 청취자를 삭제합니다. |
void |
sendNotification (Notification notification)
통지를 송신합니다. |
| 클래스 java.lang. Object 로부터 상속된 메소드 |
|---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| 생성자 의 상세 |
|---|
public NotificationBroadcasterSupport()
NotificationBroadcasterSupport(null, null) 와 동등합니다.
public NotificationBroadcasterSupport(Executor executor)
Executor 를 사용해 불려 갑니다. null NotificationFilter 을 사용해 청취자가 추가되었는지, 송신중의 통지에 대해서 isNotificationEnabled 가 true 를 돌려주는 경우,sendNotification 의 호출시에 청취자가 선택됩니다. sendNotification를 호출한 thread내에서,NotificationFilter.isNotificationEnabled 의 호출이 실행됩니다. 다음에, 선택한 청취자 마다,handleNotification 메소드를 호출하는 커멘드를 사용해 executor.execute 가 불려 갑니다. 이 생성자 은,NotificationBroadcasterSupport(executor, null) 와 동등합니다.
executor - sendNotification 메소드에 의해,
각 통지의 송신에 사용되는 executor. null 의 경우,sendNotification 를 호출하는 thread에 의해
handleNotification 메소드 자체가 불려 가는public NotificationBroadcasterSupport(MBeanNotificationInfo ... info)
송신 가능한 통지에 관한 정보를 사용해, NotificationBroadcasterSupport 를 구축합니다. 각 청취자는, 통지를 송신하는 thread에 의해 불려 갑니다. 이 생성자 은,NotificationBroadcasterSupport(null, info) 와 동등합니다.
info 배열이 빈 상태(empty)이 아닌 경우, 생성자 에 의해,info.clone() 에 의한과 같게 이것이 복제됩니다. getNotificationInfo() 를 호출할 때마다, 새로운 복제가 돌려주어집니다.
info - 이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열. null 의 경우,
빈 상태(empty)의 배열과 동등
public NotificationBroadcasterSupport(Executor executor,
MBeanNotificationInfo ... info)
송신 가능한 통지에 관한 정보를 사용해, NotificationBroadcasterSupport 를 구축합니다. 각 청취자는, 지정한 Executor 를 사용해 불려 갑니다.
null NotificationFilter 을 사용해 청취자가 추가되었는지, 송신중의 통지에 대해서 isNotificationEnabled 가 true 를 돌려주는 경우,sendNotification 의 호출시에 청취자가 선택됩니다. sendNotification 를 호출한 thread내에서,NotificationFilter.isNotificationEnabled 의 호출이 실행됩니다. 다음에, 선택한 청취자 마다,handleNotification 메소드를 호출하는 커멘드를 사용해 executor.execute 가 불려 갑니다.
info 배열이 빈 상태(empty)이 아닌 경우, 생성자 에 의해,info.clone() 에 의한과 같게 이것이 복제됩니다. getNotificationInfo() 를 호출할 때마다, 새로운 복제가 돌려주어집니다.
executor - sendNotification 메소드가
각 통지의 송신에 사용하는 executor. null 의 경우,
sendNotification 를 호출하는 thread에 의해
handleNotification 메소드 자체가 불려 가는info - 통지의 Java 클래스명과 통지형을 나타내는 배열.
이 MBean 가 통지를 송신할 때마다,
배열이 나타난다. null 의 경우,
빈 상태(empty)의 배열과 동등| 메소드의 상세 |
|---|
public void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
NotificationBroadcaster 내의 addNotificationListener listener - 통지를 받는 청취자filter - 필터 객체. 필터가 null 의 경우,
통지 처리전에 필터는 적용되지 않는handback - 통지의 발행시에 청취자에게 송신된다
불투명한 객체. Notification 브로드 캐스터 객체는,
이 객체를 사용할 수 없다. 이 객체는, 손보지 않는 상태로,
통지와 함께 청취자에게 돌려 보내지지 않으면 안 된다
IllegalArgumentException - 청취자가 null 의 경우removeNotificationListener(javax.management.NotificationListener)
public void removeNotificationListener(NotificationListener listener)
throws ListenerNotFoundException
NotificationBroadcaster 의 기술:
NotificationBroadcaster 내의 removeNotificationListener listener - 이전에 이 MBean 에 추가되었다
청취자
ListenerNotFoundException - 청취자가 MBean 에
등록되지 않은 경우NotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object) ,
NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
throws ListenerNotFoundException
NotificationEmitter 의 기술:이 MBean 로부터 청취자를 삭제합니다. MBean 는, 지정된 listener,filter, 및 handback 파라미터와 정확하게 일치하는 청취자를 가지고 있을 필요가 있습니다. 해당하는 청취자가 복수 존재하는 경우, 그 중의 1 개(살)만이 삭제됩니다.
삭제되는 청취자내에서 null 가 지정되고 있는 경우,filter 및 handback 파라미터는 null 가 됩니다.
NotificationEmitter 내의 removeNotificationListener listener - 이전에 이 MBean 에 추가되었다
청취자filter - 청취자의 추가시로 지정되었다
필터handback - 청취자의 추가시로 지정되었다
핸드백
ListenerNotFoundException - 청취자가 MBean 에
등록되지 않은 경우, 또는 지정된 필터 및 핸드백으로
등록되지 않은 경우public MBeanNotificationInfo [] getNotificationInfo()
NotificationBroadcaster 의 기술:이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열을 돌려줍니다.
이 배열에 기술되어 있지 않은 통지를 MBean 가 송신해도, 부정하지는 않습니다. 다만 일부의 MBean 서버 클라이언트는, 올바르게 기능하기 위해서, 작성되는 배열에 의존하는 경우가 있습니다.
NotificationBroadcaster 내의 getNotificationInfo public void sendNotification(Notification notification)
Executor 가 생성자 내에서 지정되었을 경우, 선택한 청취자에게 통지를 전달하기 위해(때문에), 청취자 마다 1 개의 태스크를 할당할 수 있습니다.
notification - 송신하는 통지
protected void handleNotification(NotificationListener listener,
Notification notif,
Object handback)
이 메소드는, 청취자에게 통지를 송신하기 위해(때문에),sendNotification 에 의해 불려 갑니다. 통지의 전달 방법을 변경하는 경우, 예를 들어 통지를 다른 thread로 전달하는 경우 등은, 서브 클래스내에서 오버라이드(override) 할 수 있습니다.
이 메소드의 디폴트 구현은, 이하와 동등합니다.
listener.handleNotification(notif, handback);
listener - 통지의 전달처
청취자notif - 청취자에게 전달되는 통지handback - 청취자의 추가시로 지정되었다
핸드백 객체
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.