View Javadoc

1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.server.core.jndi;
21  
22  
23  import javax.naming.spi.DirObjectFactory;
24  
25  
26  /**
27   * A specialized ObjectFactory that is optimized for our server-side JNDI
28   * provider.  This factory reports the Class of objects that it is creates as
29   * well as the objectClass corresponding to that Class.  This makes it easier
30   * for the server side provider to lookup the respective factory rather than
31   * attempt several others within the list of object factories in the order of
32   * greatest specificity.  JNDI SPI methods are inefficient since they are
33   * designed to try all object factories to produce the object.  Our provider
34   * looks up the most specific object factory based on this additional
35   * information.  This makes a huge difference when the number of ObjectFactory
36   * instances is large.
37   * <p/>
38   * Eventually, it is highly feasible for generated schemas, to also include
39   * state and object factories for various objectClasses, or domain objects.
40   * This means the number of factories will increase.  By associating object and
41   * state factories with their respective objectClasses and Classes we can
42   * integrate these DAOs into the schema subsystem making factory lookups
43   * extremely fast and efficient without costing the user too much to create and
44   * store objects within the directory.  At the end of the day the directory
45   * becomes a hierarchical object store where lookup, bind and rebind are the
46   * only operations besides search to access and store objects.  That's pretty
47   * PHAT!
48   *
49   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
50   * @version $Rev: 679219 $
51   */
52  public interface ServerDirObjectFactory extends DirObjectFactory
53  {
54      /**
55       * Gets either the OID for the objectClass or the human readable name for
56       * the objectClass this DirStateFactory is associated with.  Note
57       * that associating this factory with an objectClass automatically
58       * associates this DirObjectFactory with all descendents of the objectClass.
59       *
60       * @return the OID or human readable name of the objectClass associated with this ObjectFactory
61       */
62      String getObjectClassId();
63  
64  
65      /**
66       * Gets the Class instance associated with this ObjectFactory.  Objects to
67       * be created by this ObjectFactory will be of this type, a subclass of
68       * this type, or implement this type if it is an interface.
69       *
70       * @return the Class associated with this factory.
71       */
72      Class<?> getAssociatedClass();
73  }