blob: 8124a2cccb3741e7a615c08c98e1a83fd56e569e [file] [log] [blame]
Richard S. Halla2dc4512006-04-04 13:17:11 +00001/*
2 * $Header: /cvshome/build/org.osgi.service.obr/src/org/osgi/service/obr/Resolver.java,v 1.3 2006/03/16 14:56:17 hargrave Exp $
3 *
4 * Copyright (c) OSGi Alliance (2006). All Rights Reserved.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19// This document is an experimental draft to enable interoperability
20// between bundle repositories. There is currently no commitment to
21// turn this draft into an official specification.
22package org.osgi.service.obr;
23
24public interface Resolver
25{
26
Guillaume Nodetcd87ae52010-02-21 14:08:56 +000027 /**
28 * Add the following resource to the resolution.
29 *
30 * The resource will be part of the output and all its requirements
31 * will be satisfied.
32 *
33 * It has the same effect has adding a requirement that will match
34 * this resource by symbolicname and version.
35 *
36 * The current resolution will be lost after adding a resource.
37 *
38 * @param resource the resource to add
39 */
Richard S. Halla2dc4512006-04-04 13:17:11 +000040 void add(Resource resource);
41
Guillaume Nodetcd87ae52010-02-21 14:08:56 +000042 /**
43 * Returns the list of resources that have been added to the resolution
44 * @return
45 */
46 Resource[] getAddedResources();
47
48 /**
49 * Add the following requirement to the resolution
50 *
51 * The current resolution will be lost after adding a requirement.
52 *
53 * @param requirement the requirement to add
54 */
55 void add(Requirement requirement);
56
57 /**
58 * Returns the list of requirements that have been added to the resolution
59 * @return
60 */
61 Requirement[] getAddedRequirements();
62
Richard S. Halla2dc4512006-04-04 13:17:11 +000063 Requirement[] getUnsatisfiedRequirements();
64
65 Resource[] getOptionalResources();
66
67 Requirement[] getReason(Resource resource);
68
69 Resource[] getResources(Requirement requirement);
70
71 Resource[] getRequiredResources();
72
Guillaume Nodeta6f375e2010-02-22 12:48:42 +000073 /**
74 * Start the resolution process and return whether the constraints have
75 * been successfully met or not.
76 * The resolution can be interrupted by a call to Thread.interrupt() at any
77 * time. The result will be to stop the resolver and throw an InterruptedException.
78 *
79 * @return <code>true</code> if the resolution has succeeded else <code>false</code>
Richard S. Hall9c28c1d2010-02-23 05:03:47 +000080 * @throws InterruptedResolutionException if the resolution has been interrupted
Guillaume Nodeta6f375e2010-02-22 12:48:42 +000081 */
Richard S. Halla2dc4512006-04-04 13:17:11 +000082 boolean resolve();
83
84 void deploy(boolean start);
85}