Java Doc for RelationService.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.NotificationBroadcasterSupport
      javax.management.relation.RelationService

RelationService
public class RelationService extends NotificationBroadcasterSupport implements RelationServiceMBean,MBeanRegistration,NotificationListener(Code)
The Relation Service is in charge of creating and deleting relation types and relations, of handling the consistency and of providing query mechanisms.

It implements the NotificationBroadcaster by extending NotificationBroadcasterSupport to send notifications when a relation is removed from it.

It implements the NotificationListener interface to be able to receive notifications concerning unregistration of MBeans referenced in relation roles and of relation MBeans. It implements the MBeanRegistration interface to be able to retrieve its ObjectName and MBean Server.




Constructor Summary
public  RelationService(boolean theImmediatePurgeFlg)
     Constructor initiates relation service
Parameters:
  theImmediatePurgeFlg - - flag to indicate when a notification isreceived for the unregistration of a MBean referenced ina relation, if an immediate "purge" of the relations (lookfor the relations no longer valid) has to be performed ,or if that will be performed only when the purgeRelationsmethod will be explicitly called.

Method Summary
public  voidaddRelation(ObjectName theRelObjectName)
     Adds a MBean created by the user (and registered by him in the MBean Server) as a relation in the Relation Service.
public  voidaddRelationType(RelationType theRelTypeObj)
     Adds given object as a relation type.
public  IntegercheckRoleReading(String theRoleName, String theRelTypeName)
     Checks if given Role can be read in a relation of the given type.
public  IntegercheckRoleWriting(Role theRole, String theRelTypeName, Boolean theInitFlg)
     Checks if given Role can be set in a relation of given type.
Parameters:
  theRole - - role to be checked
Parameters:
  theRelTypeName - - name of relation type
Parameters:
  theInitFlg - - flag to specify that the checking is done for theinitialisation of a role, write access shall not be verified.
public  voidcreateRelation(String theRelId, String theRelTypeName, RoleList theRoleList)
     Creates a simple relation (represented by a RelationSupport object) of given relation type, and adds it in the Relation Service.

Roles are initialized according to the role list provided in parameter.

public  voidcreateRelationType(String theRelTypeName, RoleInfo[] theRoleInfoArray)
     Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service.
public  MapfindAssociatedMBeans(ObjectName theMBeanName, String theRelTypeName, String theRoleName)
     Retrieves the MBeans associated to given one in a relation.

This corresponds to CIM Associators and AssociatorNames operations.
Parameters:
  theMBeanName - - ObjectName of MBean
Parameters:
  theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search.

public  MapfindReferencingRelations(ObjectName theMBeanName, String theRelTypeName, String theRoleName)
     Retrieves the relations where a given MBean is referenced.

This corresponds to the CIM "References" and "ReferenceNames" operations.
Parameters:
  theMBeanName - - ObjectName of MBean
Parameters:
  theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search.

public  ListfindRelationsOfType(String theRelTypeName)
     Returns the relation ids for relations of the given type.
public  ListgetAllRelationIds()
    
public  ListgetAllRelationTypeNames()
    
public  RoleResultgetAllRoles(String theRelId)
    
public  MBeanNotificationInfo[]getNotificationInfo()
     Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.
public  booleangetPurgeFlag()
     Returns the flag to indicate if when a notification is received for the unregistration of a MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed , or if that will be performed only when the purgeRelations method will be explicitly called.
public  MapgetReferencedMBeans(String theRelId)
     Retrieves MBeans referenced in the various roles of the relation.
 ObjectgetRelation(String theRelId)
    
 RelationTypegetRelationType(String theRelTypeName)
    
public  StringgetRelationTypeName(String theRelId)
     Returns name of associated relation type for given relation.
public  ListgetRole(String theRelId, String theRoleName)
     Retrieves role value for given role name in given relation.
public  IntegergetRoleCardinality(String theRelId, String theRoleName)
    
public  RoleInfogetRoleInfo(String theRelTypeName, String theRoleInfoName)
    
public  ListgetRoleInfos(String theRelTypeName)
    
public  RoleResultgetRoles(String theRelId, String[] theRoleNameArray)
     Retrieves values of roles with given names in given relation.
public  voidhandleNotification(Notification theNtf, Object theHandback)
    
public  BooleanhasRelation(String theRelId)
     Checks if there is a relation identified in Relation Service with given relation id.
public  voidisActive()
     Checks if the Relation Service is active.
public  StringisRelation(ObjectName theObjName)
     Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service.
public  ObjectNameisRelationMBean(String theRelId)
     If the relation is represented by a MBean (created by the user and added as a relation in the Relation Service), returns the ObjectName of the MBean.
public  voidpostDeregister()
     Description copied from interface: MBeanRegistration

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

public  voidpostRegister(java.lang.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 mbeanServer.

public  voidpreDeregister()
     Description copied from interface: MBeanRegistration

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

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 mbeanServer.

public  voidpurgeRelations()
     Purges the relations.

Depending on the purgeFlag value, this method is either called automatically when a notification is received for the unregistration of a MBean referenced in a relation (if the flag is set to true), or not (if the flag is set to false).

In that case it is up to the user to call it to maintain the consistency of the relations.

public  voidremoveRelation(String theRelId)
     Removes given relation from the Relation Service.

A RelationNotification notification is sent, its type being:

- RelationNotification.RELATION_BASIC_REMOVAL if the relation was only internal to the Relation Service

- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is registered as a MBean.

public  voidremoveRelationType(String theRelTypeName)
     Removes given relation type from Relation Service.
public  voidsendRelationCreationNotification(String theRelId)
     Sends a notification (RelationNotification) for a relation creation. The notification type is:

- RelationNotification.RELATION_BASIC_CREATION if the relation is an object internal to the Relation Service

- RelationNotification.RELATION_MBEAN_CREATION if the relation is a MBean added as a relation.

public  voidsendRelationRemovalNotification(String theRelId, List theUnregMBeanList)
     Sends a notification (RelationNotification) for a relation removal. The notification type is:

- RelationNotification.RELATION_BASIC_REMOVAL if the relation is an object internal to the Relation Service

- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is a MBean added as a relation.

public  voidsendRoleUpdateNotification(String theRelId, Role theNewRole, List theOldRoleValue)
     Sends a notification (RelationNotification) for a role update in the given relation.
public  voidsetPurgeFlag(boolean thePurgeFlg)
     Sets the flag to indicate if when a notification is received for the unregistration of a MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed , or if that will be performed only when the purgeRelations method will be explicitly called.
public  voidsetRole(String theRelId, Role theRole)
     Sets the given role in given relation.
public  RoleResultsetRoles(String theRelId, RoleList theRoleList)
     Sets the given roles in given relation.
public  voidupdateRoleMap(String theRelId, Role theNewRole, List theOldRoleValue)
     Handles update of the Relation Service role map for the update of given role in given relation.


Constructor Detail
RelationService
public RelationService(boolean theImmediatePurgeFlg)(Code)
Constructor initiates relation service
Parameters:
  theImmediatePurgeFlg - - flag to indicate when a notification isreceived for the unregistration of a MBean referenced ina relation, if an immediate "purge" of the relations (lookfor the relations no longer valid) has to be performed ,or if that will be performed only when the purgeRelationsmethod will be explicitly called. true is immediate purge.




Method Detail
addRelation
public void addRelation(ObjectName theRelObjectName) throws IllegalArgumentException, RelationServiceNotRegisteredException, NoSuchMethodException, InvalidRelationIdException, InstanceNotFoundException, InvalidRelationServiceException, RelationTypeNotFoundException, RoleNotFoundException, InvalidRoleValueException(Code)
Adds a MBean created by the user (and registered by him in the MBean Server) as a relation in the Relation Service.

To be added as a relation, the MBean must conform to the following:

- implement the Relation interface

- have for RelationService ObjectName the ObjectName of current Relation Service

- have a relation id unique and unused in current Relation Service

- have for relation type a relation type created in the Relation Service

- have roles conforming to the role info provided in the relation type.
Parameters:
  theRelObjectName - - ObjectName of the relation MBean to be added.
throws:
  java.lang.IllegalArgumentException - - if null parameter
throws:
  RelationServiceNotRegisteredException - - if the Relation Serviceis not registered in the MBean Server
throws:
  java.lang.NoSuchMethodException - - If the MBean does notimplement the Relation interface
throws:
  InvalidRelationIdException - - if:

- no relation identifier in MBean

- the relation identifier is already used in the Relation Service
throws:
  InstanceNotFoundException - - if the MBean for given ObjectNamehas not been registered
throws:
  InvalidRelationServiceException - - if:

- no Relation Service name in MBean

- the Relation Service name in the MBean is not the oneof the current Relation Service
throws:
  RelationTypeNotFoundException - - if:

- no relation type name in MBean

- the relation type name in MBean does not correspond toa relation type created in the Relation Service
throws:
  InvalidRoleValueException - - if:

- the number of referenced MBeans in a role is less thanexpected minimum degree

- the number of referenced MBeans in a role exceedsexpected maximum degree

- one referenced MBean in the value is not an Object ofthe MBean class expected for that role

- a MBean provided for a role does not exist
throws:
  RoleNotFoundException - - if a value is provided for a role thatdoes not exist in the relation type




addRelationType
public void addRelationType(RelationType theRelTypeObj) throws IllegalArgumentException, InvalidRelationTypeException(Code)
Adds given object as a relation type. The object is expected to implement the RelationType interface.
Parameters:
  theRelTypeObj - - relation type object (implementing theRelationType interface)
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  InvalidRelationTypeException - - if there is already arelation type with that name.



checkRoleReading
public Integer checkRoleReading(String theRoleName, String theRelTypeName) throws IllegalArgumentException, RelationTypeNotFoundException(Code)
Checks if given Role can be read in a relation of the given type.
Parameters:
  theRoleName - - name of role to be checked
Parameters:
  theRelTypeName - - name of the relation type an Integer wrapping an integer corresponding to possibleproblems represented as constants in RoleUnresolved:

- 0 if role can be read

- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME

- integer corresponding to RoleStatus.ROLE_NOT_READABLE
exception:
  IllegalArgument - - if null parameter
exception:
  RelationTypeNotFoundException - - if the relation type isnot known in the Relation Service




checkRoleWriting
public Integer checkRoleWriting(Role theRole, String theRelTypeName, Boolean theInitFlg) throws IllegalArgumentException, RelationTypeNotFoundException(Code)
Checks if given Role can be set in a relation of given type.
Parameters:
  theRole - - role to be checked
Parameters:
  theRelTypeName - - name of relation type
Parameters:
  theInitFlg - - flag to specify that the checking is done for theinitialisation of a role, write access shall not be verified. an Integer wrapping an integer corresponding to possibleproblems represented as constants in RoleUnresolved:- 0 if role can be set- integer corresponding to RoleStatus.NO_ROLE_WITH_NAME- integer for RoleStatus.ROLE_NOT_WRITABLE- integer for RoleStatus.LESS_THAN_MIN_ROLE_DEGREE- integer for RoleStatus.MORE_THAN_MAX_ROLE_DEGREE- integer for RoleStatus.REF_MBEAN_OF_INCORRECT_CLASS- integer for RoleStatus.REF_MBEAN_NOT_REGISTERED
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationTypeNotFoundException - - if unknown relation type



createRelation
public void createRelation(String theRelId, String theRelTypeName, RoleList theRoleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RoleNotFoundException, InvalidRelationIdException, RelationTypeNotFoundException, InvalidRoleValueException(Code)
Creates a simple relation (represented by a RelationSupport object) of given relation type, and adds it in the Relation Service.

Roles are initialized according to the role list provided in parameter. The ones not initialised using that mean are set to an empty ArrayList of ObjectNames.

A RelationNotification, with type RELATION_BASIC_CREATION, is sent.
Parameters:
  theRelId - - relation identifier, to uniquely identify therelation inside the Relation Service
Parameters:
  theRelTypeName - - name of the relation type (has to be createdin the Relation Service)
Parameters:
  theRoleList - - role list to initialise roles of the relation(can be null).
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  java.lang.IllegalArgumentException - - if null paramater
exception:
  RoleNotFoundException - - if a value is provided for a rolethat does not exist in the relation type
exception:
  InvalidRelationIdException - - if relation id already used
exception:
  RelationTypeNotFoundException - - if relation type not knownin Relation Service
exception:
  InvalidRoleValueException - - if:- the same role name is used for two different roles- the number of referenced MBeans in given value is less thanexpected 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




createRelationType
public void createRelationType(String theRelTypeName, RoleInfo[] theRoleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException(Code)
Creates a relation type (RelationTypeSupport object) with given role infos (provided by the RoleInfo objects), and adds it in the Relation Service.
Parameters:
  theRelTypeName - - name of the relation type
Parameters:
  theRoleInfoArray - - array of role infos
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  InvalidRelationTypeException - - If:- there is already a relation type with that name- the same name has been used for two different role infos- no role info provided- one null role info provided



findAssociatedMBeans
public Map findAssociatedMBeans(ObjectName theMBeanName, String theRelTypeName, String theRoleName) throws IllegalArgumentException(Code)
Retrieves the MBeans associated to given one in a relation.

This corresponds to CIM Associators and AssociatorNames operations.
Parameters:
  theMBeanName - - ObjectName of MBean
Parameters:
  theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. Else allrelation types are considered.
Parameters:
  theRoleName - - can be null; if specified, only the relations wherethe MBean is referenced in that role will be considered.Else all roles are considered. an HashMap, where the keys are the ObjectNames of the MBeansassociated to given MBean, and the value is, for each key,an ArrayList of the relation ids of the relations wherethe key MBean is associated to given one (as they can beassociated in several different relations).
exception:
  java.lang.IllegalArgumentException - - if null parameter




findReferencingRelations
public Map findReferencingRelations(ObjectName theMBeanName, String theRelTypeName, String theRoleName) throws IllegalArgumentException(Code)
Retrieves the relations where a given MBean is referenced.

This corresponds to the CIM "References" and "ReferenceNames" operations.
Parameters:
  theMBeanName - - ObjectName of MBean
Parameters:
  theRelTypeName - - can be null; if specified, only the relations ofthat type will be considered in the search. Else allrelation types are considered.
Parameters:
  theRoleName - - can be null; if specified, only the relations wherethe MBean is referenced in that role will be returned.Else all roles are considered. an HashMap, where the keys are the relation ids of the relationswhere the MBean is referenced, and the value is, for eachkey, an ArrayList of role names (as a MBean can bereferenced in several roles in the same relation).
exception:
  java.lang.IllegalArgumentException - - if null parameter




findRelationsOfType
public List findRelationsOfType(String theRelTypeName) throws IllegalArgumentException, RelationTypeNotFoundException(Code)
Returns the relation ids for relations of the given type.
Parameters:
  theRelTypeName - - relation type name an ArrayList of relation ids.
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationTypeNotFoundException - - if there is no relationtype with that name.



getAllRelationIds
public List getAllRelationIds()(Code)
Returns all the relation ids for all the relations handled by the Relation Service ArrayList of String



getAllRelationTypeNames
public List getAllRelationTypeNames()(Code)
Retrieves names of all known relation types ArrayList of relation type names (Strings)



getAllRoles
public RoleResult getAllRoles(String theRelId) throws IllegalArgumentException, RelationNotFoundException, RelationServiceNotRegisteredException(Code)
Returns all roles present in the relation
Parameters:
  theRelId - - relation id a RoleResult object, including a RoleList (for rolessucccessfully retrieved) and a RoleUnresolvedList (forroles not readable).
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation for given id
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server



getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()(Code)
Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent.



getPurgeFlag
public boolean getPurgeFlag()(Code)
Returns the flag to indicate if when a notification is received for the unregistration of a MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed , or if that will be performed only when the purgeRelations method will be explicitly called. true is immediate purge. boolean indicating the purgeFlag. true - means immediate Purge.



getReferencedMBeans
public Map getReferencedMBeans(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code)
Retrieves MBeans referenced in the various roles of the relation.
Parameters:
  theRelId - - relation id a HashMap mapping:ObjectName -> ArrayList of String (role names)
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation for given relation id



getRelation
Object getRelation(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code)



getRelationType
RelationType getRelationType(String theRelTypeName) throws IllegalArgumentException, RelationTypeNotFoundException(Code)



getRelationTypeName
public String getRelationTypeName(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code)
Returns name of associated relation type for given relation.
Parameters:
  theRelId - - relation id The name of associated relation type for given relation
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation for given relation id



getRole
public List getRole(String theRelId, String theRoleName) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException, RoleNotFoundException(Code)
Retrieves role value for given role name in given relation.
Parameters:
  theRelId - - relation id
Parameters:
  theRoleName - - name of role the ArrayList of ObjectName objectsbeing the role value
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation with given id
exception:
  RoleNotFoundException - - if:- there is no role with given nameor- the role is not readable.



getRoleCardinality
public Integer getRoleCardinality(String theRelId, String theRoleName) throws IllegalArgumentException, RelationNotFoundException, RoleNotFoundException(Code)
Retrieves the number of MBeans currently referenced in the given role
Parameters:
  theRelId - - relation id
Parameters:
  theRoleName - - name of role the number of currently referenced MBeans in that role
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation with given id
exception:
  RoleNotFoundException - - if there is no role with given name



getRoleInfo
public RoleInfo getRoleInfo(String theRelTypeName, String theRoleInfoName) throws IllegalArgumentException, RelationTypeNotFoundException, RoleInfoNotFoundException(Code)
Retrieves role info for given role of a given relation type
Parameters:
  theRelTypeName - - name of relation type
Parameters:
  theRoleInfoName - - name of role RoleInfo object.
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationTypeNotFoundException - - if the relation type is notknown in the Relation Service
exception:
  RoleInfoNotFoundException - - if the role is not part ofthe relation type.



getRoleInfos
public List getRoleInfos(String theRelTypeName) throws IllegalArgumentException, RelationTypeNotFoundException(Code)
Retrieves list of role infos (RoleInfo objects) of a given relation type
Parameters:
  theRelTypeName - - name of relation type ArrayList of RoleInfo.
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationTypeNotFoundException - - if there is no relationtype with that name.



getRoles
public RoleResult getRoles(String theRelId, String[] theRoleNameArray) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException(Code)
Retrieves values of roles with given names in given relation.
Parameters:
  theRelId - - relation id
Parameters:
  theRoleNameArray - - array of names of roles to be retrieved a RoleResult object, including a RoleList (for rolessucccessfully retrieved) and a RoleUnresolvedList (forroles not retrieved).
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation with given id



handleNotification
public void handleNotification(Notification theNtf, Object theHandback)(Code)
Method inherited from the NotificationListener Interface



hasRelation
public Boolean hasRelation(String theRelId) throws IllegalArgumentException(Code)
Checks if there is a relation identified in Relation Service with given relation id.
Parameters:
  theRelId - - relation id identifying the relation boolean: true if there is a relation, false else
exception:
  java.lang.IllegalArgumentException - - if null parameter



isActive
public void isActive() throws RelationServiceNotRegisteredException(Code)
Checks if the Relation Service is active. Current condition is that the Relation Service must be registered in the MBean Server
exception:
  RelationServiceNotRegisteredException - - if it is not registered



isRelation
public String isRelation(ObjectName theObjName) throws IllegalArgumentException(Code)
Returns the relation id associated to the given ObjectName if the MBean has been added as a relation in the Relation Service.
Parameters:
  theObjName - - ObjectName of supposed relation relation id (String) or null (if the ObjectName is not arelation handled by the Relation Service)
exception:
  java.lang.IllegalArgumentException - - if null parameter



isRelationMBean
public ObjectName isRelationMBean(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code)
If the relation is represented by a MBean (created by the user and added as a relation in the Relation Service), returns the ObjectName of the MBean.
Parameters:
  theRelId - - relation id identifying the relation ObjectName of the corresponding relation MBean, or null ifthe relation is not a MBean.
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - there is no relation associated to that id



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 mbeanServer.

Specified by: postDeregister in interface MBeanRegistration




postRegister
public void postRegister(java.lang.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 mbeanServer. Thevalue false 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 mbeanServer.

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 java.lang.Exception(Code)
Description copied from interface: MBeanRegistration

Allows the MBean to perform any operations it needs before being registered in the MBean mbeanServer. 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 mbeanServer.

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.




purgeRelations
public void purgeRelations() throws RelationServiceNotRegisteredException(Code)
Purges the relations.

Depending on the purgeFlag value, this method is either called automatically when a notification is received for the unregistration of a MBean referenced in a relation (if the flag is set to true), or not (if the flag is set to false).

In that case it is up to the user to call it to maintain the consistency of the relations. To be kept in mind that if a MBean is unregistered and the purge not done immediately, if the ObjectName is reused and assigned to another MBean referenced in a relation, calling manually this purgeRelations() method will cause trouble, as will consider the ObjectName as corresponding to the unregistered MBean, not seeing the new one.

The behavior depends on the cardinality of the role where the unregistered MBean is referenced:

- if removing one MBean reference in the role makes its number of references less than the minimum degree, the relation has to be removed.

- if the remaining number of references after removing the MBean reference is still in the cardinality range, keep the relation and update it calling its handleMBeanUnregistration() callback.
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean mbeanServer.




removeRelation
public void removeRelation(String theRelId) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException(Code)
Removes given relation from the Relation Service.

A RelationNotification notification is sent, its type being:

- RelationNotification.RELATION_BASIC_REMOVAL if the relation was only internal to the Relation Service

- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is registered as a MBean. For MBeans referenced in such relation, nothing will be done,
Parameters:
  theRelId - - relation id of the relation to be removed
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation correspondingto given relation id




removeRelationType
public void removeRelationType(String theRelTypeName) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationTypeNotFoundException(Code)
Removes given relation type from Relation Service.

The relation objects of that type will be removed from the Relation Service.
Parameters:
  theRelTypeName - - name of the relation type to be removed
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationTypeNotFoundException - - If there is no relationtype with that name




sendRelationCreationNotification
public void sendRelationCreationNotification(String theRelId) throws IllegalArgumentException, RelationNotFoundException(Code)
Sends a notification (RelationNotification) for a relation creation. The notification type is:

- RelationNotification.RELATION_BASIC_CREATION if the relation is an object internal to the Relation Service

- RelationNotification.RELATION_MBEAN_CREATION if the relation is a MBean added as a relation. The source object is the Relation Service itself. It is called in Relation Service createRelation() and addRelation() methods.
Parameters:
  theRelId - - relation identifier of the updated relation
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if there is no relationfor given relation id




sendRelationRemovalNotification
public void sendRelationRemovalNotification(String theRelId, List theUnregMBeanList) throws IllegalArgumentException, RelationNotFoundException(Code)
Sends a notification (RelationNotification) for a relation removal. The notification type is:

- RelationNotification.RELATION_BASIC_REMOVAL if the relation is an object internal to the Relation Service

- RelationNotification.RELATION_MBEAN_REMOVAL if the relation is a MBean added as a relation. The source object is the Relation Service itself. It is called in Relation Service removeRelation() method.
Parameters:
  theRelId - - relation identifier of the updated relation
Parameters:
  theUnregMBeanList - - ArrayList of ObjectNames of MBeans expectedto be unregistered due to relation removal (can be null)
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if there is no relationfor given relation id




sendRoleUpdateNotification
public void sendRoleUpdateNotification(String theRelId, Role theNewRole, List theOldRoleValue) throws IllegalArgumentException, RelationNotFoundException(Code)
Sends a notification (RelationNotification) for a role update in the given relation. The notification type is:

- RelationNotification.RELATION_BASIC_UPDATE if the relation is an object internal to the Relation Service

- RelationNotification.RELATION_MBEAN_UPDATE if the relation is a MBean added as a relation. The source object is the Relation Service itself. It is called in relation MBean setRole() (for given role) and setRoles() (for each role) methods (implementation provided in RelationSupport class). It is also called in Relation Service setRole() (for given role) and setRoles() (for each role) methods.
Parameters:
  theRelId - - relation identifier of the updated relation
Parameters:
  theNewRole - - new role (name and new value)
Parameters:
  theOldRoleValue - - old role value (ArrayList of ObjectName objects)
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if there is no relationfor given relation id




setPurgeFlag
public void setPurgeFlag(boolean thePurgeFlg)(Code)
Sets the flag to indicate if when a notification is received for the unregistration of a MBean referenced in a relation, if an immediate "purge" of the relations (look for the relations no longer valid) has to be performed , or if that will be performed only when the purgeRelations method will be explicitly called. true is immediate purge.
Parameters:
  thePurgeFlg - - flag



setRole
public void setRole(String theRelId, Role theRole) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException, RoleNotFoundException, InvalidRoleValueException(Code)
Sets the given role in given relation.

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

The Relation Service will keep track of the change to keep the consistency of relations by handling referenced MBean unregistrations.
Parameters:
  theRelId - - relation id
Parameters:
  theRole - - role to be set (name and new value)
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server.
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation with given id
exception:
  RoleNotFoundException - - if:- internal relationand- the role does not exist or is not writable
exception:
  InvalidRoleValueException - - if internal relation and valueprovided for role is not valid:- the number of referenced MBeans in given value is lessthan expected minimum degreeor- the number of referenced MBeans in provided value exceedsexpected maximum degreeor- one referenced MBean in the value is not an Object of theMBean class expected for that roleor- a MBean provided for that role does not exist
exception:
  RelationTypeNotFoundException - - if unknown relation type




setRoles
public RoleResult setRoles(String theRelId, RoleList theRoleList) throws RelationServiceNotRegisteredException, IllegalArgumentException, RelationNotFoundException(Code)
Sets the given roles in given relation.

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

The Relation Service keeps track of the changes to keep the consistency of relations by handling referenced MBean unregistrations.
Parameters:
  theRelId - - relation id
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:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationNotFoundException - - if no relation with given id




updateRoleMap
public void updateRoleMap(String theRelId, Role theNewRole, List theOldRoleValue) throws IllegalArgumentException, RelationServiceNotRegisteredException, RelationNotFoundException(Code)
Handles update of the Relation Service role map for the update of given role in given relation. It is called in relation MBean setRole() (for given role) and setRoles() (for each role) methods (implementation provided in RelationSupport class).

It is also called in Relation Service setRole() (for given role) and setRoles() (for each role) methods.

To allow the Relation Service to maintain the consistency (in case of MBean unregistration) and to be able to perform queries, this method must be called when a role is updated.
Parameters:
  theRelId - - relation identifier of the updated relation
Parameters:
  theNewRole - - new role (name and new value)
Parameters:
  theOldRoleValue - - old role value (ArrayList of ObjectName objects)
exception:
  java.lang.IllegalArgumentException - - if null parameter
exception:
  RelationServiceNotRegisteredException - - if the RelationService is not registered in the MBean Server
exception:
  RelationNotFoundException - - if no relation for given id.




Methods inherited from javax.management.NotificationBroadcasterSupport
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)(Code)(Java Doc)
public MBeanNotificationInfo[] getNotificationInfo()(Code)(Java Doc)
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException(Code)(Java Doc)
public void sendNotification(Notification notif)(Code)(Java Doc)

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.