Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f400e355f571402cd7abedf66e2997959e675bf5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*******************************************************************************
 * Copyright (c) 2007, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.equinox.internal.provisional.configuratormanipulator;

import java.io.File;
import java.io.IOException;
import org.eclipse.equinox.internal.provisional.frameworkadmin.*;

/**
 * 
 * This interface provides methods that enable client bundles to 
 * manipulate the corresponding ConfiguratorBundle.
 * 
 *  @see Configurator
 */

public interface ConfiguratorManipulator {
	String SERVICE_PROP_KEY_CONFIGURATOR_BUNDLESYMBOLICNAME = "org.eclipse.equinox.configurator.BundleSymbolicName";

	/**
	 * Save configuration for the corresponding Configurator Bundle so that 
	 * Bundles kept by the specified {@link Manipulator} would be installed after completion of a launch.
	 * The location of a configuration file is determined by the parameters set to the Manipulator object
	 * and it depends on the corresponding ConfiguratorBundle implementation.
	 * 
	 * While some parameters of the {@link Manipulator} object will be modified (for setting info about the 
	 * location the ConfiguratorBundle would be able to refer in a future launch), 
	 * the Bundles kept by the {@link Manipulator} object should not be modified.
	 * 
	 * Instead, it will return BundleInfo[] to be managed not by the ConfiguratorBundle.
	 * These values are supposed to be saved into fw config files.
	 * 
	 * If backup flag is true, a file have existed already under the same name
	 * will be renamed into another name as a backup. 
	 * 
	 * We assume that the implementation of {@link Manipulator#save(boolean)} will call this method.
	 *  
	 * @return array of BundleInfo to be saved as installing bundles in fw config files.
	 * @param manipulator {@link Manipulator} object which contains the bundles to be installed finally.
	 * @param backup if files exists at the location to save, it will be copied as a backup.
	 * @throws IOException - If fail to save configuration for the corresponding Configurator Bundle.
	 */
	BundleInfo[] save(Manipulator manipulator, boolean backup) throws IOException;

	/**
	 * Update bundles kept by the specified {@link Manipulator} object into installed bundles
	 * if {@link FrameworkAdmin#launch(Manipulator, File)} with the specified 
	 * {@link Manipulator} is called taking the corresponding ConfiguratorBundle behaivior into account.
	 * 
	 * If there is no corresponding ConfiguratorBundle in Manipulator.getConfigData().getBundles(),
	 * just return.
	 * 
	 * The BundleInfo[] of the specified Manipulator object will be modified.
	 *
	 * This method is assumed to be called from {@link Manipulator#load()}.
	 *  
	 * @param manipulator {@link Manipulator} object to be used and updated.
	 * @throws IOException - If fail to read configuration for the corresponding Configurator Bundle.
	 */
	void updateBundles(Manipulator manipulator) throws IOException;

	void cleanup(Manipulator manipulator);
}

Back to the top