You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2012/09/21 02:42:58 UTC
svn commit: r1388283 - in /geronimo/server/branches/3.0/framework/modules:
geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/
geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/
geronimo-deploy-tool/src/main/java/org/apa...
Author: gawor
Date: Fri Sep 21 00:42:57 2012
New Revision: 1388283
URL: http://svn.apache.org/viewvc?rev=1388283&view=rev
Log:
GERONIMO-5764: Change how bundles installed via install-bundle command are tracked and started
Modified:
geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java
geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/Utils.java
geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandArgsImpl.java
geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandMetaData.java
geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/UninstallBundleCommandMetaData.java
geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandInstallBundle.java
geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandUninstallBundle.java
geronimo/server/branches/3.0/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
geronimo/server/branches/3.0/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/BundleRecorderGBean.java Fri Sep 21 00:42:57 2012
@@ -16,11 +16,10 @@
*/
package org.apache.geronimo.system.bundle;
+import java.io.BufferedReader;
import java.io.File;
-import java.io.FileInputStream;
+import java.io.FileReader;
import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
import org.apache.geronimo.common.DeploymentException;
import org.apache.geronimo.gbean.annotation.GBean;
@@ -32,8 +31,10 @@ import org.apache.geronimo.kernel.reposi
import org.apache.geronimo.kernel.repository.WritableListableRepository;
import org.apache.geronimo.kernel.util.FileUtils;
import org.apache.geronimo.kernel.util.IOUtils;
+import org.apache.geronimo.system.main.ServerStatus;
import org.apache.geronimo.system.plugin.PluginInstallerGBean;
import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@@ -43,7 +44,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@GBean
-public class BundleRecorderGBean implements BundleRecorder{
+public class BundleRecorderGBean implements BundleRecorder, ServerStatus {
private static final Logger log = LoggerFactory.getLogger(BundleRecorderGBean.class);
@@ -57,10 +58,11 @@ public class BundleRecorderGBean impleme
private File startupFile;
public BundleRecorderGBean(@ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
- @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
- @ParamReference(name = "ServerInfo") final ServerInfo serverInfo,
- @ParamReference(name = "PluginInstallerGBean")PluginInstallerGBean installer,
- @ParamReference(name = "Repository", namingType = "Repository") WritableListableRepository repository) throws DeploymentException, IOException {
+ @ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
+ @ParamReference(name = "ServerInfo") final ServerInfo serverInfo,
+ @ParamReference(name = "PluginInstallerGBean")PluginInstallerGBean installer,
+ @ParamReference(name = "Repository", namingType = "Repository") WritableListableRepository repository)
+ throws DeploymentException, IOException {
bundleContext = bundle.getBundleContext();
startLevelService = getStartLevelService(bundleContext);
@@ -69,33 +71,27 @@ public class BundleRecorderGBean impleme
pluginInstaller = installer;
writeableRepo = repository;
- startupFile = serverInfo.resolveServer("etc/startup.properties");
- if(!startupFile.exists() || !startupFile.isFile() || !startupFile.canRead()) {
- throw new IllegalArgumentException("startup.properties file does not exist or not a normal file or not readable. " + startupFile);
- }
-
-
+ startupFile = serverInfo.resolveServer("etc/installed-bundles.properties");
}
private StartLevel getStartLevelService(BundleContext bundleContext){
ServiceReference startLevelRef = bundleContext.getServiceReference(StartLevel.class.getCanonicalName());
return (StartLevel) bundleContext.getService(startLevelRef);
}
-
+
/**
* install the bundle to framework
* @param location
* @param startLevel
* @return the bundle object of the installed bundle. null if install failed.
*/
- private Bundle installBundleRecord(String location, int startLevel) {
-
+ private Bundle installBundle(String location, int startLevel) {
try {
// install
Bundle installedBundle = bundleContext.installBundle(location);
// set start level
startLevelService.setBundleStartLevel(installedBundle, startLevel);
-
+
return installedBundle;
} catch (BundleException e) {
log.error("Bundle installation failed: " + location);
@@ -104,6 +100,24 @@ public class BundleRecorderGBean impleme
return null;
}
+ private void startBundle(Bundle bundle) {
+ if (BundleUtils.canStart(bundle)) {
+ try {
+ bundle.start(Bundle.START_TRANSIENT);
+ } catch (BundleException e) {
+ log.error("Bundle " + bundle.getBundleId() + " failed to start: " + e.getMessage());
+ }
+ }
+ }
+
+ private void uninstallBundle(Bundle bundle) {
+ try {
+ bundle.uninstall();
+ } catch (BundleException e) {
+ log.error("Bundle " + bundle.getBundleId() + " failed to uninstall: " + e.getMessage());
+ }
+ }
+
@Override
public long recordInstall(File bundleFile, String groupId, int startLevel) throws IOException{
if (bundleFile == null || bundleFile.isDirectory()) {
@@ -117,35 +131,24 @@ public class BundleRecorderGBean impleme
// 2. install the bundle
String bundleLocation = getMvnLocationFromArtifact(artifact);
- if (startLevel <= 0){
+ if (startLevel <= 0) {
log.info("Invalid start level or no start level specified, use defalut bundle start level");
startLevel = defaultBundleStartLevel;
}
- Bundle bundle = this.installBundleRecord(bundleLocation, startLevel);
+ Bundle bundle = installBundle(bundleLocation, startLevel);
if (bundle == null) return -1;
// 3. record in startup.properties
- String recordKey = getRecordKey(artifact);
+ String recordKey = artifact.toString();
- Properties startupBundles = new Properties();
- InputStream is = null;
- try{
- is = new FileInputStream(startupFile);
- startupBundles.load(is);
- if (startupBundles.containsKey(recordKey.toString())) { // check if we have recorded this
- log.warn("This bundle has been recorded in startup.properties: "+ recordKey);
- } else {
- // record it
- Utils.appendLine(startupFile, recordKey+"="+String.valueOf(startLevel));
- }
- }finally{
- if (is!=null)
- IOUtils.close(is);
+ if (!startupFile.exists() || Utils.findLineByKeyword(startupFile, recordKey) == null) {
+ Utils.appendLine(startupFile, recordKey+"="+String.valueOf(startLevel));
+ } else {
+ log.warn("The bundle has been recorded: " + recordKey);
}
-
+
return bundle.getBundleId();
-
}
@Override
@@ -153,18 +156,20 @@ public class BundleRecorderGBean impleme
// uninstall bundle
Bundle bundle = bundleContext.getBundle(bundleId);
- String bundleLocation = bundle.getLocation();
- try {
- bundle.uninstall();
- } catch (BundleException e) {
- log.error("Bundle uninstallation failed: " + bundleLocation);
+ if (bundle == null) {
+ return;
}
+ uninstallBundle(bundle);
+
+ String bundleLocation = bundle.getLocation();
Artifact artifact = getArtifactFromMvnLocation(bundleLocation);
- if (artifact == null) return;
- String recordKey = getRecordKey(artifact);
- if (recordKey == null) return;
- if (Utils.findLineByKeyword(startupFile, recordKey) != null){
+ if (artifact == null) {
+ return;
+ }
+
+ String recordKey = artifact.toString();
+ if (Utils.findLineByKeyword(startupFile, recordKey) != null) {
// erase from startup.properties
Utils.deleteLineByKeyword(startupFile, recordKey);
@@ -179,12 +184,9 @@ public class BundleRecorderGBean impleme
FileUtils.recursiveDelete(versionFolder); // try delete the version folder recursively
Utils.regressiveDelete(artifactFolder); // try delete the parent folder if it is empty
- }
-
+ }
}
-
-
private String getMvnLocationFromArtifact(Artifact artifact){
if (artifact == null) return null;
@@ -208,21 +210,9 @@ public class BundleRecorderGBean impleme
String version = parts[2];
String type = "jar";
- return new Artifact(groupId, artifactId, version, type);
-
+ return new Artifact(groupId, artifactId, version, type);
}
-
- private String getRecordKey(Artifact artifact) {
- if (artifact == null) return null;
-
- StringBuilder recordKey = new StringBuilder();
- recordKey.append(artifact.getGroupId().replace(".", "/")).append('/').append(artifact.getArtifactId()).append('/').append(artifact.getVersion());
- recordKey.append("/");
- recordKey.append(artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType());
- return recordKey.toString();
- }
-
@Override
public long getBundleId(String symbolicName, String version) {
for (Bundle bundle : bundleContext.getBundles()) {
@@ -232,4 +222,57 @@ public class BundleRecorderGBean impleme
}
return -1;
}
+
+ @Override
+ public boolean isServerStarted() {
+ return false;
+ }
+
+ @Override
+ public void setServerStarted(boolean started) {
+ if (!startupFile.exists()) {
+ return;
+ }
+
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new FileReader(startupFile));
+ String line = null;
+ while (( line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith("#")) {
+ continue;
+ }
+
+ int pos = line.indexOf("=");
+ if (pos != -1) {
+ String name = line.substring(0, pos).trim();
+ String startLevel = line.substring(pos + 1).trim();
+
+ String mvnLocation = getMvnLocationFromArtifact(Artifact.create(name));
+ Bundle bundle = findBundle(mvnLocation);
+ if (bundle == null) {
+ bundle = installBundle(mvnLocation, Integer.parseInt(startLevel));
+ if (bundle == null) {
+ continue;
+ }
+ }
+ startBundle(bundle);
+ }
+ }
+ } catch (Exception e) {
+ log.error("Error reading file", e);
+ } finally {
+ IOUtils.close(reader);
+ }
+ }
+
+ private Bundle findBundle(String location) {
+ for (Bundle bundle : bundleContext.getBundles()) {
+ if (location.equals(bundle.getLocation())) {
+ return bundle;
+ }
+ }
+ return null;
+ }
}
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/Utils.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/Utils.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/Utils.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-bundle-recorder/src/main/java/org/apache/geronimo/system/bundle/Utils.java Fri Sep 21 00:42:57 2012
@@ -106,18 +106,20 @@ public class Utils {
try {
reader = new BufferedReader(new FileReader(file));
String line = null;
- while (( line = reader.readLine()) != null){
- if (line.startsWith("#")) continue;
+ while (( line = reader.readLine()) != null) {
+ line = line.trim();
+ if (line.startsWith("#")) {
+ continue;
+ }
- if (line.contains(keyword)) return line;
- }
-
+ if (line.startsWith(keyword)) {
+ return line;
+ }
+ }
} finally {
IOUtils.close(reader);
- }
-
- return null;
-
+ }
+ return null;
}
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandArgsImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandArgsImpl.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandArgsImpl.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandArgsImpl.java Fri Sep 21 00:42:57 2012
@@ -61,7 +61,7 @@ public class InstallBundleCommandArgsImp
options.addOption(ARGUMENT_START_SHORTFORM,
ARGUMENT_START,
false,
- "If start is provided, the bundle will be automatically started after recorded in Geronimo.");
+ "If start open is specified the bundle will be automatically started after installation.");
}
protected void addStartLevel() {
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandMetaData.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandMetaData.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandMetaData.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/InstallBundleCommandMetaData.java Fri Sep 21 00:42:57 2012
@@ -25,10 +25,9 @@ public class InstallBundleCommandMetaDat
super("install-bundle",
"2. Other Commands",
"[--groupId groupId] [--startLevel number] [--start] bundleFile",
- "Install and record an OSGi bundle file in Geronimo so that it can be automatically started " +
- "even after you cleaned the cache directory of the OSGi framework.\n" +
- "If the file is a normal jar file, then will automatically try convert the jar file to an OSGi bundle.\n" +
- "The Artifact will be calculated based on the rules which same with the install-library command, that is:\n" +
+ "Install an OSGi bundle. The bundle will be installed into the repository directory.\n" +
+ "If the bundle file is not a OSGi bundle then OSGi manifest will automatically be generated.\n" +
+ "The bundle's artiface name will be calculated based on the following rules:\n" +
"(1) a file with filename in the form <artifact>-<version>.<type>, for e.g. mylib-1.0.jar;\n"+
"(2) or if it is an OSGi bundle, will use its Bundle-SymbolicName and Bundle-Version."
);
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/UninstallBundleCommandMetaData.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/UninstallBundleCommandMetaData.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/UninstallBundleCommandMetaData.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/UninstallBundleCommandMetaData.java Fri Sep 21 00:42:57 2012
@@ -25,7 +25,7 @@ public class UninstallBundleCommandMetaD
super("uninstall-bundle",
"2. Other Commands",
"bundleId",
- "Uninstall the bundle and erase its record if it appears in startup.properties."
+ "Uninstall an OSGi bundle. The uninstalled bundle will be removed from the repository."
);
}
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandInstallBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandInstallBundle.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandInstallBundle.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandInstallBundle.java Fri Sep 21 00:42:57 2012
@@ -56,7 +56,7 @@ public class CommandInstallBundle extend
try {
long bundleId = mgr.recordInstall(bundleFile, groupId, startLevel);
if ( bundleId > 0 ){
- consoleReader.printString(DeployUtils.reformat("Installed and recorded bundle: " + bundleId, 4, 72));
+ consoleReader.printString(DeployUtils.reformat("Installed bundle: " + bundleId, 4, 72));
if (start){
if(mgr instanceof RemoteDeploymentManager) {
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandUninstallBundle.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandUninstallBundle.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandUninstallBundle.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/CommandUninstallBundle.java Fri Sep 21 00:42:57 2012
@@ -36,10 +36,10 @@ public class CommandUninstallBundle exte
GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
try {
mgr.eraseUninstall(bundleId);
- consoleReader.printString(DeployUtils.reformat("Uninstalled and erased bundle: " + bundleId, 4, 72));
+ consoleReader.printString(DeployUtils.reformat("Uninstalled bundle: " + bundleId, 4, 72));
} catch (Exception e) {
- throw new DeploymentException("Unable to erase bundle: " + bundleId, e);
+ throw new DeploymentException("Unable to uninstall bundle: " + bundleId, e);
}
} else {
throw new DeploymentException("Unable to uninstall bundle using " + dmgr.getClass().getName() + " deployment manager");
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java Fri Sep 21 00:42:57 2012
@@ -27,6 +27,7 @@ import java.net.URLClassLoader;
import java.security.Provider;
import java.security.Security;
import java.util.ArrayList;
+import java.util.Dictionary;
import java.util.Enumeration;
import java.util.List;
import java.util.Map.Entry;
@@ -40,7 +41,6 @@ import org.osgi.framework.Constants;
import org.osgi.framework.FrameworkEvent;
import org.osgi.framework.launch.Framework;
import org.osgi.framework.launch.FrameworkFactory;
-import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.service.startlevel.StartLevel;
public class FrameworkLauncher {
@@ -399,17 +399,18 @@ public class FrameworkLauncher {
info.bundle = bundle;
}
-
- // Retrieve the PackageAdmin service
- PackageAdmin pa = (PackageAdmin) context.getService(context.getServiceReference(PackageAdmin.class.getName()));
-
for (BundleInfo info : startList) {
- if (pa.getBundleType(info.bundle) != PackageAdmin.BUNDLE_TYPE_FRAGMENT) { //Fragment bundle can not start
+ if (!isFragment(info.bundle)) {
info.bundle.start();
}
}
}
+
+ private static boolean isFragment(Bundle bundle) {
+ Dictionary<String, String> headers = bundle.getHeaders();
+ return (headers != null && headers.get(Constants.FRAGMENT_HOST) != null);
+ }
private List<BundleInfo> loadStartupProperties() throws Exception {
File etc = new File(geronimoBase, "etc");
Modified: geronimo/server/branches/3.0/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?rev=1388283&r1=1388282&r2=1388283&view=diff
==============================================================================
--- geronimo/server/branches/3.0/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java (original)
+++ geronimo/server/branches/3.0/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java Fri Sep 21 00:42:57 2012
@@ -38,21 +38,16 @@ import org.apache.geronimo.kernel.config
import org.apache.geronimo.kernel.config.ConfigurationModuleType;
import org.apache.geronimo.kernel.config.ConfigurationUtil;
import org.apache.geronimo.kernel.config.DebugLoggingLifecycleMonitor;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
import org.apache.geronimo.kernel.config.LifecycleMonitor;
import org.apache.geronimo.kernel.config.PersistentConfigurationList;
import org.apache.geronimo.kernel.repository.Artifact;
import org.apache.geronimo.kernel.util.FileUtils;
import org.apache.geronimo.kernel.util.Main;
-import org.apache.xbean.osgi.bundle.util.BundleUtils;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-
-
/**
* @version $Rev:385659 $ $Date: 2007-03-07 14:40:07 +1100 (Wed, 07 Mar 2007) $
*/
@@ -320,22 +315,7 @@ public class EmbeddedDaemon implements M
e.printStackTrace();
return 1;
}
-
- // Because currently we start Geronimo bundles out of the osgi framework life cycle,
- // so there might be some bundles, which depends on geronimo bundles, can not be resovled during osgi framework launch.
- // we need re-try start it after geronimo start.
- // This could be deleted after we smooth out geronimo life cycle with osgi.
- for (Bundle b : bundle.getBundleContext().getBundles()) {
- if (BundleUtils.canStart(b)) {
- try {
- b.start(Bundle.START_TRANSIENT);
- } catch (BundleException e) {
- log.warn("Bundle " + bundle.getBundleId() + " failed to start: " + e.getMessage());
- }
- }
- }
-
-
+
return 0;
}