geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jarek Gawor <jga...@gmail.com>
Subject Re: svn commit: r940946 - in /geronimo/server/trunk/plugins: console/console-core/src/main/resources/OSGI-INF/blueprint/ pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/
Date Tue, 04 May 2010 18:34:22 GMT
The problem is that the gbeans and blueprint are in two different
bundles. So we would need to modify the WaitForBlueprintGBean to
specify somehow which bundle it should wait on (e.g. based on a
package name that the bundle exports). If that sounds good to you, I
can go ahead and switch to that.

But I'm really confused about the pluto & console code integration.
The geronimo-pluto has the PortalContainerServicesGBean bean. This
bean is configured via blueprint in console-core module. console-core
also has a ConfigActivator that loads
WEB-INF/pluto-portal-driver-config.xml. The ConfigActivator is located
in geronimo-pluto module. The pluto-portal-driver-config.xml used to
live in console-portal-driver module...
I was thinking of moving all the pluto configuration into the pluto
plugin but I can't quite figure out why things are setup in this way
right now. Do you or anyone else know?

Jarek

On Tue, May 4, 2010 at 1:02 PM, David Jencks <david_jencks@yahoo.com> wrote:
> Does the WaitForBlueprintGBean gbean I wrote for this purpose not work here?  If not,
is there something we can do to fix it?
>
> thanks
> david jencks
>
>
> On May 4, 2010, at 9:49 AM, gawor@apache.org wrote:
>
>> Author: gawor
>> Date: Tue May  4 16:49:30 2010
>> New Revision: 940946
>>
>> URL: http://svn.apache.org/viewvc?rev=940946&view=rev
>> Log:
>> wait for PortalContainerServices gbean to be initialized (since it is initialized
via blueprint)
>>
>> Modified:
>>    geronimo/server/trunk/plugins/console/console-core/src/main/resources/OSGI-INF/blueprint/pluto-portal-services.xml
>>    geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
>>    geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServices.java
>>    geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServicesGBean.java
>>
>> Modified: geronimo/server/trunk/plugins/console/console-core/src/main/resources/OSGI-INF/blueprint/pluto-portal-services.xml
>> URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/resources/OSGI-INF/blueprint/pluto-portal-services.xml?rev=940946&r1=940945&r2=940946&view=diff
>> ==============================================================================
>> --- geronimo/server/trunk/plugins/console/console-core/src/main/resources/OSGI-INF/blueprint/pluto-portal-services.xml
(original)
>> +++ geronimo/server/trunk/plugins/console/console-core/src/main/resources/OSGI-INF/blueprint/pluto-portal-services.xml
Tue May  4 16:49:30 2010
>> @@ -236,6 +236,7 @@ limitations under the License.
>>     <bean id="GeronimoPortalServices"
>>           class="org.apache.geronimo.pluto.PortalContainerServicesGBean"
>>           factory-method="getSingleton"
>> +          init-method="init"
>>           activation="eager">
>>         <property name="renderConfigService">
>>             <ref component-id="RenderConfigService"/>
>>
>> Modified: geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
>> URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java?rev=940946&r1=940945&r2=940946&view=diff
>> ==============================================================================
>> --- geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
(original)
>> +++ geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/AdminConsoleExtensionGBean.java
Tue May  4 16:49:30 2010
>> @@ -194,6 +194,8 @@ public class AdminConsoleExtensionGBean
>>     * @see org.apache.geronimo.gbean.GBeanLifecycle#doStart()
>>     */
>>     public synchronized void doStart() throws Exception {
>> +        portletContainerServices.waitForInitialization(60 * 1000);
>> +
>>         // check to make sure that a portal driver has registered with the container
services
>>         if (portletContainerServices.getAdminConfiguration() == null) {
>>             throw new RuntimeException("No portal driver has been registered
with the portal container services");
>>
>> Modified: geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServices.java
>> URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServices.java?rev=940946&r1=940945&r2=940946&view=diff
>> ==============================================================================
>> --- geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServices.java
(original)
>> +++ geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServices.java
Tue May  4 16:49:30 2010
>> @@ -31,6 +31,8 @@ import org.apache.pluto.driver.services.
>>  */
>> public interface PortalContainerServices {
>>
>> +    boolean waitForInitialization(int timeout) throws InterruptedException;
>> +
>>     AdminConfiguration getAdminConfiguration();
>>     void setAdminConfiguration(AdminConfiguration adminConfiguration);
>>
>>
>> Modified: geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServicesGBean.java
>> URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServicesGBean.java?rev=940946&r1=940945&r2=940946&view=diff
>> ==============================================================================
>> --- geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServicesGBean.java
(original)
>> +++ geronimo/server/trunk/plugins/pluto/geronimo-pluto/src/main/java/org/apache/geronimo/pluto/PortalContainerServicesGBean.java
Tue May  4 16:49:30 2010
>> @@ -18,6 +18,9 @@
>>
>> package org.apache.geronimo.pluto;
>>
>> +import java.util.concurrent.CountDownLatch;
>> +import java.util.concurrent.TimeUnit;
>> +
>> import org.slf4j.Logger;
>> import org.slf4j.LoggerFactory;
>> import org.apache.geronimo.gbean.GBeanInfo;
>> @@ -46,7 +49,8 @@ public class PortalContainerServicesGBea
>>     private DriverConfiguration driverConfiguration;
>>     private AdminConfiguration adminConfiguration;
>>
>> -
>> +    private CountDownLatch latch = new CountDownLatch(1);
>> +
>>     public void doStart() throws Exception {
>>         log.debug("Started PortalContainerServicesGBean");
>>     }
>> @@ -111,6 +115,14 @@ public class PortalContainerServicesGBea
>>         }
>>         return portalServices;
>>     }
>> +
>> +    public void init() {
>> +        latch.countDown();
>> +    }
>> +
>> +    public boolean waitForInitialization(int timeout) throws InterruptedException
{
>> +        return latch.await(timeout, TimeUnit.MILLISECONDS);
>> +    }
>>
>>     public static final GBeanInfo GBEAN_INFO;
>>
>>
>>
>
>

Mime
View raw message