-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add microprofile telemetry tracing feature. --------- Co-authored-by: Koki Kosaka <[email protected]>
- Loading branch information
Showing
35 changed files
with
2,097 additions
and
488 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
754 changes: 754 additions & 0 deletions
754
launcher-impl/glassfish/src/main/java/org/glassfish/jersey/server/ApplicationHandler.java
Large diffs are not rendered by default.
Oops, something went wrong.
102 changes: 102 additions & 0 deletions
102
...her-impl/glassfish/src/main/java/org/glassfish/jersey/server/ResourceBagConfigurator.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,102 @@ | ||
/* | ||
* Copyright (c) 2017, 2018 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 | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.server; | ||
|
||
import java.util.Comparator; | ||
import java.util.logging.Logger; | ||
|
||
import org.glassfish.jersey.internal.BootstrapBag; | ||
import org.glassfish.jersey.internal.BootstrapConfigurator; | ||
import org.glassfish.jersey.internal.inject.InjectionManager; | ||
import org.glassfish.jersey.server.model.Resource; | ||
|
||
/** | ||
* Configurator which initializes and register {@link ResourceBag} instance into {@link BootstrapBag}. | ||
* | ||
* @author Petr Bouda | ||
*/ | ||
class ResourceBagConfigurator implements BootstrapConfigurator { | ||
|
||
private static final Logger LOGGER = Logger.getLogger(ResourceBagConfigurator.class.getName()); | ||
|
||
@Override | ||
public void init(InjectionManager injectionManager, BootstrapBag bootstrapBag) { | ||
ServerBootstrapBag serverBag = (ServerBootstrapBag) bootstrapBag; | ||
ResourceConfig runtimeConfig = serverBag.getRuntimeConfig(); | ||
|
||
final boolean disableValidation = ServerProperties.getValue(runtimeConfig.getProperties(), | ||
ServerProperties.RESOURCE_VALIDATION_DISABLE, | ||
Boolean.FALSE, | ||
Boolean.class); | ||
|
||
final ResourceBag.Builder resourceBagBuilder = new ResourceBag.Builder(); | ||
|
||
// Adding programmatic resource models | ||
for (final Resource programmaticResource : runtimeConfig.getResources()) { | ||
resourceBagBuilder.registerProgrammaticResource(programmaticResource); | ||
} | ||
|
||
// Introspecting classes & instances | ||
if (Boolean.getBoolean(ServerProperties.RESOURCE_VALIDATION_IGNORE_ERRORS)) { | ||
runtimeConfig.getClasses().stream().sorted(new Comparator<Class<?>>() { | ||
@Override | ||
public int compare(Class<?> o1, Class<?> o2) { | ||
if (o1.isInterface() && !o2.isInterface()) { | ||
return 1; | ||
} else if (!o1.isInterface() && o2.isInterface()) { | ||
return -1; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
}).forEach( c -> { | ||
try { | ||
final Resource resource = Resource.from(c, disableValidation); | ||
if (resource != null) { | ||
resourceBagBuilder.registerResource(c, resource); | ||
} | ||
} catch (final IllegalArgumentException ex) { | ||
LOGGER.warning(ex.getMessage()); | ||
} | ||
}); | ||
} else { | ||
for (final Class<?> c : runtimeConfig.getClasses()) { | ||
try { | ||
final Resource resource = Resource.from(c, disableValidation); | ||
if (resource != null) { | ||
resourceBagBuilder.registerResource(c, resource); | ||
} | ||
} catch (final IllegalArgumentException ex) { | ||
LOGGER.warning(ex.getMessage()); | ||
} | ||
} | ||
} | ||
|
||
for (final Object o : runtimeConfig.getSingletons()) { | ||
try { | ||
final Resource resource = Resource.from(o.getClass(), disableValidation); | ||
if (resource != null) { | ||
resourceBagBuilder.registerResource(o, resource); | ||
} | ||
} catch (final IllegalArgumentException ex) { | ||
LOGGER.warning(ex.getMessage()); | ||
} | ||
} | ||
|
||
serverBag.setResourceBag(resourceBagBuilder.build()); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...src/main/java/com/fujitsu/launcher/microprofile/opentracing/cdi/OpenTracingExtension.java
This file was deleted.
Oops, something went wrong.
55 changes: 0 additions & 55 deletions
55
...acing/src/main/java/com/fujitsu/launcher/microprofile/opentracing/cdi/TracerProducer.java
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
.../fujitsu/launcher/microprofile/opentracing/rs/LauncherClientTracingRegistrarProvider.java
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
...ain/java/com/fujitsu/launcher/microprofile/opentracing/rs/LauncherRestClientListener.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.