1 | /*
|
---|
2 | * Copyright 2005 Paul Hinds
|
---|
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 | package org.tp23.antinstaller.runtime.exe;
|
---|
17 |
|
---|
18 | import org.tp23.antinstaller.InstallerContext;
|
---|
19 |
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * This filter is called at the end of the install. This is not the
|
---|
23 | * last Java operation since a shutDownHook is present to delete temporary
|
---|
24 | * files and in the GUI version the screen should not dissappear.
|
---|
25 | * All filter chains must end in a FinalizerFilter or subclass
|
---|
26 | * and the exec method must not throw an Exception.
|
---|
27 | *
|
---|
28 | * @author Paul Hinds
|
---|
29 | * @version $Id: FinalizerFilter.java,v 1.3 2007/01/04 22:57:17 teknopaul Exp $
|
---|
30 | */
|
---|
31 | public class FinalizerFilter implements ExecuteFilter {
|
---|
32 |
|
---|
33 | // TODO as per FindBugs the System.exit(0) in SwingPageRenderer prevents this running
|
---|
34 | /**
|
---|
35 | * @see org.tp23.antinstaller.runtime.exe.ExecuteFilter#exec(org.tp23.antinstaller.InstallerContext)
|
---|
36 | */
|
---|
37 | public void exec(InstallerContext ctx){
|
---|
38 | try {
|
---|
39 | ctx.log("Finalizing");
|
---|
40 | ctx.getLogger().close();
|
---|
41 | }
|
---|
42 | catch (Throwable e) {
|
---|
43 | e.printStackTrace();
|
---|
44 | }
|
---|
45 | }
|
---|
46 |
|
---|
47 | }
|
---|