Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 11fdd1195e5b1a3905e48283c208e31d765a83c5 (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
/*******************************************************************************
 * Copyright (c) 2009 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.p2.core;

import java.net.URI;

/**
 * An OSGi service that is used to create or obtain instances of an
 * {@link IProvisioningAgent}.
 * @since 2.0
 */
public interface IProvisioningAgentProvider {

	/**
	 * Service name constant for the agent provider service.
	 */
	public static final String SERVICE_NAME = IProvisioningAgentProvider.class.getName();

	/**
	 * Creates a provisioning agent who metadata is stored at the given location.
	 * If a <code>null</code> location is provided, the provisioning agent for the 
	 * currently running system is returned, if available. If a <code>null</code>
	 * location is provided and the currently running system has not been provisioned
	 * by any known agent, <code>null</code> is returned.
	 * <p>
	 * Callers of this method are responsible for stopping the agent
	 * when they are finished using it by invoking {@link IProvisioningAgent#stop()}.
	 * </p>
	 * @param location The location where the agent metadata is stored
	 * @return A provisioning agent, or <code>null</code> if a <code>null</code>
	 * parameter is provided and there is no currently running agent.
	 * @throws ProvisionException If agent creation failed. Reasons include:
	 * <ul>
	 * <li>The location is not writeable.</li>
	 * </ul>
	 * @see IProvisioningAgent#stop()
	 */
	public IProvisioningAgent createAgent(URI location) throws ProvisionException;
}

Back to the top