Skip to content

Commit

Permalink
initial implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Malafeev <sergeymalafeev@gmail.com>
  • Loading branch information
malafeev committed Nov 16, 2018
1 parent 168cba3 commit ea9d30f
Show file tree
Hide file tree
Showing 60 changed files with 12,202 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
.idea/
*.iml
target/
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
1 change: 1 addition & 0 deletions .mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1 @@
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
44 changes: 44 additions & 0 deletions .settings.xml
@@ -0,0 +1,44 @@

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2018 The OpenTracing Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>sonatype</id>
<username>${env.SONATYPE_USER}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
<id>bintray</id>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_KEY}</password>
</server>
<server>
<id>jfrog-snapshots</id>
<username>${env.BINTRAY_USER}</username>
<password>${env.BINTRAY_KEY}</password>
</server>
<server>
<id>github.com</id>
<username>${env.GH_USER}</username>
<password>${env.GH_TOKEN}</password>
</server>
</servers>
</settings>
46 changes: 46 additions & 0 deletions .travis.yml
@@ -0,0 +1,46 @@
sudo: required
dist: trusty

language: java
jdk:
- oraclejdk8

cache:
directories:
- $HOME/.m2/repository

before_install:
# allocate commits to CI, not the owner of the deploy key
- git config user.name "opentracingci"
- git config user.email "opentracingci+opentracing@googlegroups.com"

# setup https authentication credentials, used by ./mvnw release:prepare
- git config credential.helper "store --file=.git/credentials"
- echo "https://$GH_TOKEN:@github.com" > .git/credentials

install:
# Override default travis to use the maven wrapper
- ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V

script:
- ./travis/publish.sh

branches:
except:
- /^[0-9]/

after_success:
- mvn jacoco:report coveralls:report

env:
global:
# Ex. travis encrypt BINTRAY_USER=your_github_account
- secure: "aerr1gnlry/rhGf6XwHN0z8dM46ulcLiGfMAKwMb5MLE+dBjQiEwfcs+Vob0j9VpwFo2vmbK+YNTiseVxS/XB1BmvxqiqzMyy2xXUt5EYMDTWcFJsLkH4Rrps85Y7UPLGlbprtcczSpVlQuW6DJLYvsnmTtSBYQijNX6vRsow+Wh+rya9/owEoB5ccnCsuPAkauOWX7tZCuAgoGayvLV1SWbAYFF2SqyHrTgN60L+LD/BuLaE+vdDsdN5tFTqqzVlm1pgBkud2xQSL7qJNkTTbXl0dSGMYMXt7u9c+qBUqUyAs0nGogB0TbsLbVp7PbhNeRl2+J4LwwDmZ5XlpizHMjbn77MaOxl7Uy2195LGBuMWGor3HPiYfkmsMEc3j3SBE8Lv+8TO9ruKBswgvfJ5GwAYMHz95D3rfGBGX8exsJtItwsuvxbgzq4I158UHEYeRE5UhavWHvP/OydhLwyysiAvYF7ViEyZiHZQb6OUAerpJIPJfpEtEvm9TG/r9sZTVwN4+t8oIN/wRLiHKNfkB9pwpI4ai/KfrlUbpanxnN7actILD3zZhM6kcgoxELmDOhyDStpkGZYlp98IOmps0fKW/XJlmaoa/2qkmBx2rdPiX8c7CicUsMY4PEiGT9KcxIVLHFKCpOsX05MFn5ZiDtFy3Cuy8ubyZEXg2CxIaU="
# Ex. travis encrypt BINTRAY_KEY=xxx-https://bintray.com/profile/edit-xxx --add
- secure: "qKwgFogEvBqHwcOfBJz9T1Kn8FeakXOjliwQ5vgo4Oug+ThVV15LjP+9JC37WusSmqCmhY23DsbReANf3MnzZihPLFzPtqYJcRtQnzsxSClsTMrIwQiFMindyVn9wqYy6AQb/dV6tirYqsuPMtQKiy4e6wKuXpu3A4Cxfdhm/36qBwvY54VCmsnJFQqKH97h4MVHynsHiaPTbgOOsDWGM8ce/W5QnRj9lNk9f3mTypoCkAE1aLsrA4zQTt+6XDstF17oenG1OHJhyWHckG/tPhJBhL4QUSVr/BjSFBxCitV/TNfHFGAbxTfoBSLabf7X5LnNWWjZtebdbhySyESqYCrWh38Ed4tqEHHIHKmT19/xS3ktnwvNbv9BWu+/HRmH7gorV5g4/6I7tmXwZgHXMtY/Io2woe1OJQXxeKTVZ1H3gAomR6mBzho/FxU9kjB+Lzuh+PRoYQBwUaAA6HvAJT61VhcZFRMKG0WtxJg5BXgEQLVi+HwoJlcG8DXspP9eHFDn989o1sb+6NPhCtaCTipLnHt/L1nnh/NzTqXY89TnBxLCQiFg0mEaIzSDCIp/qYHpq6EkjUhDP/Tkr0LxqL9NEtSNB7RPQKBDuiDxdjSK2GpB2qWl/333UXqPbj+c+wHcekLg0sy6espCul8+nbb071f+vu4ML4ZW1MpY/yw="
# Ex. travis encrypt GH_TOKEN=XXX-https://github.com/settings/tokens-XXX --add
- secure: "geUUte+AO+8layejGFImY8xu4fPU/ynI3osfMlM1wFWGroX6PJ4U4BArkhpQ2A1uMXjiAUwx/9ciKG2OP17UOUfZZa0zouSDJ8O/g1FaNzbgQ9YyRH2hbSxbwbmXt0T4mBiv9gkfJDwmwVFyqGbnXq6PFHivfVKqw4i1a0FuJsPKY+c7O9EnD2DvlKzPA6DJZqbTl/XebeA6Acv4G7cxi1812aS8moovrGHLKRDfT40HZZYtm06zFq+WAa7xagMOP8PIje+LZndI/FQCKM0Ro+fqZ3AcVRFTN1PXM0hgUHPXv8kZw8t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hlsAb13NvgHQfJtHHj8Ahg="
# Ex. travis encrypt SONATYPE_PASSWORD=your_sonatype_password
- secure: "M72lT4pv3Z5sx9pDqCsZJra/NKGveQDSO7eW8b4URN98WYjcitKbItJK3zFt0hxLatLE2sADFUDdRKtJe08wzbbLLS+Hlkqr3eQykHpxbqgLyGeJrgUsbvLi7dxvd3c1qfi5KOocKegXNr7rp793Y4MGCGiFPe+m/6zvdE/iDRqtXZzQl7SNAlBcJbTKtwvqHjVzLHJsbTrXyVL9/G4aQ7l8bURtTwLcBj5A8Hrcy8GCPOhOccHB/gQIpwFZchNo3+Mv47VYBr3sCOADlo8OOh/0iRvw64NOCOsbGlN2zp0SOXFicNWX/vpMW9kI0d05ib1dCgGdRcF7slUzR8jGvFejTF/nrqtwqWWN6dkj/sFawTP5v8Ym1q/LzVVaEKzzxPQpW3uDbv+kl2lnd4V2PO2a+ffmJOBN1nDNAwxa2ctcswmyc1EOQNEVVNv0xg8oItrdDlPAJrwyzQfyhHT/U36gj1unsi6zRlpaPginU9IZoVCqhFOKpFVI+dplGI2fLpnH+Ywau+k+y4b6DB4BNHnFe+5rV3saX34xuxcbyXo9SzWXfs84Ki0LWuzw8B0LE1p1H/wqn2sAwemDJEZUsIWz4nj+eMmmcAREo7v6M/ZFQF5MOWPX82ySyurSktO9IRZfzQ7VzzBjRJuEZJNKrKGuwQhlc2ByEeoPoeI5Cog="
50 changes: 50 additions & 0 deletions README.md
@@ -0,0 +1,50 @@
[![Build Status][ci-img]][ci] [![Coverage Status][cov-img]][cov] [![Released Version][maven-img]][maven]

# OpenTracing Redisson Instrumentation
OpenTracing instrumentation for Redisson.

## Installation

pom.xml
```xml
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-redisson</artifactId>
<version>VERSION</version>
</dependency>
```

## Usage

```java
// Instantiate tracer
Tracer tracer = ...

// Optionally register tracer with GlobalTracer
GlobalTracer.register(tracer);

// Create Redisson config object
Config = ...

// Create Redisson instance
RedissonClient redissonClient = Redisson.create(config);

// Decorate RedissonClient with TracingRedissonClient
RedissonClient tracingRedissonClient = new TracingRedissonClient(redissonClient, tracer);

// Get object you need using TracingRedissonClient
RMap<MyKey, MyValue> map = tracingRedissonClient.getMap("myMap");
```


## License

[Apache 2.0 License](./LICENSE).

[ci-img]: https://travis-ci.org/opentracing-contrib/java-redisson.svg?branch=master
[ci]: https://travis-ci.org/opentracing-contrib/java-redisson
[cov-img]: https://coveralls.io/repos/github/opentracing-contrib/java-redisson/badge.svg?branch=master
[cov]: https://coveralls.io/github/opentracing-contrib/java-redisson?branch=master
[maven-img]: https://img.shields.io/maven-central/v/io.opentracing.contrib/opentracing-redisson.svg
[maven]: http://search.maven.org/#search%7Cga%7C1%7Copentracing-redisson

6 changes: 6 additions & 0 deletions RELEASE.md
@@ -0,0 +1,6 @@
# OpenTracing Release Process

This repo uses semantic versions. Please keep this in mind when choosing version numbers.

For the up-to-date release process, please refer the
[release process from the OpenTracing Java API](https://github.com/opentracing/opentracing-java/blob/master/RELEASE.md).
11 changes: 11 additions & 0 deletions header.txt
@@ -0,0 +1,11 @@
Copyright ${project.inceptionYear} The OpenTracing Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
227 changes: 227 additions & 0 deletions mvnw
@@ -0,0 +1,227 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------

# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------

if [ -z "$MAVEN_SKIP_RC" ] ; then

if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi

if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi

fi

# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="`/usr/libexec/java_home`"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac

if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi

if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$0"

# need this for relative symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname "$PRG"`/$link"
fi
done

saveddir=`pwd`

M2_HOME=`dirname "$PRG"`/..

# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`

cd "$saveddir"
# echo Using m2 at $M2_HOME
fi

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi

# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi

if [ -z "$JAVA_HOME" ]; then
javaExecutable="`which javac`"
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi

if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi

if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi

if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi

CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher

# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {

if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi

basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=`cd "$wdir/.."; pwd`
fi
# end of workaround
done
echo "${basedir}"
}

# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' < "$1")"
fi
}

BASE_DIR=`find_maven_basedir "$(pwd)"`
if [ -z "$BASE_DIR" ]; then
exit 1;
fi

export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
fi

WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

0 comments on commit ea9d30f

Please sign in to comment.