API java : Registry


java.rmi.registry
Interface Registry

All Superinterfaces:
Remote

public interface Registry
extends Remote

Registry is a remote interface to a simple remote object registry that provides methods for storing and retrieving remote object references bound with arbitrary string names. The bind, unbind, and rebind methods are used to alter the name bindings in the registry, and the lookup and list methods are used to query the current name bindings.

In its typical usage, a Registry enables RMI client bootstrapping: it provides a simple means for a client to obtain an initial reference to a remote object. Therefore, a registry's remote object implementation is typically exported with a well-known address, such as with a well-known ObjID and TCP port number (default is 1099).

The LocateRegistry class provides a programmatic API for constructing a bootstrap reference to a Registry at a remote address (see the static getRegistry methods) and for creating and exporting a Registry in the current VM on a particular local address (see the static createRegistry methods).

A Registry implementation may choose to restrict access to some or all of its methods (for example, methods that mutate the registry's bindings may be restricted to calls originating from the local host). If a Registry method chooses to deny access for a given invocation, its implementation may throw AccessException, which (because it extends RemoteException) will be wrapped in a ServerException when caught by a remote client.

The names used for bindings in a Registry are pure strings, not parsed. A service which stores its remote reference in a Registry may wish to use a package name as a prefix in the name binding to reduce the likelihood of name collisions in the registry.

Since:
JDK1.1
See Also:
LocateRegistry

Field Summary
static intREGISTRY_PORT
          Well known port for registry.
 
Method Summary
 voidbind(String name, Remote obj)
          Binds a remote reference to the specified name in this registry.
 String[]list()
          Returns an array of the names bound in this registry.
 Remotelookup(String name)
          Returns the remote reference bound to the specified name in this registry.
 voidrebind(String name, Remote obj)
          Replaces the binding for the specified name in this registry with the supplied remote reference.
 voidunbind(String name)
          Removes the binding for the specified name in this registry.
 

Field Detail

REGISTRY_PORT

static final int REGISTRY_PORT
Well known port for registry.

See Also:
Constant Field Values
Method Detail

lookup

Remote lookup(String name)
              throws RemoteException,
                    
                    
                     NotBoundException,
                    
                    
                     AccessException
Returns the remote reference bound to the specified name in this registry.

Parameters:
name - the name for the remote reference to look up
Returns:
a reference to a remote object
Throws:
NotBoundException - if name is not currently bound
RemoteException - if remote communication with the registry failed; if exception is a ServerException containing an AccessException, then the registry denies the caller access to perform this operation
AccessException - if this registry is local and it denies the caller access to perform this operation
NullPointerException - if name is null

bind

void bind(String name,
         
         
          Remote obj)
          throws RemoteException,
                
                
                 AlreadyBoundException,
                
                
                 AccessException
Binds a remote reference to the specified name in this registry.

Parameters:
name - the name to associate with the remote reference
obj - a reference to a remote object (usually a stub)
Throws:
AlreadyBoundException - if name is already bound
RemoteException - if remote communication with the registry failed; if exception is a ServerException containing an AccessException, then the registry denies the caller access to perform this operation (if originating from a non-local host, for example)
AccessException - if this registry is local and it denies the caller access to perform this operation
NullPointerException - if name is null, or if obj is null

unbind

void unbind(String name)
            throws RemoteException,
                  
                  
                   NotBoundException,
                  
                  
                   AccessException
Removes the binding for the specified name in this registry.

Parameters:
name - the name of the binding to remove
Throws:
NotBoundException - if name is not currently bound
RemoteException - if remote communication with the registry failed; if exception is a ServerException containing an AccessException, then the registry denies the caller access to perform this operation (if originating from a non-local host, for example)
AccessException - if this registry is local and it denies the caller access to perform this operation
NullPointerException - if name is null

rebind

void rebind(String name,
           
           
            Remote obj)
            throws RemoteException,
                  
                  
                   AccessException
Replaces the binding for the specified name in this registry with the supplied remote reference. If there is an existing binding for the specified name, it is discarded.

Parameters:
name - the name to associate with the remote reference
obj - a reference to a remote object (usually a stub)
Throws:
RemoteException - if remote communication with the registry failed; if exception is a ServerException containing an AccessException, then the registry denies the caller access to perform this operation (if originating from a non-local host, for example)
AccessException - if this registry is local and it denies the caller access to perform this operation
NullPointerException - if name is null, or if obj is null

list

String[] list()
              throws RemoteException,
                    
                    
                     AccessException
Returns an array of the names bound in this registry. The array will contain a snapshot of the names bound in this registry at the time of the given invocation of this method.

Returns:
an array of the names bound in this registry
Throws:
RemoteException - if remote communication with the registry failed; if exception is a ServerException containing an AccessException, then the registry denies the caller access to perform this operation
AccessException - if this registry is local and it denies the caller access to perform this operation

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-1769
Document créé le 30/08/06 21:56, dernière modification le Vendredi 17 Juin 2011, 12:12
Source du document imprimé : http://www.gaudry.be/java-api-rf-java/rmi/registry/Registry.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,38 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 Vendredi 01 Juin 2012, 21:49, toutes les heures sont au format GMT+1.00 Heure, heure d'été (+1)