JavaTM Platform
Standard Ed. 6

javax.management.modelmbean
인터페이스 ModelMBean

모든 슈퍼 인터페이스:
DynamicMBean , ModelMBeanNotificationBroadcaster , NotificationBroadcaster , PersistentMBean
기존의 구현 클래스의 일람:
RequiredModelMBean


public interface ModelMBean
extends DynamicMBean , PersistentMBean , ModelMBeanNotificationBroadcaster

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 setManagedResource (Object  mr, String  mr_type)
          이 ModelMBean 관리 인터페이스내의 모든 메소드 (MBeanInfo 와 Descriptor)의 실행 대상이 되는, 객체의 인스턴스 핸들을 설정합니다.
 void setModelMBeanInfo (ModelMBeanInfo  inModelMBeanInfo)
          ModelMBeanInfo 를 사용해 ModelMBean 객체를 초기화합니다.
 
인터페이스 javax.management. DynamicMBean 로부터 상속된 메소드
getAttribute , getAttributes , getMBeanInfo , invoke , setAttribute , setAttributes
 
인터페이스 javax.management. PersistentMBean 로부터 상속된 메소드
load , store
 
인터페이스 javax.management.modelmbean. ModelMBeanNotificationBroadcaster 로부터 상속된 메소드
addAttributeChangeNotificationListener , removeAttributeChangeNotificationListener , sendAttributeChangeNotification , sendAttributeChangeNotification , sendNotification , sendNotification
 
인터페이스 javax.management. NotificationBroadcaster 로부터 상속된 메소드
addNotificationListener , getNotificationInfo , removeNotificationListener
 

메소드의 상세

setModelMBeanInfo

void setModelMBeanInfo(ModelMBeanInfo  inModelMBeanInfo)
                       throws MBeanException ,
                              RuntimeOperationsException 
ModelMBeanInfo 를 사용해 ModelMBean 객체를 초기화합니다. 이 메소드를 사용하면(자), ModelMBean 상에, MBeanServer 에 등록되지 않은 커스텀 ModelMBeanInfo 를 설정할 수 있습니다.
ModelMBean 의 ModelMBeanInfo (Descriptor 첨부)를 커스터마이즈 해, ModelMBean 로 설정한 뒤, ModelMBean 를 MBeanServer 에 등록할 수가 있습니다.

ModelMBean 가 현재 등록되어 있는 경우, 이 메소드는 IllegalStateException 를 랩 하는 RuntimeOperationsException 를 throw 합니다.

파라미터:
inModelMBeanInfo - ModelMBean 에 의해 사용된다 ModelMBeanInfo 객체
예외:
MBeanException - 분산 통신 Exception 를 랩 한다
RuntimeOperationsException -

setManagedResource

void setManagedResource(Object  mr,
                        String  mr_type)
                        throws MBeanException ,
                               RuntimeOperationsException ,
                               InstanceNotFoundException ,
                               InvalidTargetObjectTypeException 
이 ModelMBean 관리 인터페이스내의 모든 메소드 (MBeanInfo 와 Descriptor)의 실행 대상이 되는, 객체의 인스턴스 핸들을 설정합니다.

파라미터:
mr - 관리 대상의 자원이 되어 있는 객체
mr_type - 관리 대상의 자원의 참조의 형태. ObjectReference, Handle, IOR, EJBHandle, RMIReference 의 언젠가. MBeanServer 가 건네받은 mr_type 를 처리할 수 없는 경우, InvalidTargetTypeException 가 throw 된다
예외:
MBeanException - 객체의 이니샤라이자가 예외를 throw 했을 경우
RuntimeOperationsException - IllegalArgumentException 를 랩 한다. 파라미터로서 건네받은 관리 대상의 자원의 형태가 null 의 경우
InstanceNotFoundException - 관리 대상의 자원 객체가 발견되지 않는 경우
InvalidTargetObjectTypeException - 관리 대상의 자원의 형태를 ModelMBean 또는 JMX 에이전트로 처리할 수 없는 경우

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