所有类


javax.management.relation
接口 RelationServiceMBean

所有已知实现类:
RelationService

public interface RelationServiceMBean

Relation Service 负责创建和删除关系类型和关系,还负责处理一致性和提供查询机制。

从以下版本开始:
1.5

方法摘要
 voidaddRelation(ObjectName theRelObjectName)
          作为 Relation Service 中的关系添加由用户创建(且由其在 MBean Server 中注册)的 MBean。
 voidaddRelationType(RelationType theRelTypeObj)
          作为关系类型添加给定的对象。
 IntegercheckRoleReading(String theRoleName, String theRelTypeName)
          检查给定 Role 能否在给定类型的关系中读取。
 IntegercheckRoleWriting(Role theRole, String theRelTypeName, Boolean theInitFlg)
          检查给定 Role 能否在给定类型的关系中设置。
 voidcreateRelation(String theRelId, String theRelTypeName, RoleList theRoleList)
          创建给定关系类型的简单关系(由 RelationSupport 对象表示),并将其添加到 Relation Service 中。
 voidcreateRelationType(String theRelTypeName, RoleInfo[] theRoleInfoArray)
          用给定的角色信息(由 RoleInfo 对象提供)创建一个关系类型(RelationTypeSupport 对象),并将其添加到 Relation Service 中。
 MapfindAssociatedMBeans(ObjectName theMBeanName, String theRelTypeName, String theRoleName)
          检索与关系中给定关系相关的 MBean。
 MapfindReferencingRelations(ObjectName theMBeanName, String theRelTypeName, String theRoleName)
          检索在其中引用给定 MBean 的关系。
 ListfindRelationsOfType(String theRelTypeName)
          返回给定类型的关系的关系 id。
 ListgetAllRelationIds()
          返回由 Relation Service 处理的所有关系的所有关系 id。
 ListgetAllRelationTypeNames()
          检索所有已知关系类型的名称。
 RoleResultgetAllRoles(String theRelId)
          返回关系中存在的所有角色。
 booleangetPurgeFlag()
          返回一个标志,以指示注销关系中引用的 MBean 时是否接收到通知,是否必须执行关系的直接“肃清”(查找不再有效的关系),或者是否只在显式调用 purgeRelations 方法时执行该操作。
 MapgetReferencedMBeans(String theRelId)
          检索关系的各种角色中引用的 MBean。
 StringgetRelationTypeName(String theRelId)
          返回给定关系的相关关系类型的名称。
 ListgetRole(String theRelId, String theRoleName)
          检索给定关系中给定角色名称的角色值。
 IntegergetRoleCardinality(String theRelId, String theRoleName)
          检索给定角色中当前引用的 MBean 数。
 RoleInfogetRoleInfo(String theRelTypeName, String theRoleInfoName)
          检索给定关系类型的给定角色的角色信息。
 ListgetRoleInfos(String theRelTypeName)
          检索给定关系类型的角色信息(RoleInfo 对象)的列表。
 RoleResultgetRoles(String theRelId, String[] theRoleNameArray)
          检索给定关系中具有给定名称的角色值。
 BooleanhasRelation(String theRelId)
          用给定的关系 id 检查是否存在 Relation Service 中标识的关系。
 voidisActive()
          检查该 Relation Service 是否处于活动状态。
 StringisRelation(ObjectName theObjName)
          如果 Relation Service 中作为关系添加 MBean,则返回与给定 ObjectName 相关的关系 id。
 ObjectNameisRelationMBean(String theRelId)
          如果用 MBean 表示关系(由用户创建且作为 Relation Service 中的关系添加),则返回该 MBean 的 ObjectName。
 voidpurgeRelations()
          肃清关系。
 voidremoveRelation(String theRelId)
          从 Relation Service 移除给定的关系。
 voidremoveRelationType(String theRelTypeName)
          从 Relation Service 中移除给定的关系类型。
 voidsendRelationCreationNotification(String theRelId)
          发送关系创建通知 (RelationNotification)。
 voidsendRelationRemovalNotification(String theRelId, List theUnregMBeanList)
          发送关系移除通知 (RelationNotification)。
 voidsendRoleUpdateNotification(String theRelId, Role theNewRole, List theOldRoleValue)
          发送给定关系中的角色更新通知 (RelationNotification)。
 voidsetPurgeFlag(boolean thePurgeFlg)
          设置一个标志,以指示注销关系中引用的 MBean 时是否接收到通知,是否必须执行关系的直接“肃清”(查找不再有效的关系),或者是否只在显式调用 purgeRelations 方法时执行该操作。
 voidsetRole(String theRelId, Role theRole)
          以给定关系设置给定角色。
 RoleResultsetRoles(String theRelId, RoleList theRoleList)
          以给定关系设置给定角色。
 voidupdateRoleMap(String theRelId, Role theNewRole, List theOldRoleValue)
          针对给定关系中给定角色的更新来处理 Relation Service 角色映射的更新。
 

方法详细信息

isActive

void isActive()
              throws RelationServiceNotRegisteredException
检查该 Relation Service 是否处于活动状态。当前的条件是,Relation Service 必须在 MBean Server 中注册。

抛出:
RelationServiceNotRegisteredException - 如果其尚未注册

getPurgeFlag

boolean getPurgeFlag()
返回一个标志,以指示注销关系中引用的 MBean 时是否接收到通知,是否必须执行关系的直接“肃清”(查找不再有效的关系),或者是否只在显式调用 purgeRelations 方法时执行该操作。

true 表示立即肃清。

返回:
如果是直接肃清,则返回 true。
另请参见:
setPurgeFlag(boolean)

setPurgeFlag

void setPurgeFlag(boolean thePurgeFlg)
设置一个标志,以指示注销关系中引用的 MBean 时是否接收到通知,是否必须执行关系的直接“肃清”(查找不再有效的关系),或者是否只在显式调用 purgeRelations 方法时执行该操作。

true 表示立即肃清。

参数:
thePurgeFlg - 标志
另请参见:
getPurgeFlag()

createRelationType

void createRelationType(String theRelTypeName,
                        RoleInfo[] theRoleInfoArray)
                        throws IllegalArgumentException,
                               InvalidRelationTypeException
用给定的角色信息(由 RoleInfo 对象提供)创建一个关系类型(RelationTypeSupport 对象),并将其添加到 Relation Service 中。

参数:
theRelTypeName - 关系类型的名称
theRoleInfoArray - 角色信息的数组
抛出:
IllegalArgumentException - 如果是 null 参数
InvalidRelationTypeException - 如果:

- 具有该名称的关系类型已经存在

- 两个不同的角色信息使用了同一个名称

- 未提供角色信息

- 提供了一个 null 角色信息


addRelationType

void addRelationType(RelationType theRelTypeObj)
                     throws IllegalArgumentException,
                            InvalidRelationTypeException
作为关系类型添加给定的对象。该对象期望实现 RelationType 接口。

参数:
theRelTypeObj - 关系类型对象(实现该 RelationType 接口)
抛出:
IllegalArgumentException - 如果是 null 参数
InvalidRelationTypeException - 如果已经存在具有该名称的关系类型

getAllRelationTypeNames

List getAllRelationTypeNames()
检索所有已知关系类型的名称。

返回:
关系类型名称的 ArrayList(字符串)

getRoleInfos

List getRoleInfos(String theRelTypeName)
                  throws IllegalArgumentException,
                         RelationTypeNotFoundException
检索给定关系类型的角色信息(RoleInfo 对象)的列表。

参数:
theRelTypeName - 关系类型的名称
返回:
RoleInfo 的 ArrayList。
抛出:
IllegalArgumentException - 如果是 null 参数
RelationTypeNotFoundException - 如果不存在具有该名称的关系类型。