JavaTM Platform
Standard Ed. 6

javax.management
클래스 StandardEmitterMBean

java.lang.Object 
  상위를 확장 javax.management.StandardMBean 
      상위를 확장 javax.management.StandardEmitterMBean
모든 구현된 인터페이스:
DynamicMBean , MBeanRegistration , NotificationBroadcaster , NotificationEmitter


public class StandardEmitterMBean
extends StandardMBean
implements NotificationEmitter

Java 인터페이스의 리플렉션에 의해 관리 인터페이스를 결정해, 통지를 발행하는 MBean 입니다.

다음의 예는, public 생성자 StandardEmitterMBean(implementation, mbeanInterface, emitter) 를 사용해, 임의의 구현 클래스명 Impl, 임의의 인터페이스 Intf 로 정의된 관리 인터페이스 (현재의 Standard MBean 용), 및 인터페이스 NotificationEmitter 의 임의의 구현을 지정해, 통지를 발행하는 MBean 를 작성하는 방법을 나타내고 있습니다. 이 예에서는, NotificationBroadcasterSupport 클래스를 인터페이스 NotificationEmitter 의 구현으로서 사용합니다.

     MBeanServer mbs;
     ...
     final String[] types = new String[] {"sun.disc.space","sun.disc.alarm"};
     final MBeanNotificationInfo info = new MBeanNotificationInfo(
                                          types,
                                          Notification.class.getName(),
                                          "Notification about disc info. ");
     final NotificationEmitter emitter = 
                    new NotificationBroadcasterSupport(info);

     final Intf impl = new Impl(...);
     final Object mbean = new StandardEmitterMBean(
                                  impl, Intf.class, emitter);
     mbs.registerMBean(mbean, objectName);
     

도입된 버젼:
1.6
관련 항목:
StandardMBean

생성자 의 개요
protected StandardEmitterMBean (Class <? > mbeanInterface, boolean isMXBean, NotificationEmitter  emitter)
          mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다.
protected StandardEmitterMBean (Class <? > mbeanInterface, NotificationEmitter  emitter)
          mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다.
  StandardEmitterMBean (T implementation, Class <T> mbeanInterface, boolean isMXBean, NotificationEmitter  emitter)
          지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다.
  StandardEmitterMBean (T implementation, Class <T> mbeanInterface, NotificationEmitter  emitter)
          지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다.
 
메소드의 개요
 void addNotificationListener (NotificationListener  listener, NotificationFilter  filter, Object  handback)
          이 MBean 에 청취자를 추가합니다.
 MBeanNotificationInfo [] getNotificationInfo ()
          이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열을 돌려줍니다.
 void removeNotificationListener (NotificationListener  listener)
          이 MBean 로부터 청취자를 삭제합니다.
 void removeNotificationListener (NotificationListener  listener, NotificationFilter  filter, Object  handback)
          이 MBean 로부터 청취자를 삭제합니다.
 void sendNotification (Notification  n)
          통지를 송신합니다.
 
클래스 javax.management. StandardMBean 로부터 상속된 메소드
cacheMBeanInfo , getAttribute , getAttributes , getCachedMBeanInfo , getClassName , getConstructors , getDescription , getDescription , getDescription , getDescription , getDescription , getDescription , getDescription , getImpact , getImplementation , getImplementationClass , getMBeanInfo , getMBeanInterface , getParameterName , getParameterName , invoke , postDeregister , postRegister , preDeregister , preRegister , setAttribute , setAttributes , setImplementation
 
클래스 java.lang. Object 로부터 상속된 메소드
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

생성자 의 상세

StandardEmitterMBean

public StandardEmitterMBean(T implementation,
                            Class <T> mbeanInterface,
                            NotificationEmitter  emitter)

지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다. implementationemitter 를 같은 객체로 하는 것은, 정당하고 유용합니다.

emitterNotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.

신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 가 영향을 받을 것은 없습니다.

파라미터:
implementation - MBean 인터페이스의 구현
mbeanInterface - Standard MBean 인터페이스
emitter - 통지를 처리하는 객체
예외:
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우, 지정된 implementation 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우

StandardEmitterMBean

public StandardEmitterMBean(T implementation,
                            Class <T> mbeanInterface,
                            boolean isMXBean,
                            NotificationEmitter  emitter)

지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 이 생성자 은, Standard MBean 또는 MXBean 의 작성에 사용할 수 있습니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다. implementationemitter 를 같은 객체로 하는 것은, 정당하고 유용합니다.

emitterNotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.

신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 가 영향을 받을 것은 없습니다.

파라미터:
implementation - MBean 인터페이스의 구현
mbeanInterface - Standard MBean 인터페이스
isMXBean - true 의 경우,mbeanInterface 파라미터에 의해 MXBean 인터페이스가 명명되어 생성되는 MBean 는 MXBean 가 되는
emitter - 통지를 처리하는 객체
예외:
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우, 지정된 implementation 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우

StandardEmitterMBean

protected StandardEmitterMBean(Class <? > mbeanInterface,
                               NotificationEmitter  emitter)

mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다.

emitterNotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.

신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 이 영향을 받을 것은 없습니다.

이 생성자 의 호출은, 지정한 mbeanInterface 를 구현하는 서브 클래스로부터 실시할 필요가 있습니다.

파라미터:
mbeanInterface - StandardMBean 인터페이스
emitter - 통지를 처리하는 객체
예외:
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우,this 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우

StandardEmitterMBean

protected StandardEmitterMBean(Class <? > mbeanInterface,
                               boolean isMXBean,
                               NotificationEmitter  emitter)

mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 이 생성자 은, Standard MBean 또는 MXBean 의 작성에 사용할 수 있습니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다.

emitterNotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.

신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 가 영향을 받을 것은 없습니다.

이 생성자 의 호출은, 지정한 mbeanInterface 를 구현하는 서브 클래스로부터 실시할 필요가 있습니다.

파라미터:
mbeanInterface - StandardMBean 인터페이스
isMXBean - true 의 경우,mbeanInterface 파라미터에 의해 MXBean 인터페이스가 명명되어 생성되는 MBean 는 MXBean 가 되는
emitter - 통지를 처리하는 객체
예외:
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우,this 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우
메소드의 상세

removeNotificationListener

public void removeNotificationListener(NotificationListener  listener)
                                throws ListenerNotFoundException 
인터페이스 NotificationBroadcaster 의 기술:
이 MBean 로부터 청취자를 삭제합니다. 청취자가 다른 핸드백 객체 또는 통지 필터에 등록되어 있는 경우, 이 청취자에게 대응하는 모든 엔트리가 삭제됩니다.

정의:
인터페이스 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)

removeNotificationListener

public void removeNotificationListener(NotificationListener  listener,
                                       NotificationFilter  filter,
                                       Object  handback)
                                throws ListenerNotFoundException 
인터페이스 NotificationEmitter 의 기술:

이 MBean 로부터 청취자를 삭제합니다. MBean 는, 지정된 listener,filter, 및 handback 파라미터와 정확하게 일치하는 청취자를 가지고 있을 필요가 있습니다. 해당하는 청취자가 복수 존재하는 경우, 그 중의 1 개(살)만이 삭제됩니다.

삭제되는 청취자내에서 null 가 지정되고 있는 경우,filterhandback 파라미터는 null 가 됩니다.

정의:
인터페이스 NotificationEmitter 내의 removeNotificationListener
파라미터:
listener - 이전에 이 MBean 에 추가되었다 청취자
filter - 청취자의 추가시로 지정되었다 필터
handback - 청취자의 추가시로 지정되었다 핸드백
예외:
ListenerNotFoundException - 청취자가 MBean 에 등록되지 않은 경우, 또는 지정된 필터 및 핸드백으로 등록되지 않은 경우

addNotificationListener

public void addNotificationListener(NotificationListener  listener,
                                    NotificationFilter  filter,
                                    Object  handback)
인터페이스 NotificationBroadcaster 의 기술:
이 MBean 에 청취자를 추가합니다.

정의:
인터페이스 NotificationBroadcaster 내의 addNotificationListener
파라미터:
listener - 브로드 캐스터가 발행한 통지를 처리하는 청취자 객체
filter - 필터 객체. 필터가 null 의 경우, 통지 처리전에 필터는 적용되지 않는
handback - 통지의 발행시에 청취자에게 송신된다 불투명한 객체. Notification 브로드 캐스터 객체는, 이 객체를 사용할 수 없다. 이 객체는, 손보지 않는 상태로, 통지와 함께 청취자에게 돌려 보내지지 않으면 안 되는
관련 항목:
NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener)

getNotificationInfo

public MBeanNotificationInfo [] getNotificationInfo()
인터페이스 NotificationBroadcaster 의 기술:

이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열을 돌려줍니다.

이 배열에 기술되어 있지 않은 통지를 MBean 가 송신해도, 부정하지는 않습니다. 다만 일부의 MBean 서버 클라이언트는, 올바르게 기능하기 위해서, 작성되는 배열에 의존하는 경우가 있습니다.

정의:
인터페이스 NotificationBroadcaster 내의 getNotificationInfo
반환값:
통지의 배열

sendNotification

public void sendNotification(Notification  n)

통지를 송신합니다.

생성자 에게 건네지는 emitter 파라미터가 NotificationBroadcasterSupport 의 인스턴스였을 경우, 이 메소드는 emitter. sendNotification 를 호출합니다.

파라미터:
n - 송신하는 통지
예외:
ClassCastException - 생성자 에게 건네지는 emitter 파라미터가 NotificationBroadcasterSupport 가 아니었던 경우

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.