|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.avalon.fortress.impl.role.AbstractMetaInfoManager org.apache.avalon.fortress.impl.role.ServiceMetaManager
ServiceMetaManager follows some simple rules to dynamically gather all services and the meta-information into one role manager. This really gets rid of the need of multiple role managers. It uses a set of entries in your JARs to do its magic.
/services.list
This lists all the services that are defined in this jar.
/META-INF/services/my.class.Name
One entry for each service where there are implementations for a role. This follows the JAR services mechanism.
/my/class/Implementation.meta
There is one entry sitting right beside every implementation class. This holds all the meta information for the associated class. It is a simple properties file.
We have a couple of ANT tasks to make this really easy. If you add this to your ANT build script (customizing it to make it work in your environment), it will make your life alot easier:
<taskdef name="collect-metainfo" classname="org.apache.avalon.fortress.tools.ComponentMetaInfoCollector"> <classpath> <path refid="project.class.path"/> <pathelement path="${tools.dir}/guiapp-tools.jar"/> </classpath> </taskdef> <collect-metainfo destdir="${build.classes}"> <fileset dir="${src.dir}"/> </collect-metainfo>
Field Summary |
Fields inherited from interface org.apache.avalon.fortress.MetaInfoManager |
ROLE |
Constructor Summary | |
ServiceMetaManager()
Create a ServiceMetaManager. |
|
ServiceMetaManager(MetaInfoManager parent)
Create a ServiceMetaManager with a parent RoleManager. |
|
ServiceMetaManager(MetaInfoManager parent,
java.lang.ClassLoader loader)
Create a ServiceMetaManager with the supplied classloader and parent RoleManager. |
|
ServiceMetaManager(RoleManager parent)
Create a ServiceMetaManager with a parent RoleManager. |
Method Summary | |
void |
initialize()
Initialize the ServiceMetaManager by looking at all the services and classes available in the system. |
Methods inherited from class org.apache.avalon.fortress.impl.role.AbstractMetaInfoManager |
addComponent, getLoader, 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 |
public ServiceMetaManager()
public ServiceMetaManager(RoleManager parent)
parent
- public ServiceMetaManager(MetaInfoManager parent)
parent
- public ServiceMetaManager(MetaInfoManager parent, java.lang.ClassLoader loader)
parent
- loader
- Method Detail |
public void initialize() throws java.lang.Exception
initialize
in interface Initializable
java.lang.Exception
- if there is a problem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |