Java Doc for RelationSupport.java in  » JMX » XMOJO » 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 » XMOJO » javax.management.relation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

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
 BooleanisInRelation
    
 MBeanServermbeanServer
    
 ObjectNameobjectName
    
 StringrelId
    
 ObjectNamerelServiceName
    
 StringrelTypeName
    
 RoleListroleList
    

Constructor Summary
public  RelationSupport(String theRelId, ObjectName theRelServiceName, MBeanServer theRelServiceMBeanServer, String theRelTypeName, RoleList theRoleList)
     Creates object.

This constructor has to be used when the user relation MBean implements the interfaces expected to be supported by a relation by delegating to a RelationSupport object.

public  RelationSupport(String theRelId, ObjectName theRelServiceName, String theRelTypeName, RoleList theRoleList)
     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.


Method Summary
public  RoleResultgetAllRoles()
    
 RoleResultgetAllRolesFriend(RelationService service)
     This method is a friend method to getAllRoles.
public  MapgetReferencedMBeans()
     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()
    
public  StringgetRelationTypeName()
     Returns name of associated relation type.
public  ListgetRole(String theRoleName)
     Retrieves role value for given role name.
public  IntegergetRoleCardinality(String theRoleName)
    
 ObjectgetRoleFriend(String theRoleName, boolean theMultiRoleFlg, RelationService service)
     This method gets the Role/RoleUnresolved object provided a RoleName.
public  RoleResultgetRoles(String[] theRoleNameArray)
     Retrieves values of roles with given names.
 RoleResultgetRolesFriend(String[] theRoleNameArray, RelationService service)
     This method returns an RoleResult provided a string[] of roleNames.
public  voidhandleMBeanUnregistration(ObjectName theObjName, String theRoleName)
     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.

 voidhandleMBeanUnregistrationFriend(ObjectName theObjName, String theRoleName, RelationService service)
    
public  BooleanisInRelationService()
     Returns an internal flag specifying if the object is still handled by the Relation Service.
public  voidpostDeregister()
     Description copied from interface: MBeanRegistration.
public  voidpostRegister(Boolean registrationDone)
     Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

Specified by: postRegister in interface MBeanRegistration Tags copied from interface: MBeanRegistration
Parameters:
  registrationDone - - Indicates whether or not the MBean has beensuccessfully registered in the MBean server.

public  voidpreDeregister()
     Description copied from interface: MBeanRegistration.
public  ObjectNamepreRegister(MBeanServer server, ObjectName name)
     Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations it needs before being registered in the MBean server.

public  RoleListretrieveAllRoles()
    
public  voidsetRelationServiceManagementFlag(Boolean theFlg)
     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.
public  voidsetRole(Role theRole)
     Sets the given role.
 ObjectsetRoleFriend(Role theRole, boolean theMultiRoleFlg, RelationService service)
     This method sets the value of a Role.
public  RoleResultsetRoles(RoleList theRoleList)
     Sets the given roles.
 RoleResultsetRolesFriend(RoleList theRoleList, boolean theRelServCallFlg, RelationService theRelServ)
     This method is a localfriend to setRoles.

Field Detail
isInRelation
Boolean isInRelation(Code)



mbeanServer
MBeanServer mbeanServer(Code)



objectName
ObjectName objectName(Code)



relId
String relId(Code)



relServiceName
ObjectName relServiceName(Code)



relTypeName
String relTypeName(Code)



roleList
RoleList roleList(Code)




Constructor Detail
RelationSupport
public RelationSupport(String theRelId, ObjectName theRelServiceName, MBeanServer theRelServiceMBeanServer, String theRelTypeName, RoleList theRoleList) throws InvalidRoleValueException, IllegalArgumentException(Code)
Creates object.

This constructor has to be used when the user relation MBean implements the interfaces expected to be supported by a relation by delegating to a RelationSupport object. This object needs to know the Relation Service expected to handle the relation. So it has to know the MBean Server where the Relation Service is registered.

According to a limitation, a relation MBean must be registered in the same MBean Server as the Relation Service expected to handle it. So the user relation MBean has to be created and registered, and then the wrapped RelationSupport object can be created with identified MBean Server.

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 required 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 the Relation Service method addRelation().


Parameters:
  theRelId - - relation identifier, to identify the relation inthe Relation Service. Expected to be unique in the givenRelation Service.
Parameters:
  theRelServiceName - - ObjectName of the Relation Service wherethe relation will be registered. It is required as this isthe Relation Service that is aware of the definition ofthe relation type of given relation, so that will be ableto check update operations (set).
Parameters:
  theRelServiceMBeanServer - - MBean Server where the wrapping MBeanis or will be registered. Expected to be the MBean Serverwhere the Relation Service is or will be registered.
Parameters:
  theRelTypeName - - Name of relation type.Expected to have been created in given Relation Service.
Parameters:
  theRoleList - - list of roles (Role objects) to initialised therelation. Can be null. Expected to conform to relation infoin associated relation type.
exception:
  InvalidRoleValueException - - if the same name is used for two roles.
exception:
  java.lang.IllegalArgumentException - - if a required value(Relation Service Object Name, etc.) is not provided as parameter.




RelationSupport
public RelationSupport(String theRelId, ObjectName theRelServiceName, String theRelTypeName, RoleList theRoleList) 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:
  theRelId - - relation identifier, to identify the relation in theRelation Service. Expected to be unique in the givenRelation Service.
Parameters:
  theRelServiceName - - ObjectName of the Relation Service where therelation will be registered. It is required as this is theRelation Service that is aware of the definition of therelation type of given relation, so that will be able tocheck update operations (set).
Parameters:
  theRelTypeName - - Name of relation type.Expected to have been created in given Relation Service.
Parameters:
  theRoleList - - list of roles (Role objects) to initialised therelation. Can be null. Expected to conform to relation infoin associated relation type.
exception:
  InvalidRoleValueException - - if the same name is used for two roles.
exception:
  java.lang.IllegalArgumentException - - if a required value(Relation Service Object Name, etc.) is not provided as parameter.





Method Detail
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 not readable).
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server



getAllRolesFriend
RoleResult getAllRolesFriend(RelationService service) throws RelationServiceNotRegisteredException(Code)
This method is a friend method to getAllRoles.



getReferencedMBeans
public Map 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). Relation identifier



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



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



getRole
public List getRole(String theRoleName) 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:
  theRoleName - - name of role the ArrayList of ObjectName objects being the role value
exception:
  java.lang.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 theRoleName) throws IllegalArgumentException, RoleNotFoundException(Code)
Returns the number of MBeans currently referenced in the given role
Parameters:
  theRoleName - - name of role the number of currently referenced MBeans in that role
exception:
  java.lang.IllegalArgumentException - - if null role name
exception:
  RoleNotFoundException - - if there is no role with given name



getRoleFriend
Object getRoleFriend(String theRoleName, boolean theMultiRoleFlg, RelationService service) throws IllegalArgumentException, RoleNotFoundException, RelationServiceNotRegisteredException(Code)
This method gets the Role/RoleUnresolved object provided a RoleName.



getRoles
public RoleResult getRoles(String[] theRoleNameArray) 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:
  theRoleNameArray - - array of names of roles to be retrieved a RoleResult object, including a RoleList (for rolessucccessfully retrieved) and a RoleUnresolvedList(for roles not retrieved).
exception:
  java.lang.IllegalArgumentException - - if null role name
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server




getRolesFriend
RoleResult getRolesFriend(String[] theRoleNameArray, RelationService service) throws RelationServiceNotRegisteredException(Code)
This method returns an RoleResult provided a string[] of roleNames.



handleMBeanUnregistration
public void handleMBeanUnregistration(ObjectName theObjName, String theRoleName) 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:
  theObjName - - ObjectName of unregistered MBean
Parameters:
  theRoleName - - name of role where the MBean is referenced
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RoleNotFoundException - - if role does not exist inthe relation or is not writable
exception:
  InvalidRoleValueException - - if role value does not conform tothe associated role info (this will never happen whencalled from the Relation 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.




handleMBeanUnregistrationFriend
void handleMBeanUnregistrationFriend(ObjectName theObjName, String theRoleName, RelationService service) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RelationNotFoundException(Code)



isInRelationService
public Boolean isInRelationService()(Code)
Returns an internal flag specifying if the object is still handled by the Relation Service. Internal flag specifying if the object is still handled bythe Relation Service.Specified by:isInRelationService in interface RelationSupportMBean



postDeregister
public void postDeregister()(Code)
Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations needed after having been de-registered in the MBean server.

Specified by: postDeregister in interface MBeanRegistration




postRegister
public void postRegister(Boolean registrationDone)(Code)
Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed.

Specified by: postRegister in interface MBeanRegistration Tags copied from interface: MBeanRegistration
Parameters:
  registrationDone - - Indicates whether or not the MBean has beensuccessfully registered in the MBean server. The valuefalse means that the registration phase has failed




preDeregister
public void preDeregister() throws Exception(Code)
Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations it needs before being de-registered by the MBean server.

Specified by: preDeregister in interface MBeanRegistration Tags copied from interface: MBeanRegistration
exception:
  java.langException - - This exception should be caught by theMBean server and re-thrown as an MBeanRegistrationException.




preRegister
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)
Description copied from interface: MBeanRegistration.

Allows the MBean to perform any operations it needs before being registered in the MBean server. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBean server.

Specified by: preRegister in interface MBeanRegistration Tags copied from interface: MBeanRegistration
Parameters:
  server - - The MBean server in which the MBean will be registered.
Parameters:
  name - - The object name of the MBean. The name of the MBean registered.
exception:
  java.lang.Exception - - This exception should be caught by theMBean server and re-thrown as an MBeanRegistrationException.




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



setRelationServiceManagementFlag
public void setRelationServiceManagementFlag(Boolean theFlg) 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!!!!

Specified by: setRelationServiceManagementFlag in interface RelationSupportMBean
Parameters:
  theFlg - If true the flag is handled by the relation service false otherwise
exception:
  java.lang.IllegalArgumentException - - if null parameter




setRole
public void setRole(Role theRole) throws IllegalArgumentException, InvalidRoleValueException, RelationNotFoundException, RelationServiceNotRegisteredException, RelationTypeNotFoundException, RoleNotFoundException(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:
  theRole - - role to be set (name and new value)
exception:
  java.lang.IllegalArgumentException - - if null role
exception:
  RoleNotFoundException - - if the role is not writable (no teston the write access mode performed when initialising the role)
exception:
  InvalidRoleValueException - - if value provided for role is not valid, i.e.:- the number of referenced MBeans in given value is lessthan expected minimum degree- the number of referenced MBeans in provided value exceedsexpected maximum degree- one referenced MBean in the value is not an Object of theMBean class expected for that role- a MBean provided for that role does not exist
exception:
  RelationServiceNotRegisteredException - - if the Relation Serviceis 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 been addedin the Relation Service.




setRoleFriend
Object setRoleFriend(Role theRole, boolean theMultiRoleFlg, RelationService service) throws IllegalArgumentException, RoleNotFoundException, InvalidRoleValueException, RelationTypeNotFoundException, RelationNotFoundException, RelationServiceNotRegisteredException(Code)
This method sets the value of a Role.



setRoles
public RoleResult setRoles(RoleList theRoleList) 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:
  theRoleList - - list of roles to be set a RoleResult object, including a RoleList (for rolessucccessfully set) and a RoleUnresolvedList (for roles not set).
exception:
  java.lang.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 notbeen added in the Relation Service.




setRolesFriend
RoleResult setRolesFriend(RoleList theRoleList, boolean theRelServCallFlg, RelationService theRelServ) throws IllegalArgumentException, RelationTypeNotFoundException, RelationNotFoundException(Code)
This method is a localfriend to setRoles.



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.