Skip to content

Instantly share code, notes, and snippets.

arey /
Created February 20, 2014 17:29
CXF interceptor fixing memory leak by removing attachments
import org.apache.cxf.binding.soap.SoapMessage;
import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
import org.apache.cxf.endpoint.ClientImpl;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.phase.Phase;
* Fix CXF memory leak by removing attachments once the SOAP message was sent.
public class ClearAttachmentsOutInterceptor extends AbstractSoapInterceptor {
arey / pom-jasmine.xml
Created March 4, 2014 09:10
jasmine-maven-plugin configuration testing JavaScript code of a Java web app with Jasmine
View pom-jasmine.xml
<project xmlns="" xmlns:xsi=""
<name>JavaEtMoi Samples :: ${project.artifactId} - ${project.packaging}</name>
<description>Maven configuration to test JavaScript code of a Java web app with Jasmine et PhantomJS</description>
arey /
Created April 9, 2014 19:56
No-operation Hibernate Scanner
package com.javaetmoi.core.persistence.hibernate;
import java.util.Collections;
import java.util.Set;
import org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory;
import org.hibernate.jpa.boot.scan.spi.AbstractScannerImpl;
import org.hibernate.jpa.boot.scan.spi.ScanOptions;
import org.hibernate.jpa.boot.scan.spi.ScanResult;
import org.hibernate.jpa.boot.spi.ClassDescriptor;
arey / angular-from-scratch.html
Last active August 29, 2015 14:00
HTML et JavaScript basé sur le hand's on labs "AngularJS from scratch : comprendre Angular en le re-faisant de zéro" de Devoxx France 2014
View angular-from-scratch.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>AngularJS from scratch</title>
<body class="container text-center">
<h1 class="page-header" ng-bind="labs.titre">AngularJS from scratch</h1>
<input type="text" ng-model="labs.titre"/>
arey /
Created May 24, 2012 18:24
Extracteur JMeter d'identifiant du view state JSF à l’aide d'une regex
import java.util.HashSet;
import java.util.Set;
import org.apache.jmeter.extractor.RegexExtractor;
import org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase;
import org.apache.jmeter.testelement.TestElement;
import com.javaetmoi.tests.jmeter.TestElementProcessor;
import com.javaetmoi.tests.jmeter.TestElementTree;
arey / pom-maven-replace-arobase.xml
Created July 16, 2012 18:38
Configuration maven permettant d'utiliser des délimiteurs de filtre maven sur plusieurs caractères
View pom-maven-replace-arobase.xml
<!-- Filtres les fichiers de ressources -->
<!-- Utilise les délimiteurs par défaut ${*} et @ -->
arey / jboss-app.xml
Created January 4, 2013 11:07
Fichier META-INF\jboss-app.xml d'un EAR permettant d'isoler le classloader de JBoss.
View jboss-app.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app PUBLIC
"-//JBoss//DTD Java EE Application 5.0//EN"
arey / pom-ear-jboss.xml
Created January 4, 2013 11:12
Configuration du plugin maven-ear-plugin générant e fichier jboss-app.xml avec isolation du classloader de l'EAR.
View pom-ear-jboss.xml
<!-- Generation du classPath dans le Manifest de l'EAR, paramétrage du classloader -->
<!-- et recopie centralisée des JARs des WARs dans le répertoire lib -->
arey /
Created September 5, 2013 17:05
A DbSetup destination which wraps a DataSource and gets its connection from a JDBC DataSource, adding awareness of Spring-managed transactions.
package com.javametmoi.test.dbsetup;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
arey /
Created September 6, 2013 06:14
Test case mixing both the DbSetup and the Spring frameworks
package com.javametmoi.test.dbsetup;
import static com.ninja_squad.dbsetup.Operations.insertInto;
import static com.ninja_squad.dbsetup.Operations.sequenceOf;
import static org.junit.Assert.assertEquals;
import java.sql.SQLException;
import javax.sql.DataSource;