|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
java.lang.Objectjavax.management.StandardMBean
javax.management.StandardEmitterMBean
public class StandardEmitterMBean
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);
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 |
| 생성자 의 상세 |
|---|
public StandardEmitterMBean(T implementation,
Class <T> mbeanInterface,
NotificationEmitter emitter)
지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다. implementation 및 emitter 를 같은 객체로 하는 것은, 정당하고 유용합니다.
emitter 가 NotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.
신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 가 영향을 받을 것은 없습니다.
implementation - MBean 인터페이스의 구현mbeanInterface - Standard MBean 인터페이스emitter - 통지를 처리하는 객체
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우, 지정된 implementation 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우
public StandardEmitterMBean(T implementation,
Class <T> mbeanInterface,
boolean isMXBean,
NotificationEmitter emitter)
지정한 구현을 사용해,mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 이 생성자 은, Standard MBean 또는 MXBean 의 작성에 사용할 수 있습니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다. implementation 및 emitter 를 같은 객체로 하는 것은, 정당하고 유용합니다.
emitter 가 NotificationBroadcasterSupport 의 인스턴스인 경우, 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 의 경우
protected StandardEmitterMBean(Class <? > mbeanInterface,
NotificationEmitter emitter)
mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다.
emitter 가 NotificationBroadcasterSupport 의 인스턴스인 경우, MBean 의 sendNotification 메소드는 emitter. sendNotification 를 호출합니다.
신규 MBean 에 대한 getNotificationInfo() 에 의해 반환되는 배열은, 구축시에 emitter. getNotificationInfo() 에 의해 반환되는 배열의 카피입니다. emitter.getNotificationInfo() 에 의해 반환된 배열이 나중에 변경되어도, 객체의 getNotificationInfo() 이 영향을 받을 것은 없습니다.
이 생성자 의 호출은, 지정한 mbeanInterface 를 구현하는 서브 클래스로부터 실시할 필요가 있습니다.
mbeanInterface - StandardMBean 인터페이스emitter - 통지를 처리하는 객체
IllegalArgumentException - mbeanInterface 가 관리 인터페이스의 JMX 설계 패턴에 따르지 않은 경우,this 가 특정의 인터페이스를 구현하고 있지 않는 경우, 또는 emitter 가 null 의 경우
protected StandardEmitterMBean(Class <? > mbeanInterface,
boolean isMXBean,
NotificationEmitter emitter)
mbeanInterface 에 의해 관리 인터페이스가 지정되는 MBean 를 작성합니다. 통지는, 지정한 NotificationEmitter 에 의해 처리됩니다. 이 생성자 은, Standard MBean 또는 MXBean 의 작성에 사용할 수 있습니다. 생성되는 MBean 는, 그 메소드를 emitter 에 전송 하는 것으로써,NotificationEmitter 인터페이스를 구현합니다.
emitter 가 NotificationBroadcasterSupport 의 인스턴스인 경우, 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 의 경우| 메소드의 상세 |
|---|
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 void addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
NotificationBroadcaster 의 기술:
NotificationBroadcaster 내의 addNotificationListener listener - 브로드 캐스터가 발행한 통지를
처리하는 청취자 객체filter - 필터 객체. 필터가 null 의 경우,
통지 처리전에 필터는 적용되지 않는handback - 통지의 발행시에 청취자에게 송신된다
불투명한 객체. Notification 브로드 캐스터 객체는,
이 객체를 사용할 수 없다. 이 객체는, 손보지 않는 상태로,
통지와 함께 청취자에게 돌려 보내지지 않으면 안 되는NotificationBroadcaster.removeNotificationListener(javax.management.NotificationListener) public MBeanNotificationInfo [] getNotificationInfo()
NotificationBroadcaster 의 기술:이 MBean 가 송신할 가능성이 있는 각 통지에 대해, 그 통지의 Java 클래스명과 통지형을 나타내는 배열을 돌려줍니다.
이 배열에 기술되어 있지 않은 통지를 MBean 가 송신해도, 부정하지는 않습니다. 다만 일부의 MBean 서버 클라이언트는, 올바르게 기능하기 위해서, 작성되는 배열에 의존하는 경우가 있습니다.
NotificationBroadcaster 내의 getNotificationInfo public void sendNotification(Notification n)
통지를 송신합니다.
생성자 에게 건네지는 emitter 파라미터가 NotificationBroadcasterSupport 의 인스턴스였을 경우, 이 메소드는 emitter. sendNotification 를 호출합니다.
n - 송신하는 통지
ClassCastException - 생성자 에게 건네지는 emitter 파라미터가 NotificationBroadcasterSupport 가 아니었던 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세: 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.