|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.management.NotificationBroadcasterSupport
javax.management.relation.RelationService
public class RelationService
Relation Service 負責創建和刪除關係型別和關係,負責處理一致性並負責提供查詢機制。
它通過擴展 NotificationBroadcasterSupport 實作 NotificationBroadcaster,以便在從中移除關係時發送通知。
它實作 NotificationListener 介面,以便能夠接收有關註銷關係角色中參考的 MBean 的通知以及註銷關係 MBean 的通知。
它實作 MBeanRegistration 介面,以便能夠檢索其 ObjectName 和 MBean Server。
| 建構子摘要 | |
|---|---|
RelationService(boolean immediatePurgeFlag)
建構子。 |
|
| 方法摘要 | |
|---|---|
void |
addRelation(ObjectName relationObjectName)
作為 Relation Service 中的關係添加由使用者創建(且由其在 MBean Server 中註冊)的 MBean。 |
void |
addRelationType(RelationType relationTypeObj)
作為關係型別添加給定的物件。 |
Integer |
checkRoleReading(String roleName,
String relationTypeName)
檢查給定 Role 能否以給定型別的關係進行讀取。 |
Integer |
checkRoleWriting(Role role,
String relationTypeName,
Boolean initFlag)
檢查給定 Role 能否以給定型別的關係進行設置。 |
void |
createRelation(String relationId,
String relationTypeName,
RoleList roleList)
創建給定關係型別的簡單關係(由 RelationSupport 物件表示),並將其添加到 Relation Service 中。 |
void |
createRelationType(String relationTypeName,
RoleInfo[] roleInfoArray)
用給定的角色資訊(由 RoleInfo 物件提供)創建一個關係型別(RelationTypeSupport 物件),並將其添加到 Relation Service 中。 |
Map<ObjectName,List<String>> |
findAssociatedMBeans(ObjectName mbeanName,
String relationTypeName,
String roleName)
檢索與關係中給定關係相關的 MBean。 |
Map<String,List<String>> |
findReferencingRelations(ObjectName mbeanName,
String relationTypeName,
String roleName)
檢索在參考給定 MBean 的參考關係。 |
List<String> |
findRelationsOfType(String relationTypeName)
返回給定型別的關係的關係 id。 |
List<String> |
getAllRelationIds()
返回由 Relation Service 處理的所有關係的所有關係 id。 |
List<String> |
getAllRelationTypeNames()
檢索所有已知關係型別的名稱。 |
RoleResult |
getAllRoles(String relationId)
返回關係中存在的所有角色。 |
MBeanNotificationInfo[] |
getNotificationInfo()
返回一個 NotificationInfo 物件,它包含通知的 Java 類別的名稱和發送的通知型別。 |
boolean |
getPurgeFlag()
返回一個標誌,以指示何時接收註銷關係中參考的 MBean 的通知,指示是否必須執行關係的直接“肅清”(尋找不再有效的關係),或者是否只在將顯式調用 purgeRelations 方法時執行該操作。 |
Map<ObjectName,List<String>> |
getReferencedMBeans(String relationId)
檢索關係的各種角色中參考的 MBean。 |
String |
getRelationTypeName(String relationId)
返回給定關係的相關關係型別的名稱。 |
List<ObjectName> |
getRole(String relationId,
String roleName)
檢索給定關係中給定角色名稱的角色值。 |
Integer |
getRoleCardinality(String relationId,
String roleName)
檢索給定角色中當前參考的 MBean 數。 |
RoleInfo |
getRoleInfo(String relationTypeName,
String roleInfoName)
檢索給定關係型別的給定角色名稱的角色資訊。 |
List<RoleInfo> |
getRoleInfos(String relationTypeName)
檢索給定關係型別的角色資訊(RoleInfo 物件)的列表。 |
RoleResult |
getRoles(String relationId,
String[] roleNameArray)
檢索給定關係中具有給定名稱的角色值。 |
void |
handleNotification(Notification notif,
Object handback)
出現 JMX 通知時調用。 |
Boolean |
hasRelation(String relationId)
用給定的關係 id 檢查是否存在 Relation Service 中標識的關係。 |
void |
isActive()
檢查該 Relation Service 是否處於活動狀態。 |
String |
isRelation(ObjectName objectName)
如果已經將 MBean 作為關係添加在 Relation Service 中,則返回與給定 ObjectName 相關的關係 id。 |
ObjectName |
isRelationMBean(String relationId)
如果用 MBean 表示關係(由使用者創建且作為 Relation Service 中的關係添加),則返回該 MBean 的 ObjectName。 |
void |
postDeregister()
允許 MBean 在已從 MBean 伺服器註銷之後執行所需要的任何操作。 |
void |
postRegister(Boolean registrationDone)
允許 MBean 在被註冊到 MBean 伺服器或註銷失敗後執行任何所需要的操作。 |
void |
preDeregister()
允許該 MBean 在從 MBean 伺服器註銷之前執行它所需要的任何操作。 |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
允許 MBean 在被註冊到 MBean 伺服器之前執行它所需要的任何操作。 |
void |
purgeRelations()
肅清關係。 |
void |
removeRelation(String relationId)
從 Relation Service 移除給定的關係。 |
void |
removeRelationType(String relationTypeName)
從 Relation Service 中移除給定的關係型別。 |
void |
sendRelationCreationNotification(String relationId)
發送關係創建通知 (RelationNotification)。 |
void |
sendRelationRemovalNotification(String relationId,
List<ObjectName> unregMBeanList)
發送關係移除通知 (RelationNotification)。 |
void |
sendRoleUpdateNotification(String relationId,
Role newRole,
List<ObjectName> oldValue)
發送給定關係中的角色更新通知 (RelationNotification)。 |
void |
setPurgeFlag(boolean purgeFlag)
設置一個標誌,以指示註銷關係中參考的 MBean 時是否接收通知,是否必須執行關係的直接“肅清”(尋找不再有效的關係),或者是否只在顯式調用 purgeRelations 方法時執行該操作。 |
void |
setRole(String relationId,
Role role)
設置給定關係中的給定角色。 |
RoleResult |
setRoles(String relationId,
RoleList roleList)
設置給定關係中的給定角色。 |
void |
updateRoleMap(String relationId,
Role newRole,
List<ObjectName> oldValue)
針對給定關係中給定角色的更新來處理 Relation Service 角色映射的更新。 |
| 從類別 javax.management.NotificationBroadcasterSupport 繼承的方法 |
|---|
addNotificationListener, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public RelationService(boolean immediatePurgeFlag)
immediatePurgeFlag - 指示何時接收註銷關係中參考的 MBean 的通知,指示是否必須執行關係的直接“肅清”(尋找不再有效的關係),或者是否只在顯式調用 purgeRelations 方法時執行該操作。
true 表示立即肅清。
| 方法詳細資訊 |
|---|
public void isActive()
throws RelationServiceNotRegisteredException
RelationServiceMBean 中的 isActiveRelationServiceNotRegisteredException - 如果未註冊 Relation Service
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws Exception
MBeanRegistration 複製的描述
MBeanRegistration 中的 preRegisterserver - 將要在其中註冊該 MBean 的 MBean 伺服器。name - 該 MBean 的物件名。如果 MBeanServer 介面中的某個 createMBean 方法或 registerMBean 方法的 name 參數為 null,則此 name 也為 null。在這種情況下,此方法必須為新 MBean 返回非 null 的 ObjectName。
name 參數不為 null,則它通常但並非一定為返回值。
Exception - MBean 伺服器會捕捉此異常並以 MBeanRegistrationException 的形式重新拋出。public void postRegister(Boolean registrationDone)
MBeanRegistration 複製的描述
MBeanRegistration 中的 postRegisterregistrationDone - 指示該 MBean 是否已在 MBean 伺服器中成功註冊。false 值意味著註冊階段已失敗。
public void preDeregister()
throws Exception
MBeanRegistration 複製的描述
MBeanRegistration 中的 preDeregisterException - MBean 伺服器會捕捉此異常並以 MBeanRegistrationException 的形式重新拋出。public void postDeregister()
MBeanRegistration 複製的描述
MBeanRegistration 中的 postDeregisterpublic boolean getPurgeFlag()
true 表示立即肅清。
RelationServiceMBean 中的 getPurgeFlagsetPurgeFlag(boolean)public void setPurgeFlag(boolean purgeFlag)
true 表示立即肅清。
RelationServiceMBean 中的 setPurgeFlagpurgeFlag - 標誌getPurgeFlag()
public void createRelationType(String relationTypeName,
RoleInfo[] roleInfoArray)
throws IllegalArgumentException,
InvalidRelationTypeException
RelationServiceMBean 中的 createRelationTyperelationTypeName - 關係型別的名稱roleInfoArray - 角色資訊的陣列
IllegalArgumentException - 如果參數為 null
InvalidRelationTypeException - 如果:
- 具有該名稱的關係型別已經存在
- 兩個不同的角色資訊使用了同一個名稱
- 未提供角色資訊
- 提供了一個 null 角色資訊
public void addRelationType(RelationType relationTypeObj)
throws IllegalArgumentException,
InvalidRelationTypeException
RelationServiceMBean 中的 addRelationTyperelationTypeObj - 關係型別物件(實作該 RelationType 介面)
IllegalArgumentException - 如果參數為 null或者 relationTypeObj.getRelationTypeName() 返回 null。
InvalidRelationTypeException - 如果:
- 兩個不同的角色用了同一個名稱
- 未提供角色資訊
- 提供了一個 null 角色資訊
- 具有該名稱的關係型別已經存在
public List<String> getAllRelationTypeNames()
RelationServiceMBean 中的 getAllRelationTypeNames
public List<RoleInfo> getRoleInfos(String relationTypeName)
throws IllegalArgumentException,
RelationTypeNotFoundException
RelationServiceMBean 中的 getRoleInfosrelationTypeName - 關係型別的名稱
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果不存在具有該名稱的關係型別。
public RoleInfo getRoleInfo(String relationTypeName,
String roleInfoName)
throws IllegalArgumentException,
RelationTypeNotFoundException,
RoleInfoNotFoundException
RelationServiceMBean 中的 getRoleInforelationTypeName - 關係型別的名稱roleInfoName - 角色的名稱
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果在 Relation Service 中的關係型別未知
RoleInfoNotFoundException - 如果該角色不是該關係型別的一部分。
public void removeRelationType(String relationTypeName)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationTypeNotFoundException
此型別的關係物件將要從 Relation Service 中移除。
RelationServiceMBean 中的 removeRelationTyperelationTypeName - 要移除的關係型別名稱
RelationServiceNotRegisteredException - 如果該 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果不存在具有該名稱的關係型別
public void createRelation(String relationId,
String relationTypeName,
RoleList roleList)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RoleNotFoundException,
InvalidRelationIdException,
RelationTypeNotFoundException,
InvalidRoleValueException
按照在參數中提供的角色列表初始化角色。將未按此方法初始化的角色設置為 ObjectName 的空 ArrayList。
發送型別為 RELATION_BASIC_CREATION 的 RelationNotification。
RelationServiceMBean 中的 createRelationrelationId - 關係標識符,用來唯一地標識 Relation Service 中的關係relationTypeName - 關係型別的名稱(必須在 Relation Service 中創建)roleList - 要初始化該關係的角色的角色列表(可以為 null)。
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null(角色列表除外,它在未進行角色初始化時可以為 null)
RoleNotFoundException - 如果為關係型別中不存在的角色提供值
InvalidRelationIdException - 如果關係 id 已經使用
RelationTypeNotFoundException - 如果在 Relation Service 中關係型別未知
InvalidRoleValueException - 如果:
- 兩個不同的角色使用了同一個角色名稱
- 給定值中參考的 MBean 數小於期望的最小程度
- 提供的值中參考的 MBean 數超過期望的最大程度
- 該值中參考的 MBean 的一個物件不是該角色期望的 MBean 類別的物件
- 如果不存在為該角色提供的 MBean
public void addRelation(ObjectName relationObjectName)
throws IllegalArgumentException,
RelationServiceNotRegisteredException,
NoSuchMethodException,
InvalidRelationIdException,
InstanceNotFoundException,
InvalidRelationServiceException,
RelationTypeNotFoundException,
RoleNotFoundException,
InvalidRoleValueException
將作為關係添加 MBean,它必須遵循以下做法:
- 實作該 Relation 介面
- 具有 RelationService ObjectName,即當前 Relation Service 的 ObjectName
- 具有在當前 Relation Service 中唯一且未使用的關係 id
- 具有關係型別,即在 Relation Service 中創建的關係型別
- 具有遵循在關係型別中提供的角色資訊的角色。
RelationServiceMBean 中的 addRelationrelationObjectName - 要添加的關係 MBean 的 ObjectName。
IllegalArgumentException - 如果參數為 null
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
NoSuchMethodException - 如果 MBean 沒有實作 Relation 介面
InvalidRelationIdException - 如果:
- MBean 中沒有關係標識符
- 在 Relation Service 中已經使用關係標識符
InstanceNotFoundException - 如果尚未註冊給定 ObjectName 的 MBean
InvalidRelationServiceException - 如果:
- MBean 中沒有 Relation Service 名稱
- MBean 中的 Relation Service 名稱不是當前 Relation Service 的名稱
RelationTypeNotFoundException - 如果:
- MBean 中沒有關係型別名稱
- MBean 中的關係型別名稱與 Relation Service 中創建的關係型別不對應
InvalidRoleValueException - 如果:
- 角色中參考的 MBean 數小於期望的最小程度
- 角色中參考的 MBean 數超過期望的最大程度
- 該值中參考的 MBean 的一個物件不是該角色期望的 MBean 類別的物件
- 為角色提供的 MBean 不存在
RoleNotFoundException - 如果為關係型別中不存在的角色提供了值
public ObjectName isRelationMBean(String relationId)
throws IllegalArgumentException,
RelationNotFoundException
RelationServiceMBean 中的 isRelationMBeanrelationId - 標識關係的關係 id
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在與該 id 相關的關係
public String isRelation(ObjectName objectName)
throws IllegalArgumentException
RelationServiceMBean 中的 isRelationobjectName - 假定關係的 ObjectName
IllegalArgumentException - 如果參數為 null
public Boolean hasRelation(String relationId)
throws IllegalArgumentException
RelationServiceMBean 中的 hasRelationrelationId - 標識關係的關係 id
IllegalArgumentException - 如果參數為 nullpublic List<String> getAllRelationIds()
RelationServiceMBean 中的 getAllRelationIds
public Integer checkRoleReading(String roleName,
String relationTypeName)
throws IllegalArgumentException,
RelationTypeNotFoundException
RelationServiceMBean 中的 checkRoleReadingroleName - 要檢查的角色名稱relationTypeName - 關係型別的名稱
- 如果角色可讀,則用 0 表示
- 對應於 RoleStatus.NO_ROLE_WITH_NAME 的整數
- 對應於 RoleStatus.ROLE_NOT_READABLE 的整數
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果 Relation Service 中的關係型別未知
public Integer checkRoleWriting(Role role,
String relationTypeName,
Boolean initFlag)
throws IllegalArgumentException,
RelationTypeNotFoundException
RelationServiceMBean 中的 checkRoleWritingrole - 要檢查的角色relationTypeName - 關係型別的名稱initFlag - 指定已完成角色的初始化檢查,並且不驗證寫入存取的標誌。
- 如果角色可以設置,則用 0 表示
- 對應於 RoleStatus.NO_ROLE_WITH_NAME 的整數
- 對應於 RoleStatus.ROLE_NOT_WRITABLE 的整數
- 對應於 RoleStatus.LESS_THAN_MIN_ROLE_DEGREE 的整數
- 對應於 RoleStatus.MORE_THAN_MAX_ROLE_DEGREE 的整數
- 對應於 RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS 的整數
- 對應於 RoleStatus.REF_MBEAN_NOT_REGISTERED 的整數
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果是未知關係型別
public void sendRelationCreationNotification(String relationId)
throws IllegalArgumentException,
RelationNotFoundException
- RelationNotification.RELATION_BASIC_CREATION,如果該關係是 Relation Service 內部的一個物件
- RelationNotification.RELATION_MBEAN_CREATION,如果該關係是作為關係添加的 MBean。
源物件是 Relation Service 本身。
它在 Relation Service createRelation() 和 addRelation() 方法中調用。
RelationServiceMBean 中的 sendRelationCreationNotificationrelationId - 更新的關係的關係標識符
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在給定關係 id 的關係
public void sendRoleUpdateNotification(String relationId,
Role newRole,
List<ObjectName> oldValue)
throws IllegalArgumentException,
RelationNotFoundException
- RelationNotification.RELATION_BASIC_UPDATE,如果該關係是 Relation Service 內部的一個物件
- RelationNotification.RELATION_MBEAN_UPDATE,如果該關係是作為關係添加的 MBean。
源物件是 Relation Service 本身。
它在關係 MBean setRole()(針對給定角色)和 setRoles()(針對每個角色)方法(RelationSupport 類別中提供的實作)中調用。
它還在 Relation Service setRole()(針對給定角色)和 setRoles()(針對每個角色)方法中調用。
RelationServiceMBean 中的 sendRoleUpdateNotificationrelationId - 已更新關係的關係標識符newRole - 新的角色(名稱和新值)oldValue - 舊角色值(ObjectName 物件的列表)
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在給定關係 id 的關係
public void sendRelationRemovalNotification(String relationId,
List<ObjectName> unregMBeanList)
throws IllegalArgumentException,
RelationNotFoundException
- RelationNotification.RELATION_BASIC_REMOVAL,如果該關係是 Relation Service 內部的一個物件
- RelationNotification.RELATION_MBEAN_REMOVAL,如果該關係是作為關係添加的 MBean。
源物件是 Relation Service 本身。
它在 Relation Service removeRelation() 方法中調用。
RelationServiceMBean 中的 sendRelationRemovalNotificationrelationId - 已更新關係的關係標識符unregMBeanList - 期望因為關係移除而註銷的 MBean 的 ObjectName 列表(可以為 null)
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在給定關係 id 的關係
public void updateRoleMap(String relationId,
Role newRole,
List<ObjectName> oldValue)
throws IllegalArgumentException,
RelationServiceNotRegisteredException,
RelationNotFoundException
它在關係 MBean setRole()(針對給定角色)和 setRoles()(針對每個角色)方法(RelationSupport 類別中提供的實作)中調用。
它還在 Relation Service setRole()(針對給定角色)和 setRoles()(針對每個角色)方法中調用。
為了允許 Relation Service 維護一致性(MBean 註銷時)以及能夠執行查詢,更新角色時必須調用此方法。
RelationServiceMBean 中的 updateRoleMaprelationId - 已更新關係的關係標識符newRole - 新的角色(名稱和新的值)oldValue - 舊角色值(ObjectName 物件的列表)
IllegalArgumentException - 如果參數為 null
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
RelationNotFoundException - 如果沒有給定 id 的關係。
public void removeRelation(String relationId)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationNotFoundException
發送 RelationNotification 通知,其型別是:
- RelationNotification.RELATION_BASIC_REMOVAL,如果該關係只在 Relation Service 內部
- RelationNotification.RELATION_MBEAN_REMOVAL,如果該關係作為 MBean 註冊。
對於在這樣的關係中參考的 MBean,將不執行任何操作。
RelationServiceMBean 中的 removeRelationrelationId - 要移除的關係的關係 id
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有對應於給定關係 id 的關係
public void purgeRelations()
throws RelationServiceNotRegisteredException
根據 purgeFlag 值,此方法即可以在接收到關係中參考的 MBean 的註銷通知時自動調用(如果將該標誌設置為 true),也可以不調用(如果將該標誌設置為 false)。
在此情況下,使用者負責調用它來維護關係的一致性。一定要記住:如果註銷 MBean 但沒立即執行肅清,這時如果重新使用 ObjectName 並將其指派給關係中另一個參考的 MBean,那麼手動調用此 purgeRelations() 就會出現問題,因為這樣會認為此 ObjectName 就是已註銷的 MBean,不把它看作新的 MBean。
該行為取決於在其中參考註銷的 MBean 的角色數量:
- 如果移除角色中的一個 MBean 參考使其參考數少於最小程度,則必須移除該關係。
- 如果移除 MBean 參考後剩餘的參考數仍然在該容量範圍內,則保持該關係並在調用其 handleMBeanUnregistration() 回調時更新。
RelationServiceMBean 中的 purgeRelationsRelationServiceNotRegisteredException - 如果該 Relation Service 未在 MBean Server 中註冊。
public Map<String,List<String>> findReferencingRelations(ObjectName mbeanName,
String relationTypeName,
String roleName)
throws IllegalArgumentException
這對應於 CIM "Reference" 和 "ReferenceName" 操作。
RelationServiceMBean 中的 findReferencingRelationsmbeanName - MBean 的 ObjectNamerelationTypeName - 可以為 null;如果已指定,則將只在搜尋時考慮該型別的關係。其他情況下將考慮所有關係型別。roleName - 可以為 null;如果已指定,則只返回將在該角色中參考的 MBean 關係。其他情況要考慮所有角色。
IllegalArgumentException - 如果參數為 null
public Map<ObjectName,List<String>> findAssociatedMBeans(ObjectName mbeanName,
String relationTypeName,
String roleName)
throws IllegalArgumentException
這對應於 CIM Associator 和 AssociatorName 操作。
RelationServiceMBean 中的 findAssociatedMBeansmbeanName - MBean 的 ObjectNamerelationTypeName - 可以為 null;如果已指定,則將只在搜尋時考慮該型別的關係。其他情況下將考慮所有關係型別。roleName - 可以為 null;如果已指定,則只返回將在該角色中參考的 MBean 關係。其他情況要考慮所有角色。
IllegalArgumentException - 如果參數為 null
public List<String> findRelationsOfType(String relationTypeName)
throws IllegalArgumentException,
RelationTypeNotFoundException
RelationServiceMBean 中的 findRelationsOfTyperelationTypeName - 關係型別名稱
IllegalArgumentException - 如果參數為 null
RelationTypeNotFoundException - 如果不存在具有該名稱的關係型別。
public List<ObjectName> getRole(String relationId,
String roleName)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException
RelationServiceMBean 中的 getRolerelationId - 關係 idroleName - 角色名稱
RelationServiceNotRegisteredException - 如果 Relation Service 未註冊
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有帶給定 id 的關係
RoleNotFoundException - 如果:
- 不存在具有給定名稱的角色
或者
- 角色不可讀。
setRole(java.lang.String, javax.management.relation.Role)
public RoleResult getRoles(String relationId,
String[] roleNameArray)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationNotFoundException
RelationServiceMBean 中的 getRolesrelationId - 關係 idroleNameArray - 要檢索的角色名稱的陣列
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有帶給定 id 的關係setRoles(java.lang.String, javax.management.relation.RoleList)
public RoleResult getAllRoles(String relationId)
throws IllegalArgumentException,
RelationNotFoundException,
RelationServiceNotRegisteredException
RelationServiceMBean 中的 getAllRolesrelationId - 關係 id
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有指定 id 的關係
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
public Integer getRoleCardinality(String relationId,
String roleName)
throws IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException
RelationServiceMBean 中的 getRoleCardinalityrelationId - 關係 idroleName - 角色名稱
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有帶指定 id 的關係
RoleNotFoundException - 如果不存在具有指定名稱的角色
public void setRole(String relationId,
Role role)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationNotFoundException,
RoleNotFoundException,
InvalidRoleValueException
將按照其在關係的關係型別中提供的相應角色定義檢查角色
通過處理參考的 MBean 註銷,Relation Service 將追蹤更改來保持關係的一致性。
RelationServiceMBean 中的 setRolerelationId - 關係 idrole - 要設置的角色(名稱和新值)
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在具有給定 id 的關係
RoleNotFoundException - 如果角色不存在或不可寫
InvalidRoleValueException - 如果為角色提供的值無效:
- 給定值中參考的 MBean 數小於期望的最小程度
或者
- 提供的值中參考的 MBean 數超過期望的最大程度
或者
- 該值中參考的 MBean 的一個物件不是該角色期望的 MBean 類別的物件
或者
- 如果不存在為該角色提供的 MBean
getRole(java.lang.String, java.lang.String)
public RoleResult setRoles(String relationId,
RoleList roleList)
throws RelationServiceNotRegisteredException,
IllegalArgumentException,
RelationNotFoundException
將按照其在關係的關係型別中提供的相應角色定義來檢查角色
通過處理參考的 MBean 註銷,Relation Service 追蹤更改來保持關係的一致性。
RelationServiceMBean 中的 setRolesrelationId - 關係 idroleList - 要設置的角色列表
RelationServiceNotRegisteredException - 如果 Relation Service 未在 MBean Server 中註冊
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果沒有帶給定 id 的關係getRoles(java.lang.String, java.lang.String[])
public Map<ObjectName,List<String>> getReferencedMBeans(String relationId)
throws IllegalArgumentException,
RelationNotFoundException
RelationServiceMBean 中的 getReferencedMBeansrelationId - 關係 id
ObjectName -> ArrayList of String(角色名)
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在給定關係 id 的關係
public String getRelationTypeName(String relationId)
throws IllegalArgumentException,
RelationNotFoundException
RelationServiceMBean 中的 getRelationTypeNamerelationId - 關係 id
IllegalArgumentException - 如果參數為 null
RelationNotFoundException - 如果不存在給定關係 id 的關係
public void handleNotification(Notification notif,
Object handback)
NotificationListener 中的 handleNotificationnotif - 通知。handback - 一個不透明的物件,可說明偵聽器將有關 MBean 發出者的資訊(可以為 null)聯繫在一起。public MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster 中的 getNotificationInfoNotificationBroadcasterSupport 中的 getNotificationInfo
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。