Package: UnableToSatisfyDependenciesException

UnableToSatisfyDependenciesException

nameinstructionbranchcomplexitylinemethod
UnableToSatisfyDependenciesException(String, String, Version, String)
M: 23 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
formatMessage(String, String, Version, String)
M: 26 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFailureDescription()
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getResolverErrors()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getState()
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSymbolicName()
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getVersion()
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2008, 2010 VMware Inc.
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: * VMware Inc. - initial contribution
10: *******************************************************************************/
11:
12: package org.eclipse.virgo.kernel.osgi.framework;
13:
14: import org.eclipse.osgi.service.resolver.ResolverError;
15: import org.eclipse.osgi.service.resolver.State;
16: import org.osgi.framework.Version;
17:
18: /**
19: * Signals an error resolving the dependencies of a bundle or library during installation.<p/>
20: *
21: * <strong>Concurrent Semantics</strong><br />
22: *
23: * Thread-safe.
24: *
25: */
26: @SuppressWarnings("serial")
27: public abstract class UnableToSatisfyDependenciesException extends Exception {
28:
29: private final String symbolicName;
30:
31: private final Version version;
32:
33: private final String failureDescription;
34:
35: /**
36: * Creates a new <code>UnableToSatisfyDependenciesException</code>.
37: *
38: * @param symbolicName the symbolic name of the entity that failed to install.
39: * @param version the version of the entity that failed to install.
40: * @param failureDescription the description of the dependency satisfaction problem.
41: */
42: protected UnableToSatisfyDependenciesException(String entity, String symbolicName, Version version, String failureDescription) {
43: super(formatMessage(entity, symbolicName, version, failureDescription));
44: this.symbolicName = symbolicName;
45: this.version = version;
46: this.failureDescription = failureDescription;
47: }
48:
49: /**
50: * @return the symbolic name of the entity that failed to install.
51: */
52: public String getSymbolicName() {
53: return this.symbolicName;
54: }
55:
56: /**
57: * @return the version of the entity that failed to install.
58: */
59: public Version getVersion() {
60: return this.version;
61: }
62:
63: /**
64: * @return the full description of the dependencies that could not be satisfied.
65: */
66: public String getFailureDescription() {
67: return this.failureDescription;
68: }
69:
70: /**
71: * Creates a formatted message to describe the dependency failure.
72: */
73: private static String formatMessage(String entity, String symbolicName, Version version, String failureDescription) {
74: return "Unable to satisfy dependencies of " + entity + " '" + symbolicName + "' at version '" + version + "': " + failureDescription;
75: }
76:
77: /**
78: * Get any {@link State} associated with this exception.
79: *
80: * @return either <code>null</code> or a <code>State</code>
81: */
82: public State getState() {
83: return null;
84: }
85:
86: /**
87: * Get any {@link ResolverError}s associated with this exception.
88: *
89: * @return either <code>null</code> or a possibly empty array of <code>ResolverError</code>s
90: */
91: public ResolverError[] getResolverErrors() {
92: return null;
93: }
94: }