01: package org.jicengine.operation;
02:
03: /**
04: * Context : a namespace for objects.
05: *
06: * <p>
07: * Copyright (C) 2004 Timo Laitinen
08: * </p>
09: * @author Timo Laitinen
10: * @created 2004-09-20
11: * @since JICE-0.10
12: */
13:
14: public interface Context {
15:
16: /**
17: * finds an object from the context.
18: *
19: * @return the object. NOTE: currently no null values supported.
20: * @throws ObjectNotFoundException if the context doesn't have an object
21: * with the given name.
22: */
23: public Object getObject(String name) throws ObjectNotFoundException;
24:
25: public boolean hasObject(String name);
26:
27: /**
28: * If addObject success, the object stored will be returned by getObject
29: * with the same name.
30: *
31: * @throws DuplicateNameException if there already is another object with the
32: * same name in the context.
33: */
34: public void addObject(String name, Object object)
35: throws DuplicateNameException;
36:
37: /**
38: * Returns a copy of this context.
39: *
40: * @return Context
41: */
42: public Context replicate();
43: }
|