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.references;
09:
10: import java.io.Serializable;
11:
12: import org.picocontainer.ObjectReference;
13:
14: /**
15: * Simple instance implementation of ObjectReference.
16: *
17: * @author Aslak Hellesøy
18: * @author Konstantin Pribluda
19: */
20: @SuppressWarnings("serial")
21: public class SimpleReference<T> implements ObjectReference<T>,
22: Serializable {
23: private T instance;
24:
25: public SimpleReference() {
26: // no-op
27: }
28:
29: public T get() {
30: return instance;
31: }
32:
33: public void set(T item) {
34: this.instance = item;
35: }
36: }
|