Minor deployment admin fixes:
- Typo in event-property successful
- Typo in deploymentpackage header DeploymentPackage-Customizer
- DeploymentPackageManifest validation now picks up on missing Bundle-Version headers for bundle resources
- ProcessResource command now asks for the right resources
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@629830 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
index 6dfc5fd..73a866d 100644
--- a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
+++ b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
@@ -53,13 +53,16 @@
}
String version = attributes.getValue(org.osgi.framework.Constants.BUNDLE_VERSION);
+ if (version == null || version == "") {
+ throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Invalid '" + org.osgi.framework.Constants.BUNDLE_VERSION + "' header for manifest entry '" + getPath() + "'");
+ }
try {
m_version = Version.parseVersion(version);
} catch (IllegalArgumentException e) {
throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Invalid '" + org.osgi.framework.Constants.BUNDLE_VERSION + "' header for manifest entry '" + getPath() + "'");
}
- m_customizer = parseBooleanHeader(attributes, Constants.DEPLOYMENTPACKAGE_CUSTOMISER);
+ m_customizer = parseBooleanHeader(attributes, Constants.DEPLOYMENTPACKAGE_CUSTOMIZER);
}
public String getSymbolicName() {
diff --git a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Constants.java b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Constants.java
index e0f0b1d..1713973 100644
--- a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Constants.java
+++ b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/Constants.java
@@ -28,14 +28,14 @@
// manifest 'name' section header constants
public static final String RESOURCE_PROCESSOR = "Resource-Processor";
public static final String DEPLOYMENTPACKAGE_MISSING = "DeploymentPackage-Missing";
- public static final String DEPLOYMENTPACKAGE_CUSTOMISER = "DeploymentPackage-Customiser";
+ public static final String DEPLOYMENTPACKAGE_CUSTOMIZER = "DeploymentPackage-Customizer";
// event topics and properties
public static final String EVENTTOPIC_INSTALL = "org/osgi/service/deployment/INSTALL";
public static final String EVENTTOPIC_UNINSTALL = "org/osgi/service/deployment/UNINSTALL";
public static final String EVENTTOPIC_COMPLETE = "org/osgi/service/deployment/COMPLETE";
public static final String EVENTPROPERTY_DEPLOYMENTPACKAGE_NAME = "deploymentpackage.name";
- public static final String EVENTPROPERTY_SUCCESFULL = "succesfull";
+ public static final String EVENTPROPERTY_SUCCESFUL = "succesful";
// miscellaneous constants
public static final String BUNDLE_LOCATION_PREFIX = "osgi-dp:";
diff --git a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/DeploymentAdminImpl.java b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/DeploymentAdminImpl.java
index 9f78dc3..ace0dbb 100644
--- a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/DeploymentAdminImpl.java
+++ b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/DeploymentAdminImpl.java
@@ -313,7 +313,7 @@
private void sendCompleteEvent(String name, boolean success) {
Dictionary props = new Properties();
props.put(Constants.EVENTPROPERTY_DEPLOYMENTPACKAGE_NAME, name);
- props.put(Constants.EVENTPROPERTY_SUCCESFULL, String.valueOf(success));
+ props.put(Constants.EVENTPROPERTY_SUCCESFUL, String.valueOf(success));
Event completeEvent = new Event(Constants.EVENTTOPIC_COMPLETE, props);
m_eventAdmin.postEvent(completeEvent);
}
diff --git a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/ProcessResourceCommand.java b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/ProcessResourceCommand.java
index 7389e54..97f3bb9 100644
--- a/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/ProcessResourceCommand.java
+++ b/deploymentadmin/src/main/java/org/apache/felix/deploymentadmin/spi/ProcessResourceCommand.java
@@ -57,7 +57,7 @@
BundleContext context = session.getBundleContext();
Map expectedResources = new HashMap();
- AbstractInfo[] resourceInfos = (AbstractInfo[]) source.getBundleInfos();
+ AbstractInfo[] resourceInfos = (AbstractInfo[]) source.getResourceInfos();
for (int i = 0; i < resourceInfos.length; i++) {
AbstractInfo resourceInfo = resourceInfos[i];
if(!resourceInfo.isMissing()) {