diff --git a/test/mixins/entitymanager/pom.xml b/test/mixins/entitymanager/pom.xml
new file mode 100644
index 000000000..f137326c4
--- /dev/null
+++ b/test/mixins/entitymanager/pom.xml
@@ -0,0 +1,91 @@
+
+
+
+ 4.0.0
+
+ org.switchyard.components
+ switchyard-component-test-parent
+ 2.0.0-SNAPSHOT
+ ../../pom.xml
+
+ switchyard-component-test-mixin-entitymanager
+ jar
+ SwitchYard: Entity Manager MixIn
+ Entity Manager MixIn classes
+ http://switchyard.org
+
+
+
+
+ com.experlog
+ xapool
+ 1.5.0
+
+
+
+
+
+
+
+ com.h2database
+ h2
+ test
+
+
+
+ org.jboss.as
+ jboss-as-naming
+
+
+ org.jboss.logmanager
+ log4j-jboss-logmanager
+
+
+
+
+
+ org.switchyard.components
+ switchyard-component-test-mixin-cdi
+
+
+ org.switchyard.components
+ switchyard-component-test-mixin-naming
+
+
+ org.switchyard.components
+ switchyard-component-test-mixin-jca
+
+
+ org.switchyard.components
+ switchyard-component-bean
+
+
+
+ org.hibernate.javax.persistence
+ hibernate-jpa-2.0-api
+
+
+ org.hibernate
+ hibernate-entitymanager
+
+
+
+
+
+ com.experlog
+ xapool
+
+
+
diff --git a/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/CDIPersistenceExtension.java b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/CDIPersistenceExtension.java
new file mode 100644
index 000000000..a891cd0eb
--- /dev/null
+++ b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/CDIPersistenceExtension.java
@@ -0,0 +1,189 @@
+/*
+ * CDIPersistenceExtension.java
+ *
+ * Copyright 2014 Johnathan Ingram (jingram@rogueware.org)
+ * All rights reserved.
+ *
+ * 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. *
+ *
+ */
+package org.switchyard.component.test.mixins.entitymanager;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.Extension;
+import javax.enterprise.inject.spi.ProcessAnnotatedType;
+import javax.persistence.PersistenceContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Johnathan Ingram (jingram@rogueware.org)
+ */
+public class CDIPersistenceExtension implements Extension {
+
+ private transient static final Logger log = LoggerFactory.getLogger(CDIPersistenceExtension.class);
+
+
+ // Ensure all javax.persistence.EntityManager fields with @PersistenceContext are annotated @Inject
+ public void processJPAAnnotations(@Observes ProcessAnnotatedType pat) {
+ final AnnotatedType at = pat.getAnnotatedType();
+
+ // Override any javax.persistence.EntityManager fields @PersistenceContext annotations with @Inject
+ AnnotatedType wrapped = new AnnotatedType() {
+
+ @Override
+ public Class getJavaClass() {
+ return at.getJavaClass();
+ }
+
+ @Override
+ public Set> getConstructors() {
+ return at.getConstructors();
+ }
+
+ @Override
+ public Set> getMethods() {
+ return at.getMethods();
+ }
+
+ @Override
+ public Set> getFields() {
+ Set> result = new HashSet>();
+ for (final AnnotatedField af : at.getFields()) {
+ // If there is a field with the @PersistenceContext of type javax.persistence.EntityManager,
+ // make sure the field has the @Inject
+ if (javax.persistence.EntityManager.class.equals(af.getJavaMember().getType())
+ && af.isAnnotationPresent(PersistenceContext.class)) {
+ result.add(addAnnotation(af, Inject.getAnnotation()));
+ } else {
+ result.add(af);
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public Type getBaseType() {
+ return at.getBaseType();
+ }
+
+ @Override
+ public Set getTypeClosure() {
+ return at.getTypeClosure();
+ }
+
+ @Override
+ public T getAnnotation(Class annotationType) {
+ return at.getAnnotation(annotationType);
+ }
+
+ @Override
+ public Set getAnnotations() {
+ return at.getAnnotations();
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class extends Annotation> annotationType) {
+ return at.isAnnotationPresent(annotationType);
+ }
+ };
+
+ pat.setAnnotatedType(wrapped);
+ }
+
+
+ public static AnnotatedField addAnnotation(final AnnotatedField af, final Annotation... annotations) {
+
+ return new AnnotatedField() {
+ @Override
+ public Field getJavaMember() {
+ return af.getJavaMember();
+ }
+
+ @Override
+ public boolean isStatic() {
+ return af.isStatic();
+ }
+
+ @Override
+ public AnnotatedType getDeclaringType() {
+ return af.getDeclaringType();
+ }
+
+ @Override
+ public Type getBaseType() {
+ return af.getBaseType();
+ }
+
+ @Override
+ public Set getTypeClosure() {
+ return af.getTypeClosure();
+ }
+
+ @Override
+ public T getAnnotation(Class annotationType) {
+ for (Annotation a : annotations) {
+ if (a.annotationType().equals(annotationType)) {
+ return (T) a;
+ }
+ }
+ return af.getAnnotation(annotationType);
+ }
+
+ @Override
+ public Set getAnnotations() {
+ Set result = new HashSet(af.getAnnotations());
+ result.addAll(Arrays.asList(annotations));
+ return result;
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class extends Annotation> annotationType) {
+ for (Annotation a : annotations) {
+
+ if (a.annotationType().equals(annotationType)) {
+ return true;
+ }
+ }
+
+ return af.isAnnotationPresent(annotationType);
+ }
+ };
+ }
+
+ public static class Inject {
+
+ @javax.inject.Inject
+ public static Object field;
+
+ public static Annotation getAnnotation() {
+ try {
+ return Inject.class.getField("field").getAnnotation(javax.inject.Inject.class);
+ } catch (Exception ex) {
+ return null;
+ }
+ }
+ }
+}
diff --git a/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/DataSourceDelegate.java b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/DataSourceDelegate.java
new file mode 100644
index 000000000..ca43aff18
--- /dev/null
+++ b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/DataSourceDelegate.java
@@ -0,0 +1,85 @@
+/*
+ * DataSourceDelegate.java
+ *
+ * Copyright 2014 Johnathan Ingram (jingram@rogueware.org)
+ *
+ * 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. *
+ *
+ */
+package org.switchyard.component.test.mixins.entitymanager;
+
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
+import javax.sql.DataSource;
+
+/**
+ *
+ * @author Johnathan Ingram (jingram@rogueware.org)
+ */
+public class DataSourceDelegate implements javax.sql.DataSource, Serializable {
+
+ private DataSource ds;
+
+ public DataSourceDelegate(DataSource ds) {
+ this.ds = ds;
+ }
+
+ @Override
+ public Connection getConnection() throws SQLException {
+ return ds.getConnection();
+ }
+
+ @Override
+ public Connection getConnection(String username, String password) throws SQLException {
+ return ds.getConnection(username, password);
+ }
+
+ @Override
+ public PrintWriter getLogWriter() throws SQLException {
+ return ds.getLogWriter();
+ }
+
+ @Override
+ public void setLogWriter(PrintWriter out) throws SQLException {
+ ds.setLogWriter(out);
+ }
+
+ @Override
+ public void setLoginTimeout(int seconds) throws SQLException {
+ ds.setLoginTimeout(seconds);
+ }
+
+ @Override
+ public int getLoginTimeout() throws SQLException {
+ return ds.getLoginTimeout();
+ }
+
+ @Override
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ return ds.getParentLogger();
+ }
+
+ @Override
+ public T unwrap(Class iface) throws SQLException {
+ return ds.unwrap(iface);
+ }
+
+ @Override
+ public boolean isWrapperFor(Class> iface) throws SQLException {
+ return ds.isWrapperFor(iface);
+ }
+}
diff --git a/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/EntityManagerDelegate.java b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/EntityManagerDelegate.java
new file mode 100644
index 000000000..b0b9ba7c4
--- /dev/null
+++ b/test/mixins/entitymanager/src/main/java/org/switchyard/component/test/mixins/entitymanager/EntityManagerDelegate.java
@@ -0,0 +1,178 @@
+/*
+ * EntityManagerDelegate.java
+ *
+ * Copyright 2014 Johnathan Ingram (jingram@rogueware.org)
+ *
+ * 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. *
+ *
+ */
+package org.switchyard.component.test.mixins.entitymanager;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import javax.persistence.EntityManager;
+import javax.transaction.Status;
+import javax.transaction.Synchronization;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.TransactionRequiredException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author Johnathan Ingram (jingram@rogueware.org)
+ */
+public class EntityManagerDelegate implements InvocationHandler, Serializable {
+
+ private transient static final Logger log = LoggerFactory.getLogger(EntityManagerDelegate.class);
+ private transient static final ThreadLocal