KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > defaults > ObjectReference


1 /*****************************************************************************
2  * Copyright (C) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  *****************************************************************************/

9 package org.picocontainer.defaults;
10
11 /**
12  * A way to refer to objects that are stored in "awkward" places (for example inside a
13  * <code>HttpSession</code> or {@link ThreadLocal}).
14  * <p/>
15  * This interface is typically implemented by someone integrating Pico into an existing container.
16  *
17  * @author <a HREF="mailto:joe@thoughtworks.net">Joe Walnes</a>
18  */

19 public interface ObjectReference {
20     /**
21      * Retrieve an actual reference to the object. Returns null if the reference is not available
22      * or has not been populated yet.
23      *
24      * @return an actual reference to the object.
25      */

26     Object JavaDoc get();
27
28     /**
29      * Assign an object to the reference.
30      *
31      * @param item the object to assign to the reference. May be <code>null</code>.
32      */

33     void set(Object JavaDoc item);
34 }
35
Popular Tags