[jboss-cvs] JBossAS SVN: r91748 - in projects/reloaded/trunk: naming and 12 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 28 18:50:03 EDT 2009
Author: wolfc
Date: 2009-07-28 18:50:03 -0400 (Tue, 28 Jul 2009)
New Revision: 91748
Added:
projects/reloaded/trunk/naming/
projects/reloaded/trunk/naming/.classpath
projects/reloaded/trunk/naming/.project
projects/reloaded/trunk/naming/.settings/
projects/reloaded/trunk/naming/.settings/org.eclipse.jdt.core.prefs
projects/reloaded/trunk/naming/.settings/org.maven.ide.eclipse.prefs
projects/reloaded/trunk/naming/pom.xml
projects/reloaded/trunk/naming/src/
projects/reloaded/trunk/naming/src/main/
projects/reloaded/trunk/naming/src/main/java/
projects/reloaded/trunk/naming/src/main/java/org/
projects/reloaded/trunk/naming/src/main/java/org/jboss/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/CurrentComponent.java
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/interceptor/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/interceptor/AbstractNamingInterceptor.java
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEApplication.java
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEComponent.java
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEModule.java
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/
projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/ThreadLocalStack.java
projects/reloaded/trunk/naming/src/test/
projects/reloaded/trunk/naming/src/test/java/
projects/reloaded/trunk/naming/src/test/resources/
Log:
RELOADED-9: initial setup
Property changes on: projects/reloaded/trunk/naming
___________________________________________________________________
Name: svn:ignore
+ eclipse-target
Added: projects/reloaded/trunk/naming/.classpath
===================================================================
--- projects/reloaded/trunk/naming/.classpath (rev 0)
+++ projects/reloaded/trunk/naming/.classpath 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,8 @@
+<classpath>
+ <classpathentry kind="src" path="src/test/java" output="eclipse-target/test-classes" including="**/*.java"/>
+ <classpathentry kind="src" path="src/test/resources" output="eclipse-target/test-classes" excluding="**/*.java"/>
+ <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
+ <classpathentry kind="output" path="eclipse-target/classes"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+</classpath>
\ No newline at end of file
Added: projects/reloaded/trunk/naming/.project
===================================================================
--- projects/reloaded/trunk/naming/.project (rev 0)
+++ projects/reloaded/trunk/naming/.project 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,17 @@
+<projectDescription>
+ <name>jboss-reloaded-naming</name>
+ <comment></comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: projects/reloaded/trunk/naming/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- projects/reloaded/trunk/naming/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ projects/reloaded/trunk/naming/.settings/org.eclipse.jdt.core.prefs 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,5 @@
+#Tue Jul 28 17:18:36 CEST 2009
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
Added: projects/reloaded/trunk/naming/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- projects/reloaded/trunk/naming/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ projects/reloaded/trunk/naming/.settings/org.maven.ide.eclipse.prefs 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,8 @@
+#Wed Jul 29 00:48:01 CEST 2009
+activeProfiles=eclipse
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: projects/reloaded/trunk/naming/pom.xml
===================================================================
--- projects/reloaded/trunk/naming/pom.xml (rev 0)
+++ projects/reloaded/trunk/naming/pom.xml 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,30 @@
+<!--
+ vi:ts=2:sw=2:expandtab
+-->
+<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/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.reloaded</groupId>
+ <artifactId>jboss-reloaded-build</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-reloaded-naming</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+ <name>JBoss Reloaded Naming</name>
+ <url>http://www.jboss.org</url>
+ <description>
+ </description>
+
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>org.jboss.bootstrap</groupId>
+ <artifactId>jboss-bootstrap</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ -->
+ </dependencies>
+</project>
Added: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/CurrentComponent.java
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/CurrentComponent.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/CurrentComponent.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming;
+
+import org.jboss.reloaded.naming.spi.JavaEEComponent;
+import org.jboss.reloaded.naming.util.ThreadLocalStack;
+
+/**
+ * Provides the bridge between the JNDI object factory and the namespaces.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public class CurrentComponent
+{
+ private static ThreadLocalStack<JavaEEComponent> stack = new ThreadLocalStack<JavaEEComponent>();
+
+ public static JavaEEComponent get()
+ {
+ return stack.get();
+ }
+
+ public static JavaEEComponent pop()
+ {
+ return stack.pop();
+ }
+
+ public static void push(JavaEEComponent component)
+ {
+ stack.push(component);
+ }
+}
Added: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/interceptor/AbstractNamingInterceptor.java
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/interceptor/AbstractNamingInterceptor.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/interceptor/AbstractNamingInterceptor.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming.interceptor;
+
+import org.jboss.reloaded.naming.CurrentComponent;
+import org.jboss.reloaded.naming.spi.JavaEEComponent;
+
+/**
+ * Provides the means of pushing the JavaEE namespace upon invocations.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public abstract class AbstractNamingInterceptor<T>
+{
+ protected void afterInvoke(T context)
+ {
+ JavaEEComponent component = CurrentComponent.pop();
+ assert component == getComponent() : "popped wrong component " + component + ", was expecting " + getComponent();
+ }
+
+ protected void beforeInvoke(T context)
+ {
+ JavaEEComponent component = getComponent();
+ assert component != null : "component is null";
+ CurrentComponent.push(component);
+ }
+
+ protected abstract JavaEEComponent getComponent();
+
+ public Object invoke(T context) throws Throwable
+ {
+ beforeInvoke(context);
+ try
+ {
+ return proceed(context);
+ }
+ finally
+ {
+ afterInvoke(context);
+ }
+ }
+
+ protected abstract Object proceed(T context) throws Throwable;
+}
Added: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEApplication.java
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEApplication.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEApplication.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming.spi;
+
+import javax.naming.Context;
+
+/**
+ * A named reference to the application scoped namespace.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface JavaEEApplication
+{
+ /**
+ * The JNDI namespace which holds java:app.
+ * @return the context for java:app
+ */
+ Context getContext();
+
+ /**
+ * The name of the application.
+ * @return the name of the application
+ */
+ String getName();
+}
Added: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEComponent.java
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEComponent.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEComponent.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming.spi;
+
+import javax.naming.Context;
+
+/**
+ * A named reference to the component scoped namespace.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface JavaEEComponent
+{
+ /**
+ * The JNDI namespace which holds java:comp.
+ * @return the context for java:comp
+ */
+ Context getContext();
+
+ /**
+ * The JavaEE Module in which this component is defined.
+ * @return the module in which this component belongs
+ */
+ JavaEEModule getModule();
+
+ /**
+ * The name of the component. In case of an EJB it's equal to the bean name.
+ * @return the name of the component
+ */
+ String getName();
+}
Added: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEModule.java
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEModule.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/spi/JavaEEModule.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming.spi;
+
+import javax.naming.Context;
+
+/**
+ * A named reference to the module scoped namespace.
+ *
+ * @author <a href="mailto:cdewolf at redhat.com">Carlo de Wolf</a>
+ * @version $Revision: $
+ */
+public interface JavaEEModule
+{
+ /**
+ * The JavaEE application in which this module is defined.
+ * @return the application in which this module belongs
+ */
+ JavaEEApplication getApplication();
+
+ /**
+ * The JNDI namespace which holds java:module.
+ * @return the context for java:module
+ */
+ Context getContext();
+
+ /**
+ * The name of the module. In case of an EJB it's equal to the EJB jar name.
+ * @return the name of the module
+ */
+ String getName();
+}
Copied: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/ThreadLocalStack.java (from rev 91369, projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/ThreadLocalStack.java)
===================================================================
--- projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/ThreadLocalStack.java (rev 0)
+++ projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/ThreadLocalStack.java 2009-07-28 22:50:03 UTC (rev 91748)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.reloaded.naming.util;
+
+import java.util.LinkedList;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision$
+ */
+public class ThreadLocalStack<T>
+{
+ private ThreadLocal<LinkedList<T>> stack = new ThreadLocal<LinkedList<T>>();
+
+ public void push(T obj)
+ {
+ LinkedList<T> list = stack.get();
+ if (list == null)
+ {
+ list = new LinkedList<T>();
+ stack.set(list);
+ }
+ list.addLast(obj);
+ }
+
+ public T pop()
+ {
+ LinkedList<T> list = stack.get();
+ if (list == null)
+ {
+ return null;
+ }
+ T rtn = list.removeLast();
+ if (list.size() == 0)
+ {
+ //stack.set(null);
+ stack.remove();
+ //list.clear();
+ }
+ return rtn;
+ }
+
+ public T get()
+ {
+ LinkedList<T> list = stack.get();
+ if (list == null)
+ {
+ return null;
+ }
+ return list.getLast();
+ }
+
+ /*
+ public List<T> getList()
+ {
+ return stack.get();
+ }
+ */
+}
Property changes on: projects/reloaded/trunk/naming/src/main/java/org/jboss/reloaded/naming/util/ThreadLocalStack.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list