Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.factories.components
Class ComponentMetadataRepo

java.lang.Object
  extended by org.infinispan.factories.components.ComponentMetadataRepo
Direct Known Subclasses:
ComponentMetadataPersister

public class ComponentMetadataRepo
extends Object

This is a repository of component metadata, which is populated when the Infinispan core jar is loaded up. Actual metadata is analyzed and persisted into the jar at build-time, taking it off the critical path.

Since:
5.1
Author:
Manik Surtani
See Also:
ComponentMetadata

Constructor Summary
ComponentMetadataRepo()
           
 
Method Summary
 ComponentMetadata findComponentMetadata(Class<?> componentType)
          Locates metadata for a given component type if registered.
 ComponentMetadata findComponentMetadata(String componentName)
          Locates metadata for a given component type if registered.
 String findFactoryForComponent(Class<?> componentType)
          Locates the fully qualified class name of a factory capable of constructing an instance of
 void initialize(Iterable<ModuleMetadataFileFinder> moduleMetadataFiles, ClassLoader cl)
          Initializes this repository.
 void injectFactoryForComponent(Class<?> componentType, Class<?> factoryType)
          Inject a factory for a given component type.
 void readMetadata(URL metadataFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentMetadataRepo

public ComponentMetadataRepo()
Method Detail

readMetadata

public void readMetadata(URL metadataFile)
                  throws IOException,
                         ClassNotFoundException
Throws:
IOException
ClassNotFoundException

findComponentMetadata

public ComponentMetadata findComponentMetadata(Class<?> componentType)
Locates metadata for a given component type if registered. If not registered, superclasses/interfaces are consulted, until, finally, an empty instance of ComponentMetadata is returned effectively declaring that the component has no dependencies or any lifecycle methods declared.

Parameters:
componentType - component type to look for
Returns:
metadata expressed as a ComponentMetadata instance

findComponentMetadata

public ComponentMetadata findComponentMetadata(String componentName)
Locates metadata for a given component type if registered. If not registered, a null is returned.

Parameters:
componentName - name of component type to look for
Returns:
metadata expressed as a ComponentMetadata instance, or null

findFactoryForComponent

public String findFactoryForComponent(Class<?> componentType)
Locates the fully qualified class name of a factory capable of constructing an instance of
componentType
. Typically this is a factory annotated with DefaultFactoryFor.

Parameters:
componentType - component to create
Returns:
a factory, or null if not found.

initialize

public void initialize(Iterable<ModuleMetadataFileFinder> moduleMetadataFiles,
                       ClassLoader cl)
Initializes this repository. The Iterable passed in should contain all ModuleMetadataFileFinder instances for all loaded Infinispan modules. Note that the core module is always loaded and need not be contained in this iterable.

Parameters:
moduleMetadataFiles - file finders to iterate through and load into the repository

injectFactoryForComponent

public void injectFactoryForComponent(Class<?> componentType,
                                      Class<?> factoryType)
Inject a factory for a given component type.

Parameters:
componentType - Component type that the factory will produce
factoryType - Factory that produces the given type of components

Infinispan Distribution 5.2.6.Final-redhat-2

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.