Skip to content

Instantly share code, notes, and snippets.

View johnament's full-sized avatar

John Ament johnament

View GitHub Profile
@johnament
johnament / request
Created November 10, 2017 19:54
whoami
GET /auth/admin/master/console/whoami HTTP/1.1
Host: mycompany
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept: application/json
Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJGbEhyZ1cwdU1XS2FhVnFtbHVRMERmT01adFlaOW9qTFJDTDNKRjdjOWhVIn0.eyJqdGkiOiJjOTRkY2EwZC04ZmZlLTRjN2EtOThjOS0zZjEyZDk3N2Q0MzkiLCJleHAiOjE1MTAzNDM4MTEsIm5iZiI6MCwiaWF0IjoxNTEwMzQzNTExLCJpc3MiOiJodHRwczovL3FhLnN0cmF0YXMubmV0L2F1dGgvcmVhbG1zL21hc3RlciIsImF1ZCI6InNlY3VyaXR5LWFkbWluLWNvbnNvbGUiLCJzdWIiOiI3OTEyMmI0NC1hOTViLTRhOWMtOGQ0MS0wZWFlMWFiY2M4NTMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJzZWN1cml0eS1hZG1pbi1jb25zb2xlIiwibm9uY2UiOiI1M2Q4ZTZiZC0wNDRkLTQ1MWEtYTQzNS1mMWE4NTEyZTE0NjUiLCJhdXRoX3RpbWUiOjE1MTAzNDM1MTAsInNlc3Npb25fc3RhdGUiOiJmNDEyMzhkOS0wNzk3LTQzNGMtYjc2My01NGMyNTFlZDZiZjAiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbXSwicmVzb3VyY2VfYWNjZXNzIjp7fSwicHJlZmVycmVkX3VzZXJuYW1lIjoia2V5Y2xvYWstYWRtaW4ifQ.MvhWoze2kW0-zb_hQqC9yVGhLMcZAXesdHgwzgxpmtuwyfyCCJOVkw48-qDKMZ0MPMeP5C4WwB9MbODPPMGrV3Jvuf-YT-SaX5y5ItY
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
/*
* 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
@johnament
johnament / Async.java
Created March 8, 2016 01:54
A really simple Async CDI extension
import javax.interceptor.InterceptorBinding;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Inherited
@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
2015-11-11 07:33:32
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):
"DefaultMetadataResolver-1-1" #68 daemon prio=5 os_prio=31 tid=0x00007fae9d9f4800 nid=0xbc0b runnable [0x00007000019e0000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
- locked <0x000000077f865360> (a java.net.SocksSocketImpl)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
package org.jboss.arquillian.enablecdi;
import org.apache.deltaspike.cdise.api.CdiContainer;
import org.apache.deltaspike.cdise.api.CdiContainerLoader;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
/**
2015-06-12 20:33:05,431 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Core 1.0.0.CR1 "Kenny" started in 1255ms - Started 99 of 106 services (17 services are lazy, passive or on-demand)
2015-06-12 20:33:06,249 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0027: Starting deployment of "mysql" (runtime-name: "mysql")
2015-06-12 20:33:06,381 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
2015-06-12 20:33:06,382 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-15) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.fabric.jdbc.FabricMySQLDriver (version 5.1)
2015-06-12 20:33:06,386 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-9) WFLYJCA0018: Started Driver service with driver-name = mysql_com.mysql.jdbc.Driver_5_1
2015-06-12 20:33:06,386 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service threa
@johnament
johnament / build.gradle
Created November 24, 2014 23:39
How to configure gradle w/ CDI capabilities
apply plugin: 'java'
apply plugin: 'idea'
apply plugin:'application'
sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
// NetBeans will automatically add "run" and "debug" tasks relying on the
// "mainClass" property. You may however define the property prior executing
// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
@johnament
johnament / pom.xml
Created September 21, 2014 15:50
Example config for exec plugin.
<plugin>
<artifactId>exec-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution><!-- apply patch to WildFly 8.1 -->
<id>prep-patch</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
@johnament
johnament / ConfigProducer.java
Created September 12, 2014 23:01
Loading configuration
@ApplicationScoped
public class ConfigProducer {
private Configuration config;
public void observe(@Observes Configuration config) {
this.config = config;
}
@Produces
@ApplicationScoped
public Configuration produce() {
return config;