Author: thomas.diesler(a)jboss.com
Date: 2009-11-11 17:59:08 -0500 (Wed, 11 Nov 2009)
New Revision: 96285
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Fix the infinite loop issue with Interceptors
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
---
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-11-11
22:35:35 UTC (rev 96284)
+++
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml 2009-11-11
22:59:08 UTC (rev 96285)
@@ -132,8 +132,7 @@
</bean>
<bean name="LifecycleInterceptorService"
class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager"
/></parameter></constructor>
- <incallback method="addInterceptor" />
- <uncallback method="removeInterceptor" />
+ <incallback method="addBootstrapInterceptor" />
</bean>
<!--
Modified:
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
---
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-11-11
22:35:35 UTC (rev 96284)
+++
projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml 2009-11-11
22:59:08 UTC (rev 96285)
@@ -125,8 +125,7 @@
</bean>
<bean name="LifecycleInterceptorService"
class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager"
/></parameter></constructor>
- <incallback method="addInterceptor" />
- <uncallback method="removeInterceptor" />
+ <incallback method="addBootstrapInterceptor" />
</bean>
<!--
Modified:
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java
===================================================================
---
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-11-11
22:35:35 UTC (rev 96284)
+++
projects/jboss-osgi/trunk/reactor/deployment/src/main/java/org/jboss/osgi/deployment/internal/LifecycleInterceptorServiceImpl.java 2009-11-11
22:59:08 UTC (rev 96285)
@@ -53,8 +53,7 @@
return super.getInterceptorChain();
}
- @Override
- protected void addInterceptor(LifecycleInterceptor interceptor)
+ protected void addBootstrapInterceptor(LifecycleInterceptor interceptor)
{
super.addInterceptor(interceptor);
}
Modified:
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java
===================================================================
---
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-11-11
22:35:35 UTC (rev 96284)
+++
projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/service/internal/LifecycleInterceptorServiceImpl.java 2009-11-11
22:59:08 UTC (rev 96285)
@@ -64,8 +64,8 @@
public void startService()
{
- BundleContext context = getSystemContext();
- delegate = new AbstractLifecycleInterceptorService(context)
+ BundleContext sysContext = getSystemContext();
+ delegate = new AbstractLifecycleInterceptorService(sysContext)
{
@Override
protected InvocationContext getInvocationContext(Bundle bundle)
@@ -87,12 +87,14 @@
return inv;
}
};
-
+
// Add bootstrap interceptors
for (LifecycleInterceptor aux : bootstrapInterceptors)
- addInterceptor(aux);
+ sysContext.registerService(LifecycleInterceptor.class.getName(), aux, null);
- registration = context.registerService(LifecycleInterceptorService.class.getName(),
delegate, null);
+ bootstrapInterceptors.clear();
+
+ registration =
sysContext.registerService(LifecycleInterceptorService.class.getName(), delegate, null);
}
public void stopService()
@@ -105,22 +107,11 @@
}
}
- public void addInterceptor(LifecycleInterceptor interceptor)
+ public void addBootstrapInterceptor(LifecycleInterceptor interceptor)
{
- if (delegate == null)
- {
- bootstrapInterceptors.add(interceptor);
- }
- else
- {
- getSystemContext().registerService(LifecycleInterceptor.class.getName(),
interceptor, null);
- }
+ bootstrapInterceptors.add(interceptor);
}
- public void removeInterceptor(LifecycleInterceptor interceptor)
- {
- }
-
public void handleStateChange(int state, Bundle bundle)
{
if (delegate != null)
Modified:
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
---
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-11
22:35:35 UTC (rev 96284)
+++
projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml 2009-11-11
22:59:08 UTC (rev 96285)
@@ -107,8 +107,7 @@
</bean>
<bean name="LifecycleInterceptorService"
class="org.jboss.osgi.framework.service.internal.LifecycleInterceptorServiceImpl">
<constructor><parameter><inject bean="OSGiBundleManager"
/></parameter></constructor>
- <incallback method="addInterceptor" />
- <uncallback method="removeInterceptor" />
+ <incallback method="addBootstrapInterceptor" />
</bean>
<!--