API java : Relation


javax.management.relation
Interface Relation

All Known Subinterfaces:
RelationSupportMBean
All Known Implementing Classes:
RelationSupport

public interface Relation

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
 RoleResult getAllRoles()
          Returns all roles present in the relation.
 Map getReferencedMBeans()
          Retrieves MBeans referenced in the various roles of the relation.
 String getRelationId()
          Returns relation identifier (used to uniquely identify the relation inside the Relation Service).
 ObjectName getRelationServiceName()
          Returns ObjectName of the Relation Service handling the relation.
 String getRelationTypeName()
          Returns name of associated relation type.
 List getRole(String theRoleName)
          Retrieves role value for given role name.
 Integer getRoleCardinality(String theRoleName)
          Returns the number of MBeans currently referenced in the given role.
 RoleResult getRoles(String[] theRoleNameArray)
          Retrieves values of roles with given names.
 void handleMBeanUnregistration(ObjectName theObjName, String theRoleName)
          Callback used by the Relation Service when a MBean referenced in a role is unregistered.
 RoleList retrieveAllRoles()
          Returns all roles in the relation without checking read mode.
 void setRole(Role theRole)
          Sets the given role.
 RoleResult setRoles(RoleList theRoleList)
          Sets the given roles.
 

Method Detail

getRole

List getRole(String theRoleName)
             throws IllegalArgumentException,
                    RoleNotFoundException,
                    RelationServiceNotRegisteredException
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
Returns:
the ArrayList of ObjectName objects being the role value
Throws:
IllegalArgumentException - if null role name
RoleNotFoundException - if:

- there is no role with given name

- the role is not readable.

RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
See Also:
setRole(javax.management.relation.Role)

getRoles

RoleResult getRoles(String[] theRoleNameArray)
                    throws IllegalArgumentException,
                           RelationServiceNotRegisteredException
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
Returns:
a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not retrieved).
Throws:
IllegalArgumentException - if null role name
RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
See Also:
setRoles(javax.management.relation.RoleList)

getRoleCardinality

Integer getRoleCardinality(String theRoleName)
                           throws IllegalArgumentException,
                                  RoleNotFoundException
Returns the number of MBeans currently referenced in the given role.

Parameters:
theRoleName - name of role
Returns:
the number of currently referenced MBeans in that role
Throws:
IllegalArgumentException - if null role name
RoleNotFoundException - if there is no role with given name

getAllRoles

RoleResult getAllRoles()
                       throws RelationServiceNotRegisteredException
Returns all roles present in the relation.

Returns:
a RoleResult object, including a RoleList (for roles successfully retrieved) and a RoleUnresolvedList (for roles not readable).
Throws:
RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server

retrieveAllRoles

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

Returns:
a RoleList.

setRole

void setRole(Role theRole)
             throws IllegalArgumentException,
                    RoleNotFoundException,
                    RelationTypeNotFoundException,
                    InvalidRoleValueException,
                    RelationServiceNotRegisteredException,
                    RelationNotFoundException
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)
Throws:
IllegalArgumentException - if null role
RoleNotFoundException - if the role is not writable (no test on the write access mode performed when initialising the role)
InvalidRoleValueException - if value provided for role is not valid, i.e.:

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

- the number of referenced MBeans in provided value exceeds expected maximum degree

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

- a MBean provided for that role does not exist.

RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service.
RelationNotFoundException - if the relation has not been added in the Relation Service.
See Also:
getRole(java.lang.String)

setRoles

RoleResult setRoles(RoleList theRoleList)
                    throws IllegalArgumentException,
                           RelationServiceNotRegisteredException,
                           RelationTypeNotFoundException,
                           RelationNotFoundException
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
Returns:
a RoleResult object, including a RoleList (for roles successfully set) and a RoleUnresolvedList (for roles not set).
Throws:
IllegalArgumentException - if null role name
RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service.
RelationNotFoundException - if the relation MBean has not been added in the Relation Service.
See Also:
getRoles(java.lang.String[])

handleMBeanUnregistration

void handleMBeanUnregistration(ObjectName theObjName,
                               String theRoleName)
                               throws IllegalArgumentException,
                                      RoleNotFoundException,
                                      InvalidRoleValueException,
                                      RelationServiceNotRegisteredException,
                                      RelationTypeNotFoundException,
                                      RelationNotFoundException
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
theRoleName - name of role where the MBean is referenced
Throws:
IllegalArgumentException - if null parameter
RoleNotFoundException - if role does not exist in the relation or is not writable
InvalidRoleValueException - if role value does not conform to the associated role info (this will never happen when called from the Relation Service)
RelationServiceNotRegisteredException - if the Relation Service is not registered in the MBean Server
RelationTypeNotFoundException - if the relation type has not been declared in the Relation Service.
RelationNotFoundException - if this method is called for a relation MBean not added in the Relation Service.

getReferencedMBeans

Map getReferencedMBeans()
Retrieves MBeans referenced in the various roles of the relation.

Returns:
a HashMap mapping:

ObjectName -> ArrayList of String (role names)


getRelationTypeName

String getRelationTypeName()
Returns name of associated relation type.

Returns:
the name of the relation type.

getRelationServiceName

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

Returns:
the ObjectName of the Relation Service.

getRelationId

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

Returns:
the relation id.

Ces informations proviennent du site de http://java.sun.com

Remarques

Contenu

Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :

Quels sont les motivations de cette démarche?

Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.

Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.

Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.

Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.

Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.

Réseaux sociaux

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.

 

Nuage de mots clés

6 mots clés dont 0 définis manuellement (plus d'information...).

Avertissement

Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.

Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.

 

Astuce pour imprimer les couleurs des cellules de tableaux : http://www.gaudry.be/ast-rf-450.html
Aucun commentaire pour cette page

© Ce document issu de l′infobrol est enregistré sous le certificat Cyber PrInterDeposit Digital Numbertection. Enregistrement IDDN n° 5329-2523
Document créé le 30/08/06 23:03, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-javax/management/relation/Relation.html Document affiché 1 fois ce mois de Juin.
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Utilisateur (masquer)
Apparence (afficher)
Stats (afficher)
15832 documents
452 astuces.
549 niouzes.
3099 definitions.
447 membres.
8115 messages.

Document genere en :
1,23 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
L'herbe est toujours plus verte chez les autres... jusqu'à ce qu'on découvre que c'est du gazon artificiel.

Jacques Salomé [Extrait de Si je m’écoutais, je m’entendrais]
 
l'infobrol
Nous sommes le Samedi 02 Juin 2012, 01:39, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)