KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > excalibur > component > servlet > AbstractReferenceProxy


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12  * implied.
13  *
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.avalon.excalibur.component.servlet;
18
19 /**
20  * Common Reference Proxy implementation.
21  *
22  * @deprecated ECM is no longer supported
23  *
24  * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a>
25  * @version CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:16 $
26  * @since 4.2
27  */

28 abstract class AbstractReferenceProxy
29     implements ReferenceProxy
30 {
31     /** AbstractReferenceProxyLatch which owns the proxy. */
32     private AbstractReferenceProxyLatch m_latch;
33
34     /** Name of the proxy. */
35     private String JavaDoc m_name;
36
37     /*---------------------------------------------------------------
38      * Constructors
39      *-------------------------------------------------------------*/

40     /**
41      * Create a new AbstractReferenceProxy around a given object.
42      *
43      * @param object The object to protect with the proxy.
44      * @param latch ReferenceProxyLatch which owns the proxy.
45      */

46     AbstractReferenceProxy( AbstractReferenceProxyLatch latch, String JavaDoc name )
47     {
48         m_latch = latch;
49         m_name = name;
50     }
51
52     /*---------------------------------------------------------------
53      * Methods
54      *-------------------------------------------------------------*/

55     /**
56      * Returns the name of the proxy.
57      *
58      * @return The name of the proxy.
59      */

60     String JavaDoc getName()
61     {
62         return m_name;
63     }
64
65     /**
66      * Called when all references to the ReferenceProxy have been removed.
67      */

68     protected void finalize()
69     {
70         m_latch.notifyFinalized( this );
71     }
72 }
73
Popular Tags