|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 패키지 다음의 패키지 | 프레임 있어 프레임 없음 | |||||||||
참조처:
설명
| 인터페이스의 개요 | |
|---|---|
| ModelMBean | ModelMBean 는, 이 인터페이스를 구현할 필요가 있습니다. |
| ModelMBeanInfo | ModelMBeanInfo 는, ModelMBean 마다 이 인터페이스를 구현할 필요가 있습니다. |
| ModelMBeanNotificationBroadcaster | ModelMBean 는, 이 인터페이스를 구현할 필요가 있습니다. |
| 클래스의 개요 | |
|---|---|
| DescriptorSupport | 이 클래스는, ModelMBean 요소의 메타데이타셋트를 나타냅니다. |
| ModelMBeanAttributeInfo | ModelMBeanAttributeInfo 객체는, ModelMBean 의 속성을 기술합니다. |
| ModelMBeanConstructorInfo | ModelMBeanConstructorInfo 객체는, ModelMBean 의 생성자 을 기술합니다. |
| ModelMBeanInfoSupport | 이 클래스는, ModelMBean 의 메타데이타를 나타냅니다. |
| ModelMBeanNotificationInfo | ModelMBeanNotificationInfo 객체는, ModelMBean 가 발행하는 통지를 기술합니다. |
| ModelMBeanOperationInfo | ModelMBeanOperationInfo 객체는, ModelMBean 의 관리 오퍼레이션을 기술합니다. |
| RequiredModelMBean | 이 클래스는, ModelMBean 의 구현입니다. |
| 예외의 개요 | |
|---|---|
| InvalidTargetObjectTypeException | 지정된 타겟 객체형이 무효인 경우에 throw 되는 예외입니다. |
| XMLParseException | 이 예외는, XML 형식의 캐릭터 라인이 ModelMBean 객체에 해석되는 경우, 또는 XML 형식의 캐릭터 라인이 ModelMBean 객체로부터 작성되는 경우에 throw 됩니다. |
ModelMBean 클래스의 정의를 제공합니다. Model MBean 는, 관리 인터페이스와 부하의 관리 대상 자원의 브릿지로서 기능하는 MBean 입니다. 관리 인터페이스와 관리 대상 자원은, 어느쪽이나 Java 객체로서 지정됩니다. 복수가 다른 관리 인터페이스 및 관리 대상 자원으로, 같은 Model MBean 구현을 반복해 이용할 수 있습니다. 또, Model MBean 구현은, 지속성 기능, 캐싱 기능등의 공통 기능을 제공할 수 있습니다.
Model MBean 는,ModelMBean 인터페이스를 구현합니다. Model MBean 는,DynamicMBean 이며,ModelMBeanInfo 를 구현하는 객체를 돌려주는 getMBeanInfo 메소드를 가지고 있습니다.
모든 MBean 는, MBean 자체의 정보와 그 속성, 오퍼레이션, 생성자 , 및 통지를 갖춘 MBeanInfo 를 가집니다. Model MBean 는, 이 MBeanInfo 에, (key, value)의 페어 형식의 추가 정보를 encode 하는 Descriptor 를 추가합니다. 일반적으로,Descriptor 는,DescriptorSupport 의 인스턴스입니다.
RequiredModelMBean 클래스는, 표준 Model MBean 구현을 제공합니다.
다음에, MBean 서버로부터 HashMap 의 get 메소드를 관리할 수 있도록(듯이)하기 위한 Model MBean 의 예를 나타냅니다. MBean 서버로부터는, 이외의 메소드는 이용할 수 없습니다. 이 예에서는,HashMap 에 관한 특별한 정보는 없습니다. (와)과 같이 해, 임의의 public 클래스의 public 메소드를 관리용으로 공개할 수 있습니다.
import java.lang.reflect.Method;
import java.util.HashMap;
import javax.management. *;
import javax.management.modelmbean. *;
// ...
MBeanServer mbs = MBeanServerFactory.createMBeanServer();
// The MBean Server
HashMap map = new HashMap();
// The resource that will be managed
// Construct the management interface for the Model MBean
Method getMethod = HashMap.class.getMethod("get", new Class[] {Object.class});
ModelMBeanOperationInfo getInfo =
new ModelMBeanOperationInfo("Get value for key", getMethod);
ModelMBeanInfo mmbi =
new ModelMBeanInfoSupport(HashMap.class.getName(),
"Map of keys and values",
null, // no attributes
null, // no constructors
new ModelMBeanOperationInfo[] {getInfo},
null); // no notifications
// Make the Model MBean and link it to the resource
ModelMBean mmb = new RequiredModelMBean(mmbi);
mmb.setManagedResource(map, "ObjectReference");
// Register the Model MBean in the MBean Server
ObjectName mapName = new ObjectName(":type=Map, name=whatever");
mbs.registerMBean(mmb, mapName);
// Resource can evolve independently of the MBean
map.put("key", "value");
// Can access the "get" method through the MBean Server
mbs.invoke(mapName, "get", new Object[] {"key"}, new String[] {Object.class.getName()});
// returns "value"
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 패키지 다음의 패키지 | 프레임 있어 프레임 없음 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.