You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/07/25 12:42:01 UTC
svn commit: r425368 -
/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
Author: rickhall
Date: Tue Jul 25 03:42:00 2006
New Revision: 425368
URL: http://svn.apache.org/viewvc?rev=425368&view=rev
Log:
For class accessibility checking we must load directly from the bundle's
module as opposed to Bundle.loadClass() because the spec requires that
that method fire framework events if the class is not found.
Modified:
incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java?rev=425368&r1=425367&r2=425368&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/ServiceRegistrationImpl.java Tue Jul 25 03:42:00 2006
@@ -121,11 +121,13 @@
{
// First, try to load the class from the bundle that registered
// the service.
- Class targetClass = m_bundle.loadClass(clazz.getName());
+ Class targetClass = ((BundleImpl) m_bundle)
+ .getInfo().getCurrentModule().getClass(clazz.getName());
if (targetClass != null)
{
return (targetClass == clazz);
}
+
// If it cannot be found from the registering bundle, then try to load
// from the service object or service factory class.
Class sourceClass = (m_factory != null)
@@ -135,6 +137,7 @@
}
catch (Exception ex)
{
+ // Ignore this and return false.
}
return false;
}