1 package org.apache.commons.betwixt.registry;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import org.apache.commons.betwixt.XMLBeanInfo;
20
21 /*** <p>Plug in registry for <code>XMLBeanInfo</code>'s.</p>
22 *
23 * <p>This decouples the implementation of the <code>XMLBeanInfo</code> cache.
24 * Users can plug in the standard implementations found
25 * in this package to switch caching on and off.
26 * Alternatively, they can plug-in an exotic cache of their own devising.</p>
27 *
28 * <p>Users can also prime a cache with <code>XMLBeanInfo</code>
29 * classes created programmatically.</p>
30 *
31 * <p>To find a <code>XMLBeanInfo</code> for a class,
32 * <code>XMLIntrospector</code> checks in the registry first
33 * before starting introspection.
34 * If the registry returns an <code>XMLBeanInfo</code>, then that's used.
35 * Otherwise, the <code>XMLBeanInfo</code> will be found by standard introspection
36 * and then {@link #put} will be called so that the registry
37 * can cache - if it wished - the <code>XMLBeanInfo</code>.
38 * </p>
39 *
40 * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
41 * @version $Id: XMLBeanInfoRegistry.java 155402 2005-02-26 12:52:00Z dirkv $
42 */
43 public interface XMLBeanInfoRegistry {
44
45 /***
46 * Get the <code>XMLBeanInfo</code> for the given class.
47 *
48 * @param forThisClass get <code>XMLBeanInfo</code> for this class
49 *
50 * @return <code>null</code> if fresh introspection should be used
51 * to find the <code>XMLBeanInfo</code>
52 */
53 public XMLBeanInfo get(Class forThisClass);
54
55 /***
56 * Associate a class with it's <code>XMLBeanInfo</code>.
57 *
58 * @param forThisClass the class to associate with the given bean info
59 * @param beanInfo the <code>XMLBeanInfo</code> to use for the given class
60 */
61 public void put(Class forThisClass, XMLBeanInfo beanInfo);
62
63 /***
64 * Flush or resets the current registry to it's original state.
65 * It has to be implemented, however could be an empty implementation
66 */
67 public void flush();
68 }