You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ni...@apache.org on 2014/03/10 10:43:17 UTC

[06/20] git commit: introducing abstract ExtensionExecutor

introducing abstract ExtensionExecutor


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

Branch: refs/heads/master
Commit: f66fc7c130aeded5818a2240c037a958e972165d
Parents: 975a6a4
Author: Nirmal Fernando <ni...@apache.org>
Authored: Mon Mar 10 14:56:42 2014 +0530
Committer: Nirmal Fernando <ni...@apache.org>
Committed: Mon Mar 10 14:56:42 2014 +0530

----------------------------------------------------------------------
 .../agent/executor/ExtensionExecutor.java       | 86 ++++++++++++++++++++
 1 file changed, 86 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/f66fc7c1/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/executor/ExtensionExecutor.java
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/executor/ExtensionExecutor.java b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/executor/ExtensionExecutor.java
new file mode 100644
index 0000000..fc06068
--- /dev/null
+++ b/components/org.apache.stratos.cartridge.agent/src/main/java/org/apache/stratos/cartridge/agent/executor/ExtensionExecutor.java
@@ -0,0 +1,86 @@
+/*
+ * 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.executor;
+
+import java.util.List;
+
+import org.apache.stratos.cartridge.agent.phase.Phase;
+
+/**
+ * An extension executor can be used to extend the features
+ * of a {@link Phase}.
+ * 
+ */
+public abstract class ExtensionExecutor {
+	
+	/**
+	 * A unique id for this {@link ExtensionExecutor}
+	 */
+	private String id;
+	
+	private List<String> fileNamesToBeExecuted;
+	
+	public ExtensionExecutor(String id) {
+		this.setId(id);
+	}
+	
+	public ExtensionExecutor(List<String> fileNames) {
+		this.setFileNamesToBeExecuted(fileNames);
+	}
+	
+	public ExtensionExecutor() {
+	}
+	
+	/**
+	 * Sets the id of this {@link ExtensionExecutor}
+	 * @param id
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+	
+	/**
+	 * Returns the id of this {@link ExtensionExecutor}
+	 * @return id
+	 */
+	public String getId() {
+		return this.id;
+	}
+	
+	public List<String> getFileNamesToBeExecuted() {
+		return fileNamesToBeExecuted;
+	}
+
+	public void setFileNamesToBeExecuted(List<String> fileNamesToBeExecuted) {
+		this.fileNamesToBeExecuted = fileNamesToBeExecuted;
+	}
+
+	/**
+	 * Execution of this {@link ExtensionExecutor}
+	 */
+	public abstract void execute();
+	
+	/**
+	 * Clean up this extension.
+	 */
+	public abstract void cleanUp();
+
+	
+}