public interface DirObjectFactory
This interface represents a factory for creating an object given an object and attributes about the object.
The JNDI framework allows for object implementations to be loaded in dynamically via object factories. See ObjectFactory for details.
A DirObjectFactory extends ObjectFactory by allowing an Attributes instance to be supplied to the getObjectInstance() method. DirObjectFactory implementations are intended to be used by DirContext service providers. The service provider, in addition reading an object from the directory, might already have attributes that are useful for the object factory to check to see whether the factory is supposed to process the object. For instance, an LDAP-style service provider might have read the "objectclass" of the object. A CORBA object factory might be interested only in LDAP entries with "objectclass=corbaObject". By using the attributes supplied by the LDAP service provider, the CORBA object factory can quickly eliminate objects that it need not worry about, and non-CORBA object factories can quickly eliminate CORBA-related LDAP entries.
NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, ?>),
DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, ?>, javax.naming.directory.Attributes),
ObjectFactory| Method Summary | |
|---|---|
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment,
Attributes attrs)
Creates an object using the location or reference information, and attributes specified. |
| Methods inherited from interface javax.naming.spi.ObjectFactory |
|---|
getObjectInstance |
| Method Detail |
|---|
Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment, Attributes attrs) throws Exception
Special requirements of this object are supplied
using environment.
An example of such an environment property is user identity
information.
DirectoryManager.getObjectInstance() successively loads in object factories. If it encounters a DirObjectFactory, it will invoke DirObjectFactory.getObjectInstance(); otherwise, it invokes ObjectFactory.getObjectInstance(). It does this until a factory produces a non-null answer.
When an exception is thrown by an object factory, the exception is passed on to the caller of DirectoryManager.getObjectInstance(). The search for other factories that may produce a non-null answer is halted. An object factory should only throw an exception if it is sure that it is the only intended factory and that no other object factories should be tried. If this factory cannot create an object using the arguments supplied, it should return null.
Since DirObjectFactory extends ObjectFactory, it effectively has two getObjectInstance() methods, where one differs from the other by the attributes argument. Given a factory that implements DirObjectFactory, DirectoryManager.getObjectInstance() will only use the method that accepts the attributes argument, while NamingManager.getObjectInstance() will only use the one that does not accept the attributes argument.
See ObjectFactory for a description URL context factories and other properties of object factories that apply equally to DirObjectFactory.
The name, attrs, and environment parameters are owned by the caller. The implementation will not modify these objects or keep references to them, although it may keep references to clones or copies.
obj - The possibly null object containing location or reference
information that can be used in creating an object.name - The name of this object relative to nameCtx,
or null if no name is specified.nameCtx - The context relative to which the name
parameter is specified, or null if name is
relative to the default initial context.environment - The possibly null environment that is used in
creating the object.attrs - The possibly null attributes containing some of obj's
attributes. attrs might not necessarily have all of obj's
attributes. If the object factory requires more attributes, it needs
to get it, either using obj, or name and nameCtx.
The factory must not modify attrs.
Exception - If this object factory encountered an exception
while attempting to create an object, and no other object factories are
to be tried.DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, ?>, javax.naming.directory.Attributes),
NamingManager.getURLContext(java.lang.String, java.util.Hashtable, ?>)Ces informations proviennent du site de http://java.sun.com
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 :
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.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
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.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)