80
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package com.nokia.mj.impl.rt.support;
|
|
19 |
|
|
20 |
abstract class FinalizableBase
|
|
21 |
{
|
|
22 |
private Finalizer mFinalizer;
|
|
23 |
|
|
24 |
protected FinalizableBase()
|
|
25 |
{
|
|
26 |
FinalizerStatistics.finalizableCreated(getClass().getName());
|
|
27 |
mFinalizer = new Finalizer()
|
|
28 |
{
|
|
29 |
public void finalizeImpl()
|
|
30 |
{
|
|
31 |
doFinalize();
|
|
32 |
}
|
|
33 |
};
|
|
34 |
}
|
|
35 |
|
|
36 |
void doFinalize()
|
|
37 |
{
|
|
38 |
if (mFinalizer != null)
|
|
39 |
{
|
|
40 |
mFinalizer = null;
|
|
41 |
FinalizerStatistics.classFinalized(getClass().getName());
|
|
42 |
}
|
|
43 |
}
|
|
44 |
}
|
|
45 |
|