diff options
author | afinkbein | 2010-05-15 18:32:28 +0000 |
---|---|---|
committer | afinkbein | 2010-05-15 18:32:28 +0000 |
commit | d4da6979e39c7442f4d207e2295c84fac0dcca59 (patch) | |
tree | 4c5e9217d7243bd9ac162308f3e7fded261368f2 | |
parent | 716f00a9c9079cbab0554aeda9e1e334f7ffb590 (diff) | |
download | org.eclipse.osee-d4da6979e39c7442f4d207e2295c84fac0dcca59.tar.gz org.eclipse.osee-d4da6979e39c7442f4d207e2295c84fac0dcca59.tar.xz org.eclipse.osee-d4da6979e39c7442f4d207e2295c84fac0dcca59.zip |
Changes to remove the MpRuntimeConfiguration reflection
5 files changed, 1 insertions, 150 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java index f810c68011a..8abde027c8a 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironment.java @@ -128,7 +128,6 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest this.factory = factory; this.testStation = factory.getTestStation(); this.runtimeManager = factory.getRuntimeManager(); - this.runtimeManager.addRuntimeLibraryListener(Activator.getInstance()); this.associatedObjectListeners = new HashMap<Class<?>, ArrayList<IAssociatedObjectListener>>(); this.associatedObjects = new HashMap<Class<?>, Object>(100); @@ -414,7 +413,6 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest } isShutdown = true; runtimeManager.cleanup(); - runtimeManager.removeRuntimeLibraryListener(Activator.getInstance()); Activator.getInstance().unregisterTestEnvironment(); // here we remove all environment tasks (emulators) removeAllTasks(); @@ -544,18 +542,6 @@ public abstract class TestEnvironment implements TestEnvironmentInterface, ITest return connector; } - // public void setConnector(IServiceConnector connector) { - // this.connector = connector; - // } - - public void setupClassLoaderAndJar(String[] jarVersions, String classPath) throws Exception { - setupClassLoaderAndJar(jarVersions, new String[] {classPath}); - } - - public void setupClassLoaderAndJar(String[] jarVersions, String[] classPaths) throws Exception { - getRuntimeManager().setupClassLoaderAndJar(jarVersions, classPaths); - } - @Deprecated public void setEnvSetup(boolean isEnvSetup) { this.isEnvSetup = isEnvSetup; diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironmentInterface.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironmentInterface.java index 04b425d8b68..e6ab6e3596b 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironmentInterface.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TestEnvironmentInterface.java @@ -78,8 +78,6 @@ public interface TestEnvironmentInterface { public Remote getControlInterface(String id) ;
public void registerControlInterface(String id, Remote controlInterface) ;
public IServiceConnector getConnector() ;
- public void setupClassLoaderAndJar(String[] jarVersions, String classPath) throws Exception ; - public void setupClassLoaderAndJar(String[] jarVersions, String[] classPaths) throws Exception ; public IEnvironmentFactory getEnvironmentFactory(); public void initializationThreadAdd(Callable callable); }
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/AbstractRuntimeManager.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/AbstractRuntimeManager.java index d378c2d533d..70478383de8 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/AbstractRuntimeManager.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/AbstractRuntimeManager.java @@ -382,58 +382,6 @@ public class AbstractRuntimeManager implements IRuntimeLibraryManager { return jarCache; } - public final boolean setupClassLoaderAndJar(String[] jarVersions, String[] classpaths) throws Exception { - return configureMessages(jarVersions, classpaths); - - } - - private boolean configureMessages(String[] jarVersions, String[] classpaths) throws IOException, BundleException { - - if (!checkCurrentJarVersions(jarVersions).getStatus()) { - if (runtimeLibraryLoader != null) { - onRuntimeUnloaded(); - } - currentJarVersions = jarVersions; - Arrays.sort(currentJarVersions); - runtimeLibraryLoader = getClassLoader(jarVersions); - scriptClassLoader = - new OseeURLClassLoader("Script ClassLoader", Lib.getUrlFromString(classpaths), this.runtimeLibraryLoader); - onRuntimeLoaded(); - return true; - } - - // NOTE cheap fix here.... we need to do this the right way so that the classpaths can get - // updated.... look at resetScriptClassloader - scriptClassLoader = - new OseeURLClassLoader("Script ClassLoader", Lib.getUrlFromString(classpaths), this.runtimeLibraryLoader); - return false; - } - - /** - * @deprecated - */ - @Deprecated - @Override - public void onRuntimeLoaded() { - for (RuntimeLibraryListener listener : listeners) { - if (scriptClassLoader == null) { - listener.onPostRuntimeLibraryUpdated(ExportClassLoader.getInstance()); - } else { - listener.onPostRuntimeLibraryUpdated(scriptClassLoader); - } - } - } - - /** - * @deprecated - */ - @Deprecated - @Override - public void onRuntimeUnloaded() { - for (RuntimeLibraryListener listener : listeners) { - listener.onRuntimeLibraryUnload(); - } - } /** * @throws BundleException @@ -592,12 +540,6 @@ public class AbstractRuntimeManager implements IRuntimeLibraryManager { } cleanUpNeeded = false; - try { - onRuntimeUnloaded(); - } catch (Throwable th) { - OseeLog.log(AbstractRuntimeManager.class, Level.SEVERE, th); - } - for (Bundle bundle : installedBundles) { try { diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IRuntimeLibraryManager.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IRuntimeLibraryManager.java index 2855940b2c6..fbcd2252e69 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IRuntimeLibraryManager.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/interfaces/IRuntimeLibraryManager.java @@ -30,15 +30,6 @@ public interface IRuntimeLibraryManager extends Xmlizable { ReturnStatus isRunningJarVersions(String[] versions);
- /**
- * Sets up the class loader
- *
- * @param jarVersions
- * @param classPaths
- * @return true if there is no change in class loader configuration
- * @throws Exception
- */
- boolean setupClassLoaderAndJar(String[] jarVersions, String[] classPaths) throws Exception;
void addRuntimeLibraryListener(RuntimeLibraryListener listener);
@@ -66,19 +57,4 @@ public interface IRuntimeLibraryManager extends Xmlizable { void cleanup();
- /**
- * This will be replaced by using OSGi bundles and services in the future
- *
- * @deprecated
- */
- @Deprecated
- void onRuntimeUnloaded();
-
- /**
- * This will be replaced by using OSGi bundles and services in the future
- *
- * @deprecated
- */
- @Deprecated
- void onRuntimeLoaded();
}
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/internal/Activator.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/internal/Activator.java index f139a33466c..4716330ad6f 100644 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/internal/Activator.java +++ b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/internal/Activator.java @@ -13,11 +13,9 @@ package org.eclipse.osee.ote.core.internal; import java.util.ArrayList; import java.util.Hashtable; import java.util.List; -import java.util.logging.Level; import org.eclipse.osee.framework.core.util.ServiceDependencyTracker; import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; -import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.ote.core.OteProperties; import org.eclipse.osee.ote.core.StandardShell; import org.eclipse.osee.ote.core.cmd.CommandDistributer; @@ -27,7 +25,6 @@ import org.eclipse.osee.ote.core.environment.TestEnvironmentInterface; import org.eclipse.osee.ote.core.environment.console.ConsoleCommandManager; import org.eclipse.osee.ote.core.environment.console.ICommandManager; import org.eclipse.osee.ote.core.environment.interfaces.RuntimeConfigurationInitilizer; -import org.eclipse.osee.ote.core.environment.interfaces.RuntimeLibraryListener; import org.eclipse.osee.ote.core.environment.status.OTEStatusBoard; import org.eclipse.osee.ote.core.environment.status.StatusBoard; import org.osgi.framework.BundleActivator; @@ -40,7 +37,7 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer; * @author Andrew M. Finkbeiner * @author Ryan D. Brooks */
-public class Activator implements BundleActivator, RuntimeLibraryListener {
+public class Activator implements BundleActivator {
private ServiceRegistration statusBoardRegistration; private ServiceRegistration testEnvironmentRegistration; @@ -48,7 +45,6 @@ public class Activator implements BundleActivator, RuntimeLibraryListener { CommandDistributer commandDistributer; private static Activator activator; private BundleContext bundleContext; - private List<RuntimeConfigurationInitilizer> initializersToUninitialize = new ArrayList<RuntimeConfigurationInitilizer>(); private CompositeKeyHashMap<String, ServiceTrackerCustomizer, ServiceTracker> serviceTrackers = new CompositeKeyHashMap<String, ServiceTrackerCustomizer, ServiceTracker>(); private ConsoleCommandManager consoleCommandManager; private StandardShell stdShell; @@ -83,7 +79,6 @@ private ServiceDependencyTracker serviceDependencyTracker; closeAllValidServiceTrackers(); statusBoardRegistration.unregister(); unregisterTestEnvironment(); - stopRuntimeServices(); if (stdShell != null) { stdShell.shutdown(); } @@ -112,52 +107,6 @@ private ServiceDependencyTracker serviceDependencyTracker; testEnvironmentRegistration = bundleContext.registerService(TestEnvironmentInterface.class.getName(), env, new Hashtable()); } - public void onPostRuntimeLibraryUpdated(ClassLoader classloader) { - TestEnvironmentInterface env; - try { - env = (TestEnvironmentInterface)getServiceTracker(TestEnvironmentInterface.class.getName(), null).waitForService(2000); - } catch (InterruptedException ex1) { - throw new IllegalStateException("interrupted while waiting for service", ex1); - } - if (env == null) { - throw new IllegalStateException("Unable to acquire test environment service"); - } - Class<? extends RuntimeConfigurationInitilizer> clazz = env.getEnvironmentFactory().getRuntimeClass(); - if (clazz == null) { - String className = env.getEnvironmentFactory().getRuntimeLibraryConfiguration(); - if(System.getProperty("ote.runtime.config.class") != null){ - className = System.getProperty("ote.runtime.config.class"); - } - try { - clazz = (Class<? extends RuntimeConfigurationInitilizer>)classloader.loadClass(className).asSubclass(RuntimeConfigurationInitilizer.class); - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, "Could not use reflection to load runtime configuration class", ex); - return; - } - } - try { - RuntimeConfigurationInitilizer initilizer = clazz.newInstance(); - initializersToUninitialize.add(initilizer); - initilizer.startRuntimeOsgiServices(bundleContext); - if (env != null && env instanceof TestEnvironment){ - ((TestEnvironment)env).waitForWorkerThreadsToComplete(); - } - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, "Failed to initialize runtime. Runtime Config Class=" + clazz.getName(), ex); - } - } - - public void onRuntimeLibraryUnload() { - stopRuntimeServices(); - } - - private synchronized void stopRuntimeServices(){ - for(RuntimeConfigurationInitilizer initializer:initializersToUninitialize){ - initializer.stopRuntimeOsgiServices(); - } - initializersToUninitialize.clear(); - } - /** * */ |