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