Return-Path: Delivered-To: apmail-incubator-directory-cvs-archive@www.apache.org Received: (qmail 92766 invoked from network); 30 Jan 2005 18:53:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Jan 2005 18:53:52 -0000 Received: (qmail 3936 invoked by uid 500); 30 Jan 2005 18:53:52 -0000 Delivered-To: apmail-incubator-directory-cvs-archive@incubator.apache.org Received: (qmail 3888 invoked by uid 500); 30 Jan 2005 18:53:52 -0000 Mailing-List: contact directory-cvs-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: directory-dev@incubator.apache.org Delivered-To: mailing list directory-cvs@incubator.apache.org Received: (qmail 3865 invoked by uid 99); 30 Jan 2005 18:53:51 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sun, 30 Jan 2005 10:53:51 -0800 Received: (qmail 92726 invoked by uid 65534); 30 Jan 2005 18:53:50 -0000 Message-ID: <20050130185350.92722.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sun, 30 Jan 2005 18:53:50 -0000 Subject: svn commit: r149139 - incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerDirObjectFactory.java incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/jndi/ServerDirStateFactory.java To: directory-cvs@incubator.apache.org From: akarasulu@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Sun Jan 30 10:53:49 2005 New Revision: 149139 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D149139 Log: some basic interfaces for efficient object and state factories Added: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirObjectFactory.java incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirStateFactory.java Added: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/lda= p/server/jndi/ServerDirObjectFactory.java URL: http://svn.apache.org/viewcvs/incubator/directory/apacheds/trunk/core/= src/main/java/org/apache/ldap/server/jndi/ServerDirObjectFactory.java?view= =3Dauto&rev=3D149139 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirObjectFactory.java (added) +++ incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirObjectFactory.java Sun Jan 30 10:53:49 2005 @@ -0,0 +1,69 @@ +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.server.jndi; + + +import javax.naming.spi.DirObjectFactory; + + +/** + * A specialized ObjectFactory that is optimized for our server-side JNDI + * provider. This factory reports the Class of objects that it is creates= as + * well as the objectClass corresponding to that Class. This makes it eas= ier + * for the server side provider to lookup the respective factory rather th= an + * attempt several others within the list of object factories in the order= of + * greatest specificity. JNDI SPI methods are inefficient since they are + * designed to try all object factories to produce the object. Our provid= er + * looks up the most specific object factory based on this additional + * information. This makes a huge difference when the number of ObjectFac= tory + * instances is large. + *
+ * Eventually, it is highly feasible for generated schemas, to also include + * state and object factories for various objectClasses, or domain objects. + * This means the number of factories will increase. By associating objec= t and + * state factories with their respective objectClasses and Classes we can + * integrate these DAOs into the schema subsystem making factory lookups + * extremely fast and efficient without costing the user too much to creat= e and + * store objects within the directory. At the end of the day the directory + * becomes a hierarchical object store where lookup, bind and rebind are t= he + * only operations besides search to access and store objects. That's pre= tty + * PHAT! + * + * @author Apache Di= rectory Project + * @version $Rev$ + */ +public interface ServerDirObjectFactory extends DirObjectFactory +{ + /** + * Gets either the OID for the objectClass or the human readable name = for + * the objectClass this DirStateFactory is associated with. Note + * that associating this factory with an objectClass automatically + * associates this DirObjectFactory with all descendents of the object= Class. + * + * @return the OID or human readable name of the objectClass associate= d with this ObjectFactory + */ + String getObjectClassId(); + + /** + * Gets the Class instance associated with this ObjectFactory. Object= s to + * be created by this ObjectFactory will be of this type, a subclass of + * this type, or implement this type if it is an interface. + * + * @return the Class associated with this factory. + */ + Class getAssociatedClass(); +} Added: incubator/directory/apacheds/trunk/core/src/main/java/org/apache/lda= p/server/jndi/ServerDirStateFactory.java URL: http://svn.apache.org/viewcvs/incubator/directory/apacheds/trunk/core/= src/main/java/org/apache/ldap/server/jndi/ServerDirStateFactory.java?view= =3Dauto&rev=3D149139 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirStateFactory.java (added) +++ incubator/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/s= erver/jndi/ServerDirStateFactory.java Sun Jan 30 10:53:49 2005 @@ -0,0 +1,63 @@ +/* + * Copyright 2004 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or impli= ed. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +package org.apache.ldap.server.jndi; + + +import javax.naming.spi.DirStateFactory; + + +/** + * A specialized StateFactory that is optimized for our server-side JNDI + * provider. This factory reports the id of the objectClass that it + * is associated with. This makes it easier for the server side provider = to + * find the required factory rather than attempt several others within the= list + * of state factories. JNDI SPI methods are inefficient since they are de= signed + * to try all state factories to produce an object. Our provider looks up + * the most specific state factories based on additional information. This + * makes a huge difference when the number of StateFactories becomes large. + *
+ * Eventually, it is highly feasible for generated schemas, to also include + * state and object factories for various objectClasses. This means the n= umber + * of factories will increase. By associating object and state factories = with + * their respective objectClasses we can integrate this into the schema + * subsystem making factory lookups extremely fast and efficient without c= osting + * the user too much to create and store objects within the directory. + * + * @author Apache Di= rectory Project + * @version $Rev$ + */ +public interface ServerDirStateFactory extends DirStateFactory +{ + /** + * Gets either the OID for the objectClass or the human readable name = for + * the objectClass this DirStateFactory is associated with. Note + * that associating this factory with an objectClass automatically + * associates this DirStateFactory with all descendents of the objectC= lass. + * + * @return the OID or human readable name of the objectClass associate= d with this StateFactory + */ + String getObjectClassId(); + + /** + * Gets the Class instance associated with this StateFactory. Objects= to + * be persisted by this StateFactory must be of this type, a subclass = of + * this type, or implement this type if it is an interface. + * + * @return the class associated with this factory. + */ + Class getAssociatedClass(); +}