Author: rickhall
Date: Tue Jun 15 20:34:40 2010
New Revision: 955040
URL: http://svn.apache.org/viewvc?rev=955040&view=rev
Log:
Rename ModuleImpl to ManagedModuleImpl
Added:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ManagedModuleImpl.java
- copied, changed from r955035,
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
Removed:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/BundleImpl.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/EntryFilterEnumeration.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ExtensionManager.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/FelixResolverState.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/AbstractModuleImpl.java
Tue Jun 15 20:34:40 2010
@@ -432,7 +432,7 @@ abstract class AbstractModuleImpl implem
}
else if
(cfg.equalsIgnoreCase(Constants.FRAMEWORK_BUNDLE_PARENT_FRAMEWORK))
{
- parent = ModuleImpl.class.getClassLoader();
+ parent = ManagedModuleImpl.class.getClassLoader();
}
// On Android we cannot set the parent class loader to be null, so
// we special case that situation here and set it to the system
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/BundleImpl.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/BundleImpl.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/BundleImpl.java
Tue Jun 15 20:34:40 2010
@@ -131,9 +131,9 @@ class BundleImpl implements Bundle
for (int i = 0; i < m_modules.size(); i++)
{
getFramework().getResolverState().removeModule(m_modules.get(i));
- if (m_modules.get(i) instanceof ModuleImpl)
+ if (m_modules.get(i) instanceof ManagedModuleImpl)
{
- ((ModuleImpl) m_modules.get(i)).close();
+ ((ManagedModuleImpl) m_modules.get(i)).close();
}
}
}
@@ -390,7 +390,7 @@ class BundleImpl implements Bundle
// Create ordered list of modules to search for localization
// property resources.
- List moduleList = createLocalizationModuleList((ModuleImpl)
getCurrentModule());
+ List moduleList =
createLocalizationModuleList((ManagedModuleImpl) getCurrentModule());
// Create ordered list of files to load properties from
List resourceList = createLocalizationResourceList(basename,
locale);
@@ -464,7 +464,7 @@ class BundleImpl implements Bundle
}
}
- private static List createLocalizationModuleList(ModuleImpl module)
+ private static List createLocalizationModuleList(ManagedModuleImpl module)
{
// If the module is a fragment, then we actually need
// to search its host and associated fragments for its
@@ -476,12 +476,12 @@ class BundleImpl implements Bundle
List<Module> hosts = module.getDependentHosts();
if ((hosts != null) && (hosts.size() > 0))
{
- module = (ModuleImpl) hosts.get(0);
+ module = (ManagedModuleImpl) hosts.get(0);
for (int hostIdx = 1; hostIdx < hosts.size(); hostIdx++)
{
if
(module.getVersion().compareTo(hosts.get(hostIdx).getVersion()) < 0)
{
- module = (ModuleImpl) hosts.get(hostIdx);
+ module = (ManagedModuleImpl) hosts.get(hostIdx);
}
}
}
@@ -1091,9 +1091,9 @@ class BundleImpl implements Bundle
// Set protection domain after adding the module to the bundle,
// since this requires that the bundle has a module.
// TODO: VB - We should probably inject into virtual modules too.
- if (module instanceof ModuleImpl)
+ if (module instanceof ManagedModuleImpl)
{
- ((ModuleImpl) module).setSecurityContext(
+ ((ManagedModuleImpl) module).setSecurityContext(
new BundleProtectionDomain(getFramework(), this));
}
@@ -1146,7 +1146,7 @@ class BundleImpl implements Bundle
}
else
{
- module = new ModuleImpl(
+ module = new ManagedModuleImpl(
getFramework().getLogger(),
getFramework().getConfig(),
getFramework().getResolver(),
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/EntryFilterEnumeration.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/EntryFilterEnumeration.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/EntryFilterEnumeration.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/EntryFilterEnumeration.java
Tue Jun 15 20:34:40 2010
@@ -42,7 +42,7 @@ class EntryFilterEnumeration implements
String filePattern, boolean recurse, boolean isURLValues)
{
m_module = module;
- List<Module> fragmentModules = ((ModuleImpl) module).getFragments();
+ List<Module> fragmentModules = ((ManagedModuleImpl)
module).getFragments();
if (includeFragments && (fragmentModules != null))
{
m_modules = new ArrayList(fragmentModules.size() + 1);
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ExtensionManager.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ExtensionManager.java
Tue Jun 15 20:34:40 2010
@@ -476,7 +476,7 @@ class ExtensionManager extends URLStream
{
try
{
- result = ((ModuleImpl) ((BundleImpl)
extBundle).getCurrentModule()).getResourceLocal(path);
+ result = ((ManagedModuleImpl) ((BundleImpl)
extBundle).getCurrentModule()).getResourceLocal(path);
}
catch (Exception ex)
{
@@ -595,7 +595,7 @@ class ExtensionManager extends URLStream
// Utility methods.
//
- class ExtensionManagerModule extends ModuleImpl
+ class ExtensionManagerModule extends ManagedModuleImpl
{
private final Version m_version;
ExtensionManagerModule(Felix felix)
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/Felix.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/Felix.java
Tue Jun 15 20:34:40 2010
@@ -24,7 +24,7 @@ import java.net.*;
import java.security.*;
import java.util.*;
import java.util.Map.Entry;
-import org.apache.felix.framework.ModuleImpl.FragmentRequirement;
+import org.apache.felix.framework.ManagedModuleImpl.FragmentRequirement;
import org.apache.felix.framework.ServiceRegistry.ServiceRegistryCallbacks;
import org.apache.felix.framework.cache.BundleArchive;
import org.apache.felix.framework.cache.BundleCache;
@@ -1767,7 +1767,7 @@ ex.printStackTrace();
// been triggered, then activate the bundle immediately.
if (!bundle.isDeclaredActivationPolicyUsed()
|| (bundle.getCurrentModule().getDeclaredActivationPolicy() !=
Module.LAZY_ACTIVATION)
- || ((ModuleImpl)
bundle.getCurrentModule()).isActivationTriggered())
+ || ((ManagedModuleImpl)
bundle.getCurrentModule()).isActivationTriggered())
{
// Record the event type for the final event and activate.
eventType = BundleEvent.STARTED;
@@ -2700,7 +2700,7 @@ ex.printStackTrace();
{
bundle = new BundleImpl(this, ba, vm);
// TODO: VB - Fix this hack. Perhaps with RFC-154.
- ((ModuleImpl) manager.getCurrentModule())
+ ((ManagedModuleImpl) manager.getCurrentModule())
.addDependentVirtual(bundle.getCurrentModule());
}
finally
@@ -4403,12 +4403,12 @@ m_logger.log(Logger.LOG_DEBUG, "DYNAMIC
module.resolve(null, vbWires);
// Resolve all attached fragments.
- if (module instanceof ModuleImpl)
+ if (module instanceof ManagedModuleImpl)
{
- List<Module> fragments = ((ModuleImpl)
module).getFragments();
+ List<Module> fragments = ((ManagedModuleImpl)
module).getFragments();
for (int i = 0; (fragments != null) && (i <
fragments.size()); i++)
{
- ((ModuleImpl) fragments.get(i)).setResolved();
+ ((ManagedModuleImpl)
fragments.get(i)).setResolved();
// Update the state of the module's bundle to
resolved as well.
markBundleResolved(fragments.get(i));
m_logger.log(
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/FelixResolverState.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/FelixResolverState.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/FelixResolverState.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/FelixResolverState.java
Tue Jun 15 20:34:40 2010
@@ -159,18 +159,18 @@ public class FelixResolverState implemen
public void detachFragment(Module host, Module fragment)
{
- List<Module> fragments = ((ModuleImpl) host).getFragments();
+ List<Module> fragments = ((ManagedModuleImpl) host).getFragments();
fragments.remove(fragment);
try
{
- ((ModuleImpl) host).attachFragments(fragments);
+ ((ManagedModuleImpl) host).attachFragments(fragments);
}
catch (Exception ex)
{
// Try to clean up by removing all fragments.
try
{
- ((ModuleImpl) host).attachFragments(null);
+ ((ManagedModuleImpl) host).attachFragments(null);
}
catch (Exception ex2)
{
@@ -240,7 +240,7 @@ public class FelixResolverState implemen
// Get the fragments currently attached to the host so we
// can remove the older version of the current fragment, if any.
- List<Module> fragments = ((ModuleImpl) host).getFragments();
+ List<Module> fragments = ((ManagedModuleImpl) host).getFragments();
Module attachedFragment = null;
for (int fragIdx = 0;
(fragments != null) && (attachedFragment == null) && (fragIdx
< fragments.size());
@@ -290,14 +290,14 @@ public class FelixResolverState implemen
fragments = (newFragments.isEmpty()) ? null : newFragments;
try
{
- ((ModuleImpl) host).attachFragments(fragments);
+ ((ManagedModuleImpl) host).attachFragments(fragments);
}
catch (Exception ex)
{
// Try to clean up by removing all fragments.
try
{
- ((ModuleImpl) host).attachFragments(null);
+ ((ManagedModuleImpl) host).attachFragments(null);
}
catch (Exception ex2)
{
@@ -337,7 +337,7 @@ public class FelixResolverState implemen
// Check to see if the removed fragment was actually merged
with
// the host, since it might not be if it wasn't the highest
version.
// If it was, recalculate the fragments for the host.
- List<Module> fragments = ((ModuleImpl) host).getFragments();
+ List<Module> fragments = ((ManagedModuleImpl)
host).getFragments();
if ((fragments != null) && fragments.contains(fragment))
{
List<Module> fragmentList = getMatchingFragments(host);
@@ -349,14 +349,14 @@ public class FelixResolverState implemen
// Attach the fragments to the host.
try
{
- ((ModuleImpl) host).attachFragments(fragmentList);
+ ((ManagedModuleImpl)
host).attachFragments(fragmentList);
}
catch (Exception ex)
{
// Try to clean up by removing all fragments.
try
{
- ((ModuleImpl) host).attachFragments(null);
+ ((ManagedModuleImpl) host).attachFragments(null);
}
catch (Exception ex2)
{
@@ -488,14 +488,14 @@ public class FelixResolverState implemen
// Attach the fragments to the host.
try
{
- ((ModuleImpl) host).attachFragments(fragments);
+ ((ManagedModuleImpl) host).attachFragments(fragments);
}
catch (Exception ex)
{
// Try to clean up by removing all fragments.
try
{
- ((ModuleImpl) host).attachFragments(null);
+ ((ManagedModuleImpl) host).attachFragments(null);
}
catch (Exception ex2)
{
@@ -534,11 +534,11 @@ public class FelixResolverState implemen
// Set fragments to null, which will remove the module from all
// of its dependent fragment modules.
- if (host instanceof ModuleImpl)
+ if (host instanceof ManagedModuleImpl)
{
try
{
- ((ModuleImpl) host).attachFragments(null);
+ ((ManagedModuleImpl) host).attachFragments(null);
}
catch (Exception ex)
{
Copied:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ManagedModuleImpl.java
(from r955035,
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java)
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ManagedModuleImpl.java?p2=felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ManagedModuleImpl.java&p1=felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java&r1=955035&r2=955040&rev=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ModuleImpl.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/ManagedModuleImpl.java
Tue Jun 15 20:34:40 2010
@@ -70,7 +70,7 @@ import org.osgi.framework.BundleExceptio
import org.osgi.framework.BundleReference;
import org.osgi.framework.Constants;
-public class ModuleImpl extends AbstractModuleImpl
+public class ManagedModuleImpl extends AbstractModuleImpl
{
private final FelixResolver m_resolver;
private final Content m_content;
@@ -109,7 +109,7 @@ public class ModuleImpl extends Abstract
* @param bootPkgWildcards
* @throws org.osgi.framework.BundleException
*/
- public ModuleImpl(
+ public ManagedModuleImpl(
Logger logger, Map configMap, Bundle bundle, String id,
String[] bootPkgs, boolean[] bootPkgWildcards)
throws BundleException
@@ -121,7 +121,7 @@ public class ModuleImpl extends Abstract
m_implicitBootDelegation = false;
}
- public ModuleImpl(
+ public ManagedModuleImpl(
Logger logger, Map configMap, FelixResolver resolver,
Bundle bundle, String id, Map headerMap, Content content,
URLStreamHandler streamHandler, String[] bootPkgs,
@@ -807,7 +807,7 @@ public class ModuleImpl extends Abstract
// dependencies when we are uninstalling the module.
for (int i = 0; (m_fragments != null) && (i < m_fragments.size()); i++)
{
- ((ModuleImpl) m_fragments.get(i)).removeDependentHost(this);
+ ((ManagedModuleImpl) m_fragments.get(i)).removeDependentHost(this);
}
// Remove cached capabilities and requirements.
@@ -826,7 +826,7 @@ public class ModuleImpl extends Abstract
Content[] fragmentContents = new Content[m_fragments.size()];
for (int i = 0; (m_fragments != null) && (i < m_fragments.size());
i++)
{
- ((ModuleImpl) m_fragments.get(i)).addDependentHost(this);
+ ((ManagedModuleImpl)
m_fragments.get(i)).addDependentHost(this);
fragmentContents[i] =
m_fragments.get(i).getContent()
.getEntryAsContent(FelixConstants.CLASS_PATH_DOT);
@@ -1009,7 +1009,7 @@ public class ModuleImpl extends Abstract
{
Constructor ctor = (Constructor)
m_secureAction.getConstructor(
ModuleClassLoader.class,
- new Class[] { ModuleImpl.class, ClassLoader.class });
+ new Class[] { ManagedModuleImpl.class,
ClassLoader.class });
m_classLoader = (ModuleClassLoader)
m_secureAction.invoke(ctor,
new Object[] { this, determineParentClassLoader() });
@@ -1351,7 +1351,7 @@ public class ModuleImpl extends Abstract
public Bundle getBundle()
{
- return ModuleImpl.this.getBundle();
+ return ManagedModuleImpl.this.getBundle();
}
protected Class loadClass(String name, boolean resolve)
@@ -1382,7 +1382,7 @@ public class ModuleImpl extends Abstract
String msg = name;
if (getLogger().getLogLevel() >= Logger.LOG_DEBUG)
{
- msg = diagnoseClassLoadError(m_resolver,
ModuleImpl.this, name);
+ msg = diagnoseClassLoadError(m_resolver,
ManagedModuleImpl.this, name);
ex = (msg != null)
? new ClassNotFoundException(msg, cnfe)
: ex;
@@ -1621,7 +1621,7 @@ public class ModuleImpl extends Abstract
public URL getResource(String name)
{
- return ModuleImpl.this.getResource(name);
+ return ManagedModuleImpl.this.getResource(name);
}
protected URL findResource(String name)
@@ -1636,7 +1636,7 @@ public class ModuleImpl extends Abstract
// can't. As a workaround, we make findResources() delegate instead.
protected Enumeration findResources(String name)
{
- return ModuleImpl.this.getResources(name);
+ return ManagedModuleImpl.this.getResources(name);
}
protected String findLibrary(String name)
@@ -1702,12 +1702,12 @@ public class ModuleImpl extends Abstract
public String toString()
{
- return ModuleImpl.this.toString();
+ return ManagedModuleImpl.this.toString();
}
}
private static String diagnoseClassLoadError(
- FelixResolver resolver, ModuleImpl module, String name)
+ FelixResolver resolver, ManagedModuleImpl module, String name)
{
// We will try to do some diagnostics here to help the developer
// deal with this exception.
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/PackageAdminImpl.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
Tue Jun 15 20:34:40 2010
@@ -195,7 +195,7 @@ class PackageAdminImpl implements Packag
{
// Get attached fragments.
List<Module> modules =
- ((ModuleImpl)
+ ((ManagedModuleImpl)
((BundleImpl) bundle).getCurrentModule()).getFragments();
// Convert fragment modules to bundles.
List list = new ArrayList();
Modified:
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
URL:
http://svn.apache.org/viewvc/felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java?rev=955040&r1=955039&r2=955040&view=diff
==============================================================================
---
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
(original)
+++
felix/sandbox/rickhall/vb/framework-vb/src/main/java/org/apache/felix/framework/RequiredBundleImpl.java
Tue Jun 15 20:34:40 2010
@@ -67,7 +67,7 @@ class RequiredBundleImpl implements Requ
{
// For each of this bundle's modules, loop through all of the
// modules that require it and add them to the module list.
- List<Module> dependents = ((ModuleImpl)
modules.get(modIdx)).getDependentRequirers();
+ List<Module> dependents = ((ManagedModuleImpl)
modules.get(modIdx)).getDependentRequirers();
for (int depIdx = 0; (dependents != null) && (depIdx <
dependents.size()); depIdx++)
{
if (dependents.get(depIdx).getBundle() != null)