You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by mc...@apache.org on 2004/06/27 19:26:14 UTC
svn commit: rev 22203 - in incubator/directory/eve/branches/plus: . etc/deliverables/blocks src/java/org/apache/eve/backend src/java/org/apache/eve/schema
Author: mcconnell
Date: Sun Jun 27 10:26:14 2004
New Revision: 22203
Modified:
incubator/directory/eve/branches/plus/ (props changed)
incubator/directory/eve/branches/plus/avalon-index.xml
incubator/directory/eve/branches/plus/etc/deliverables/blocks/default.block
incubator/directory/eve/branches/plus/index.xml
incubator/directory/eve/branches/plus/src/java/org/apache/eve/backend/NexusModule.java
incubator/directory/eve/branches/plus/src/java/org/apache/eve/schema/SchemaModule.java
Log:
Just bringing svn up-to-date. Changes include addition of a optional schema resolution by artifact and some resolution of dependencies.
Modified: incubator/directory/eve/branches/plus/avalon-index.xml
==============================================================================
--- incubator/directory/eve/branches/plus/avalon-index.xml (original)
+++ incubator/directory/eve/branches/plus/avalon-index.xml Sun Jun 27 10:26:14 2004
@@ -227,7 +227,8 @@
<info>
<group>avalon/util</group>
<name>avalon-util-defaults</name>
- <version>1.2.1</version>
+ <version>1.2.2</version> <!-- bumped to 1.2.2 to fix bug accessing Env variable -->
+ <status>SNAPSHOT</status>
</info>
<dependencies>
<include key="avalon-util-env"/>
@@ -869,6 +870,27 @@
<include key="jms"/>
</dependencies>
</project>
+
+ <!--
+ Avalon Laboratory.
+ -->
+
+ <project basedir="../laboratory/cache">
+ <info>
+ <group>avalon/planet</group>
+ <name>avalon-cache</name>
+ <version>1.0.0</version>
+ <status>SNAPSHOT</status>
+ </info>
+ <dependencies>
+ <include key="avalon-framework-api"/>
+ <include key="avalon-repository-main"/>
+ </dependencies>
+ <plugins>
+ <include key="avalon-meta-tools"/>
+ </plugins>
+ </project>
+
<!--
<project basedir="../../runtime/merlin/unit">
Modified: incubator/directory/eve/branches/plus/etc/deliverables/blocks/default.block
==============================================================================
--- incubator/directory/eve/branches/plus/etc/deliverables/blocks/default.block (original)
+++ incubator/directory/eve/branches/plus/etc/deliverables/blocks/default.block Sun Jun 27 10:26:14 2004
@@ -17,6 +17,7 @@
<!-- add a filter to the following entries
or better still generate a template automatically -->
+ <resource id="avalon/repository:avalon-repository-api" version="2.1.0-DEV"/>
<resource id="avalon-framework:avalon-framework-api" version="4.2.0"/>
<resource id="avalon-framework:avalon-framework-impl" version="4.2.0"/>
<resource id="avalon-logkit:avalon-logkit" version="2.0.0"/>
@@ -31,11 +32,24 @@
<resource id="incubator-directory:ldap-common" version="SNAPSHOT"/>
<resource id="incubator-directory:eve-plus" version="0.0.1"/>
+ <resource id="incubator-directory:ldap-snacc-provider" version="SNAPSHOT"/>
</repository>
</classpath>
</classloader>
<component name="input" class="org.apache.eve.input.InputModule"/>
+ <component name="nexus" class="org.apache.eve.backend.NexusModule"/>
+ <component name="client" class="org.apache.eve.client.ClientModule"/>
+ <component name="authman" class="org.apache.eve.security.auth.AuthenticationModule"/>
+ <component name="event" class="org.apache.eve.event.protocol.EventModule"/>
+ <component name="protocol" class="org.apache.eve.protocol.ProtocolModule"/>
+ <component name="decoder" class="org.apache.eve.decoder.DecoderModule"/>
+ <component name="encoder" class="org.apache.eve.encoder.EncoderModule"/>
+ <component name="output" class="org.apache.eve.output.OutputModule"/>
+ <component name="schema" class="org.apache.eve.schema.SchemaModule"/>
+
+
+ <include name="repository" id="avalon/planet:avalon-cache" version="1.0.0-DEV"/>
<include name="threads"
id="cornerstone-threads:cornerstone-threads-impl"
Modified: incubator/directory/eve/branches/plus/index.xml
==============================================================================
--- incubator/directory/eve/branches/plus/index.xml (original)
+++ incubator/directory/eve/branches/plus/index.xml Sun Jun 27 10:26:14 2004
@@ -94,10 +94,12 @@
<dependencies>
<include key="avalon-framework-api"/>
<include key="avalon-framework-impl"/>
+ <include key="avalon-repository-api"/>
<include key="avalon-logkit"/>
<include key="cornerstone-threads-api"/>
<include key="excalibur-thread-api"/>
<include key="ldap-common"/>
+ <include key="ldap-snacc-provider"/>
<include key="commons-collections"/>
<include key="regexp"/>
<include key="jdbm"/>
Modified: incubator/directory/eve/branches/plus/src/java/org/apache/eve/backend/NexusModule.java
==============================================================================
--- incubator/directory/eve/branches/plus/src/java/org/apache/eve/backend/NexusModule.java (original)
+++ incubator/directory/eve/branches/plus/src/java/org/apache/eve/backend/NexusModule.java Sun Jun 27 10:26:14 2004
@@ -44,6 +44,7 @@
*
* @avalon.component name="nexus" lifestyle="singleton"
* @avalon.service type="org.apache.eve.backend.UnifiedBackend"
+ * @avalon.attribute key="urn:composition:deployment.timeout" value="0"
*
* @phoenix:mx-topic name="backend-nexus"
* @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
Modified: incubator/directory/eve/branches/plus/src/java/org/apache/eve/schema/SchemaModule.java
==============================================================================
--- incubator/directory/eve/branches/plus/src/java/org/apache/eve/schema/SchemaModule.java (original)
+++ incubator/directory/eve/branches/plus/src/java/org/apache/eve/schema/SchemaModule.java Sun Jun 27 10:26:14 2004
@@ -12,7 +12,9 @@
import java.io.File;
import java.io.FileInputStream ;
+import java.io.IOException ;
import java.io.FileNotFoundException ;
+import java.net.URL;
import java.util.HashMap ;
import java.util.Iterator ;
@@ -31,7 +33,11 @@
import org.apache.avalon.framework.context.ContextException ;
import org.apache.avalon.framework.configuration.Configuration ;
import org.apache.avalon.framework.configuration.ConfigurationException ;
-
+import org.apache.avalon.framework.service.ServiceException ;
+import org.apache.avalon.framework.service.ServiceManager ;
+import org.apache.avalon.repository.Repository;
+import org.apache.avalon.repository.RepositoryException;
+import org.apache.avalon.repository.Artifact;
/**
* Schema manager module/block implementation used to parse schema files and
@@ -60,6 +66,10 @@
private File m_basedir;
+ private Repository m_cache;
+
+ private Configuration m_config;
+
public void enableLogging(Logger a_logger)
{
super.enableLogging(a_logger) ;
@@ -129,6 +139,15 @@
}
}
+ /**
+ * @avalon.dependency key="cache" type="org.apache.avalon.repository.Repository"
+ */
+ public void service( ServiceManager manager ) throws ServiceException
+ {
+ super.service( manager );
+ m_cache = (Repository) manager.lookup( "cache" );
+ }
+
/*
=========================================
@@ -227,6 +246,12 @@
// and its contents to the top level directory but updates fail on jar.
//
+ m_config = a_config;
+
+ }
+
+ public void initialize() throws Exception
+ {
/*
* TODO
*
@@ -239,19 +264,23 @@
* will be able easily reuse it in the real eve.
*/
+ getLogger().info( "configuration of the schema module" );
+
String l_baseDir = m_basedir.getAbsolutePath() ;
- l_baseDir = l_baseDir + File.separator + "SAR-INF" + File.separator +
- "lib" ;
+ l_baseDir = l_baseDir + File.separator + "lib" ;
// Stage I:
- Configuration [] l_schemaNodes = a_config.getChildren("schema") ;
+ Configuration [] l_schemaNodes = m_config.getChildren("schema") ;
+
String l_schemaName = null ;
String l_schemaFile = null ;
SchemaImpl l_schema = null ;
- for(int ii = 0; ii < l_schemaNodes.length; ii++) {
+ for(int ii = 0; ii < l_schemaNodes.length; ii++)
+ {
l_schemaName = l_schemaNodes[ii].getAttribute("name") ;
- l_schemaFile = l_baseDir + File.separator +
- l_schemaNodes[ii].getAttribute("filepath") ;
+
+ l_schemaFile = getSchemaFilename( l_baseDir, l_schemaNodes[ii] );
+
l_schema = parse(l_schemaFile) ;
m_complete.addSchema(l_schema) ;
m_schemaFileMap.put(l_schemaName, l_schema) ;
@@ -259,7 +288,7 @@
// Stage II:
Configuration [] l_normalizers =
- a_config.getChild("normalization").getChildren("normalizer") ;
+ m_config.getChild("normalization").getChildren("normalizer") ;
String l_rule = null ;
Normalizer l_normalizer = null ;
for(int ii = 0; ii < l_normalizers.length; ii++) {
@@ -271,7 +300,7 @@
// Stage III:
Configuration [] l_syntaxes =
- a_config.getChild("syntax-checkers").getChildren("syntax-checker") ;
+ m_config.getChild("syntax-checkers").getChildren("syntax-checker") ;
String l_oid = null ;
SyntaxChecker l_checker = null ;
for(int ii = 0; ii < l_syntaxes.length; ii++) {
@@ -293,7 +322,7 @@
// process the keys for distinguished names used to refer to a SAA
//
- Configuration [] l_saaNodes = a_config.getChildren("SAA") ;
+ Configuration [] l_saaNodes = m_config.getChildren("SAA") ;
String l_saaDN = null ;
for(int ii = 0; ii < l_saaNodes.length; ii++) {
try {
@@ -312,8 +341,33 @@
}
}
+ private String getSchemaFilename( String base, Configuration config )
+ throws ConfigurationException, RepositoryException, IOException
+ {
+ String filepath = config.getAttribute( "filepath", null );
+ if( null != filepath )
+ {
+ return base + File.separator + filepath;
+ }
+ else
+ {
+ String spec = config.getAttribute( "artifact", null );
+ if( null != spec )
+ {
+ Artifact artifact = Artifact.createArtifact( spec );
+ URL url = m_cache.getResource( artifact );
+ return url.toString();
+ }
+ else
+ {
+ final String error =
+ "Configuration schema declaration does not contain artifact or filepath attribute.";
+ throw new ConfigurationException( error );
+ }
+ }
+ }
- SyntaxChecker buildSyntaxChecker(String a_oid, Configuration a_syntaxNode)
+ SyntaxChecker buildSyntaxChecker(String a_oid, Configuration a_syntaxNode)
throws ConfigurationException
{
Configuration [] l_regexes = a_syntaxNode.getChildren("regex") ;