Java Doc for RelationSupport.java in  » JMX » jfoxmx » javax » management » relation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » jfoxmx » javax.management.relation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.management.relation.RelationSupport

All known Subclasses:   example.jmx.relation.SimpleRelation,
RelationSupport
public class RelationSupport implements RelationSupportMBean,MBeanRegistration(Code)
A RelationSupport object is used internally by the Relation Service to represent simple relations (only roles, no properties or methods), with an unlimited number of roles, of any relation type. As internal representation, it is not exposed to the user.

RelationSupport class conforms to the design patterns of standard MBean. So the user can decide to instantiate a RelationSupport object himself as a MBean (as it follows the MBean design patterns), to register it in the MBean Server, and then to add it in the Relation Service.

The user can also, when creating his own MBean relation class, have it extending RelationSupport, to retrieve the implementations of required interfaces (see below).

It is also possible to have in a user relation MBean class a member being a RelationSupport object, and to implement the required interfaces by delegating all to this member.

RelationSupport implements the Relation interface (to be handled by the Relation Service).

It implements also the MBeanRegistration interface to be able to retrieve the MBean Server where it is registered (if registered as a MBean) to access to its Relation Service.



Field Summary
protected  Stringid
    
protected  StringrelationTypeName
    
protected  MaproleMap
    

Constructor Summary
public  RelationSupport(String relationId, ObjectName relationServiceObjectName, String relationTypeName, RoleList roleList)
     Creates object.

This constructor has to be used when the RelationSupport object will be registered as a MBean by the user, or when creating a user relation MBean those class extends RelationSupport.

Nothing is done at the Relation Service level, i.e.

public  RelationSupport(String relationId, ObjectName relationServiceObjectName, MBeanServer mbeanServer, String relationTypeName, RoleList roleList)
    

Method Summary
protected  Object_getRole(String roleName)
    
protected  Object_setRole(Role role)
    
public  RoleResultgetAllRoles()
    
public  MapgetReferencedMBeans()
     Retrieves MBeans referenced in the various roles of the relation.
public  StringgetRelationId()
    
public  ObjectNamegetRelationServiceName()
    
public  StringgetRelationTypeName()
     Returns name of associated relation type.
public  ListgetRole(String roleName)
     Retrieves role value for given role name.
public  IntegergetRoleCardinality(String roleName)
    
public  RoleResultgetRoles(String[] roleNames)
     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  BooleanisInRelationService()
     Returns an internal flag specifying if the object is still handled by the Relation Service.
public  voidpostDeregister()
    
public  voidpostRegister(Boolean registrationDone)
    
public  voidpreDeregister()
    
public  ObjectNamepreRegister(MBeanServer server, ObjectName name)
    
public  RoleListretrieveAllRoles()
    
public  voidsetRelationServiceManagementFlag(Boolean flag)
     Sets the flag to specify that it is handled or not by the Relation Service

BEWARE, this method has to be exposed for the user relation MBeans, as the Relation Service will access them through their management interface.

public  voidsetRole(Role role)
     Sets the given role.
public  RoleResultsetRoles(RoleList roleList)
     Sets the given roles.

Field Detail
id
protected String id(Code)



relationTypeName
protected String relationTypeName(Code)



roleMap
protected Map roleMap(Code)




Constructor Detail
RelationSupport
public RelationSupport(String relationId, ObjectName relationServiceObjectName, String relationTypeName, RoleList roleList) throws InvalidRoleValueException, IllegalArgumentException(Code)
Creates object.

This constructor has to be used when the RelationSupport object will be registered as a MBean by the user, or when creating a user relation MBean those class extends RelationSupport.

Nothing is done at the Relation Service level, i.e. the RelationSupport object is not added, and no check if the provided values are correct. The object is always created, EXCEPT if:

- one mandatory parameter is not provided

- the same name is used for two roles.

To be handled as a relation, the object has then to be added in the Relation Service using Relation Service method addRelation().
Parameters:
  relationId - relation identifier, to identify the relation in theRelation Service.

Expected to be unique in the given Relation Service.
Parameters:
  relationServiceObjectName - ObjectName of the Relation Service wherethe relation will be registered.

It is required as this is the Relation Service that is aware of thedefinition of the relation type of given relation, so that will be ableto check update operations (set).
Parameters:
  relationTypeName - Name of relation type.

Expected to have been created in given Relation Service.
Parameters:
  roleList - list of roles (Role objects) to initialised therelation. Can be null.

Expected to conform to relation info in associated relation type.
exception:
  InvalidRoleValueException - if the same name is used for tworoles.
exception:
  IllegalArgumentException - if a required value (RelationService Object Name, etc.) is not provided as parameter.




RelationSupport
public RelationSupport(String relationId, ObjectName relationServiceObjectName, MBeanServer mbeanServer, String relationTypeName, RoleList roleList) throws InvalidRoleValueException, IllegalArgumentException(Code)




Method Detail
_getRole
protected Object _getRole(String roleName) throws IllegalArgumentException, RelationServiceNotRegisteredException(Code)



_setRole
protected Object _setRole(Role role) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException(Code)



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



getReferencedMBeans
public Map getReferencedMBeans()(Code)
Retrieves MBeans referenced in the various roles of the relation. tell us how many role's refrences a MBean has 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)



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



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



getRole
public List 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




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[] roleNames) 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:
  roleNames - array of names of roles to be retrieved a RoleResult object, including a RoleList (for rolessucccessfully 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




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.




isInRelationService
public Boolean isInRelationService()(Code)
Returns an internal flag specifying if the object is still handled by the Relation Service.



postDeregister
public void postDeregister()(Code)



postRegister
public void postRegister(Boolean registrationDone)(Code)



preDeregister
public void preDeregister() throws Exception(Code)



preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)



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



setRelationServiceManagementFlag
public void setRelationServiceManagementFlag(Boolean flag) throws IllegalArgumentException(Code)
Sets the flag to specify that it is handled or not by the Relation Service

BEWARE, this method has to be exposed for the user relation MBeans, as the Relation Service will access them through their management interface. It is RECOMMENDED NOT to use this method. Using it does not affect the registration of the relation object in the Relation Service, but will provide wrong information about it!!!!
exception:
  IllegalArgumentException - if null parameter




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 the role is not writable (notest on the write access mode performed when initialising 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.




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 rolessucccessfully set) and a RoleUnresolvedList (for roles notset).
exception:
  IllegalArgumentException - if null role name
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.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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