adding working phase

Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/ea588e48
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/ea588e48
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/ea588e48

Branch: refs/heads/master
Commit: ea588e488afef179729e61908614c8edfb6ec734
Parents: 9e7fbad
Author: Nirmal Fernando <[email protected]>
Authored: Mon Mar 10 14:54:31 2014 +0530
Committer: Nirmal Fernando <[email protected]>
Committed: Mon Mar 10 14:54:31 2014 +0530

----------------------------------------------------------------------
 .../agent/phase/impl/WorkingPhase.java          | 57 ++++++++++++++++++++
 1 file changed, 57 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/ea588e48/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/phase/impl/WorkingPhase.java
----------------------------------------------------------------------
diff --git 
a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/phase/impl/WorkingPhase.java
 
b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/phase/impl/WorkingPhase.java
new file mode 100644
index 0000000..b10f0e0
--- /dev/null
+++ 
b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/phase/impl/WorkingPhase.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.apache.stratos.cartridge.agent.phase.impl;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stratos.cartridge.agent.executor.ExtensionExecutor;
+import org.apache.stratos.cartridge.agent.phase.Phase;
+
+/**
+ * Working phase of Cartridge Agent. After sending out member activated event,
+ * agent goes to the working phase.
+ */
+public class WorkingPhase extends Phase {
+
+       private static final Log log = LogFactory.getLog(WorkingPhase.class);
+                       
+       public WorkingPhase() {
+               super(WorkingPhase.class.getName());
+       }
+       
+       public WorkingPhase(String id) {
+               super(id);
+       }
+
+       @Override
+       public void execute() {
+               
+               log.info("Currently Executing Phase: "+super.getId());
+               
+               // execute all the extensions of this phase in order.
+               for (ExtensionExecutor extensionExecutor : 
super.getExtensions()) {
+                       extensionExecutor.execute();
+               }
+               
+               log.info("Finished Executing Phase: "+super.getId());
+
+       }
+
+}

Reply via email to