1 package org.apache.commons.betwixt.registry;
2
3 /*
4 * ====================================================================
5 *
6 * The Apache Software License, Version 1.1
7 *
8 * Copyright (c) 1999-2002 The Apache Software Foundation. All rights
9 * reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * 2. Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in
20 * the documentation and/or other materials provided with the
21 * distribution.
22 *
23 * 3. The end-user documentation included with the redistribution, if
24 * any, must include the following acknowlegement:
25 * "This product includes software developed by the
26 * Apache Software Foundation (http://www.apache.org/)."
27 * Alternately, this acknowlegement may appear in the software itself,
28 * if and wherever such third-party acknowlegements normally appear.
29 *
30 * 4. The names "The Jakarta Project", "Commons", and "Apache Software
31 * Foundation" must not be used to endorse or promote products derived
32 * from this software without prior written permission. For written
33 * permission, please contact apache@apache.org.
34 *
35 * 5. Products derived from this software may not be called "Apache"
36 * nor may "Apache" appear in their names without prior written
37 * permission of the Apache Group.
38 *
39 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
45 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This software consists of voluntary contributions made by many
54 * individuals on behalf of the Apache Software Foundation. For more
55 * information on the Apache Software Foundation, please see
56 * <http://www.apache.org/>.
57 */
58
59 import org.apache.commons.betwixt.XMLBeanInfo;
60
61 /*** <p>Plug in registry for <code>XMLBeanInfo</code>'s.</p>
62 *
63 * <p>This decouples the implementation of the <code>XMLBeanInfo</code> cache.
64 * Users can plug in the standard implementations found
65 * in this package to switch caching on and off.
66 * Alternatively, they can plug-in an exotic cache of their own devising.</p>
67 *
68 * <p>Users can also prime a cache with <code>XMLBeanInfo</code>
69 * classes created programmatically.</p>
70 *
71 * <p>To find a <code>XMLBeanInfo</code> for a class,
72 * <code>XMLIntrospector</code> checks in the registry first
73 * before starting introspection.
74 * If the registry returns an <code>XMLBeanInfo</code>, then that's used.
75 * Otherwise, the <code>XMLBeanInfo</code> will be found by standard introspection
76 * and then {@link #put} will be called so that the registry
77 * can cache - if it wished - the <code>XMLBeanInfo</code>.
78 * </p>
79 *
80 * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
81 * @version $Id: XMLBeanInfoRegistry.java,v 1.3 2003/01/06 22:50:44 rdonkin Exp $
82 */
83 public interface XMLBeanInfoRegistry {
84
85 /***
86 * Get the <code>XMLBeanInfo</code> for the given class.
87 *
88 * @param forThisClass get <code>XMLBeanInfo</code> for this class
89 *
90 * @return <code>null</code> if fresh introspection should be used
91 * to find the <code>XMLBeanInfo</code>
92 */
93 public XMLBeanInfo get(Class forThisClass);
94
95 /***
96 * Associate a class with it's <code>XMLBeanInfo</code>.
97 *
98 * @param forThisClass the class to associate with the given bean info
99 * @param beanInfo the <code>XMLBeanInfo</code> to use for the given class
100 */
101 public void put(Class forThisClass, XMLBeanInfo beanInfo);
102
103 /***
104 * Flush or resets the current registry to it's original state.
105 * It has to be implemented, however could be an empty implementation
106 */
107 public void flush();
108 }
This page was automatically generated by Maven