Skip to content

Commit

Permalink
Rest client update to version 1.4.1
Browse files Browse the repository at this point in the history
Signed-off-by: David Kral <david.k.kral@oracle.com>
  • Loading branch information
Verdent committed Aug 7, 2020
1 parent ae1631d commit 6c916ea
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ext/microprofile/mp-rest-client/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.eclipse.microprofile.rest.client</groupId>
<artifactId>microprofile-rest-client-api</artifactId>
<version>1.3.3</version>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019 Payara Foundation and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -24,10 +24,13 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.CDI;
import javax.ws.rs.Consumes;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
Expand Down Expand Up @@ -56,6 +59,8 @@
*/
class InterfaceModel {

private static final Logger LOGGER = Logger.getLogger(InterfaceModel.class.getName());

private final InjectionManager injectionManager;
private final Class<?> restClientClass;
private final String[] produces;
Expand Down Expand Up @@ -336,9 +341,15 @@ Builder clientHeaders(ClientHeaderParam[] clientHeaderParams) {
}

Builder clientHeadersFactory(RegisterClientHeaders registerClientHeaders) {
clientHeadersFactory = registerClientHeaders != null
? ReflectionUtil.createInstance(registerClientHeaders.value())
: null;
if (registerClientHeaders != null) {
Class<? extends ClientHeadersFactory> value = registerClientHeaders.value();
try {
clientHeadersFactory = CDI.current().select(value).get();
} catch (Exception ex) {
LOGGER.log(Level.FINEST, ex, () -> "This class is not a CDI bean. " + value);
clientHeadersFactory = ReflectionUtil.createInstance(value);
}
}
return this;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/microprofile/rest-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<dependency>
<groupId>org.eclipse.microprofile.rest.client</groupId>
<artifactId>microprofile-rest-client-tck</artifactId>
<version>1.3.3</version>
<version>1.4.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 6c916ea

Please sign in to comment.