geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.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 17:02:21 GMT
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