eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject [3/3] incubator-eagle git commit: [EAGLE-533] Fix storage configuration and remove AppJUnitRunner
Date Thu, 08 Sep 2016 12:24:41 GMT
[EAGLE-533] Fix storage configuration and remove AppJUnitRunner

https://issues.apache.org/jira/browse/EAGLE-533

* Fix storage configuration
* Remove `AppJUnitRunner` to avoid junit dependency conflict during runtime.
* Add `ServerDebug` tool

Author: Hao Chen <hao@apache.org>

Closes #427 from haoch/FixStorageConfig.


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

Branch: refs/heads/master
Commit: c752ed868cbb7d93306e66f890c291c621411a33
Parents: 3db5cdb
Author: Hao Chen <hao@apache.org>
Authored: Thu Sep 8 20:24:23 2016 +0800
Committer: Hao Chen <hao@apache.org>
Committed: Thu Sep 8 20:24:23 2016 +0800

----------------------------------------------------------------------
 .gitignore                                      |   5 +-
 eagle-core/eagle-app/eagle-app-base/pom.xml     |   7 +-
 .../apache/eagle/app/AbstractApplication.java   |   6 +-
 .../java/org/apache/eagle/app/Application.java  |  33 ++-
 .../org/apache/eagle/app/ApplicationCLI.java    |  14 +-
 .../apache/eagle/app/ApplicationLifecycle.java  |  20 +-
 .../org/apache/eagle/app/ApplicationTool.java   |  12 +-
 .../org/apache/eagle/app/StormApplication.java  |   4 +-
 .../app/config/ApplicationProviderConfig.java   |  12 +-
 .../config/ApplicationProviderDescConfig.java   |  31 ++-
 .../app/config/ApplicationProvidersConfig.java  |   2 +-
 .../app/environment/AbstractEnvironment.java    |  34 +--
 .../eagle/app/environment/Environment.java      |   7 +-
 .../eagle/app/environment/ExecutionRuntime.java |  27 +-
 .../environment/ExecutionRuntimeManager.java    |  49 ++--
 .../environment/ExecutionRuntimeProvider.java   |   4 +-
 .../app/environment/impl/SparkEnvironment.java  |   6 +-
 .../environment/impl/SparkExecutionRuntime.java |   2 +-
 .../app/environment/impl/StormEnvironment.java  |   4 +-
 .../environment/impl/StormExecutionRuntime.java |  10 +-
 .../app/module/ApplicationExtensionLoader.java  |  14 +-
 .../app/module/ApplicationGuiceModule.java      |  14 +-
 .../eagle/app/resource/ApplicationResource.java |  62 ++---
 .../eagle/app/service/ApplicationContext.java   |  47 ++--
 .../service/ApplicationManagementService.java   |   4 +
 .../app/service/ApplicationOperations.java      |  83 ++++---
 .../app/service/ApplicationProviderLoader.java  |  33 +--
 .../app/service/ApplicationProviderService.java |   3 +-
 .../impl/ApplicationManagementServiceImpl.java  |  65 +++--
 .../impl/ApplicationProviderConfigLoader.java   |  90 +++----
 .../impl/ApplicationProviderSPILoader.java      |  28 +--
 .../impl/ApplicationProviderServiceImpl.java    |  41 ++--
 .../eagle/app/sink/DefaultStreamSinkConfig.java |   4 +-
 .../eagle/app/sink/FlattenEventMapper.java      |  16 +-
 .../apache/eagle/app/sink/KafkaStreamSink.java  |  18 +-
 .../eagle/app/sink/LoggingStreamSink.java       |   8 +-
 .../apache/eagle/app/sink/StormStreamSink.java  |  30 +--
 .../eagle/app/sink/StreamEventMapper.java       |   6 +-
 .../eagle/app/sink/StreamSinkProvider.java      |  18 +-
 .../app/spi/AbstractApplicationProvider.java    |  26 +-
 .../eagle/app/spi/ApplicationProvider.java      |   8 +-
 .../apache/eagle/app/test/AppJUnitRunner.java   |  87 -------
 .../eagle/app/test/ApplicationSimulator.java    |  34 +--
 .../app/test/ApplicationSimulatorImpl.java      |  38 +--
 .../eagle/app/test/ApplicationTestBase.java     |  12 +-
 .../app/test/ApplicationTestGuiceModule.java    |  11 +-
 .../eagle/app/utils/DynamicJarPathFinder.java   |  37 +--
 eagle-core/eagle-app/pom.xml                    |  13 +
 .../apache/eagle/common/config/EagleConfig.java |  18 +-
 .../common/config/EagleConfigConstants.java     |  76 +++---
 .../eagle/common/config/EagleConfigFactory.java | 187 +++++++-------
 .../eagle/common/config/TestEagleConfig.java    |  23 +-
 .../src/test/resources/application-test.conf    |  33 +++
 .../src/test/resources/test-service-config.conf |  31 ---
 .../src/test/resources/application.conf         |  25 +-
 .../eagle/storage/DataStorageManager.java       |  36 +--
 .../storage/spi/DataStorageServiceLoader.java   |  35 +--
 .../src/test/resources/application.conf         |  23 +-
 .../integrationtest/CoprocessorITSuite.java     | 246 -------------------
 .../integrationtest/CoprocessorJarUtils.java    |  41 ----
 .../integrationtest/CoprocessorToolITSuite.java |  92 -------
 .../storage/hbase/it/CoprocessorITSuite.java    | 246 +++++++++++++++++++
 .../storage/hbase/it/CoprocessorJarUtils.java   |  41 ++++
 .../hbase/it/CoprocessorToolITSuite.java        |  92 +++++++
 .../src/test/resources/application-it.conf      |  27 ++
 .../src/test/resources/application-sandbox.conf |  23 --
 .../src/test/resources/application.conf         |  20 +-
 .../eagle/storage/jdbc/JdbcConstants.java       |  20 +-
 .../src/test/resources/application-derby.conf   |  21 +-
 .../src/test/resources/application-mysql.conf   |  22 +-
 .../src/test/resources/application.conf         |  20 +-
 .../test/resources/unittest.application.conf    |  24 +-
 .../example/ExampleApplicationProviderTest.java |   6 +-
 .../eagle/app/jpm/JPMApplicationTest.java       |   6 +-
 .../MRHistoryJobApplicationProviderTest.java    |  11 +-
 .../MRRunningJobApplicationProviderTest.java    |   6 +-
 .../auditlog/MapRFSAuditLogAppProviderTest.java |   6 +-
 .../src/main/conf/application.conf              | 138 +++++++----
 .../src/main/resources/application.conf         |  35 ++-
 .../org/apache/eagle/server/ServerDebug.java    |  49 ++++
 80 files changed, 1456 insertions(+), 1362 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index f6d9234..3a925f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,10 +77,11 @@ logs/
 .DS_Store
 
 *.cache-tests
-application-local.conf
+**/application-local.conf
+**/application-debug.conf
 
 *.orig
 **/*.pyc
 
 site/
-**/*.db
+**/*.db
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/pom.xml b/eagle-core/eagle-app/eagle-app-base/pom.xml
index 12b056c..9b0b29e 100644
--- a/eagle-core/eagle-app/eagle-app-base/pom.xml
+++ b/eagle-core/eagle-app/eagle-app-base/pom.xml
@@ -53,11 +53,6 @@
             <artifactId>slf4j-log4j12</artifactId>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>com.google.inject.extensions</groupId>
             <artifactId>guice-servlet</artifactId>
         </dependency>
@@ -100,7 +95,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <scope>compile</scope>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
index a80ab11..8943df3 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/AbstractApplication.java
@@ -16,13 +16,13 @@
  */
 package org.apache.eagle.app;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.Environment;
 import org.apache.eagle.app.environment.ExecutionRuntimeManager;
+import com.typesafe.config.Config;
 
-public abstract class AbstractApplication<Env extends Environment,Proc> implements Application<Env,Proc>, ApplicationTool {
+public abstract class AbstractApplication<E extends Environment, P> implements Application<E, P>, ApplicationTool {
     @Override
     public void run(Config config) {
-        ExecutionRuntimeManager.getInstance().getRuntime(getEnvironmentType(),config).start(this,config);
+        ExecutionRuntimeManager.getInstance().getRuntime(getEnvironmentType(), config).start(this, config);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
index a64869e..84398b1 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/Application.java
@@ -16,41 +16,40 @@
  */
 package org.apache.eagle.app;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.Environment;
+import com.typesafe.config.Config;
 
 import java.io.Serializable;
 
 /**
- * Application Execution Interface
- *
+ * Application Execution Interface.
  * <h1>Design Principle</h1>
  * <ul>
- *  <li>Easy to develop and extend </li>
- *  <li>Easy to test and run locally</li>
- *  <li>Easy to manage lifecycle through framework</li>
+ * <li>Easy to develop and extend </li>
+ * <li>Easy to test and run locally</li>
+ * <li>Easy to manage lifecycle through framework</li>
  * </ul>
  *
- * @param <Proc>
- * @param <Env>
+ * @param <P>
+ * @param <E>
  */
-public interface Application <
-    Env extends Environment,        // Application Environment
-    Proc                            // Application Process
-> extends Serializable {
+public interface Application<
+    E extends Environment,        // Application Environment
+    P                            // Application Process
+    > extends Serializable {
     /**
-     * Execute with application configuration
+     * Execute with application configuration.
      *
-     * @param config application configuration
+     * @param config      application configuration
      * @param environment execution environment
      * @return execution process
      */
-    Proc execute(Config config, Env environment);
+    P execute(Config config, E environment);
 
     /**
-     * Execution Environment type
+     * Execution Environment type.
      *
      * @return application environment type
      */
-    Class<? extends Env> getEnvironmentType();
+    Class<? extends E> getEnvironmentType();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
index bee2bed..d9b0e44 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationCLI.java
@@ -17,23 +17,17 @@
 package org.apache.eagle.app;
 
 /**
- * Usage: java org.apache.eagle.app.ApplicationCLI [APPLICATION_CLASS] [APPLICATION_OPTIONS: -D Key=Value]
+ * Usage: java org.apache.eagle.app.ApplicationCLI [APPLICATION_CLASS] [APPLICATION_OPTIONS: -D Key=Value].
  */
 public class ApplicationCLI {
-    /**
-     * @param args
-     * @throws ClassNotFoundException
-     * @throws IllegalAccessException
-     * @throws InstantiationException
-     */
     public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
-        if(args.length < 1){
-            System.err.println("Usage: java "+ApplicationCLI.class.getName()+" [APPLICATION_CLASS] [APPLICATION_OPTIONS: -D Key=Value]");
+        if (args.length < 1) {
+            System.err.println("Usage: java " + ApplicationCLI.class.getName() + " [APPLICATION_CLASS] [APPLICATION_OPTIONS: -D Key=Value]");
             System.exit(1);
         } else {
             String appClassName = args[0];
             Class<? extends ApplicationTool> appClass = (Class<? extends ApplicationTool>) Class.forName(appClassName);
-            String[] appArgs = new String[args.length-1];
+            String[] appArgs = new String[args.length - 1];
             System.arraycopy(args, 1, appArgs, 0, args.length - 1);
             appClass.newInstance().run(appArgs);
         }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationLifecycle.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationLifecycle.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationLifecycle.java
index 9e3d992..94b6195 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationLifecycle.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationLifecycle.java
@@ -18,22 +18,26 @@ package org.apache.eagle.app;
 
 public interface ApplicationLifecycle {
     /**
-     * on application installed
+     * on application installed.
      */
-    default void onInstall(){}
+    default void onInstall() {
+    }
 
     /**
-     * on application uninstalled
+     * on application uninstalled.
      */
-    default void onUninstall(){}
+    default void onUninstall() {
+    }
 
     /**
-     *
+     * onStart.
      */
-    default void onStart(){}
+    default void onStart() {
+    }
 
     /**
-     *
+     * onStop.
      */
-    default void onStop(){}
+    default void onStop() {
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
index 2b1448e..bb3bcfe 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/ApplicationTool.java
@@ -16,18 +16,18 @@
  */
 package org.apache.eagle.app;
 
+import org.apache.eagle.common.config.ConfigOptionParser;
 import com.typesafe.config.Config;
 import com.typesafe.config.ConfigFactory;
 import org.apache.commons.cli.ParseException;
-import org.apache.eagle.common.config.ConfigOptionParser;
 
 public interface ApplicationTool {
     /**
-     * Run application through CLI
+     * Run application through CLI.
      *
      * @param args application arguments
      */
-    default void run(String[] args){
+    default void run(String[] args) {
         try {
             run(new ConfigOptionParser().load(args));
         } catch (ParseException e) {
@@ -36,13 +36,9 @@ public interface ApplicationTool {
         }
     }
 
-    /**
-     *
-     * @param config
-     */
     void run(Config config);
 
-    default void run(){
+    default void run() {
         run(ConfigFactory.load());
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
index 821e5cd..7e70cde 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/StormApplication.java
@@ -16,10 +16,10 @@
  */
 package org.apache.eagle.app;
 
-import backtype.storm.generated.StormTopology;
 import org.apache.eagle.app.environment.impl.StormEnvironment;
+import backtype.storm.generated.StormTopology;
 
-public abstract class StormApplication extends AbstractApplication<StormEnvironment,StormTopology>{
+public abstract class StormApplication extends AbstractApplication<StormEnvironment, StormTopology> {
     @Override
     public Class<? extends StormEnvironment> getEnvironmentType() {
         return StormEnvironment.class;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderConfig.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderConfig.java
index e3cd9e7..b787885 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderConfig.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderConfig.java
@@ -23,18 +23,22 @@ public class ApplicationProviderConfig {
     private String jarPath;
     private String className;
 
-    public ApplicationProviderConfig(){}
-    public ApplicationProviderConfig(String jarPath, Class<? extends ApplicationProvider> className){
+    public ApplicationProviderConfig() {
+    }
+
+    public ApplicationProviderConfig(String jarPath, Class<? extends ApplicationProvider> className) {
         this.jarPath = jarPath;
         this.className = className.getCanonicalName();
     }
-    public ApplicationProviderConfig(String jarPath, String className){
+
+    public ApplicationProviderConfig(String jarPath, String className) {
         this.jarPath = jarPath;
         this.className = className;
     }
+
     @Override
     public String toString() {
-        return String.format("ApplicationProviderConfig[jarPath=%s,className=%s]",this.getJarPath(),this.getClassName());
+        return String.format("ApplicationProviderConfig[jarPath=%s,className=%s]", this.getJarPath(), this.getClassName());
     }
 
     public String getJarPath() {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
index 77ad848..7f0dbb0 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProviderDescConfig.java
@@ -18,17 +18,16 @@ package org.apache.eagle.app.config;
 
 
 import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
-import org.apache.eagle.app.spi.AbstractApplicationProvider;
 import org.apache.eagle.metadata.model.ApplicationDocs;
 import org.apache.eagle.metadata.model.Configuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.InputStream;
+import java.util.List;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.*;
-import java.io.InputStream;
-import java.util.List;
 
 @XmlRootElement(name = "application")
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -42,7 +41,7 @@ public class ApplicationProviderDescConfig {
     private Configuration configuration;
     private ApplicationDocs docs;
 
-    @XmlElementWrapper(name="streams")
+    @XmlElementWrapper(name = "streams")
     @XmlElement(name = "stream")
     private List<StreamDefinition> streams;
 
@@ -93,7 +92,7 @@ public class ApplicationProviderDescConfig {
     @Override
     public String toString() {
         return String.format("ApplicationDesc [type=%s, name=%s, version=%s, appClass=%s, viewPath=%s, configuration= %s properties, description=%s",
-                getType(),getName(),getVersion(),getAppClass(), getViewPath(), getConfiguration() == null ? 0: getConfiguration().size(),getDescription());
+            getType(), getName(), getVersion(), getAppClass(), getViewPath(), getConfiguration() == null ? 0 : getConfiguration().size(), getDescription());
     }
 
     public void setConfiguration(Configuration configuration) {
@@ -109,25 +108,25 @@ public class ApplicationProviderDescConfig {
         this.streams = streams;
     }
 
-    private final static Logger LOG = LoggerFactory.getLogger(ApplicationProviderDescConfig.class);
+    private static final Logger LOG = LoggerFactory.getLogger(ApplicationProviderDescConfig.class);
 
-    public static ApplicationProviderDescConfig loadFromXML(Class<?> classLoader, String configXmlFile){
+    public static ApplicationProviderDescConfig loadFromXML(Class<?> classLoader, String configXmlFile) {
         try {
             JAXBContext jc = JAXBContext.newInstance(ApplicationProviderDescConfig.class);
             Unmarshaller unmarshaller = jc.createUnmarshaller();
-//            InputStream is = ApplicationProviderDescConfig.class.getResourceAsStream(configXmlFile);
+            // InputStream is = ApplicationProviderDescConfig.class.getResourceAsStream(configXmlFile);
             InputStream is = classLoader.getResourceAsStream(configXmlFile);
-            if(is == null){
-                is = ApplicationProviderDescConfig.class.getResourceAsStream("/"+configXmlFile);
+            if (is == null) {
+                is = ApplicationProviderDescConfig.class.getResourceAsStream("/" + configXmlFile);
             }
-            if(is == null){
-                LOG.error("Application descriptor configuration {} is not found",configXmlFile);
-                throw new IllegalStateException("Application descriptor configuration "+configXmlFile+" is not found");
+            if (is == null) {
+                LOG.error("Application descriptor configuration {} is not found", configXmlFile);
+                throw new IllegalStateException("Application descriptor configuration " + configXmlFile + " is not found");
             }
             return (ApplicationProviderDescConfig) unmarshaller.unmarshal(is);
-        }catch (Exception ex){
-            LOG.error("Failed to load application descriptor configuration: {}",configXmlFile,ex);
-            throw new RuntimeException("Failed to load application descriptor configuration: "+configXmlFile,ex);
+        } catch (Exception ex) {
+            LOG.error("Failed to load application descriptor configuration: {}", configXmlFile, ex);
+            throw new RuntimeException("Failed to load application descriptor configuration: " + configXmlFile, ex);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProvidersConfig.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProvidersConfig.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProvidersConfig.java
index f5aaa9f..903a15f 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProvidersConfig.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/config/ApplicationProvidersConfig.java
@@ -16,11 +16,11 @@
  */
 package org.apache.eagle.app.config;
 
+import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
-import java.util.List;
 
 @XmlRootElement(name = "providers")
 @XmlAccessorType(XmlAccessType.FIELD)

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/AbstractEnvironment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/AbstractEnvironment.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/AbstractEnvironment.java
index 6f7fd97..45de7b9 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/AbstractEnvironment.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/AbstractEnvironment.java
@@ -16,47 +16,47 @@
  */
 package org.apache.eagle.app.environment;
 
-import com.typesafe.config.Config;
-import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.eagle.app.sink.KafkaStreamSink;
 import org.apache.eagle.app.sink.StreamSinkProvider;
+import com.typesafe.config.Config;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public abstract class AbstractEnvironment implements Environment {
     private final Config config;
     private final StreamSinkProvider sinkProvider;
-    private final static String APPLICATIONS_SINK_TYPE_PROPS_KEY = "application.sink.provider";
-    private final static String DEFAULT_APPLICATIONS_SINK_TYPE = KafkaStreamSink.Provider.class.getName();
-    private final static Logger LOGGER = LoggerFactory.getLogger(AbstractEnvironment.class);
+    private static final String APPLICATIONS_SINK_TYPE_PROPS_KEY = "application.sink.provider";
+    private static final String DEFAULT_APPLICATIONS_SINK_TYPE = KafkaStreamSink.Provider.class.getName();
+    private static final Logger LOGGER = LoggerFactory.getLogger(AbstractEnvironment.class);
 
-    public AbstractEnvironment(Config config){
+    public AbstractEnvironment(Config config) {
         this.config = config;
         this.sinkProvider = loadStreamSinkProvider();
     }
 
-    private StreamSinkProvider loadStreamSinkProvider(){
-        String sinkProviderClassName = config.hasPath(APPLICATIONS_SINK_TYPE_PROPS_KEY) ?
-                config.getString(APPLICATIONS_SINK_TYPE_PROPS_KEY) : DEFAULT_APPLICATIONS_SINK_TYPE;
+    private StreamSinkProvider loadStreamSinkProvider() {
+        String sinkProviderClassName = config.hasPath(APPLICATIONS_SINK_TYPE_PROPS_KEY)
+            ? config.getString(APPLICATIONS_SINK_TYPE_PROPS_KEY) : DEFAULT_APPLICATIONS_SINK_TYPE;
         try {
             Class<?> sinkProviderClass = Class.forName(sinkProviderClassName);
-            if(!StreamSinkProvider.class.isAssignableFrom(sinkProviderClass)){
-                throw new IllegalStateException(sinkProviderClassName+ "is not assignable from "+StreamSinkProvider.class.getCanonicalName());
+            if (!StreamSinkProvider.class.isAssignableFrom(sinkProviderClass)) {
+                throw new IllegalStateException(sinkProviderClassName + "is not assignable from " + StreamSinkProvider.class.getCanonicalName());
             }
-            StreamSinkProvider instance =  (StreamSinkProvider) sinkProviderClass.newInstance();
-            LOGGER.info("Loaded {}",instance);
+            StreamSinkProvider instance = (StreamSinkProvider) sinkProviderClass.newInstance();
+            LOGGER.info("Loaded {}", instance);
             return instance;
         } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
-            LOGGER.error(e.getMessage(),e);
-            throw new IllegalStateException(e.getMessage(),e.getCause());
+            LOGGER.error(e.getMessage(), e);
+            throw new IllegalStateException(e.getMessage(), e.getCause());
         }
     }
 
     @Override
     public int hashCode() {
         return new HashCodeBuilder()
-                .append(this.getClass())
-                .append(this.config()).build();
+            .append(this.getClass())
+            .append(this.config()).build();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/Environment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/Environment.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/Environment.java
index 56ce14a..9569c5f 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/Environment.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/Environment.java
@@ -16,15 +16,16 @@
  */
 package org.apache.eagle.app.environment;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.sink.StreamSinkProvider;
+import com.typesafe.config.Config;
 
 import java.io.Serializable;
 
 /**
- * Execution Environment Context
+ * Execution Environment Context.
  */
-public interface Environment extends Serializable{
+public interface Environment extends Serializable {
     Config config();
+
     StreamSinkProvider streamSink();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
index 2cc5e78..e9a6366 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntime.java
@@ -16,35 +16,44 @@
  */
 package org.apache.eagle.app.environment;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.Application;
+import com.typesafe.config.Config;
 
 /**
- * Execution Runtime Adapter
+ * Execution Runtime Adapter.
  */
-public interface ExecutionRuntime<Env extends Environment, Proc> {
+public interface ExecutionRuntime<E extends Environment, P> {
+
     /**
-     * @param environment
+     * Prepare runtime.
+     *
+     * @param environment environment context
      */
-    void prepare(Env environment);
+    void prepare(E environment);
 
-    Env environment();
+    E environment();
 
     /**
+     * Start application process.
+     *
      * @param executor
      * @param config
      */
-    void start(Application<Env, Proc> executor, Config config);
+    void start(Application<E, P> executor, Config config);
 
     /**
+     * Stop application process.
+     *
      * @param executor
      * @param config
      */
-    void stop(Application<Env, Proc> executor, Config config);
+    void stop(Application<E, P> executor, Config config);
 
     /**
+     * Check application process status.
+     *
      * @param executor
      * @param config
      */
-    void status(Application<Env, Proc> executor, Config config);
+    void status(Application<E, P> executor, Config config);
 }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeManager.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeManager.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeManager.java
index 9804d48..fc1e632 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeManager.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeManager.java
@@ -16,12 +16,12 @@
  */
 package org.apache.eagle.app.environment;
 
-import com.google.common.base.Preconditions;
-import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.impl.SparkEnvironment;
 import org.apache.eagle.app.environment.impl.SparkExecutionRuntime;
 import org.apache.eagle.app.environment.impl.StormEnvironment;
 import org.apache.eagle.app.environment.impl.StormExecutionRuntime;
+import com.google.common.base.Preconditions;
+import com.typesafe.config.Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -30,46 +30,47 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
- * Manage execution runtime corresponding to Environment
+ * Manage execution runtime corresponding to Environment.
  *
  * @see Environment
  * @see ExecutionRuntime
  */
 public class ExecutionRuntimeManager {
-    private final static ExecutionRuntimeManager INSTANCE = new ExecutionRuntimeManager();
-    private final static Logger LOGGER = LoggerFactory.getLogger(ExecutionRuntimeManager.class);
+    private static final ExecutionRuntimeManager INSTANCE = new ExecutionRuntimeManager();
+    private static final Logger LOGGER = LoggerFactory.getLogger(ExecutionRuntimeManager.class);
 
     static {
-        getInstance().register(StormEnvironment.class,new StormExecutionRuntime.Provider());
-        getInstance().register(SparkEnvironment.class,new SparkExecutionRuntime.Provider());
+        getInstance().register(StormEnvironment.class, new StormExecutionRuntime.Provider());
+        getInstance().register(SparkEnvironment.class, new SparkExecutionRuntime.Provider());
     }
 
     private final Map<Class<? extends Environment>, ExecutionRuntimeProvider> executionRuntimeProviders;
     private final Map<Environment, ExecutionRuntime> executionRuntimeCache;
 
-    private ExecutionRuntimeManager(){
+    private ExecutionRuntimeManager() {
         executionRuntimeProviders = new HashMap<>();
         executionRuntimeCache = new HashMap<>();
     }
 
-    public static ExecutionRuntimeManager getInstance(){
+    public static ExecutionRuntimeManager getInstance() {
         return INSTANCE;
     }
 
-    public <E extends Environment,P> ExecutionRuntime getRuntime(E environment) {
-        Preconditions.checkNotNull(environment,"Failed to create execution runtime as environment is null");
-        if(executionRuntimeCache.containsKey(environment))
+    public <E extends Environment, P> ExecutionRuntime getRuntime(E environment) {
+        Preconditions.checkNotNull(environment, "Failed to create execution runtime as environment is null");
+        if (executionRuntimeCache.containsKey(environment)) {
             return executionRuntimeCache.get(environment);
+        }
 
-        if(executionRuntimeProviders.containsKey(environment.getClass())){
-            ExecutionRuntime<E,P> runtime = ((ExecutionRuntimeProvider<E,P>)executionRuntimeProviders.get(environment.getClass())).get();
+        if (executionRuntimeProviders.containsKey(environment.getClass())) {
+            ExecutionRuntime<E, P> runtime = ((ExecutionRuntimeProvider<E, P>) executionRuntimeProviders.get(environment.getClass())).get();
             runtime.prepare(environment);
-            executionRuntimeCache.put(environment,runtime);
-            LOGGER.info("Created new execution runtime {} for environment: {}",runtime,environment);
+            executionRuntimeCache.put(environment, runtime);
+            LOGGER.info("Created new execution runtime {} for environment: {}", runtime, environment);
             return runtime;
         } else {
-            LOGGER.error("No matched execution runtime found for environment: "+environment);
-            throw new IllegalStateException("No matched execution runtime found for environment: "+environment);
+            LOGGER.error("No matched execution runtime found for environment: " + environment);
+            throw new IllegalStateException("No matched execution runtime found for environment: " + environment);
         }
     }
 
@@ -78,15 +79,15 @@ public class ExecutionRuntimeManager {
             E environment = environmentClass.getConstructor(Config.class).newInstance(config);
             return getRuntime(environment);
         } catch (InstantiationException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
-            LOGGER.error("Failed to create environment instance of type: "+environmentClass,e);
-            throw new RuntimeException("Failed to create environment instance of type: "+environmentClass,e);
+            LOGGER.error("Failed to create environment instance of type: " + environmentClass, e);
+            throw new RuntimeException("Failed to create environment instance of type: " + environmentClass, e);
         }
     }
 
-    public void register(Class<? extends Environment> appSuperClass,ExecutionRuntimeProvider executionRuntimeProvider){
-        if(executionRuntimeProviders.containsKey(appSuperClass)){
-            throw new IllegalStateException("Duplicated application type registered: "+appSuperClass.getCanonicalName());
+    public void register(Class<? extends Environment> appSuperClass, ExecutionRuntimeProvider executionRuntimeProvider) {
+        if (executionRuntimeProviders.containsKey(appSuperClass)) {
+            throw new IllegalStateException("Duplicated application type registered: " + appSuperClass.getCanonicalName());
         }
-        executionRuntimeProviders.put(appSuperClass,executionRuntimeProvider);
+        executionRuntimeProviders.put(appSuperClass, executionRuntimeProvider);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeProvider.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeProvider.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeProvider.java
index 5728eb5..44be0f0 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeProvider.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/ExecutionRuntimeProvider.java
@@ -16,6 +16,6 @@
  */
 package org.apache.eagle.app.environment;
 
-public interface ExecutionRuntimeProvider<Env extends Environment, Proc>{
-    ExecutionRuntime<Env,Proc> get();
+public interface ExecutionRuntimeProvider<E extends Environment, P> {
+    ExecutionRuntime<E, P> get();
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkEnvironment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkEnvironment.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkEnvironment.java
index 07113db..1f9d6fa 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkEnvironment.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkEnvironment.java
@@ -16,14 +16,14 @@
  */
 package org.apache.eagle.app.environment.impl;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.AbstractEnvironment;
+import com.typesafe.config.Config;
 
 /**
- * Storm Execution Environment Context
+ * Storm Execution Environment Context.
  */
 public class SparkEnvironment extends AbstractEnvironment {
-    public SparkEnvironment(Config config){
+    public SparkEnvironment(Config config) {
         super(config);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
index 23aaa67..e2fc7d5 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/SparkExecutionRuntime.java
@@ -16,10 +16,10 @@
  */
 package org.apache.eagle.app.environment.impl;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.Application;
 import org.apache.eagle.app.environment.ExecutionRuntime;
 import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
+import com.typesafe.config.Config;
 
 public class SparkExecutionRuntime implements ExecutionRuntime<SparkEnvironment,Object> {
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
index 6715a2b..18675a6 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormEnvironment.java
@@ -16,12 +16,12 @@
  */
 package org.apache.eagle.app.environment.impl;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.environment.AbstractEnvironment;
 import org.apache.eagle.app.sink.StormStreamSink;
+import com.typesafe.config.Config;
 
 /**
- * Storm Execution Environment Context
+ * Storm Execution Environment Context.
  */
 public class StormEnvironment extends AbstractEnvironment {
     public StormEnvironment(Config envConfig) {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
index 99dbed8..7acfc62 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/environment/impl/StormExecutionRuntime.java
@@ -16,17 +16,17 @@
  */
 package org.apache.eagle.app.environment.impl;
 
+import org.apache.eagle.app.Application;
+import org.apache.eagle.app.environment.ExecutionRuntime;
+import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
+import org.apache.eagle.app.utils.DynamicJarPathFinder;
+import org.apache.eagle.metadata.model.ApplicationEntity;
 import backtype.storm.Config;
 import backtype.storm.LocalCluster;
 import backtype.storm.StormSubmitter;
 import backtype.storm.generated.*;
 import backtype.storm.utils.NimbusClient;
 import com.google.common.base.Preconditions;
-import org.apache.eagle.app.Application;
-import org.apache.eagle.app.environment.ExecutionRuntime;
-import org.apache.eagle.app.environment.ExecutionRuntimeProvider;
-import org.apache.eagle.app.utils.DynamicJarPathFinder;
-import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.thrift7.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationExtensionLoader.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationExtensionLoader.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationExtensionLoader.java
index 762b5fe..a74b6f2 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationExtensionLoader.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationExtensionLoader.java
@@ -16,22 +16,22 @@
  */
 package org.apache.eagle.app.module;
 
-import com.google.inject.Guice;
-import com.google.inject.Module;
-import com.google.inject.Stage;
 import org.apache.eagle.app.service.ApplicationProviderService;
 import org.apache.eagle.common.module.ModuleRegistry;
 import org.apache.eagle.common.module.ModuleRegistryImpl;
+import com.google.inject.Guice;
+import com.google.inject.Module;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class ApplicationExtensionLoader {
-    private final static Logger LOGGER = LoggerFactory.getLogger(ApplicationExtensionLoader.class);
-    public static ModuleRegistry load(Module ... context){
+    private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationExtensionLoader.class);
+
+    public static ModuleRegistry load(Module... context) {
         LOGGER.warn("Loading application extension modules");
         ModuleRegistry registry = new ModuleRegistryImpl();
-        Guice.createInjector(context).getInstance(ApplicationProviderService.class).getProviders().forEach((provider)->{
-            LOGGER.warn("Registering modules from {}",provider);
+        Guice.createInjector(context).getInstance(ApplicationProviderService.class).getProviders().forEach((provider) -> {
+            LOGGER.warn("Registering modules from {}", provider);
             provider.register(registry);
         });
         return registry;

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationGuiceModule.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationGuiceModule.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationGuiceModule.java
index 757a428..d4a176d 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationGuiceModule.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/module/ApplicationGuiceModule.java
@@ -1,4 +1,4 @@
-/**
+/*
  * 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.
@@ -16,18 +16,18 @@
  */
 package org.apache.eagle.app.module;
 
-import com.google.inject.AbstractModule;
-import com.google.inject.Singleton;
-import com.google.inject.util.Providers;
 import org.apache.eagle.app.service.ApplicationManagementService;
-import org.apache.eagle.app.service.impl.ApplicationManagementServiceImpl;
 import org.apache.eagle.app.service.ApplicationProviderService;
+import org.apache.eagle.app.service.impl.ApplicationManagementServiceImpl;
 import org.apache.eagle.metadata.service.ApplicationDescService;
-
+import com.google.inject.AbstractModule;
+import com.google.inject.Singleton;
+import com.google.inject.util.Providers;
 
 public class ApplicationGuiceModule extends AbstractModule {
     private ApplicationProviderService appProviderInst;
-    public ApplicationGuiceModule(ApplicationProviderService appProviderInst){
+
+    public ApplicationGuiceModule(ApplicationProviderService appProviderInst) {
         this.appProviderInst = appProviderInst;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/resource/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/resource/ApplicationResource.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/resource/ApplicationResource.java
index 12d2d2d..713ced5 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/resource/ApplicationResource.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/resource/ApplicationResource.java
@@ -17,7 +17,6 @@
 package org.apache.eagle.app.resource;
 
 
-import com.google.inject.Inject;
 import org.apache.eagle.app.service.ApplicationManagementService;
 import org.apache.eagle.app.service.ApplicationOperations;
 import org.apache.eagle.app.service.ApplicationProviderService;
@@ -25,10 +24,11 @@ import org.apache.eagle.metadata.model.ApplicationDesc;
 import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.eagle.metadata.resource.RESTResponse;
 import org.apache.eagle.metadata.service.ApplicationEntityService;
+import com.google.inject.Inject;
 
+import java.util.Collection;
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
-import java.util.Collection;
 
 @Path("/apps")
 public class ApplicationResource {
@@ -38,9 +38,9 @@ public class ApplicationResource {
 
     @Inject
     public ApplicationResource(
-            ApplicationProviderService providerService,
-            ApplicationManagementService applicationManagementService,
-            ApplicationEntityService entityService){
+        ApplicationProviderService providerService,
+        ApplicationManagementService applicationManagementService,
+        ApplicationEntityService entityService) {
         this.providerService = providerService;
         this.applicationManagementService = applicationManagementService;
         this.entityService = entityService;
@@ -49,22 +49,22 @@ public class ApplicationResource {
     @GET
     @Path("/providers")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Collection<ApplicationDesc>> getApplicationDescs(){
+    public RESTResponse<Collection<ApplicationDesc>> getApplicationDescs() {
         return RESTResponse.async(providerService::getApplicationDescs).get();
     }
 
     @GET
     @Path("/providers/{type}")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<ApplicationDesc> getApplicationDescByType(@PathParam("type") String type){
-        return RESTResponse.async(()->providerService.getApplicationDescByType(type)).get();
+    public RESTResponse<ApplicationDesc> getApplicationDescByType(@PathParam("type") String type) {
+        return RESTResponse.async(() -> providerService.getApplicationDescByType(type)).get();
     }
 
     @PUT
     @Path("/providers/reload")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Collection<ApplicationDesc>> reloadApplicationDescs(){
-        return RESTResponse.<Collection<ApplicationDesc>>async((response)-> {
+    public RESTResponse<Collection<ApplicationDesc>> reloadApplicationDescs() {
+        return RESTResponse.<Collection<ApplicationDesc>>async((response) -> {
             providerService.reload();
             response.message("Successfully reload application providers");
             response.data(providerService.getApplicationDescs());
@@ -73,8 +73,8 @@ public class ApplicationResource {
 
     @GET
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Collection<ApplicationEntity>> getApplicationEntities(@QueryParam("siteId") String siteId){
-        return RESTResponse.async(()-> {
+    public RESTResponse<Collection<ApplicationEntity>> getApplicationEntities(@QueryParam("siteId") String siteId) {
+        return RESTResponse.async(() -> {
             if (siteId == null) {
                 return entityService.findAll();
             } else {
@@ -86,8 +86,8 @@ public class ApplicationResource {
     @GET
     @Path("/{appUuid}")
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<ApplicationEntity> getApplicationEntityByUUID(@PathParam("appUuid") String appUuid){
-        return RESTResponse.async(()->entityService.getByUUID(appUuid)).get();
+    public RESTResponse<ApplicationEntity> getApplicationEntityByUUID(@PathParam("appUuid") String appUuid) {
+        return RESTResponse.async(() -> entityService.getByUUID(appUuid)).get();
     }
 
     /**
@@ -96,16 +96,16 @@ public class ApplicationResource {
      * {
      *      uuid: APPLICATION_UUID
      * }
-     * </pre>
+     * </pre>.
      */
     @POST
     @Path("/install")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<ApplicationEntity> installApplication(ApplicationOperations.InstallOperation operation){
-        return RESTResponse.<ApplicationEntity>async((response)-> {
+    public RESTResponse<ApplicationEntity> installApplication(ApplicationOperations.InstallOperation operation) {
+        return RESTResponse.<ApplicationEntity>async((response) -> {
             ApplicationEntity entity = applicationManagementService.install(operation);
-            response.message("Successfully installed application "+operation.getAppType()+" onto site "+operation.getSiteId());
+            response.message("Successfully installed application " + operation.getAppType() + " onto site " + operation.getSiteId());
             response.data(entity);
         }).get();
     }
@@ -116,7 +116,7 @@ public class ApplicationResource {
      * {
      *      uuid: APPLICATION_UUID
      * }
-     * </pre>
+     * </pre>.
      *
      * @param operation
      */
@@ -124,10 +124,10 @@ public class ApplicationResource {
     @Path("/uninstall")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Void> uninstallApplication(ApplicationOperations.UninstallOperation operation){
-        return RESTResponse.<Void>async((response)-> {
+    public RESTResponse<Void> uninstallApplication(ApplicationOperations.UninstallOperation operation) {
+        return RESTResponse.<Void>async((response) -> {
             ApplicationEntity entity = applicationManagementService.uninstall(operation);
-            response.success(true).message("Successfully uninstalled application "+entity.getUuid());
+            response.success(true).message("Successfully uninstalled application " + entity.getUuid());
         }).get();
     }
 
@@ -137,17 +137,18 @@ public class ApplicationResource {
      * {
      *      uuid: APPLICATION_UUID
      * }
-     *operation
+     * </pre>
+     * operation.
      * @param operation
      */
     @POST
     @Path("/start")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Void> startApplication(ApplicationOperations.StartOperation operation){
-        return RESTResponse.<Void>async((response)-> {
+    public RESTResponse<Void> startApplication(ApplicationOperations.StartOperation operation) {
+        return RESTResponse.<Void>async((response) -> {
             ApplicationEntity entity = applicationManagementService.start(operation);
-            response.success(true).message("Successfully started application "+entity.getUuid());
+            response.success(true).message("Successfully started application " + entity.getUuid());
         }).get();
     }
 
@@ -157,17 +158,18 @@ public class ApplicationResource {
      * {
      *      uuid: APPLICATION_UUID
      * }
-     * </pre>
+     * </pre>.
+     *
      * @param operation
      */
     @POST
     @Path("/stop")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
-    public RESTResponse<Void> stopApplication(ApplicationOperations.StopOperation operation){
-        return RESTResponse.<Void>async((response)-> {
+    public RESTResponse<Void> stopApplication(ApplicationOperations.StopOperation operation) {
+        return RESTResponse.<Void>async((response) -> {
             ApplicationEntity entity = applicationManagementService.stop(operation);
-            response.success(true).message("Successfully stopped application "+entity.getUuid());
+            response.success(true).message("Successfully stopped application " + entity.getUuid());
         }).get();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
index 1a80b78..f7f895e 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationContext.java
@@ -16,9 +16,6 @@
  */
 package org.apache.eagle.app.service;
 
-import com.google.common.base.Preconditions;
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
 import org.apache.eagle.alert.coordination.model.Kafka2TupleMetadata;
 import org.apache.eagle.alert.coordination.model.Tuple2StreamMetadata;
 import org.apache.eagle.alert.engine.coordinator.StreamDefinition;
@@ -33,18 +30,23 @@ import org.apache.eagle.app.sink.KafkaStreamSinkConfig;
 import org.apache.eagle.metadata.model.ApplicationEntity;
 import org.apache.eagle.metadata.model.StreamDesc;
 import org.apache.eagle.metadata.model.StreamSinkConfig;
+import com.google.common.base.Preconditions;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
 
 import java.io.Serializable;
-import java.util.*;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import java.util.stream.Collectors;
 
 /**
  * Managed Application Interface: org.apache.eagle.app.service.ApplicationContext
- *
  * <ul>
- *     <li>Application Metadata Entity (Persistence): org.apache.eagle.metadata.model.ApplicationEntity</li>
- *     <li>Application Processing Logic (Execution): org.apache.eagle.app.Application</li>
- *     <li>Application Lifecycle Listener (Installation): org.apache.eagle.app.ApplicationLifecycle</li>
+ * <li>Application Metadata Entity (Persistence): org.apache.eagle.metadata.model.ApplicationEntity</li>
+ * <li>Application Processing Logic (Execution): org.apache.eagle.app.Application</li>
+ * <li>Application Lifecycle Listener (Installation): org.apache.eagle.app.ApplicationLifecycle</li>
  * </ul>
  */
 public class ApplicationContext implements Serializable, ApplicationLifecycle {
@@ -55,17 +57,17 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
     private final IMetadataDao alertMetadataService;
 
     /**
-     * @param metadata ApplicationEntity
-     * @param application Application
+     * @param metadata    ApplicationEntity.
+     * @param application Application.
      */
-    public ApplicationContext(Application application, ApplicationEntity metadata, Config envConfig, IMetadataDao alertMetadataService){
-        Preconditions.checkNotNull(application,"Application is null");
-        Preconditions.checkNotNull(metadata,"ApplicationEntity is null");
+    public ApplicationContext(Application application, ApplicationEntity metadata, Config envConfig, IMetadataDao alertMetadataService) {
+        Preconditions.checkNotNull(application, "Application is null");
+        Preconditions.checkNotNull(metadata, "ApplicationEntity is null");
         this.application = application;
         this.metadata = metadata;
-        this.runtime = ExecutionRuntimeManager.getInstance().getRuntime(application.getEnvironmentType(),envConfig);
-        Map<String,Object> executionConfig = metadata.getConfiguration();
-        if(executionConfig == null) {
+        this.runtime = ExecutionRuntimeManager.getInstance().getRuntime(application.getEnvironmentType(), envConfig);
+        Map<String, Object> executionConfig = metadata.getConfiguration();
+        if (executionConfig == null) {
             executionConfig = Collections.emptyMap();
         }
 
@@ -80,7 +82,7 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
 
     @Override
     public void onInstall() {
-        if(metadata.getDescriptor().getStreams()!=null) {
+        if (metadata.getDescriptor().getStreams() != null) {
             List<StreamDesc> streamDescCollection = metadata.getDescriptor().getStreams().stream().map((streamDefinition -> {
                 StreamSinkConfig streamSinkConfig = this.runtime.environment().streamSink().getSinkConfig(streamDefinition.getStreamId(), this.config);
                 StreamDesc streamDesc = new StreamDesc();
@@ -92,7 +94,7 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
             metadata.setStreams(streamDescCollection);
 
             // iterate each stream descriptor and create alert datasource for each
-            for(StreamDesc streamDesc : streamDescCollection) {
+            for (StreamDesc streamDesc : streamDescCollection) {
                 // only take care of Kafka sink
                 if (streamDesc.getSink() instanceof KafkaStreamSinkConfig) {
                     KafkaStreamSinkConfig kafkaCfg = (KafkaStreamSinkConfig) streamDesc.getSink();
@@ -121,10 +123,11 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
     @Override
     public void onUninstall() {
         // we should remove alert data source and stream definition while we do uninstall
-        if(metadata.getStreams() == null)
+        if (metadata.getStreams() == null) {
             return;
+        }
         // iterate each stream descriptor and create alert datasource for each
-        for(StreamDesc streamDesc : metadata.getStreams()) {
+        for (StreamDesc streamDesc : metadata.getStreams()) {
             alertMetadataService.removeDataSource(metadata.getAppId());
             alertMetadataService.removeStream(streamDesc.getStreamId());
         }
@@ -132,12 +135,12 @@ public class ApplicationContext implements Serializable, ApplicationLifecycle {
 
     @Override
     public void onStart() {
-        this.runtime.start(this.application,this.config);
+        this.runtime.start(this.application, this.config);
     }
 
     @Override
     public void onStop() {
-        this.runtime.stop(this.application,this.config);
+        this.runtime.stop(this.application, this.config);
     }
 
     public ApplicationEntity getMetadata() {

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationManagementService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationManagementService.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationManagementService.java
index 82c441a..b93bb77 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationManagementService.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationManagementService.java
@@ -21,6 +21,7 @@ import org.apache.eagle.metadata.model.ApplicationEntity;
 
 public interface ApplicationManagementService {
     /**
+     * Install application.
      *
      * @param operation
      * @return
@@ -28,6 +29,7 @@ public interface ApplicationManagementService {
     ApplicationEntity install(ApplicationOperations.InstallOperation operation) throws EntityNotFoundException;
 
     /**
+     * Uninstall application.
      *
      * @param operation
      * @return
@@ -35,6 +37,7 @@ public interface ApplicationManagementService {
     ApplicationEntity uninstall(ApplicationOperations.UninstallOperation operation);
 
     /**
+     * Start application.
      *
      * @param operation
      * @return
@@ -42,6 +45,7 @@ public interface ApplicationManagementService {
     ApplicationEntity start(ApplicationOperations.StartOperation operation);
 
     /**
+     * Stop application.
      *
      * @param operation
      * @return

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationOperations.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationOperations.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationOperations.java
index 4815a90..8717f83 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationOperations.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationOperations.java
@@ -26,29 +26,33 @@ public final class ApplicationOperations {
         String getType();
     }
 
-    private final static String INSTALL = "INSTALL";
-    private final static String UNINSTALL = "UNINSTALL";
-    private final static String START = "START";
-    private final static String STOP = "STOP";
+    private static final String INSTALL = "INSTALL";
+    private static final String UNINSTALL = "UNINSTALL";
+    private static final String START = "START";
+    private static final String STOP = "STOP";
 
-    public static class InstallOperation implements Operation{
+    public static class InstallOperation implements Operation {
         private String siteId;
         private String appType;
         private ApplicationEntity.Mode mode = ApplicationEntity.Mode.LOCAL;
         private String jarPath;
-        private Map<String,Object> configuration;
+        private Map<String, Object> configuration;
 
-        public InstallOperation(){}
-        public InstallOperation(String siteId,String appType){
+        public InstallOperation() {
+        }
+
+        public InstallOperation(String siteId, String appType) {
             this.setSiteId(siteId);
             this.setAppType(appType);
         }
-        public InstallOperation(String siteId,String appType,ApplicationEntity.Mode mode){
+
+        public InstallOperation(String siteId, String appType, ApplicationEntity.Mode mode) {
             this.setSiteId(siteId);
             this.setAppType(appType);
             this.setMode(mode);
         }
-        public InstallOperation(String siteId,String appType,ApplicationEntity.Mode mode,Map<String,Object> configuration){
+
+        public InstallOperation(String siteId, String appType, ApplicationEntity.Mode mode, Map<String, Object> configuration) {
             this.setSiteId(siteId);
             this.setAppType(appType);
             this.setMode(mode);
@@ -56,17 +60,20 @@ public final class ApplicationOperations {
         }
 
         public String getSiteId() {
-           return siteId;
-       }
+            return siteId;
+        }
+
         public void setSiteId(String siteId) {
-           this.siteId = siteId;
-       }
+            this.siteId = siteId;
+        }
+
         public String getAppType() {
-           return appType;
-       }
+            return appType;
+        }
+
         public void setAppType(String appType) {
-           this.appType = appType;
-       }
+            this.appType = appType;
+        }
 
         public Map<String, Object> getConfiguration() {
             return configuration;
@@ -98,14 +105,18 @@ public final class ApplicationOperations {
         }
     }
 
-    public static class UninstallOperation implements Operation{
+    public static class UninstallOperation implements Operation {
         private String uuid;
         private String appId;
-        public UninstallOperation(){}
-        public UninstallOperation(String uuid){
+
+        public UninstallOperation() {
+        }
+
+        public UninstallOperation(String uuid) {
             this.setUuid(uuid);
         }
-        public UninstallOperation(String uuid,String appId){
+
+        public UninstallOperation(String uuid, String appId) {
             this.setUuid(uuid);
             this.setAppId(appId);
         }
@@ -113,6 +124,7 @@ public final class ApplicationOperations {
         public String getUuid() {
             return uuid;
         }
+
         public void setUuid(String uuid) {
             this.uuid = uuid;
         }
@@ -131,20 +143,26 @@ public final class ApplicationOperations {
         }
     }
 
-    public static class StartOperation implements Operation{
+    public static class StartOperation implements Operation {
         private String uuid;
         private String appId;
-        public StartOperation(){}
-        public StartOperation(String uuid){
+
+        public StartOperation() {
+        }
+
+        public StartOperation(String uuid) {
             this.setUuid(uuid);
         }
-        public StartOperation(String uuid,String appId){
+
+        public StartOperation(String uuid, String appId) {
             this.setUuid(uuid);
             this.setAppId(appId);
         }
+
         public String getUuid() {
             return uuid;
         }
+
         public void setUuid(String uuid) {
             this.uuid = uuid;
         }
@@ -163,21 +181,26 @@ public final class ApplicationOperations {
         }
     }
 
-    public static class StopOperation implements Operation{
+    public static class StopOperation implements Operation {
         private String uuid;
         private String appId;
 
-        public StopOperation(){}
-        public StopOperation(String uuid){
+        public StopOperation() {
+        }
+
+        public StopOperation(String uuid) {
             this.setUuid(uuid);
         }
-        public StopOperation(String uuid,String appId){
+
+        public StopOperation(String uuid, String appId) {
             this.setUuid(uuid);
             this.setAppId(appId);
         }
+
         public String getUuid() {
             return uuid;
         }
+
         public void setUuid(String uuid) {
             this.uuid = uuid;
         }

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderLoader.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderLoader.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderLoader.java
index 0c895a3..d526bd4 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderLoader.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderLoader.java
@@ -16,10 +16,10 @@
  */
 package org.apache.eagle.app.service;
 
-import com.typesafe.config.Config;
 import org.apache.eagle.app.service.impl.ApplicationProviderConfigLoader;
 import org.apache.eagle.app.service.impl.ApplicationProviderSPILoader;
 import org.apache.eagle.app.spi.ApplicationProvider;
+import com.typesafe.config.Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -29,8 +29,8 @@ import java.util.Map;
 
 public abstract class ApplicationProviderLoader {
     private final Config config;
-    private final Map<String,ApplicationProvider> providers;
-    private final static Logger LOG = LoggerFactory.getLogger(ApplicationProviderLoader.class);
+    private final Map<String, ApplicationProvider> providers;
+    private static final Logger LOG = LoggerFactory.getLogger(ApplicationProviderLoader.class);
 
     public ApplicationProviderLoader(Config config) {
         this.config = config;
@@ -43,33 +43,34 @@ public abstract class ApplicationProviderLoader {
         return config;
     }
 
-    protected void registerProvider(ApplicationProvider provider){
-        if(providers.containsKey(provider.getApplicationDesc().getType())){
-            throw new RuntimeException("Duplicated APPLICATION_TYPE: "+provider.getApplicationDesc().getType()+", was already registered by provider: "+providers.get(provider.getApplicationDesc().getType()));
+    protected void registerProvider(ApplicationProvider provider) {
+        if (providers.containsKey(provider.getApplicationDesc().getType())) {
+            throw new RuntimeException("Duplicated APPLICATION_TYPE: " + provider.getApplicationDesc().getType()
+                + ", was already registered by provider: " + providers.get(provider.getApplicationDesc().getType()));
         }
-        providers.put(provider.getApplicationDesc().getType(),provider);
-        LOG.info("Initialized application provider: {}",provider);
+        providers.put(provider.getApplicationDesc().getType(), provider);
+        LOG.info("Initialized application provider: {}", provider);
     }
 
-    public Collection<ApplicationProvider> getProviders(){
+    public Collection<ApplicationProvider> getProviders() {
         return providers.values();
     }
 
     public ApplicationProvider<?> getApplicationProviderByType(String type) {
-        if(providers.containsKey(type)) {
+        if (providers.containsKey(type)) {
             return providers.get(type);
-        }else{
-            throw new IllegalArgumentException("Unknown Application Type: "+type);
+        } else {
+            throw new IllegalArgumentException("Unknown Application Type: " + type);
         }
     }
 
-    public void reset(){
+    public void reset() {
         providers.clear();
     }
 
-    public static String getDefaultAppProviderLoader(){
-        if(ApplicationProviderConfigLoader
-                .appProviderConfExists(ApplicationProviderConfigLoader.DEFAULT_APPLICATIONS_CONFIG_FILE)){
+    public static String getDefaultAppProviderLoader() {
+        if (ApplicationProviderConfigLoader
+            .appProviderConfExists(ApplicationProviderConfigLoader.DEFAULT_APPLICATIONS_CONFIG_FILE)) {
             return ApplicationProviderConfigLoader.class.getCanonicalName();
         } else {
             return ApplicationProviderSPILoader.class.getCanonicalName();

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderService.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderService.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderService.java
index 52dfb5c..71e7eb0 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderService.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/ApplicationProviderService.java
@@ -19,13 +19,14 @@ package org.apache.eagle.app.service;
 
 import org.apache.eagle.app.Application;
 import org.apache.eagle.app.spi.ApplicationProvider;
-import org.apache.eagle.app.config.ApplicationProviderConfig;
 import org.apache.eagle.metadata.service.ApplicationDescService;
 
 import java.util.Collection;
 
 public interface ApplicationProviderService extends ApplicationDescService {
     void reload();
+
     Collection<ApplicationProvider> getProviders();
+
     <T extends Application> ApplicationProvider<T> getApplicationProviderByType(String type);
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/c752ed86/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
index c355a10..14abbc3 100644
--- a/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
+++ b/eagle-core/eagle-app/eagle-app-base/src/main/java/org/apache/eagle/app/service/impl/ApplicationManagementServiceImpl.java
@@ -16,15 +16,10 @@
  */
 package org.apache.eagle.app.service.impl;
 
-import com.google.common.base.Preconditions;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.typesafe.config.Config;
-import com.typesafe.config.ConfigFactory;
 import org.apache.eagle.alert.metadata.IMetadataDao;
 import org.apache.eagle.app.service.ApplicationContext;
-import org.apache.eagle.app.service.ApplicationOperations;
 import org.apache.eagle.app.service.ApplicationManagementService;
+import org.apache.eagle.app.service.ApplicationOperations;
 import org.apache.eagle.app.service.ApplicationProviderService;
 import org.apache.eagle.app.spi.ApplicationProvider;
 import org.apache.eagle.metadata.exceptions.EntityNotFoundException;
@@ -34,6 +29,10 @@ import org.apache.eagle.metadata.model.Property;
 import org.apache.eagle.metadata.model.SiteEntity;
 import org.apache.eagle.metadata.service.ApplicationEntityService;
 import org.apache.eagle.metadata.service.SiteEntityService;
+import com.google.common.base.Preconditions;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.typesafe.config.Config;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,15 +47,15 @@ public class ApplicationManagementServiceImpl implements ApplicationManagementSe
     private final ApplicationEntityService applicationEntityService;
     private final IMetadataDao alertMetadataService;
     private final Config config;
-    private final static Logger LOGGER = LoggerFactory.getLogger(ApplicationManagementServiceImpl.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationManagementServiceImpl.class);
 
     @Inject
     public ApplicationManagementServiceImpl(
-            Config config,
-            SiteEntityService siteEntityService,
-            ApplicationProviderService applicationProviderService,
-            ApplicationEntityService applicationEntityService,
-            IMetadataDao alertMetadataService){
+        Config config,
+        SiteEntityService siteEntityService,
+        ApplicationProviderService applicationProviderService,
+        ApplicationEntityService applicationEntityService,
+        IMetadataDao alertMetadataService) {
         this.config = config;
         this.siteEntityService = siteEntityService;
         this.applicationProviderService = applicationProviderService;
@@ -66,15 +65,15 @@ public class ApplicationManagementServiceImpl implements ApplicationManagementSe
 
     @Override
     public ApplicationEntity install(ApplicationOperations.InstallOperation operation) throws EntityNotFoundException {
-        Preconditions.checkNotNull(operation.getSiteId(),"siteId is null");
-        Preconditions.checkNotNull(operation.getAppType(),"appType is null");
-        if(operation.getMode().equals(ApplicationEntity.Mode.CLUSTER)){
-            Preconditions.checkNotNull(operation.getJarPath(),"jarPath is null when mode is CLUSTER");
+        Preconditions.checkNotNull(operation.getSiteId(), "siteId is null");
+        Preconditions.checkNotNull(operation.getAppType(), "appType is null");
+        if (operation.getMode().equals(ApplicationEntity.Mode.CLUSTER)) {
+            Preconditions.checkNotNull(operation.getJarPath(), "jarPath is null when mode is CLUSTER");
         }
         SiteEntity siteEntity = siteEntityService.getBySiteId(operation.getSiteId());
-        Preconditions.checkNotNull(siteEntity,"Site with ID: "+operation.getSiteId()+" is not found");
+        Preconditions.checkNotNull(siteEntity, "Site with ID: " + operation.getSiteId() + " is not found");
         ApplicationDesc appDesc = applicationProviderService.getApplicationDescByType(operation.getAppType());
-        Preconditions.checkNotNull("Application with TYPE: "+operation.getAppType()+" is not found");
+        Preconditions.checkNotNull("Application with TYPE: " + operation.getAppType() + " is not found");
         ApplicationEntity applicationEntity = new ApplicationEntity();
         applicationEntity.setDescriptor(appDesc);
         applicationEntity.setSite(siteEntity);
@@ -92,31 +91,31 @@ public class ApplicationManagementServiceImpl implements ApplicationManagementSe
         ApplicationProvider provider = applicationProviderService.getApplicationProviderByType(operation.getAppType());
 
         List<Property> propertyList = provider.getApplicationDesc().getConfiguration().getProperties();
-        for(Property p : propertyList){
+        for (Property p : propertyList) {
             appConfig.put(p.getName(), p.getValue());
         }
-        if(operation.getConfiguration() != null) {
+        if (operation.getConfiguration() != null) {
             appConfig.putAll(operation.getConfiguration());
         }
         applicationEntity.setConfiguration(appConfig);
         ApplicationContext applicationContext = new ApplicationContext(
-                applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
-                applicationEntity,config, alertMetadataService);
+            applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
+            applicationEntity, config, alertMetadataService);
         applicationContext.onInstall();
         return applicationEntityService.create(applicationEntity);
     }
 
     @Override
     public ApplicationEntity uninstall(ApplicationOperations.UninstallOperation operation) {
-        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(),operation.getAppId());
+        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(), operation.getAppId());
         ApplicationContext applicationContext = new ApplicationContext(
-                applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
-                applicationEntity,config, alertMetadataService);
+            applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
+            applicationEntity, config, alertMetadataService);
         // TODO: Check status, skip stop if already STOPPED
         try {
             applicationContext.onStop();
-        }catch (Throwable throwable){
-            LOGGER.error(throwable.getMessage(),throwable);
+        } catch (Throwable throwable) {
+            LOGGER.error(throwable.getMessage(), throwable);
         }
         applicationContext.onUninstall();
         return applicationEntityService.delete(applicationEntity);
@@ -124,20 +123,20 @@ public class ApplicationManagementServiceImpl implements ApplicationManagementSe
 
     @Override
     public ApplicationEntity start(ApplicationOperations.StartOperation operation) {
-        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(),operation.getAppId());
+        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(), operation.getAppId());
         ApplicationContext applicationContext = new ApplicationContext(
-                applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
-                applicationEntity,config, alertMetadataService);
+            applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
+            applicationEntity, config, alertMetadataService);
         applicationContext.onStart();
         return applicationEntity;
     }
 
     @Override
     public ApplicationEntity stop(ApplicationOperations.StopOperation operation) {
-        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(),operation.getAppId());
+        ApplicationEntity applicationEntity = applicationEntityService.getByUUIDOrAppId(operation.getUuid(), operation.getAppId());
         ApplicationContext applicationContext = new ApplicationContext(
-                applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
-                applicationEntity,config, alertMetadataService);
+            applicationProviderService.getApplicationProviderByType(applicationEntity.getDescriptor().getType()).getApplication(),
+            applicationEntity, config, alertMetadataService);
         applicationContext.onStop();
         return applicationEntity;
     }


Mime
View raw message