KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > aop > scope > ScopedObject


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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 /**
20  * An AOP-introduction interface for scoped objects.
21  *
22  * <p>Objects created from the {@link ScopedProxyFactoryBean} can be cast
23  * to this interface, enabling access to the raw target object
24  * and programmatic removal of the target object.
25  *
26  * @author Rod Johnson
27  * @author Juergen Hoeller
28  * @since 2.0
29  * @see ScopedProxyFactoryBean
30  */

31 public interface ScopedObject {
32
33     /**
34      * Return the current target object behind this scoped object proxy,
35      * in its raw form (as stored in the target scope).
36      * <p>The raw target object can for example be passed to persistence
37      * providers which would not be able to handle the scoped proxy object.
38      * @return the current target object behind this scoped object proxy
39      */

40     Object JavaDoc getTargetObject();
41
42     /**
43      * Remove this object from its target scope, for example from
44      * the backing session.
45      * <p>Note that no further calls may be made to the scoped object
46      * afterwards (at least within the current thread, that is, with
47      * the exact same target object in the target scope).
48      */

49     void removeFromScope();
50     
51 }
52
Popular Tags