01: // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
02:
03: package jodd.petite.scope;
04:
05: /**
06: * Petite container bean scope. Scopes actually represents wrapper over none, one or many internal
07: * bean pools. Which pool is used depends on scopes behaviour and external data.
08: * <p>
09: * Scopes are instantiated once on their first usage and stored within one container.
10: */
11: public interface Scope {
12:
13: /**
14: * Lookups for bean name.
15: */
16: Object lookup(String name);
17:
18: /**
19: * Registeres the bean within the current scope.
20: */
21: void register(String name, Object object);
22:
23: /**
24: * Removes the bean from the scope entirely.
25: */
26: void remove(String name);
27:
28: /**
29: * Replaces the bean in current scope. Second parameter is provided by container.
30: */
31: void replaceIn(String name, ScopeReplacer scopeReplacer);
32: }
|