You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by do...@apache.org on 2001/04/02 11:09:06 UTC
cvs commit: jakarta-avalon/src/java/org/apache/avalon/camelot Descriptor.java AbstractCamelotDeployer.java DefaultRegistry.java Info.java Registry.java DefaultLocatorRegistry.java LocatorRegistry.java MetaInfo.java
donaldp 01/04/02 02:09:06
Modified: src/java/org/apache/avalon/camelot
AbstractCamelotDeployer.java DefaultRegistry.java
Info.java Registry.java
Added: src/java/org/apache/avalon/camelot Descriptor.java
Removed: src/java/org/apache/avalon/camelot
DefaultLocatorRegistry.java LocatorRegistry.java
MetaInfo.java
Log:
Updated Camelot to use terms that are currently in more current use.
ie MetaInfo->Descriptor (As per BeanInfo/BeanDescriptor)
Also adapted Registry so that you pass the class of desired info item in. This negated the need for a separate LocatorRegistry and thus this was elided.
Revision Changes Path
1.2 +3 -3 jakarta-avalon/src/java/org/apache/avalon/camelot/AbstractCamelotDeployer.java
Index: AbstractCamelotDeployer.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/camelot/AbstractCamelotDeployer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractCamelotDeployer.java 2001/02/24 04:00:36 1.1
+++ AbstractCamelotDeployer.java 2001/04/02 09:09:03 1.2
@@ -26,7 +26,7 @@
protected boolean m_deployToLocatorRegistry;
protected boolean m_deployToInfoRegistry;
- protected LocatorRegistry m_locatorRegistry;
+ protected Registry m_locatorRegistry;
protected Container m_container;
protected Registry m_infoRegistry;
@@ -42,8 +42,8 @@
{
if( m_deployToLocatorRegistry )
{
- m_locatorRegistry = (LocatorRegistry)componentManager.
- lookup( "org.apache.avalon.camelot.LocatorRegistry" );
+ m_locatorRegistry = (Registry)componentManager.
+ lookup( "org.apache.avalon.camelot.Registry/Locator" );
}
if( m_deployToInfoRegistry )
1.2 +6 -1 jakarta-avalon/src/java/org/apache/avalon/camelot/DefaultRegistry.java
Index: DefaultRegistry.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/camelot/DefaultRegistry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DefaultRegistry.java 2001/02/24 04:00:36 1.1
+++ DefaultRegistry.java 2001/04/02 09:09:04 1.2
@@ -49,7 +49,7 @@
}
}
- public Info getInfo( final String name )
+ public Info getInfo( final String name, final Class clazz )
throws RegistryException
{
final Info info = (Info)m_infos.get( name );
@@ -57,6 +57,11 @@
if( null == info )
{
throw new RegistryException( "Name " + name + " not registered" );
+ }
+ else if( !clazz.isInstance( info ) )
+ {
+ throw new RegistryException( "Info of type " + info.getClass().getName() +
+ " not compatable with expected type " + clazz.getName() );
}
else
{
1.2 +5 -3 jakarta-avalon/src/java/org/apache/avalon/camelot/Info.java
Index: Info.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/camelot/Info.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Info.java 2001/02/24 04:00:36 1.1
+++ Info.java 2001/04/02 09:09:04 1.2
@@ -10,9 +10,11 @@
import org.apache.avalon.Component;
/**
- * This contains information relating to a component.
- * There is currently two different sub-interfaces - MetaInfo and Locator.
- * MetaInfo describes meta information about component while Locator
+ * This contains information relating to a component.
+ * (ie BlockInfo, BeanInfo, MailetInfo etc).
+ *
+ * There is currently also two different sub-interfaces - Descriptor and Locator.
+ * Descriptor describes static meta information about component while Locator
* locates it in the system.
*
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
1.2 +2 -1 jakarta-avalon/src/java/org/apache/avalon/camelot/Registry.java
Index: Registry.java
===================================================================
RCS file: /home/cvs/jakarta-avalon/src/java/org/apache/avalon/camelot/Registry.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Registry.java 2001/02/24 04:00:36 1.1
+++ Registry.java 2001/04/02 09:09:04 1.2
@@ -39,10 +39,11 @@
* Retrieve an Info by name.
*
* @param name the name
+ * @param clazz the expected class type of info
* @return the Info
* @exception RegistryException if an error occurs
*/
- Info getInfo( String name ) throws RegistryException;
+ Info getInfo( String name, Class clazz ) throws RegistryException;
/**
* Return an iterator of all names of infos registered.
1.1 jakarta-avalon/src/java/org/apache/avalon/camelot/Descriptor.java
Index: Descriptor.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.avalon.camelot;
/**
* This contains information about the component.
* (ie would be a BlockDescriptor, an EJBDescriptor, a MailetDescriptor etc)
*
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
*/
public interface Descriptor
extends Info
{
}
---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org