View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.ldap.server.schema;
18  
19  
20  import javax.naming.NamingException;
21  import javax.naming.ldap.LdapContext;
22  
23  import org.apache.ldap.server.jndi.ServerDirObjectFactory;
24  
25  
26  /***
27   * A registry used for looking up JNDI object factories based on meta data
28   * regarding the objectClass and Class associations with the object factory.
29   * Unlike other registries which often throw exceptions when they cannot find
30   * an object, this one does not.  It returns null if an 'optional' object
31   * factory cannot be found.
32   *
33   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34   * @version $Rev: 264732 $
35   */
36  public interface ObjectFactoryRegistry
37  {
38      /***
39       * Gets the list of ObjectFactories associated with an entry.  Several object
40       * factories could be associated with an entry due to the presence of
41       * auxiliary objectClasses.
42       *
43       * @param ctx the context of the entry
44       * @return the ObjectFactories that could be used for the entry
45       */
46      ServerDirObjectFactory getObjectFactories( LdapContext ctx ) throws NamingException;
47  
48      /***
49       * Registers a server-side object factory with this registry.
50       *
51       * @param factory the factory to register.
52       */
53      void register( ServerDirObjectFactory factory ) throws NamingException;
54  }