API java : MBeanServerFactory


javax.management
Class MBeanServerFactory

java.lang.Object
  extended by javax.management.MBeanServerFactory

public class MBeanServerFactory
extends Object

Provides MBean server references. There are no instances of this class.

Since JMX 1.2 this class makes it possible to replace the default MBeanServer implementation. This is done using the MBeanServerBuilder class. The class of the initial MBeanServerBuilder to be instantiated can be specified through the javax.management.builder.initial system property. The specified class must be a public subclass of MBeanServerBuilder, and must have a public empty constructor.

By default, if no value for that property is specified, an instance of javax.management.MBeanServerBuilder is created. Otherwise, the MBeanServerFactory attempts to load the specified class using Thread.currentThread().getContextClassLoader(), or if that is null, Class.forName(). Then it creates an initial instance of that Class using Class.newInstance(). If any checked exception is raised during this process (e.g. ClassNotFoundException, InstantiationException) the MBeanServerFactory will propagate this exception from within a RuntimeException.

The javax.management.builder.initial system property is consulted every time a new MBeanServer needs to be created, and the class pointed to by that property is loaded. If that class is different from that of the current MBeanServerBuilder, then a new MBeanServerBuilder is created. Otherwise, the MBeanServerFactory may create a new MBeanServerBuilder or reuse the current one.

If the class pointed to by the property cannot be loaded, or does not correspond to a valid subclass of MBeanServerBuilder then an exception is propagated, and no MBeanServer can be created until the javax.management.builder.initial system property is reset to valid value.

The MBeanServerBuilder makes it possible to wrap the MBeanServers returned by the default MBeanServerBuilder implementation, for the purpose of e.g. adding an additional security layer.

Since:
1.5

Method Summary
static MBeanServer createMBeanServer()
          Return a new object implementing the MBeanServer interface with a standard default domain name.
static MBeanServer createMBeanServer(String domain)
          Return a new object implementing the MBeanServer interface with the specified default domain name.
static ArrayList findMBeanServer(String agentId)
          Return a list of registered MBeanServer objects.
static ClassLoaderRepository getClassLoaderRepository(MBeanServer server)
          Return the ClassLoaderRepository used by the given MBeanServer.
static MBeanServer newMBeanServer()
          Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object.
static MBeanServer newMBeanServer(String domain)
          Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object.
static void releaseMBeanServer(MBeanServer mbeanServer)
          Remove internal MBeanServerFactory references to a created MBeanServer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

releaseMBeanServer

public static void releaseMBeanServer(MBeanServer mbeanServer)
Remove internal MBeanServerFactory references to a created MBeanServer. This allows the garbage collector to remove the MBeanServer object.

Parameters:
mbeanServer - the MBeanServer object to remove.
Throws:
IllegalArgumentException - if mbeanServer was not generated by one of the createMBeanServer methods, or if releaseMBeanServer was already called on it.
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("releaseMBeanServer").

createMBeanServer

public static MBeanServer createMBeanServer()

Return a new object implementing the MBeanServer interface with a standard default domain name. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The standard default domain name is DefaultDomain.

The MBeanServer reference is internally kept. This will allow findMBeanServer to return a reference to this MBeanServer object.

This method is equivalent to createMBeanServer(null).

Returns:
the newly created MBeanServer.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("createMBeanServer").
JMRuntimeException - if the property javax.management.builder.initial exists but the class it names cannot be instantiated through a public no-argument constructor; or if the instantiated builder returns null from its newMBeanServerDelegate or newMBeanServer methods.
ClassCastException - if the property javax.management.builder.initial exists and can be instantiated but is not assignment compatible with MBeanServerBuilder.

createMBeanServer

public static MBeanServer createMBeanServer(String domain)

Return a new object implementing the MBeanServer interface with the specified default domain name. The given domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The MBeanServer reference is internally kept. This will allow findMBeanServer to return a reference to this MBeanServer object.

Parameters:
domain - the default domain name for the created MBeanServer. This is the value that will be returned by MBeanServer.getDefaultDomain().
Returns:
the newly created MBeanServer.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("createMBeanServer").
JMRuntimeException - if the property javax.management.builder.initial exists but the class it names cannot be instantiated through a public no-argument constructor; or if the instantiated builder returns null from its newMBeanServerDelegate or newMBeanServer methods.
ClassCastException - if the property javax.management.builder.initial exists and can be instantiated but is not assignment compatible with MBeanServerBuilder.

newMBeanServer

public static MBeanServer newMBeanServer()

Return a new object implementing the MBeanServer interface with a standard default domain name, without keeping an internal reference to this new object. The default domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

The standard default domain name is DefaultDomain.

No reference is kept. findMBeanServer will not be able to return a reference to this MBeanServer object, but the garbage collector will be able to remove the MBeanServer object when it is no longer referenced.

This method is equivalent to newMBeanServer(null).

Returns:
the newly created MBeanServer.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("newMBeanServer").
JMRuntimeException - if the property javax.management.builder.initial exists but the class it names cannot be instantiated through a public no-argument constructor; or if the instantiated builder returns null from its newMBeanServerDelegate or newMBeanServer methods.
ClassCastException - if the property javax.management.builder.initial exists and can be instantiated but is not assignment compatible with MBeanServerBuilder.

newMBeanServer

public static MBeanServer newMBeanServer(String domain)

Return a new object implementing the MBeanServer interface with the specified default domain name, without keeping an internal reference to this new object. The given domain name is used as the domain part in the ObjectName of MBeans when the domain is specified by the user is null.

No reference is kept. findMBeanServer will not be able to return a reference to this MBeanServer object, but the garbage collector will be able to remove the MBeanServer object when it is no longer referenced.

Parameters:
domain - the default domain name for the created MBeanServer. This is the value that will be returned by MBeanServer.getDefaultDomain().
Returns:
the newly created MBeanServer.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("newMBeanServer").
JMRuntimeException - if the property javax.management.builder.initial exists but the class it names cannot be instantiated through a public no-argument constructor; or if the instantiated builder returns null from its newMBeanServerDelegate or newMBeanServer methods.
ClassCastException - if the property javax.management.builder.initial exists and can be instantiated but is not assignment compatible with MBeanServerBuilder.

findMBeanServer

public static ArrayList findMBeanServer(String agentId)

Return a list of registered MBeanServer objects. A registered MBeanServer object is one that was created by one of the createMBeanServer methods and not subsequently released with releaseMBeanServer.

Parameters:
agentId - The agent identifier of the MBeanServer to retrieve. If this parameter is null, all registered MBeanServers in this JVM are returned. Otherwise, only MBeanServers whose id is equal to agentId are returned. The id of an MBeanServer is the MBeanServerId attribute of its delegate MBean.
Returns:
A list of MBeanServer objects.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanServerPermission("findMBeanServer").

getClassLoaderRepository

public static ClassLoaderRepository getClassLoaderRepository(MBeanServer server)
Return the ClassLoaderRepository used by the given MBeanServer. This method is equivalent to server.getClassLoaderRepository().

Parameters:
server - The MBeanServer under examination. Since JMX 1.2, if server is null, the result is a NullPointerException. This behavior differs from what was implemented in JMX 1.1 - where the possibility to use null was deprecated.
Returns:
The Class Loader Repository used by the given MBeanServer.
Throws:
SecurityException - if there is a SecurityManager and the caller's permissions do not include or imply MBeanPermission("getClassLoaderRepository").
NullPointerException - if server is null.

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

7 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-12749
Document créé le 13/04/08 23:31, dernière modification le Vendredi 17 Juin 2011, 10:12
Source du document imprimé : http:///www.gaudry.be/java-api-javaee-rf-javax/faces/model/ArrayDataModel.html
St.Gaudry©07.01.02
Outils (masquer)
||
Recherche (afficher)
Recherche :

Apparence (afficher)
Stats (afficher)
15838 documents
455 astuces.
550 niouzes.
3107 definitions.
447 membres.
8121 messages.

Document genere en :
0,07 seconde

Mises à jour :
Mises à jour du site
Citation (masquer)
Un langage de programmation est censé être une façon conventionnelle de donner des ordres à un ordinateur. Il n'est pas censé être obscur, bizarre et plein de pièges subtils (ça ce sont les attributs de la magie).

Dave Small
 
l'infobrol
Nous sommes le Dimanche 20 Mai 2018, 23:38, toutes les heures sont au format GMTs