You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/10/28 10:40:21 UTC
svn commit: rev 55797 - in incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi: . ibs
Author: akarasulu
Date: Thu Oct 28 01:40:20 2004
New Revision: 55797
Modified:
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/EveContextFactory.java
incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/ibs/SchemaService.java
Log:
all is ready for use of schema service
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/EveContextFactory.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/EveContextFactory.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/EveContextFactory.java Thu Oct 28 01:40:20 2004
@@ -16,12 +16,14 @@
import org.apache.eve.SystemPartition;
import org.apache.eve.jndi.ibs.EveExceptionService;
import org.apache.eve.jndi.ibs.OperationalAttributeService;
+import org.apache.eve.jndi.ibs.SchemaService;
import org.apache.eve.db.*;
import org.apache.eve.db.jdbm.JdbmDatabase;
import org.apache.eve.schema.bootstrap.BootstrapRegistries;
import org.apache.eve.schema.bootstrap.BootstrapSchemaLoader;
import org.apache.eve.schema.AttributeTypeRegistry;
import org.apache.eve.schema.OidRegistry;
+import org.apache.eve.schema.GlobalRegistries;
/**
@@ -128,7 +130,7 @@
// Load the schema here and check that it is ok!
// --------------------------------------------------------------------
- BootstrapRegistries registries = new BootstrapRegistries();
+ BootstrapRegistries bootstrapRegistries = new BootstrapRegistries();
BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
String[] schemas = DEFAULT_SCHEMAS;
@@ -137,8 +139,8 @@
schemas = ( ( String ) initialEnv.get( SCHEMAS_ENV ) ).split( "," );
}
- loader.load( schemas, registries );
- List errors = registries.checkRefInteg();
+ loader.load( schemas, bootstrapRegistries );
+ List errors = bootstrapRegistries.checkRefInteg();
if ( ! errors.isEmpty() )
{
NamingException e = new NamingException();
@@ -177,9 +179,9 @@
Database db = new JdbmDatabase( suffix, wkdir );
AttributeTypeRegistry attributeTypeRegistry;
- attributeTypeRegistry = registries.getAttributeTypeRegistry();
+ attributeTypeRegistry = bootstrapRegistries.getAttributeTypeRegistry();
OidRegistry oidRegistry;
- oidRegistry = registries.getOidRegistry();
+ oidRegistry = bootstrapRegistries.getOidRegistry();
ExpressionEvaluator evaluator;
evaluator = new ExpressionEvaluator( db, oidRegistry, attributeTypeRegistry );
@@ -200,9 +202,16 @@
};
SystemPartition system = new SystemPartition( db, eng, attributes );
+ GlobalRegistries globalRegistries = new GlobalRegistries( system, bootstrapRegistries );
RootNexus root = new RootNexus( system );
provider = new EveJndiProvider( root );
+
+ // --------------------------------------------------------------------
+ // Adding interceptors
+ // --------------------------------------------------------------------
+
+
/*
* Create and add the Eve Exception service interceptor to both the
* before and onError interceptor chains.
@@ -212,6 +221,17 @@
InvocationStateEnum.FAILUREHANDLING
};
Interceptor interceptor = new EveExceptionService( root );
+ provider.addInterceptor( interceptor, state );
+
+ /*
+ * Create and add the Eve scheam service interceptor to both the
+ * before and after interceptor chains.
+ */
+ state = new InvocationStateEnum[]{
+ InvocationStateEnum.PREINVOCATION,
+ InvocationStateEnum.POSTINVOCATION
+ };
+ interceptor = new SchemaService( root, globalRegistries );
provider.addInterceptor( interceptor, state );
/*
Modified: incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/ibs/SchemaService.java
==============================================================================
--- incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/ibs/SchemaService.java (original)
+++ incubator/directory/eve/trunk/backend/core/src/java/org/apache/eve/jndi/ibs/SchemaService.java Thu Oct 28 01:40:20 2004
@@ -19,6 +19,7 @@
import org.apache.eve.jndi.BaseInterceptor;
import org.apache.eve.RootNexus;
+import org.apache.eve.schema.GlobalRegistries;
/**
@@ -31,15 +32,20 @@
{
/** the root nexus to all database partitions */
private final RootNexus nexus;
+ /** the global schema object registries */
+ private final GlobalRegistries globalRegistries;
+
/**
* Creates a schema service interceptor.
*
* @param nexus the root nexus to access all database partitions
+ * @param globalRegistries the global schema object registries
*/
- public SchemaService( RootNexus nexus )
+ public SchemaService( RootNexus nexus, GlobalRegistries globalRegistries )
{
this.nexus = nexus;
+ this.globalRegistries = globalRegistries;
}
}