Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EditorConfig Code Format Changes #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ jobs:
java-version: ${{ matrix.version }}
distribution: 'zulu'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- uses: editorconfig-checker/action-editorconfig-checker@v2
- run: editorconfig-checker

- name: Build with Gradle
run: ./gradlew build publishToMavenLocal -x :examples:build
- name: Build Examples
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish package to the Clojars
on:
workflow_dispatch:
release:
types: [ "created" ]
push:
tags:
- v*

jobs:
publish:
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
- Deadlining for APIs - ability to specify execution timeouts for gRPC stubs at service end
- Task/Upstream request retries using Hedged Requests
- Tool recommendations for testing

398 changes: 199 additions & 199 deletions LICENSE

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ allprojects {
}

tasks.withType(GenerateModuleMetadata) {
enabled = false
enabled = false
}

def gJEXVersion = '1.40-SNAPSHOT'
Expand All @@ -40,10 +40,10 @@ publishing {
from components.java
pom {
licenses {
license {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
}
}
}
Expand Down Expand Up @@ -106,6 +106,3 @@ subprojects {
]
}
}



1 change: 0 additions & 1 deletion contrib/hibernate/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
rootProject.name = 'hibernate'

6 changes: 3 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

tasks.withType(GenerateModuleMetadata) {
enabled = false
enabled = false
}

publishing {
Expand All @@ -15,10 +15,10 @@ publishing {
from components.java
pom {
licenses {
license {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
}
}
}
Expand Down
24 changes: 12 additions & 12 deletions core/src/main/java/com/flipkart/gjex/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
*/
public interface Constants {

String LOGGING_ID = "loggingId";
String LOGGING_ID = "loggingId";

String CONFIG_FILE_PROPERTY = "gjex.configurationFile";
String CONFIG_FILE_PROPERTY = "gjex.configurationFile";

/**
* Root for all packaged configs.
*/
* Root for all packaged configs.
*/
String CONFIG_ROOT = "packaged";

/**
* Configuration yml resource path.
*/
* Configuration yml resource path.
*/
String CONFIGURATION_YML = CONFIG_ROOT + "/configuration.yml";

/**
* Config file name for GRPC Service module class names
*/
* Config file name for GRPC Service module class names
*/
String GRPC_MODULE_NAMES_CONFIG = "grpc_modules.yml";

/**
* The GRPC Service modules property name
*/
* The GRPC Service modules property name
*/
String GRPC_MODULE_NAMES = "GJEX.grpc.module.names";

/** Static name for GJEX core application name used to distinguish Resources added by the framework with custom ones added by the GJEX applications */
String GJEX_CORE_APPLICATION = "@@GJEXCoreApplication@@";
/** Static name for GJEX core application name used to distinguish Resources added by the framework with custom ones added by the GJEX applications */
String GJEX_CORE_APPLICATION = "@@GJEXCoreApplication@@";

}
128 changes: 64 additions & 64 deletions core/src/main/java/com/flipkart/gjex/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,90 +35,90 @@
@SuppressWarnings("rawtypes")
public abstract class Application<T extends GJEXConfiguration, U extends Map> implements Logging {

/** The GJEX startup display contents*/
private static final MessageFormat STARTUP_DISPLAY = new MessageFormat(
/** The GJEX startup display contents*/
private static final MessageFormat STARTUP_DISPLAY = new MessageFormat(
"\n*************************************************************************\n" +
" ╔═╗ ╦╔═╗═╗ ╦ " + " Application name : {0} \n" +
" ║ ╦ ║║╣ ╔╩╦╝ " + " Startup Time : {1}" + " ms\n" +
" ╚═╝╚╝╚═╝╩ ╚═ " + " Host Name: {2} \n " +
"*************************************************************************"
" ╔═╗ ╦╔═╗═╗ ╦ " + " Application name : {0} \n" +
" ║ ╦ ║║╣ ╔╩╦╝ " + " Startup Time : {1}" + " ms\n" +
" ╚═╝╚╝╚═╝╩ ╚═ " + " Host Name: {2} \n " +
"*************************************************************************"
);

/** The machine name where this GJEX instance is running */
private String hostName;
/** The machine name where this GJEX instance is running */
private String hostName;

private final ArgumentParserWrapper argumentParser;
private final ArgumentParserWrapper argumentParser;
/**
* Constructor for this class
*/
* Constructor for this class
*/
public Application() {
this.argumentParser = new ArgumentParserWrapper();
try {
this.hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
//ignore the exception, not critical information
}
this.argumentParser = new ArgumentParserWrapper();
try {
this.hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
//ignore the exception, not critical information
}
}

/**
* Gets the name of this GJEX application
* @return
*/
public String getName() {
/**
* Gets the name of this GJEX application
* @return
*/
public String getName() {
return getClass().getSimpleName();
}

/**
* Initializes this Application using the Bootstrap provided. Derived types may perform startup/one-time initializations
* by implementing this method.
* @param bootstrap the Bootstrap for this Application
*/
public abstract void initialize(Bootstrap<T, U> bootstrap);

/**
* When the application runs, this is called after the {@link Bundle}s are run. Override it to add
* providers, resources, etc. for your application.
*
* @param configuration the parsed {@link GJEXConfiguration} object
* @param environment the application's {@link Environment}
* @throws Exception if something goes wrong
*/
public abstract void run(T configuration, U configMap, Environment environment) throws Exception;

/**
* Parses command-line arguments and runs this Application. Usually called from a {@code public
* static void main} entry point
*
* @param arguments command-line arguments for starting this Application
* @throws Exception in case of errors during run
*/
public final void run(String... arguments) throws Exception {
info("** GJEX starting up... **");
long start = System.currentTimeMillis();

Namespace namespace = argumentParser.parseArguments(arguments);
String configFilePath = namespace.getString("file");
final Bootstrap<T, U> bootstrap = new Bootstrap<>(this, configFilePath, getConfigurationClass());

/* Hook for applications to initialize their pre-start environment using bootstrap's properties */
/**
* Initializes this Application using the Bootstrap provided. Derived types may perform startup/one-time initializations
* by implementing this method.
* @param bootstrap the Bootstrap for this Application
*/
public abstract void initialize(Bootstrap<T, U> bootstrap);

/**
* When the application runs, this is called after the {@link Bundle}s are run. Override it to add
* providers, resources, etc. for your application.
*
* @param configuration the parsed {@link GJEXConfiguration} object
* @param environment the application's {@link Environment}
* @throws Exception if something goes wrong
*/
public abstract void run(T configuration, U configMap, Environment environment) throws Exception;

/**
* Parses command-line arguments and runs this Application. Usually called from a {@code public
* static void main} entry point
*
* @param arguments command-line arguments for starting this Application
* @throws Exception in case of errors during run
*/
public final void run(String... arguments) throws Exception {
info("** GJEX starting up... **");
long start = System.currentTimeMillis();

Namespace namespace = argumentParser.parseArguments(arguments);
String configFilePath = namespace.getString("file");
final Bootstrap<T, U> bootstrap = new Bootstrap<>(this, configFilePath, getConfigurationClass());

/* Hook for applications to initialize their pre-start environment using bootstrap's properties */
initialize(bootstrap);

/* Create Environment */
Environment environment = new Environment(getName(), bootstrap.getMetricRegistry());

/* Run bundles etc */
bootstrap.run(environment);
/* Run bundles etc */
bootstrap.run(environment);

/* Run this Application */
run(bootstrap.getConfiguration(), bootstrap.getConfigMap(), environment);

final Object[] displayArgs = {this.getName(), (System.currentTimeMillis() - start), hostName};
info(STARTUP_DISPLAY.format(displayArgs));
info("** GJEX startup complete **");
final Object[] displayArgs = {this.getName(), (System.currentTimeMillis() - start), hostName};
info(STARTUP_DISPLAY.format(displayArgs));
info("** GJEX startup complete **");

}
public Class<T> getConfigurationClass() {
return Generics.getTypeParameter(getClass(), GJEXConfiguration.class);
}
}
public Class<T> getConfigurationClass() {
return Generics.getTypeParameter(getClass(), GJEXConfiguration.class);
}

}
54 changes: 27 additions & 27 deletions core/src/main/java/com/flipkart/gjex/core/Bundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,52 +36,52 @@
public interface Bundle<T extends GJEXConfiguration, U extends Map> {

/**
* Initializes this Bundle with the application bootstrap.
*
* @param bootstrap the application bootstrap
*/
* Initializes this Bundle with the application bootstrap.
*
* @param bootstrap the application bootstrap
*/
void initialize(Bootstrap<?, ?> bootstrap);

/**
* Runs this Bundle in the application environment.
*
* @param environment the application environment
*/
* Runs this Bundle in the application environment.
*
* @param environment the application environment
*/
void run(T configuration, U configMap, Environment environment);

/**
* Returns Service instances loaded by this Bundle
* @return List containing Service instances
*/
* Returns Service instances loaded by this Bundle
* @return List containing Service instances
*/
List<Service> getServices();

/**
* Returns Filter instances loaded by this Bundle
* @return List containing Filter instances
*/
List<GrpcFilter> getGrpcFilters();
* Returns Filter instances loaded by this Bundle
* @return List containing Filter instances
*/
List<GrpcFilter> getGrpcFilters();

/**
* Returns HealthCheck instances loaded by this Bundle
* @return List containing HealthCheck instances
*/
* Returns HealthCheck instances loaded by this Bundle
* @return List containing HealthCheck instances
*/
List<HealthCheck> getHealthChecks();

/**
* Returns the TracingSampler instances loaded by this Bundle
* @return the TracingSampler instances
*/
* Returns the TracingSampler instances loaded by this Bundle
* @return the TracingSampler instances
*/
List<TracingSampler> getTracingSamplers();

/**
* Returns the ScheduledJob instances loaded by this Bundle
* @return the ScheduledJob instances
*/
* Returns the ScheduledJob instances loaded by this Bundle
* @return the ScheduledJob instances
*/
List<ScheduledJob> getScheduledJobs();

/**
* Returns list of custom {@link ResourceConfig} instances configured by the GJEX application
* @return ResourceConfig instances
*/
* Returns list of custom {@link ResourceConfig} instances configured by the GJEX application
* @return ResourceConfig instances
*/
List<ResourceConfig> getResourceConfigs();
}
Loading
Loading