KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > resolver > ResolverError


1 /*******************************************************************************
2  * Copyright (c) 2003, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.osgi.service.resolver;
12
13 /**
14  * ResolverErrors represent a single error that prevents a bundle from resolving
15  * in a <code>State</code> object.
16  * @since 3.2
17  */

18 public interface ResolverError {
19     /**
20      * Error type constant (bit mask) indicating that an Import-Package could
21      * not be resolved.
22      * @see ResolverError#getType()
23      */

24     public static final int MISSING_IMPORT_PACKAGE = 0x0001;
25     /**
26      * Error type constant (bit mask) indicating that a Require-Bundle could
27      * not be resolved.
28      * @see ResolverError#getType()
29      */

30     public static final int MISSING_REQUIRE_BUNDLE = 0x0002;
31     /**
32      * Error type constant (bit mask) indicating that a Fragment-Host could
33      * not be resolved.
34      * @see ResolverError#getType()
35      */

36     public static final int MISSING_FRAGMENT_HOST = 0x0004;
37     /**
38      * Error type constant (bit mask) indicating that the bundle could not
39      * be resolved because another singleton bundle was selected.
40      * @see ResolverError#getType()
41      */

42     public static final int SINGLETON_SELECTION = 0x0008;
43     /**
44      * Error type constant (bit mask) indicating that the bundle fragment
45      * could not be resolved because a constraint conflict with a host.
46      * @see ResolverError#getType()
47      */

48     public static final int FRAGMENT_CONFLICT = 0x0010;
49     /**
50      * Error type constant (bit mask) indicating that an Import-Package could
51      * not be resolved because of a uses directive conflict.
52      * @see ResolverError#getType()
53      */

54     public static final int IMPORT_PACKAGE_USES_CONFLICT = 0x0020;
55     /**
56      * Error type constant (bit mask) indicating that a Require-Bundle could
57      * not be resolved because of a uses directive conflict.
58      * @see ResolverError#getType()
59      */

60     public static final int REQUIRE_BUNDLE_USES_CONFLICT = 0x0040;
61     /**
62      * Error type constant (bit mask) indicating that an Import-Package could
63      * not be resolved because the importing bundle does not have the correct
64      * permissions to import the package.
65      * @see ResolverError#getType()
66      */

67     public static final int IMPORT_PACKAGE_PERMISSION = 0x0080;
68     /**
69      * Error type constant (bit mask) indicating that an Import-Package could
70      * not be resolved because no exporting bundle has the correct
71      * permissions to export the package.
72      * @see ResolverError#getType()
73      */

74     public static final int EXPORT_PACKAGE_PERMISSION = 0x0100;
75     /**
76      * Error type constant (bit mask) indicating that a Require-Bundle could
77      * not be resolved because the requiring bundle does not have the correct
78      * permissions to require the bundle.
79      * @see ResolverError#getType()
80      */

81     public static final int REQUIRE_BUNDLE_PERMISSION = 0x0200;
82     /**
83      * Error type constant (bit mask) indicating that a Require-Bundle could
84      * not be resolved because no bundle with the required symbolic name has
85      * the correct permissions to provied the required symbolic name.
86      * @see ResolverError#getType()
87      */

88     public static final int PROVIDE_BUNDLE_PERMISSION = 0x0400;
89     /**
90      * Error type constant (bit mask) indicating that a Fragment-Host could
91      * not be resolved because no bundle with the required symbolic name has
92      * the correct permissions to host a fragment.
93      * @see ResolverError#getType()
94      */

95     public static final int HOST_BUNDLE_PERMISSION = 0x0800;
96     /**
97      * Error type constant (bit mask) indicating that a Fragment-Host could
98      * not be resolved because the fragment bundle does not have the correct
99      * permissions to be a fragment.
100      * @see ResolverError#getType()
101      */

102     public static final int FRAGMENT_BUNDLE_PERMISSION = 0x1000;
103     /**
104      * Error type constant (bit mask) indicating that a bundle could not be
105      * resolved because a platform filter did not match the runtime environment.
106      * @see ResolverError#getType()
107      */

108     public static final int PLATFORM_FILTER = 0x2000;
109
110     /**
111      * Error type constant (bit mask) indicating that a bundle could not be
112      * resolved because the required execution enviroment did not match the runtime
113      * environment.
114      * @see ResolverError#getType()
115      */

116     public static final int MISSING_EXECUTION_ENVIRONMENT = 0x4000;
117
118     /**
119      * Error type constant (bit mask) indicating that a bundle could not be
120      * resolved because the required generic capability could not be resolved.
121      */

122     public static final int MISSING_GENERIC_CAPABILITY = 0x8000;
123
124     /**
125      * Returns the bundle which this ResolverError is for
126      * @return the bundle which this ResolverError is for
127      */

128     public BundleDescription getBundle();
129
130     /**
131      * Returns the type of ResolverError this is
132      * @return the type of ResolverError this is
133      */

134     public int getType();
135
136     /**
137      * Returns non-translatable data associated with this ResolverError.
138      * For example, the data for a ResolverError of type MISSING_IMPORT_PACKAGE
139      * could be the Import-Package manifest statement which did not resolve.
140      * @return non-translatable data associated with this ResolverError
141      */

142     public String JavaDoc getData();
143
144     /**
145      * Returns the unsatisfied constraint if this ResolverError occurred
146      * because of an unsatisfied constraint; otherwise <code>null</code>
147      * is returned.
148      * @return the unsatisfied constraint or <code>null</code>.
149      */

150     public VersionConstraint getUnsatisfiedConstraint();
151 }
152
Popular Tags