1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.ldap.server.schema;
18
19
20 import org.apache.ldap.server.jndi.ServerDirStateFactory;
21
22 import javax.naming.NamingException;
23
24
25 /***
26 * A registry used for looking up JNDI state factories based on meta data
27 * regarding the objectClass and Class associations with the factory. Unlike
28 * other registries which often throw exceptions when they cannot find an
29 * object, this one does not. It returns null if an 'optional' state factory
30 * cannot be found.
31 *
32 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33 * @version $Rev$
34 */
35 public interface StateFactoryRegistry
36 {
37 /***
38 * Gets the list of StateFactories associated with a class. Several state
39 * factories may be associated with a class or interface depending on its
40 * ancestry. Also more specific factories may be registered for subclasses
41 * of the class. So a request for a general class may result in several
42 * factories which could persist the state of an object although more
43 * specifically.
44 *
45 * @param obj the object to be persisted by the factories
46 * @return the set of state factories which persist objects of the specified class
47 */
48 ServerDirStateFactory getStateFactories( Object obj ) throws NamingException;
49
50 /***
51 * Registers a server-side state factory with this registry.
52 *
53 * @param factory the factory to register.
54 */
55 void register( ServerDirStateFactory factory );
56 }