Author: ruwan
Date: Wed Apr  1 18:04:41 2009
New Revision: 760988

URL: http://svn.apache.org/viewvc?rev=760988&view=rev
Log:
Added comments and reformatting the code

Modified:
    
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerStateDetectionStrategy.java

Modified: 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerStateDetectionStrategy.java
URL: 
http://svn.apache.org/viewvc/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerStateDetectionStrategy.java?rev=760988&r1=760987&r2=760988&view=diff
==============================================================================
--- 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerStateDetectionStrategy.java
 (original)
+++ 
synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerStateDetectionStrategy.java
 Wed Apr  1 18:04:41 2009
@@ -18,8 +18,8 @@
  */
 package org.apache.synapse;
 
-import org.apache.synapse.security.secret.SecretManager;
 import org.apache.synapse.config.SynapsePropertiesLoader;
+import org.apache.synapse.security.secret.SecretManager;
 
 /**
  * Detects possible current server state
@@ -39,9 +39,14 @@
                                            ServerConfigurationInformation 
information) {
         ServerState previousState = contextInformation.getServerState();
         String deploymentMode = information.getDeploymentMode();
+
+        // if the previous state is ServerState.UNDETERMINED it should be 
ServerState.INITIALIZABLE
         if (previousState == ServerState.UNDETERMINED) {
 
+            // if the server is running on production mode we need to 
initialize the secret manager 
+            // before the server state to be ServerState.INITIALIZABLE
             if (deploymentMode != null && 
PRODUCTION_MODE.equals(deploymentMode.trim())) {
+
                 SecretManager secretManager = SecretManager.getInstance();
                 if (secretManager.isInitialized()) {
                     return ServerState.INITIALIZABLE;
@@ -51,10 +56,13 @@
                         return ServerState.INITIALIZABLE;
                     }
                 }
+                
             } else {
                 return ServerState.INITIALIZABLE;
             }
         }
+
+        // if the previous state is deterministic then the current state is 
the previous state
         return previousState;
     }
 }


Reply via email to