Java Doc for Relation.java in  » 6.0-JDK-Core » management » javax » management » relation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » management » javax.management.relation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.management.relation.Relation

Relation
public interface Relation (Code)
This interface has to be implemented by any MBean class expected to represent a relation managed using the Relation Service.

Simple relations, i.e. having only roles, no properties or methods, can be created directly by the Relation Service (represented as RelationSupport objects, internally handled by the Relation Service).

If the user wants to represent more complex relations, involving properties and/or methods, he has to provide his own class implementing the Relation interface. This can be achieved either by inheriting from RelationSupport class, or by implementing the interface (fully or delegation to a RelationSupport object member).

Specifying such user relation class is to introduce properties and/or methods. Those have to be exposed for remote management. So this means that any user relation class must be a MBean class.
since:
   1.5





Method Summary
public  RoleResultgetAllRoles()
     Returns all roles present in the relation.
public  Map<ObjectName, List<String>>getReferencedMBeans()
     Retrieves MBeans referenced in the various roles of the relation.
public  StringgetRelationId()
     Returns relation identifier (used to uniquely identify the relation inside the Relation Service).
public  ObjectNamegetRelationServiceName()
     Returns ObjectName of the Relation Service handling the relation.
public  StringgetRelationTypeName()
     Returns name of associated relation type.
public  List<ObjectName>getRole(String roleName)
     Retrieves role value for given role name.
public  IntegergetRoleCardinality(String roleName)
     Returns the number of MBeans currently referenced in the given role.
public  RoleResultgetRoles(String[] roleNameArray)
     Retrieves values of roles with given names.
public  voidhandleMBeanUnregistration(ObjectName objectName, String roleName)
     Callback used by the Relation Service when a MBean referenced in a role is unregistered.

The Relation Service will call this method to let the relation take action to reflect the impact of such unregistration.

BEWARE.

public  RoleListretrieveAllRoles()
     Returns all roles in the relation without checking read mode.
public  voidsetRole(Role role)
     Sets the given role.
public  RoleResultsetRoles(RoleList roleList)
     Sets the given roles.



Method Detail
getAllRoles
public RoleResult getAllRoles() throws RelationServiceNotRegisteredException(Code)
Returns all roles present in the relation. a RoleResult object, including a RoleList (for rolessuccessfully retrieved) and a RoleUnresolvedList (for roles notreadable).
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server



getReferencedMBeans
public Map<ObjectName, List<String>> getReferencedMBeans()(Code)
Retrieves MBeans referenced in the various roles of the relation. a HashMap mapping:

ObjectName -> ArrayList of String (role names)




getRelationId
public String getRelationId()(Code)
Returns relation identifier (used to uniquely identify the relation inside the Relation Service). the relation id.



getRelationServiceName
public ObjectName getRelationServiceName()(Code)
Returns ObjectName of the Relation Service handling the relation. the ObjectName of the Relation Service.



getRelationTypeName
public String getRelationTypeName()(Code)
Returns name of associated relation type. the name of the relation type.



getRole
public List<ObjectName> getRole(String roleName) throws IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException(Code)
Retrieves role value for given role name.

Checks if the role exists and is readable according to the relation type.
Parameters:
  roleName - name of role the ArrayList of ObjectName objects being the role value
exception:
  IllegalArgumentException - if null role name
exception:
  RoleNotFoundException - if:

- there is no role with given name

- the role is not readable.
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server
See Also:   Relation.setRole




getRoleCardinality
public Integer getRoleCardinality(String roleName) throws IllegalArgumentException, RoleNotFoundException(Code)
Returns the number of MBeans currently referenced in the given role.
Parameters:
  roleName - name of role the number of currently referenced MBeans in that role
exception:
  IllegalArgumentException - if null role name
exception:
  RoleNotFoundException - if there is no role with given name



getRoles
public RoleResult getRoles(String[] roleNameArray) throws IllegalArgumentException, RelationServiceNotRegisteredException(Code)
Retrieves values of roles with given names.

Checks for each role if it exists and is readable according to the relation type.
Parameters:
  roleNameArray - array of names of roles to be retrieved a RoleResult object, including a RoleList (for rolessuccessfully retrieved) and a RoleUnresolvedList (for roles notretrieved).
exception:
  IllegalArgumentException - if null role name
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server
See Also:   Relation.setRoles




handleMBeanUnregistration
public void handleMBeanUnregistration(ObjectName objectName, String roleName) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException(Code)
Callback used by the Relation Service when a MBean referenced in a role is unregistered.

The Relation Service will call this method to let the relation take action to reflect the impact of such unregistration.

BEWARE. the user is not expected to call this method.

Current implementation is to set the role with its current value (list of ObjectNames of referenced MBeans) without the unregistered one.
Parameters:
  objectName - ObjectName of unregistered MBean
Parameters:
  roleName - name of role where the MBean is referenced
exception:
  IllegalArgumentException - if null parameter
exception:
  RoleNotFoundException - if role does not exist in therelation or is not writable
exception:
  InvalidRoleValueException - if role value does not conform tothe associated role info (this will never happen when called from theRelation Service)
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server
exception:
  RelationTypeNotFoundException - if the relation type has notbeen declared in the Relation Service.
exception:
  RelationNotFoundException - if this method is called for arelation MBean not added in the Relation Service.




retrieveAllRoles
public RoleList retrieveAllRoles()(Code)
Returns all roles in the relation without checking read mode. a RoleList.



setRole
public void setRole(Role role) throws IllegalArgumentException, RoleNotFoundException, RelationTypeNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationNotFoundException(Code)
Sets the given role.

Will check the role according to its corresponding role definition provided in relation's relation type

Will send a notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not).
Parameters:
  role - role to be set (name and new value)
exception:
  IllegalArgumentException - if null role
exception:
  RoleNotFoundException - if there is no role with the suppliedrole's name or if the role is not writable (no test on the write accessmode performed when initializing the role)
exception:
  InvalidRoleValueException - if value provided forrole is not valid, i.e.:

- the number of referenced MBeans in given value is less thanexpected minimum degree

- the number of referenced MBeans in provided value exceeds expectedmaximum degree

- one referenced MBean in the value is not an Object of the MBeanclass expected for that role

- a MBean provided for that role does not exist.
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server
exception:
  RelationTypeNotFoundException - if the relation type has notbeen declared in the Relation Service.
exception:
  RelationNotFoundException - if the relation has not beenadded in the Relation Service.
See Also:   Relation.getRole




setRoles
public RoleResult setRoles(RoleList roleList) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException(Code)
Sets the given roles.

Will check the role according to its corresponding role definition provided in relation's relation type

Will send one notification (RelationNotification with type RELATION_BASIC_UPDATE or RELATION_MBEAN_UPDATE, depending if the relation is a MBean or not) per updated role.
Parameters:
  roleList - list of roles to be set a RoleResult object, including a RoleList (for rolessuccessfully set) and a RoleUnresolvedList (for roles notset).
exception:
  IllegalArgumentException - if null role list
exception:
  RelationServiceNotRegisteredException - if the RelationService is not registered in the MBean Server
exception:
  RelationTypeNotFoundException - if the relation type has notbeen declared in the Relation Service.
exception:
  RelationNotFoundException - if the relation MBean has not beenadded in the Relation Service.
See Also:   Relation.getRoles




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.