Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 4. Mapping Manager


The Mapping Manager is an interface that obtains preconfigured MappingContexts for particular Mapping Class types, such as the java.security.acl.Group used in role mapping. Implementations of the Service Provider Interface (SPI) can define their own Mapping Class types.
The MappingManager interface is found in the following package:
 package org.jboss.security.mapping;
 
/**
 *  Manager used to map various types 
 */
public interface MappingManager
{
   MappingContext getMappingContext(Class mappingType); 
}
The MappingContext is a set of preconfigured MappingProvider instances for a particular class type and security domain. The MappingContext interface looks like this:
package org.jboss.security.mapping;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 *  Generic Context used by the Mapping Framework 
 */
public class MappingContext
{ 
   private List modules = new ArrayList();
   
   public MappingContext(List mod)
   { 
      this.modules = mod;
   }
   
   /**
    * Get the set of mapping modules
    * @return
    */
   public List getModules()
   {
      return this.modules;
   }
   
   /**
    * Apply mapping semantics on the passed object
    * @param obj Read-only Contextual Map
    * @param mappedObject an object on which mapping will be applied 
    */
   public <T> void performMapping(Map obj, T mappedObject)
   {
      int len = modules.size(); 
      
      for(int i = 0 ; i < len; i++)
      {
         MappingProvider<T> mp = (MappingProvider<T>)modules.get(i);
         mp.performMapping(obj, mappedObject);
      } 
   } 
}
The MappingProvider interface looks like the following:
package org.jboss.security.mapping;

import java.util.Map;

/**
 *  A provider with mapping functionality 
 */
public interface MappingProvider<T>
{
   /**
    * Initializes the provider with the configured module options
    * @param options
    */
   void init(Map options);
   
   /**
    * Maps the passed object
    * @param map A read-only contextual map that can provide information to the provider
    * @param mappedObject an Object on which the mapping will be applied 
    * @throws IllegalArgumentException if the mappedObject is not understood by the 
    * provider.
    */
    void performMapping(Map map, T mappedObject);
}
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2026 Red Hat
Retour au début