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

Cleanup #1337

Merged
merged 3 commits into from
Jun 11, 2020
Merged

Cleanup #1337

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,34 +39,35 @@ public class FastFactoryFinderResolver extends DefaultFactoryFinderResolver {
this.classMap = classMap;
}

@Override
public FactoryFinder resolveFactoryFinder(ClassResolver classResolver, String resourcePath) {
return new FastFactoryFinder(resourcePath);
}

// exposed for testing purpose
Map<String, Class<?>> getClassMap() {
return Collections.unmodifiableMap(this.classMap);
}

static String mapKey(String resourcePath, String prefix, String key) {
final int len = resourcePath.length() + (prefix == null ? 0 : prefix.length()) + key.length() + 1;
static String mapKey(String resourcePath, String key) {
final int len = resourcePath.length() + key.length() + 1;
final StringBuilder sb = new StringBuilder(len);

if (resourcePath.startsWith("/")) {
sb.append(resourcePath, 1, resourcePath.length());
} else {
sb.append(resourcePath);
}

if (!resourcePath.endsWith("/")) {
sb.append("/");
}
if (prefix != null) {
sb.append(prefix);
}

sb.append(key);

return sb.toString();
}

@Override
public FactoryFinder resolveFactoryFinder(ClassResolver classResolver, String resourcePath) {
return new FastFactoryFinder(resourcePath);
}

// exposed for testing purpose
Map<String, Class<?>> getClassMap() {
return Collections.unmodifiableMap(this.classMap);
}

public static class Builder {
private Map<String, Class<?>> classMap = new HashMap<>();

Expand Down Expand Up @@ -105,31 +106,31 @@ public String getResourcePath() {

@Override
public Optional<Object> newInstance(String key) {
return doNewInstance(key, null);
return doNewInstance(key);
}

@Override
public <T> Optional<T> newInstance(String key, Class<T> type) {
return doNewInstance(key, null).map(type::cast);
return doNewInstance(key).map(type::cast);
}

@Override
public Optional<Class<?>> findClass(String key) {
final String mapKey = mapKey(path, null, key);
final String mapKey = mapKey(path, key);
final Class<?> cl = classMap.get(mapKey);
LOG.tracef("Found a non-optional class for key %s: %s", mapKey, cl == null ? "null" : cl.getName());
return Optional.ofNullable(cl);
}

@Override
public Optional<Class<?>> findOptionalClass(String key) {
final String mapKey = mapKey(path, null, key);
final String mapKey = mapKey(path, key);
final Class<?> cl = classMap.get(mapKey);
LOG.tracef("Found an optional class for key %s: %s", mapKey, cl == null ? "null" : cl.getName());
return Optional.ofNullable(cl);
}

private Optional<Object> doNewInstance(String key, String propertyPrefix) {
private Optional<Object> doNewInstance(String key) {
return findClass(key).map(ObjectHelper::newInstance);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# Quarkus
#
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Camel
Expand Down Expand Up @@ -114,4 +113,4 @@ camel.component.aws-kinesis-firehose.region={{env:AWS_REGION}}
#
camel.component.aws-swf.access-key={{env:AWS_ACCESS_KEY}}
camel.component.aws-swf.secret-key={{env:AWS_SECRET_KEY}}
camel.component.aws-swf.region={{env:AWS_REGION}}
camel.component.aws-swf.region={{env:AWS_REGION}}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
#
# Quarkus
#
quarkus.log.file.enable = false
quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
quarkus.log.category."org.apache.camel.quarkus.component.bean.validator".level = DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# Quarkus
#
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false
quarkus.log.category."org.apache.camel.quarkus.core".level = DEBUG

#
Expand All @@ -38,4 +38,4 @@ quarkus.camel.native.reflection.exclude-patterns = org.apache.commons.lang3.tupl
#
# Camel
#
camel.context.name=quarkus-camel-example
camel.context.name=quarkus-camel-example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# Quarkus
#
quarkus.ssl.native=true
quarkus.log.file.enable = false

# include xml routes in native image
quarkus.native.additional-build-args = -H:IncludeResources=routes/.*-routes.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

## include xml routes and scheme
quarkus.native.additional-build-args = -H:IncludeResources=person.xsd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# Quarkus
#
quarkus.log.file.enable = false

#
# Quarkus :: DS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#
# Quarkus - Log
#
quarkus.log.file.enable = false
quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
quarkus.log.category."org.apache.camel.quarkus.component.kafka".level = DEBUG
quarkus.log.category."org.apache.zookeeper".level = WARNING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.ssl.native=true
quarkus.log.file.enable = false

#
# Camel
#
camel.context.name = quarkus-camel-example
camel.context.name = quarkus-camel-example
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camel.context.name is another good candidate for removal in the next cleanup round

Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

# include xml routes in native image
quarkus.native.additional-build-args = -H:IncludeResources=routes/my-routes.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

# include xml routes in native image
quarkus.native.additional-build-args = -H:IncludeResources=routes/my-routes.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

#
# Quarkus :: Camel
#
Expand Down Expand Up @@ -47,4 +42,4 @@ camel.main.auto-configuration-log-summary = false
# Other
#
the.message = default
%staging.the.message = test
%staging.the.message = test
20 changes: 0 additions & 20 deletions integration-tests/netty/src/main/resources/application.properties

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
# Quarkus
#
quarkus.ssl.native=true
quarkus.log.file.enable = false
quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
quarkus.log.category."org.apache.camel.quarkus.component.platform.http".level = INFO
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#
quarkus.ssl.native=true
quarkus.http.body.uploads-directory=target/uploads
quarkus.log.file.enable = false
quarkus.log.category."org.apache.camel.quarkus.core.deployment".level = INFO
quarkus.log.category."org.apache.camel.quarkus.component.platform.http".level = INFO

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
#
Expand All @@ -29,4 +24,4 @@ camel.context.name = quarkus-camel-example
# Camel :: Reactive Streams
#

camel.component.reactive-streams.backpressure-strategy = LATEST
camel.component.reactive-streams.backpressure-strategy = LATEST

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
#
# Quarkus
#
quarkus.log.file.enable = false

#
# Camel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false
quarkus.ssl.native=true

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
## limitations under the License.
## ---------------------------------------------------------------------------

#
# Quarkus
#
quarkus.log.file.enable = false

#
# Quarkus Datasource
#
Expand Down