01: /*****************************************************************************
02: * Copyright (C) PicoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: *****************************************************************************/package org.picocontainer;
09:
10: /**
11: * A way to refer to objects that are stored in "awkward" places (for example inside a
12: * <code>HttpSession</code> or {@link ThreadLocal}).
13: * <p/>
14: * This interface is typically implemented by someone integrating Pico into an existing container.
15: *
16: * @author Joe Walnes
17: */
18: public interface ObjectReference<T> {
19: /**
20: * Retrieve an actual reference to the object. Returns null if the reference is not available
21: * or has not been populated yet.
22: *
23: * @return an actual reference to the object.
24: */
25: T get();
26:
27: /**
28: * Assign an object to the reference.
29: *
30: * @param item the object to assign to the reference. May be <code>null</code>.
31: */
32: void set(T item);
33: }
|