-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3837 from dseurotech/refactorings/exterminateStatics
Refactorings/exterminate statics
- Loading branch information
Showing
772 changed files
with
14,795 additions
and
12,931 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2018, 2022 Eurotech and/or its affiliates and others | ||
This program and the accompanying materials are made | ||
available under the terms of the Eclipse Public License 2.0 | ||
which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
Eurotech - initial API and implementation | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>kapua-broker</artifactId> | ||
<groupId>org.eclipse.kapua</groupId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>kapua-broker-api</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.kapua</groupId> | ||
<artifactId>kapua-service-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.kapua</groupId> | ||
<artifactId>kapua-qa-markers</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
broker/artemis/plugin/src/main/java/org/eclipse/kapua/broker/artemis/AppModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.broker.artemis; | ||
|
||
import com.google.inject.Provides; | ||
import org.eclipse.kapua.KapuaException; | ||
import org.eclipse.kapua.broker.artemis.plugin.security.setting.BrokerSetting; | ||
import org.eclipse.kapua.broker.artemis.plugin.security.setting.BrokerSettingKey; | ||
import org.eclipse.kapua.broker.artemis.plugin.utils.BrokerHostResolver; | ||
import org.eclipse.kapua.broker.artemis.plugin.utils.BrokerIdResolver; | ||
import org.eclipse.kapua.broker.artemis.plugin.utils.BrokerIdentity; | ||
import org.eclipse.kapua.broker.artemis.plugin.utils.DefaultBrokerHostResolver; | ||
import org.eclipse.kapua.broker.artemis.plugin.utils.DefaultBrokerIdResolver; | ||
import org.eclipse.kapua.commons.core.AbstractKapuaModule; | ||
import org.eclipse.kapua.commons.liquibase.DatabaseCheckUpdate; | ||
import org.eclipse.kapua.commons.setting.system.SystemSetting; | ||
import org.eclipse.kapua.commons.setting.system.SystemSettingKey; | ||
|
||
import javax.inject.Named; | ||
import javax.inject.Singleton; | ||
|
||
public class AppModule extends AbstractKapuaModule { | ||
@Override | ||
protected void configureModule() { | ||
bind(DatabaseCheckUpdate.class).asEagerSingleton(); | ||
bind(BrokerSetting.class).in(Singleton.class); | ||
bind(BrokerIdentity.class).in(Singleton.class); | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
@Named("clusterName") | ||
String clusterName(SystemSetting systemSetting) { | ||
return systemSetting.getString(SystemSettingKey.CLUSTER_NAME); | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
@Named("metricModuleName") | ||
String metricModuleName() { | ||
return "broker-telemetry"; | ||
} | ||
|
||
@Provides | ||
@Singleton | ||
@Named("brokerHost") | ||
String brokerHost(BrokerHostResolver brokerHostResolver) { | ||
return brokerHostResolver.getBrokerHost(); | ||
} | ||
|
||
|
||
@Singleton | ||
@Provides | ||
BrokerIdResolver brokerIdResolver(BrokerSetting brokerSettings) throws KapuaException { | ||
return new DefaultBrokerIdResolver(); | ||
} | ||
|
||
@Singleton | ||
@Provides | ||
BrokerHostResolver brokerHostResolver(BrokerSetting brokerSettings) throws KapuaException { | ||
return new DefaultBrokerHostResolver(brokerSettings.getString(BrokerSettingKey.BROKER_HOST)); | ||
} | ||
} |
Oops, something went wrong.