01: /**
02: *
03: */package net.refractions.udig.core;
04:
05: import java.io.IOException;
06:
07: import org.eclipse.core.runtime.IProgressMonitor;
08:
09: /**
10: * An implementation of a Provider that provides the reference it was constructed with.
11: *
12: * <p>
13: * Example:
14: * </p><p>
15: * Provider<Integer> p=new StaticProvider<Integer>(integerInstance);
16: * </p>
17: *
18: * @author jones
19: * @since 1.1.0
20: */
21: public class StaticBlockingProvider<T> implements IBlockingProvider<T> {
22:
23: T object;
24:
25: public StaticBlockingProvider(T objectToProvide) {
26: this .object = objectToProvide;
27: }
28:
29: public T get(IProgressMonitor monitor) throws IOException {
30: return object;
31: }
32:
33: }
|