Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Chiu <[email protected]>
  • Loading branch information
Alan Chiu committed May 4, 2021
1 parent fff728f commit e24eb69
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public EnvoyHTTPStream startStream(EnvoyHTTPCallbacks callbacks) {
return envoyEngine.startStream(callbacks);
}

public int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML,
String logLevel) {
public int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration,
String logLevel) {
// re-enable lifecycle-based stat flushing when https://github.com/lyft/envoy-mobile/issues/748
// gets fixed. AndroidAppLifecycleMonitor monitor = new AndroidAppLifecycleMonitor();
// application.registerActivityLifecycleCallbacks(monitor);
return envoyEngine.runWithConfig(envoyConfiguration, configurationYAML, logLevel);
return envoyEngine.runWithTemplate(configurationYAML, envoyConfiguration, logLevel);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.envoyproxy.envoymobile.engine;

import io.envoyproxy.envoymobile.engine.types.EnvoyHTTPCallbacks;
import io.envoyproxy.envoymobile.engine.types.EnvoyLogger;
import io.envoyproxy.envoymobile.engine.types.EnvoyOnEngineRunning;
import io.envoyproxy.envoymobile.engine.types.EnvoyStringAccessor;

import java.util.Map;
Expand All @@ -27,13 +25,13 @@ public interface EnvoyEngine {
*
* The envoyConfiguration is used to resolve the configurationYAML.
*
* @param envoyConfiguration The EnvoyConfiguration used to start Envoy.
* @param configurationYAML The configuration yaml with which to start Envoy.
* @param envoyConfiguration The EnvoyConfiguration used to start Envoy.
* @param logLevel The log level to use when starting Envoy.
* @return A status indicating if the action was successful.
*/
int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML,
String logLevel);
int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration,
String logLevel);

/**
* Run the Envoy engine with the provided EnvoyConfiguration and log level.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ public void terminate() {
*
* The envoyConfiguration is used to resolve the configurationYAML.
*
* @param envoyConfiguration The EnvoyConfiguration used to start Envoy.
* @param configurationYAML The configuration yaml with which to start Envoy.
* @param envoyConfiguration The EnvoyConfiguration used to start Envoy.
* @param logLevel The log level to use when starting Envoy.
* @return A status indicating if the action was successful.
*/
@Override
public int runWithConfig(EnvoyConfiguration envoyConfiguration, String configurationYAML,
String logLevel) {
public int runWithTemplate(String configurationYAML, EnvoyConfiguration envoyConfiguration,
String logLevel) {
for (EnvoyHTTPFilterFactory filterFactory : envoyConfiguration.httpPlatformFilterFactories) {
JniLibrary.registerFilterFactory(filterFactory.getFilterName(),
new JvmFilterFactoryContext(filterFactory));
Expand Down
2 changes: 1 addition & 1 deletion library/kotlin/io/envoyproxy/envoymobile/EngineImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class EngineImpl constructor(
streamClient = StreamClientImpl(envoyEngine)
pulseClient = PulseClientImpl(envoyEngine)
if (configurationYAML != null) {
envoyEngine.runWithConfig(envoyConfiguration, configurationYAML, logLevel.level)
envoyEngine.runWithTemplate(configurationYAML, envoyConfiguration, logLevel.level)
} else {
envoyEngine.runWithConfig(envoyConfiguration, logLevel.level)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ import io.envoyproxy.envoymobile.engine.types.EnvoyStringAccessor
internal class MockEnvoyEngine : EnvoyEngine {
override fun runWithConfig(envoyConfiguration: EnvoyConfiguration?, logLevel: String?): Int = 0

override fun runWithConfig(envoyConfiguration: EnvoyConfiguration, configurationYAML: String?, logLevel: String?): Int = 0
override fun runWithTemplate(
configurationYAML: String,
envoyConfiguration: EnvoyConfiguration,
logLevel: String
): Int = 0

override fun startStream(callbacks: EnvoyHTTPCallbacks?): EnvoyHTTPStream = MockEnvoyHTTPStream(callbacks!!)

Expand Down

0 comments on commit e24eb69

Please sign in to comment.