01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: Participant.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.rep;
09:
10: /**
11: * A <code>Participant</code> is basically a service that needs to be
12: * initialized before it can return objects that correspond to specified
13: * identification keys.
14: *
15: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
16: * @version $Revision: 3634 $
17: * @see Rep
18: * @since 1.0
19: */
20: public interface Participant {
21: /**
22: * Returns the default object for this participant.
23: *
24: * @return <code>an <code>Object</code> instance containing the default
25: * object</code>; or
26: * <p><code>null</code> if no default object exists
27: * @since 1.0
28: */
29: public Object getObject();
30:
31: /**
32: * Retrieves the object from the participant that corresponds to a
33: * particular key.
34: *
35: * @param key An <code>Object</code> instance that used as the key to look
36: * up a corresponding object from the participant.
37: * @return the requested <code>Object</code> instance; or
38: * <p><code>null</code> if no object could be found that corresponds to
39: * the provided key
40: * @since 1.0
41: */
42: public Object getObject(Object key);
43:
44: /**
45: * Checks if the initialization of this participant is finished.
46: *
47: * @return <code>true</code> if the initialization is finished; or
48: * <p><code>false</code> if the initialization is in progress
49: * @since 1.0
50: */
51: public boolean isFinished();
52: }
|