JavaTM Platform
Standard Ed. 6

javax.management.relation
�ӿ� Relation

������֪�ӽӿڣ�
RelationSupportMBean
������֪ʵ���ࣺ
RelationSupport

public interface Relation

�˽ӿڱ������κ� MBean �ࣨ������ʾΪһ��ʹ�� Relation Service �����Ĺ�ϵ����ʵ�֡�

�򵥵Ĺ�ϵ����ֻ�н�ɫ��û�����Ի򷽷��������� Relation Service ֱ�Ӵ�������ʾΪ RelationSupport ������ Relation Service �ڲ���������

����û�ϣ����ʾ�����ӵĹ�ϵ���������Ժ�/�򷽷�������������ṩ�Լ�ʵ�� Relation �ӿڵ��ࡣ�����ͨ���� RelationSupport ��̳еõ���Ҳ����ͨ��ʵ�ָýӿڵõ���ȫȨ����ί�и� RelationSupport �����Ա����

ָ���������û���ϵ����Ϊ���������Ժ�/�򷽷�����Щ��Ҫ��Զ�̹�����������ˣ�����ζ���κ��û���ϵ�඼������һ�� MBean �ࡣ

�����°汾��ʼ��
1.5

����ժҪ
 RoleResult getAllRoles()
          ���ظù�ϵ�д��ڵ����н�ɫ��
 Map<ObjectName,List<String>> getReferencedMBeans()
          �����ڸù�ϵ�ĸ��ֽ�ɫ�����õ� MBean��
 String getRelationId()
          ���ع�ϵ��ʶ��������Ψһ��ʶ Relation Service �ڵĹ�ϵ����
 ObjectName getRelationServiceName()
          ���ش�����ϵ�� Relation Service �� ObjectName��
 String getRelationTypeName()
          ������ع�ϵ���͵����ơ�
 List<ObjectName> getRole(String roleName)
          ����������ɫ���ƵĽ�ɫֵ��
 Integer getRoleCardinality(String roleName)
          ���ص�ǰ�ڸ�����ɫ�����õ� MBean ����
 RoleResult getRoles(String[] roleNameArray)
          �������и������ƵĽ�ɫֵ��
 void handleMBeanUnregistration(ObjectName objectName, String roleName)
          ��ע����ɫ�����õ� MBean ʱ�� Relation Service ʹ�õĻص���
 RoleList retrieveAllRoles()
          ���ع�ϵ�е����н�ɫ��������ȡģʽ��
 void setRole(Role role)
          ���ø�����ɫ��
 RoleResult setRoles(RoleList roleList)
          ���ø����Ľ�ɫ��
 

������ϸ��Ϣ

getRole

List<ObjectName> getRole(String roleName)
                         throws IllegalArgumentException,
                                RoleNotFoundException,
                                RelationServiceNotRegisteredException
����������ɫ���ƵĽ�ɫֵ��

���չ�ϵ���ͼ���ɫ�Ƿ���ڼ��Ƿ�ɶ���

������
roleName - ��ɫ����
���أ�
��Ϊ��ɫֵ�� ObjectName ����� ArrayList
�׳���
IllegalArgumentException - ���Ϊ null ��ɫ����
RoleNotFoundException - �����

- �����ھ��и������ƵĽ�ɫ

- ��ɫ���ɶ���

RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ��ע��
������
setRole(javax.management.relation.Role)

getRoles

RoleResult getRoles(String[] roleNameArray)
                    throws IllegalArgumentException,
                           RelationServiceNotRegisteredException
�������и������ƵĽ�ɫֵ��

���չ�ϵ���ͼ��ÿ����ɫ�Ƿ���ڼ��Ƿ�ɶ���

������
roleNameArray - Ҫ�����Ľ�ɫ���Ƶ�����
���أ�
RoleResult ���󣬰���һ�� RoleList����Գɹ��������Ľ�ɫ����һ�� RoleUnresolvedList�����δ�������Ľ�ɫ����
�׳���
IllegalArgumentException - ����� null ��ɫ����
RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ��ע�ᡣ
������
setRoles(javax.management.relation.RoleList)

getRoleCardinality

Integer getRoleCardinality(String roleName)
                           throws IllegalArgumentException,
                                  RoleNotFoundException
���ص�ǰ�ڸ�����ɫ�����õ� MBean ����

������
roleName - ��ɫ����
���أ�
��ǰ�ڴ˽�ɫ�����õ� MBean ��
�׳���
IllegalArgumentException - ����� null ��ɫ����
RoleNotFoundException - ��������ھ��и������ƵĽ�ɫ

getAllRoles

RoleResult getAllRoles()
                       throws RelationServiceNotRegisteredException
���ظù�ϵ�д��ڵ����н�ɫ��

���أ�
RoleResult ���󣬸ö������һ�� RoleList����Գɹ��������Ľ�ɫ����һ�� RoleUnresolvedList����Բ��ɶ��Ľ�ɫ����
�׳���
RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ��ע��

retrieveAllRoles

RoleList retrieveAllRoles()
���ع�ϵ�е����н�ɫ��������ȡģʽ��

���أ�
һ�� RoleList��

setRole

void setRole(Role role)
             throws IllegalArgumentException,
                    RoleNotFoundException,
                    RelationTypeNotFoundException,
                    InvalidRoleValueException,
                    RelationServiceNotRegisteredException,
                    RelationNotFoundException
���ø�����ɫ��

���������ڹ�ϵ�Ĺ�ϵ�������ṩ����Ӧ��ɫ�������ɫ

������֪ͨ�������� RELATION_BASIC_UPDATE �� RELATION_MBEAN_UPDATE �� RelationNotification������ȡ���ڸù�ϵ�Ƿ�Ϊ MBean��

������
role - Ҫ���õĽ�ɫ�����ƺ���ֵ��
�׳���
IllegalArgumentException - ����� null ��ɫ��
RoleNotFoundException - ��������ھ���ָ�����ƵĽ�ɫ�����߸ý�ɫ����д����ʼ����ɫʱδִ��д�����ģʽ���ԣ���
InvalidRoleValueException - ���Ϊ��ɫ�ṩ��ֵ��Ч�����磺

- ����ֵ�����õ� MBean ��С����������С�̶ȣ�

- �ṩ��ֵ�����õ� MBean ���������������̶ȣ�

- ��ֵ�����õ� MBean ��һ�������Ǹý�ɫ������ MBean ��Ķ���

- ���������Ϊ�ý�ɫ�ṩ�� MBean��

RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ��ע�ᡣ
RelationTypeNotFoundException - ����� Relation Service ����δ�����ù�ϵ���͡�
RelationNotFoundException - �����δ�� Relation Service �����ӹ�ϵ��
������
getRole(java.lang.String)

setRoles

RoleResult setRoles(RoleList roleList)
                    throws IllegalArgumentException,
                           RelationServiceNotRegisteredException,
                           RelationTypeNotFoundException,
                           RelationNotFoundException
���ø����Ľ�ɫ��

���������ڹ�ϵ�Ĺ�ϵ�������ṩ����Ӧ��ɫ�������ɫ

ÿ�����µĽ�ɫ������һ��֪ͨ�������� RELATION_BASIC_UPDATE �� RELATION_MBEAN_UPDATE �� RelationNotification������ȡ���ڸù�ϵ�Ƿ�Ϊ MBean����

������
roleList - Ҫ���õĽ�ɫ�б�
���أ�
RoleResult ���󣬸ö������һ�� RoleList����Գɹ����õĽ�ɫ����һ�� RoleUnresolvedList�����δ�ɹ����õĽ�ɫ����
�׳���
IllegalArgumentException - ����� null ��ɫ�б���
RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ��ע�᣻
RelationTypeNotFoundException - ����� Relation Service ����δ�����ù�ϵ���ͣ�
RelationNotFoundException - �����δ�� Relation Service �����ӹ�ϵ MBean��
������
getRoles(java.lang.String[])

handleMBeanUnregistration

void handleMBeanUnregistration(ObjectName objectName,
                               String roleName)
                               throws IllegalArgumentException,
                                      RoleNotFoundException,
                                      InvalidRoleValueException,
                                      RelationServiceNotRegisteredException,
                                      RelationTypeNotFoundException,
                                      RelationNotFoundException
��ע����ɫ�����õ� MBean ʱ�� Relation Service ʹ�õĻص���

Relation Service �����ô˷��������øù�ϵ��ȡ�ж�����ӳ����ע����Ӱ�졣

С�ģ��������û����ô˷�����

��ǰʵ����Ϊ�����䵱ǰֵ�����õ� MBean �� ObjectName �б���������ע����ֵ���ý�ɫ��

������
objectName - ע���� MBean �� ObjectName
roleName - ���������� MBean �Ľ�ɫ����
�׳���
IllegalArgumentException - ����� null ������
RoleNotFoundException - �����ɫ���ڹ�ϵ�л򲻿�д��
InvalidRoleValueException - �����ɫֵ����ѭ��ؽ�ɫ��Ϣ������Զ�����ڴ� Relation Service �е���ʱ��������
RelationServiceNotRegisteredException - ��� Relation Service δ�� MBean Server ע�᣻
RelationTypeNotFoundException - ����� Relation Service ����δ�����ù�ϵ���ͣ�
RelationNotFoundException - ���δ�� Relation Service �����ӵĹ�ϵ MBean ���ô˷�����

getReferencedMBeans

Map<ObjectName,List<String>> getReferencedMBeans()
�����ڸù�ϵ�ĸ��ֽ�ɫ�����õ� MBean��

���أ�
һ�� HashMap ӳ�䣺

ObjectName -> ArrayList of String����ɫ����


getRelationTypeName

String getRelationTypeName()
������ع�ϵ���͵����ơ�

���أ�
��ϵ���͵����ơ�

getRelationServiceName

ObjectName getRelationServiceName()
���ش�����ϵ�� Relation Service �� ObjectName��

���أ�
Relation Service �� ObjectName��

getRelationId

String getRelationId()
���ع�ϵ��ʶ��������Ψһ��ʶ Relation Service �ڵĹ�ϵ����

���أ�
��ϵ id��

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������