JavaTM Platform
Standard Ed. 6

javax.management.modelmbean
인터페이스 ModelMBeanNotificationBroadcaster

모든 슈퍼 인터페이스:
NotificationBroadcaster
기존의 서브 인터페이스의 일람:
ModelMBean
기존의 구현 클래스의 일람:
RequiredModelMBean


public interface ModelMBeanNotificationBroadcaster
extends NotificationBroadcaster

ModelMBean 는, 이 인터페이스를 구현할 필요가 있습니다. 이 인터페이스의 구현은, 모든 JMX 에이전트에 부속되어 있습니다.

관리 대상이 되는 Java 자원은, MBeanServer 의 createMBean 메소드를 사용해, ModelMBean 를 인스턴스화합니다. 다음에, ModelMBean 인스턴스의 ModelMBeanInfo (Descriptor 첨부)를 설정합니다. ModelMBean 의 ModelMBeanInfo 에서 공개된 속성과 오퍼레이션에는, MBean, 연결기, 어댑터로부터 액세스 할 수 있습니다. ModelMBeanInfo Descriptor 를 사용해, 관리 대상 어플리케이션내의 값과 메소드를 정의해, ModelMBean 의 속성 및 오퍼레이션에 맵 할 수가 있습니다. 이 매핑은, XML 형식의 파일을 사용한 개발시, 또는 실행시에 프로그램을 사용해 동적으로 정의할 수 있습니다.

MBeanServer 로 인스턴스화 된 MBean 는 모두 관리 대상이 됩니다. 이러한 속성 및 오퍼레이션에는, MBeanServer 에 접속된 연결기 또는 어댑터 경유로 원격 접근 할 수 있습니다. JMX 준거의 MBean 가 아닌 Java 객체는, MBeanServer 에 등록할 수 없습니다. 자원은, ModelMBean 를 인스턴스화하는 것으로, MBean 의 유효성을 보증합니다.

모든 public 메소드로, MBeanException 및 RuntimeOperationsException 가 throw 될 필요가 있습니다. 이렇게 하는 것으로, 분산형 통신 (RMI, EJB 등)에 의한 예외를 랩 할 수 있습니다. 스펙 및 javadoc 에 기재되어 있는 시나리오 이외에서는, 구현이 반드시 이러한 예외를 throw 한다고는 할 수 없습니다.

도입된 버젼:
1.5

메소드의 개요
 void addAttributeChangeNotificationListener (NotificationListener  listener, String  attributeName, Object  handback)
          NotificationListener 인터페이스를 구현하는 객체를 청취자로서 등록합니다.
 void removeAttributeChangeNotificationListener (NotificationListener  listener, String  attributeName)
          RequiredModelMBean 로부터 attributeChangeNotification 의 청취자를 삭제합니다.
 void sendAttributeChangeNotification (Attribute  oldValue, Attribute  newValue)
          ModelMBean 상의 등록이 끝난 AttributeChangeNotification 청취자에게, 속성의 낡은 값과 새로운 값을 포함한 attributeChangeNotification 를 송신합니다.
 void sendAttributeChangeNotification (AttributeChangeNotification  notification)
          ModelMBean 상의 등록이 끝난 attributeChangeNotification 청취자에게 건네지는 attributeChangeNotification 를 송신합니다.
 void sendNotification (Notification  ntfyObj)
          ModelMBean 상의 등록이 끝난 Notification 청취자에게, jmx.modelmbean.generic 통지로서 건네받는 Notification 를 송신합니다.
 void sendNotification (String  ntfyText)
          ModelMBean 상의 등록이 끝난 Notification 청취자에게 건네지는 텍스트 캐릭터 라인을 포함한 Notification 를 송신합니다.
 
인터페이스 javax.management. NotificationBroadcaster 로부터 상속된 메소드
addNotificationListener , getNotificationInfo , removeNotificationListener
 

메소드의 상세

sendNotification

void sendNotification(Notification  ntfyObj)
                      throws MBeanException ,
                             RuntimeOperationsException 
ModelMBean 상의 등록이 끝난 Notification 청취자에게, jmx.modelmbean.generic 통지로서 건네받는 Notification 를 송신합니다.

파라미터:
ntfyObj - 청취자 객체의 handleNotification 메소드에게 건네지는 통지
예외:
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받은 Notification 객체가 null 의 경우

sendNotification

void sendNotification(String  ntfyText)
                      throws MBeanException ,
                             RuntimeOperationsException 
ModelMBean 상의 등록이 끝난 Notification 청취자에게 건네지는 텍스트 캐릭터 라인을 포함한 Notification 를 송신합니다.

파라미터:
ntfyText - Notification 로 지정되어 청취자 객체의 handleNotification 메소드에게 건네지는 텍스트. 구축 끝난 Notification 를 다음에 나타냅니다. type "jmx.modelmbean.generic" source 이 ModelMBean 인스턴스 sequence 1
예외:
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받은 Notification 텍스트 캐릭터 라인이 null 의 경우

sendAttributeChangeNotification

void sendAttributeChangeNotification(AttributeChangeNotification  notification)
                                     throws MBeanException ,
                                            RuntimeOperationsException 
ModelMBean 상의 등록이 끝난 attributeChangeNotification 청취자에게 건네지는 attributeChangeNotification 를 송신합니다.

파라미터:
notification - 청취자 객체의 handleNotification 메소드에게 건네지는 통지
예외:
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받은 AttributeChangeNotification 객체가 null 의 경우

sendAttributeChangeNotification

void sendAttributeChangeNotification(Attribute  oldValue,
                                     Attribute  newValue)
                                     throws MBeanException ,
                                            RuntimeOperationsException 
ModelMBean 상의 등록이 끝난 AttributeChangeNotification 청취자에게, 속성의 낡은 값과 새로운 값을 포함한 attributeChangeNotification 를 송신합니다.

파라미터:
oldValue - Attribute 의 초기치
newValue - Attribute 의 현재의 값

  
 구축 끝난 attributeChangeNotification.
   type        "jmx.attribute.change"
   source      이 ModelMBean 인스턴스
   sequence    1
   attributeName oldValue.getName()
   attributeType oldValue 의 클래스
   attributeOldValue oldValue.getValue()
   attributeNewValue newValue.getValue()
 
예외:
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받는 Attribute 객체가 null 인 경우, 또는 파라미터에 같은 이름의 Attribute 객체가 복수 지정되었을 경우

addAttributeChangeNotificationListener

void addAttributeChangeNotificationListener(NotificationListener  listener,
                                            String  attributeName,
                                            Object  handback)
                                            throws MBeanException ,
                                                   RuntimeOperationsException ,
                                                   IllegalArgumentException 
NotificationListener 인터페이스를 구현하는 객체를 청취자로서 등록합니다. ModelMBean 에 의해 임의의 attributeChangeNotification 가 발행되면(자), 이 객체의 handleNotification() 메소드가 불려 갑니다. 그 외의 Notification 는 포함하지 않습니다. 이것들은 개별적으로 등록할 필요가 있습니다. 이 attributeName 용의 AttributeChangeNotification 가 생성됩니다.

파라미터:
listener - 등록이 끝난 MBean 가 발행한 통지를 처리하는 청취자 객체
attributeName - ModelMBean 속성의 이름. 이 속성의 변경 통지를 수신한다. null 의 경우, 어느 속성이 변경되었을 때도 attributeChangeNotification 가 발행되는
handback - 통지가 발행되었을 때 통지와 함께 청취자에게 송신되는 문맥
예외:
IllegalArgumentException - 청취자는 null 로 할 수 없다
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받는 속성명이 존재하지 않는 경우
관련 항목:
removeAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String)

removeAttributeChangeNotificationListener

void removeAttributeChangeNotificationListener(NotificationListener  listener,
                                               String  attributeName)
                                               throws MBeanException ,
                                                      RuntimeOperationsException ,
                                                      ListenerNotFoundException 
RequiredModelMBean 로부터 attributeChangeNotification 의 청취자를 삭제합니다.

파라미터:
listener - 등록이 끝난 MBean 가 발행한 통지를 처리하고 있던 청취자의 이름. 이 메소드는 이 청취자에 관한 모든 정보를 삭제하는
attributeName - 속성. 청취자는, 이 속성의 attributeChangeNotification 를 수신할 필요가 없어졌다. null 의 경우, 모든 attributeChangeNotification 의 청취자가 삭제된다
예외:
ListenerNotFoundException - 청취자가 MBean 에 등록되지 않은지, null 의 경우
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException - inAttributeName 파라미터가 속성명에 일치하지 않는 경우, IllegalArgumentException 를 랩 한다.
관련 항목:
addAttributeChangeNotificationListener(javax.management.NotificationListener, java.lang.String, java.lang.Object)

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 도 참조해 주세요.