Hi Anjana,
I think this commit made trunk build broken [1]. You may supposed to commit
to the 4.0.1 branch while you commit to the trunk. Please take a look.

thanks
Eranda

[1]. [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(default-compile) on project org.wso2.carbon.core: Compilation failure:
Compilation failure:
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java:[63,24]
cannot find symbol
[ERROR] symbol  : class ServerStartupHandler
[ERROR] location: class
org.wso2.carbon.core.internal.CarbonCoreServiceComponent
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java:[152,43]
cannot find symbol
[ERROR] symbol  : class ServerStartupHandler
[ERROR] location: class
org.wso2.carbon.core.internal.CarbonCoreServiceComponent
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java:[162,46]
cannot find symbol
[ERROR] symbol  : class ServerStartupHandler
[ERROR] location: class
org.wso2.carbon.core.internal.CarbonCoreServiceComponent
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java:[780,31]
cannot find symbol
[ERROR] symbol  : method stop()
[ERROR] location: interface org.apache.axis2.clustering.ClusteringAgent
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java:[63,78]
cannot find symbol
[ERROR] symbol  : class ServerStartupHandler
[ERROR] location: class
org.wso2.carbon.core.internal.CarbonCoreServiceComponent
[ERROR]
/data/chekin-client/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java:[179,13]
cannot find symbol
[ERROR] symbol  : class ServerStartupHandler
[ERROR] location: class
org.wso2.carbon.core.internal.CarbonCoreServiceComponent


On Fri, Aug 31, 2012 at 1:05 PM, <[email protected]> wrote:

> Author: anjana
> Date: Fri Aug 31 03:35:05 2012
> New Revision: 140635
> URL: http://wso2.org/svn/browse/wso2?view=rev&revision=140635
>
> Log:
> Refactoring server startup listener logic to use OSGi services
>
> Added:
>
>  
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/ServerStartupHandler.java
> Modified:
>
>  
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java
>
>  
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonStartupListener.java
>
>  
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java
>
>  
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java
>
> Added:
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/ServerStartupHandler.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/ServerStartupHandler.java?pathrev=140635
>
> ==============================================================================
> --- (empty file)
> +++
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/ServerStartupHandler.java
>  Fri Aug 31 03:35:05 2012
> @@ -0,0 +1,28 @@
> +/*
> + * Copyright 2004-2012 The Apache Software Foundation.
> + *
> + * Licensed under the Apache License, Version 2.0 (the "License");
> + * you may not use this file except in compliance with the License.
> + * You may obtain a copy of the License at
> + *
> + *      http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing, software
> + * distributed under the License is distributed on an "AS IS" BASIS,
> + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> implied.
> + * See the License for the specific language governing permissions and
> + * limitations under the License.
> + */
> +package org.wso2.carbon.core;
> +
> +/**
> + * This class is used as a listener for getting notifications when the
> server startup happens.
> + */
> +public interface ServerStartupHandler {
> +
> +       /**
> +        * Called when the server startup is done.
> +        */
> +       void invoke();
> +
> +}
>
> Modified:
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java?rev=140635&r1=140634&r2=140635&view=diff
>
> ==============================================================================
> ---
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java
>      (original)
> +++
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java
>      Fri Aug 31 03:35:05 2012
> @@ -933,9 +933,5 @@
>          artifactsCleanupExec.shutdownNow();
>      }
>
> -    public static void addCarbonStartupListener(CarbonStartupListener
> listener) {
> -
>  StartupFinalizerServiceComponent.addCarbonStartupListener(listener);
> -    }
> -
>  }
>
>
> Modified:
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java?rev=140635&r1=140634&r2=140635&view=diff
>
> ==============================================================================
> ---
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java
>   (original)
> +++
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/CarbonCoreServiceComponent.java
>   Fri Aug 31 03:35:05 2012
> @@ -45,6 +45,8 @@
>   * cardinality="0..n" policy="dynamic"  bind="addServerShutdownHandler"
> unbind="removeServerShutdownHandler"
>   * @scr.reference name="serverRestartHandler"
> interface="org.wso2.carbon.core.ServerRestartHandler"
>   * cardinality="0..n" policy="dynamic"  bind="addServerRestartHandler"
> unbind="removeServerRestartHandler"
> + * @scr.reference name="serverStartupHandler"
> interface="org.wso2.carbon.core.ServerStartupHandler"
> + * cardinality="0..n" policy="dynamic"  bind="addServerStartupHandler"
> unbind="removeServerStartupHandler"
>   * @scr.reference name="discoveryService"
> interface="org.wso2.carbon.base.DiscoveryService"
>    * cardinality="0..1" policy="dynamic"  bind="setDiscoveryService"
> unbind="unsetDiscoveryService"
>    */
> @@ -55,7 +57,13 @@
>      private CarbonCoreDataHolder dataHolder =
> CarbonCoreDataHolder.getInstance();
>
>      private static List<ServerShutdownHandler> shutdownHandlers = new
> ArrayList<ServerShutdownHandler>();
> +
>      private static List<ServerRestartHandler> restartHandlers = new
> ArrayList<ServerRestartHandler>();
> +
> +    private static List<ServerStartupHandler> startupHandlers = new
> ArrayList<ServerStartupHandler>();
> +
> +    private static boolean serverStarted;
> +
>      private CarbonServerManager carbonServerManager;
>
>      protected void activate(ComponentContext ctxt) {
> @@ -81,6 +89,7 @@
>          } catch (Exception e) {
>              log.debug("Error while retrieving serverConfiguration
> instance", e);
>          }
> +        serverStarted = false;
>          log.debug("Carbon Core bundle is deactivated ");
>      }
>
> @@ -125,7 +134,7 @@
>      }
>
>      protected void addServerShutdownHandler(ServerShutdownHandler
> shutdownHandler) {
> -        shutdownHandlers.add(shutdownHandler);
> +       shutdownHandlers.add(shutdownHandler);
>      }
>
>      protected void removeServerShutdownHandler(ServerShutdownHandler
> shutdownHandler) {
> @@ -139,6 +148,20 @@
>      protected void removeServerRestartHandler(ServerRestartHandler
> restartHandler) {
>          restartHandlers.remove(restartHandler);
>      }
> +
> +    protected void addServerStartupHandler(ServerStartupHandler
> startupHandler) {
> +       synchronized (this.getClass()) {
> +               if (serverStarted) {
> +                   startupHandler.invoke();
> +               } else {
> +                       startupHandlers.add(startupHandler);
> +               }
> +               }
> +    }
> +
> +    protected void removeServerStartupHandler(ServerStartupHandler
> startupHandler) {
> +       startupHandlers.remove(startupHandler);
> +    }
>
>      public static void shutdown() {
>          for (ServerShutdownHandler shutdownHandler : shutdownHandlers) {
> @@ -151,4 +174,12 @@
>              restartHandler.invoke();
>          }
>      }
> +
> +    public static synchronized void startup() {
> +        for (ServerStartupHandler startupHandler : startupHandlers) {
> +               startupHandler.invoke();
> +        }
> +        startupHandlers.clear();
> +        serverStarted = true;
> +    }
>  }
>
> Modified:
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java
> URL:
> http://wso2.org/svn/browse/wso2/carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java?rev=140635&r1=140634&r2=140635&view=diff
>
> ==============================================================================
> ---
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java
>     (original)
> +++
> carbon/kernel/trunk/core/org.wso2.carbon.core/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java
>     Fri Aug 31 03:35:05 2012
> @@ -31,7 +31,6 @@
>  import org.osgi.service.component.ComponentContext;
>  import org.wso2.carbon.CarbonConstants;
>  import org.wso2.carbon.core.ServerStatus;
> -import org.wso2.carbon.core.init.CarbonStartupListener;
>  import org.wso2.carbon.core.init.JMXServerManager;
>  import org.wso2.carbon.core.multitenancy.utils.TenantAxisUtils;
>  import org.wso2.carbon.core.util.ClusteringUtil;
> @@ -78,11 +77,6 @@
>      private Timer pendingServicesObservationTimer = new Timer();
>      private CarbonCoreDataHolder dataHolder =
> CarbonCoreDataHolder.getInstance();
>      private ServiceRegistration listerManagerServiceRegistration;
> -
> -    private static List<CarbonStartupListener> startupListeners =
> -       new ArrayList<CarbonStartupListener>();
> -
> -    private static boolean startupFinished;
>
>      protected void activate(ComponentContext ctxt) {
>          try {
> @@ -122,21 +116,9 @@
>              log.fatal("Cannot activate StartupFinalizerServiceComponent",
> e);
>          }
>      }
> -
> -    public synchronized static void
> addCarbonStartupListener(CarbonStartupListener listener) {
> -        if (startupFinished) {
> -               listener.serverInitialized();
> -        } else {
> -            startupListeners.add(listener);
> -        }
> -    }
>
>      protected void deactivate(ComponentContext ctxt) {
>          listerManagerServiceRegistration.unregister();
> -        synchronized (this.getClass()) {
> -                       startupListeners.clear();
> -                       startupFinished = false;
> -               }
>      }
>
>      private void populateRequiredServices() {
> @@ -216,23 +198,11 @@
>          if (log.isDebugEnabled()) {
>              log.debug("Started Transport Listener Manager");
>          }
> -        /* notify the listeners that the Carbon server is fully
> initialized */
> -        handleStartupListenerFinish();
> +        /* notify listeners of server startup */
> +        CarbonCoreServiceComponent.startup();
>          setServerStartTimeParam();
>          printInfo();
>      }
> -
> -    private synchronized static void handleStartupListenerFinish() {
> -       for (CarbonStartupListener listener : startupListeners) {
> -                       listener.serverInitialized();
> -               }
> -               if (log.isDebugEnabled()) {
> -                       log.debug(startupListeners.size() +
> -                                       " Carbon startup listeners
> notified at handleStartupListenerFinish");
> -               }
> -               startupListeners.clear();
> -               startupFinished = true;
> -    }
>
>      private void setServerStartTimeParam() {
>          Parameter startTimeParam = new Parameter();
> _______________________________________________
> Commits mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/commits
>



-- 
*Eranda Sooriyabandara
*Software Engineer;
Integration Technologies Team;
WSO2 Inc.; http://wso2.com

*
*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to