Keel 2.1RC2

org.keel.core.container
Class KeelMetaInfoManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.fortress.impl.role.AbstractMetaInfoManager
          extended byorg.keel.core.container.KeelMetaInfoManager
All Implemented Interfaces:
Initializable, LogEnabled, MetaInfoManager

public final class KeelMetaInfoManager
extends AbstractMetaInfoManager
implements Initializable

This MetaInfoManager overrides the standard Fortress one very slightly: instead of getResources() to find meta-data, we use only those resources available through the URLClassLoader.


Field Summary
 
Fields inherited from class org.apache.avalon.fortress.impl.role.AbstractMetaInfoManager
 
Fields inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
 
Fields inherited from interface org.apache.avalon.fortress.MetaInfoManager
ROLE
 
Constructor Summary
KeelMetaInfoManager()
          Create a ServiceMetaManager.
KeelMetaInfoManager(MetaInfoManager parent)
          Create a ServiceMetaManager with a parent RoleManager.
KeelMetaInfoManager(MetaInfoManager parent, java.lang.ClassLoader loader)
          Create a ServiceMetaManager with the supplied classloader and parent RoleManager.
KeelMetaInfoManager(RoleManager parent)
          Create a ServiceMetaManager with a parent RoleManager.
 
Method Summary
protected  void addComponent(java.lang.String role, java.lang.String className, java.util.Properties meta, java.util.List deps)
          Addition of a component to the meta info manager.
 java.util.Enumeration cleanUrlList(java.util.Enumeration originalURLs)
           
private  java.lang.String getDepFile(java.lang.String implementation)
          Translate a class name into the meta file name.
protected  java.lang.ClassLoader getLoader()
          Get the classloader used for the RoleManager for any class that extends this one.
private  java.lang.String getMetaFile(java.lang.String implementation)
          Translate a class name into the meta file name.
 void initialize()
          Initialize the ServiceMetaManager by looking at all the services and classes available in the system.
private  void readEntries(java.util.Set entries, java.net.URL url)
          Read entries in a list file and add them all to the provided Set.
private  void readMeta(java.lang.String role, java.lang.String implementation)
          Read the meta information in and actually add the role.
private  void setupImplementations(java.lang.String role)
          Get all the implementations of a service and set up their meta information.
 
Methods inherited from class org.apache.avalon.fortress.impl.role.AbstractMetaInfoManager
getMetaInfoForClassname, getMetaInfoForShortName, isAlreadyAdded
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeelMetaInfoManager

public KeelMetaInfoManager()
Create a ServiceMetaManager.


KeelMetaInfoManager

public KeelMetaInfoManager(RoleManager parent)
Create a ServiceMetaManager with a parent RoleManager.

Parameters:
parent -

KeelMetaInfoManager

public KeelMetaInfoManager(MetaInfoManager parent)
Create a ServiceMetaManager with a parent RoleManager.

Parameters:
parent -

KeelMetaInfoManager

public KeelMetaInfoManager(MetaInfoManager parent,
                           java.lang.ClassLoader loader)
Create a ServiceMetaManager with the supplied classloader and parent RoleManager.

Parameters:
parent -
loader -
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Initialize the ServiceMetaManager by looking at all the services and classes available in the system.

Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception - if there is a problem

cleanUrlList

public java.util.Enumeration cleanUrlList(java.util.Enumeration originalURLs)

setupImplementations

private void setupImplementations(java.lang.String role)
                           throws java.lang.ClassNotFoundException
Get all the implementations of a service and set up their meta information.

Parameters:
role - The role name we are reading implementations for.
Throws:
java.lang.ClassNotFoundException - if the role or component cannot be found

readMeta

private void readMeta(java.lang.String role,
                      java.lang.String implementation)
Read the meta information in and actually add the role.

Parameters:
role -
implementation -

getMetaFile

private java.lang.String getMetaFile(java.lang.String implementation)
Translate a class name into the meta file name.

Parameters:
implementation -
Returns:
String

getDepFile

private java.lang.String getDepFile(java.lang.String implementation)
Translate a class name into the meta file name.

Parameters:
implementation -
Returns:
String

readEntries

private void readEntries(java.util.Set entries,
                         java.net.URL url)
                  throws java.io.IOException
Read entries in a list file and add them all to the provided Set.

Parameters:
entries -
url -
Throws:
java.io.IOException - if we cannot read the entries

addComponent

protected void addComponent(java.lang.String role,
                            java.lang.String className,
                            java.util.Properties meta,
                            java.util.List deps)
Description copied from class: AbstractMetaInfoManager
Addition of a component to the meta info manager.

Overrides:
addComponent in class AbstractMetaInfoManager
Parameters:
role - the role associated with the component
className - the class name
meta - the properties object for the meta info

getLoader

protected java.lang.ClassLoader getLoader()
Get the classloader used for the RoleManager for any class that extends this one.

Overrides:
getLoader in class AbstractMetaInfoManager
Returns:
ClassLoader

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.