01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.springframework.aop.scope;
18:
19: import org.springframework.aop.RawTargetAccess;
20:
21: /**
22: * An AOP introduction interface for scoped objects.
23: *
24: * <p>Objects created from the {@link ScopedProxyFactoryBean} can be cast
25: * to this interface, enabling access to the raw target object
26: * and programmatic removal of the target object.
27: *
28: * @author Rod Johnson
29: * @author Juergen Hoeller
30: * @since 2.0
31: * @see ScopedProxyFactoryBean
32: */
33: public interface ScopedObject extends RawTargetAccess {
34:
35: /**
36: * Return the current target object behind this scoped object proxy,
37: * in its raw form (as stored in the target scope).
38: * <p>The raw target object can for example be passed to persistence
39: * providers which would not be able to handle the scoped proxy object.
40: * @return the current target object behind this scoped object proxy
41: */
42: Object getTargetObject();
43:
44: /**
45: * Remove this object from its target scope, for example from
46: * the backing session.
47: * <p>Note that no further calls may be made to the scoped object
48: * afterwards (at least within the current thread, that is, with
49: * the exact same target object in the target scope).
50: */
51: void removeFromScope();
52:
53: }
|