[seam-commits] Seam SVN: r13337 - in sandbox/encore: core and 61 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Jul 6 13:14:09 EDT 2010


Author: lincolnthree
Date: 2010-07-06 13:14:08 -0400 (Tue, 06 Jul 2010)
New Revision: 13337

Added:
   sandbox/encore/core/
   sandbox/encore/core/pom.xml
   sandbox/encore/core/src/
   sandbox/encore/core/src/main/
   sandbox/encore/core/src/main/java/
   sandbox/encore/core/src/main/java/org/
   sandbox/encore/core/src/main/java/org/jboss/
   sandbox/encore/core/src/main/java/org/jboss/encore/
   sandbox/encore/core/src/main/java/org/jboss/encore/grammar/
   sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/
   sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaParser.java
   sandbox/encore/core/src/main/java/org/jboss/encore/model/
   sandbox/encore/core/src/main/java/org/jboss/encore/model/Mutable.java
   sandbox/encore/core/src/main/java/org/jboss/encore/model/Project.java
   sandbox/encore/core/src/main/java/org/jboss/encore/model/Stateful.java
   sandbox/encore/core/src/main/java/org/jboss/encore/model/java/
   sandbox/encore/core/src/main/java/org/jboss/seam/
   sandbox/encore/core/src/main/java/org/jboss/seam/encore/
   sandbox/encore/core/src/main/resources/
   sandbox/encore/core/src/test/
   sandbox/encore/core/src/test/java/
   sandbox/encore/core/src/test/java/org/
   sandbox/encore/core/src/test/java/org/jboss/
   sandbox/encore/core/src/test/java/org/jboss/encore/
   sandbox/encore/core/src/test/java/org/jboss/encore/grammar/
   sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/
   sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaParserTest.java
   sandbox/encore/core/src/test/java/org/jboss/seam/
   sandbox/encore/core/src/test/java/org/jboss/seam/encore/
   sandbox/encore/core/src/test/resources/
   sandbox/encore/core/src/test/resources/org/
   sandbox/encore/core/src/test/resources/org/jboss/
   sandbox/encore/core/src/test/resources/org/jboss/encore/
   sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/
   sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/
   sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java
   sandbox/encore/pom.xml
   sandbox/encore/shell/
   sandbox/encore/shell/pom.xml
   sandbox/encore/shell/src/
   sandbox/encore/shell/src/main/
   sandbox/encore/shell/src/main/java/
   sandbox/encore/shell/src/main/java/org/
   sandbox/encore/shell/src/main/java/org/jboss/
   sandbox/encore/shell/src/main/java/org/jboss/encore/
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/
   sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/StartupEvent.java
   sandbox/encore/shell/src/main/resources/
   sandbox/encore/shell/src/main/resources/META-INF/
   sandbox/encore/shell/src/main/resources/META-INF/beans.xml
   sandbox/encore/shell/src/test/
   sandbox/encore/shell/src/test/java/
   sandbox/encore/shell/src/test/java/org/
   sandbox/encore/shell/src/test/java/org/jboss/
   sandbox/encore/shell/src/test/java/org/jboss/encore/
   sandbox/encore/shell/src/test/java/org/jboss/encore/shell/
   sandbox/encore/shell/src/test/resources/
   sandbox/encore/src/
   sandbox/encore/src/main/
   sandbox/encore/src/main/java/
   sandbox/encore/src/main/java/org/
   sandbox/encore/src/main/java/org/jboss/
   sandbox/encore/src/main/java/org/jboss/encore/
   sandbox/encore/src/main/java/org/jboss/encore/grammar/
   sandbox/encore/src/main/java/org/jboss/encore/grammar/java/
   sandbox/encore/src/main/java/org/jboss/encore/model/
   sandbox/encore/src/main/java/org/jboss/encore/model/java/
   sandbox/encore/src/main/java/org/jboss/encore/mojo/
   sandbox/encore/src/main/java/org/jboss/seam/
   sandbox/encore/src/main/java/org/jboss/seam/encore/
   sandbox/encore/src/main/resources/
   sandbox/encore/src/test/
   sandbox/encore/src/test/java/
   sandbox/encore/src/test/java/org/
   sandbox/encore/src/test/java/org/jboss/
   sandbox/encore/src/test/java/org/jboss/encore/
   sandbox/encore/src/test/java/org/jboss/encore/grammar/
   sandbox/encore/src/test/java/org/jboss/encore/grammar/java/
   sandbox/encore/src/test/java/org/jboss/seam/
   sandbox/encore/src/test/java/org/jboss/seam/encore/
   sandbox/encore/src/test/resources/
   sandbox/encore/src/test/resources/org/
   sandbox/encore/src/test/resources/org/jboss/
   sandbox/encore/src/test/resources/org/jboss/encore/
   sandbox/encore/src/test/resources/org/jboss/encore/grammar/
   sandbox/encore/src/test/resources/org/jboss/encore/grammar/java/
Modified:
   sandbox/encore/
Log:
Module Structure Updates



Property changes on: sandbox/encore
___________________________________________________________________
Name: svn:ignore
   + .settings


Added: sandbox/encore/core/pom.xml
===================================================================
--- sandbox/encore/core/pom.xml	                        (rev 0)
+++ sandbox/encore/core/pom.xml	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,59 @@
+<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">
+   <modelVersion>4.0.0</modelVersion>
+
+   <parent>
+      <artifactId>encore</artifactId>
+      <groupId>org.jboss.encore</groupId>
+      <version>1.0.0-SNAPSHOT</version>
+      <relativePath>../pom.xml</relativePath>
+   </parent>
+
+   <artifactId>core</artifactId>
+   <version>1.0.0-SNAPSHOT</version>
+
+   <packaging>jar</packaging>
+   <name>Encore Core APIs</name>
+   <description>Simplified project bootstrapping and incremental enhancement framework</description>
+
+   <dependencies>
+      <!-- Resource manipulation dependencies -->
+      <dependency>
+         <groupId>org.jboss.shrinkwrap</groupId>
+         <artifactId>shrinkwrap-api</artifactId>
+         <version>1.0.0-alpha-9</version>
+      </dependency>
+
+      <!-- Eclipse Java Development Tools (JDT) parser and its (many) required 
+         libraries -->
+      <dependency>
+         <groupId>org.eclipse.equinox</groupId>
+         <artifactId>common</artifactId>
+         <version>3.3.0-v20070426</version>
+      </dependency>
+      <dependency>
+         <groupId>org.eclipse.jdt</groupId>
+         <artifactId>core</artifactId>
+         <version>3.3.0-v_771</version>
+         <exclusions>
+            <exclusion>
+               <groupId>org.eclipse.core.runtime.compatibility</groupId>
+               <artifactId>auth</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.eclipse.equinox</groupId>
+               <artifactId>app</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.eclipse</groupId>
+               <artifactId>text</artifactId>
+            </exclusion>
+            <exclusion>
+               <groupId>org.eclipse.core</groupId>
+               <artifactId>filesystem</artifactId>
+            </exclusion>
+         </exclusions>
+      </dependency>
+   </dependencies>
+
+</project>
\ No newline at end of file

Added: sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaParser.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaParser.java	                        (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/grammar/java/JavaParser.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,44 @@
+package org.jboss.encore.grammar.java;
+
+import java.io.InputStream;
+
+import org.eclipse.jdt.core.dom.AST;
+import org.eclipse.jdt.core.dom.ASTParser;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.internal.compiler.util.Util;
+
+public class JavaParser
+{
+
+   /**
+    * Parses and process the java source code as a compilation unit and the
+    * result it abstract syntax tree (AST) representation and this action uses
+    * the third edition of java Language Specification, that gets the
+    * possibility to support J2SE 5 during the parsing.
+    * 
+    * @param source - the java source to be parsed (i.e. the char[] contains
+    *           Java source).
+    * @return CompilationUnit Abstract syntax tree representation of a java
+    *         source file.
+    */
+   public static CompilationUnit parse(InputStream inputStream)
+   {
+      try
+      {
+         char[] source = Util.getInputStreamAsCharArray(inputStream, inputStream.available(), "ISO8859_1");
+
+         ASTParser parser = ASTParser.newParser(AST.JLS3);
+         parser.setSource(source);
+         parser.setKind(ASTParser.K_COMPILATION_UNIT);
+         // to get more informations from the unit.
+         parser.setResolveBindings(true);
+
+         return (CompilationUnit) parser.createAST(null);
+      }
+      catch (Exception e)
+      {
+         throw new IllegalArgumentException("InputStream must be a parsable java file: ", e);
+      }
+   }
+
+}

Added: sandbox/encore/core/src/main/java/org/jboss/encore/model/Mutable.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/model/Mutable.java	                        (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/model/Mutable.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.model;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface Mutable
+{
+
+}

Added: sandbox/encore/core/src/main/java/org/jboss/encore/model/Project.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/model/Project.java	                        (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/model/Project.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.model;
+
+/**
+ * The root node of the Project Object Graph (POG)
+ * 
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+public interface Project extends Mutable, Stateful
+{
+
+}

Added: sandbox/encore/core/src/main/java/org/jboss/encore/model/Stateful.java
===================================================================
--- sandbox/encore/core/src/main/java/org/jboss/encore/model/Stateful.java	                        (rev 0)
+++ sandbox/encore/core/src/main/java/org/jboss/encore/model/Stateful.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.model;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ *
+ */
+public interface Stateful
+{
+
+}

Added: sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaParserTest.java
===================================================================
--- sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaParserTest.java	                        (rev 0)
+++ sandbox/encore/core/src/test/java/org/jboss/encore/grammar/java/JavaParserTest.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,84 @@
+package org.jboss.encore.grammar.java;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.jdt.core.dom.ASTNode;
+import org.eclipse.jdt.core.dom.ASTVisitor;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jdt.core.dom.ImportDeclaration;
+import org.eclipse.jdt.core.dom.MethodDeclaration;
+import org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.junit.Before;
+import org.junit.Test;
+
+public class JavaParserTest
+{
+   private InputStream stream;
+
+   @Before
+   public void reset()
+   {
+      stream = JavaParserTest.class
+               .getResourceAsStream("/org/jboss/encore/grammar/java/MockClassFile.java");
+   }
+
+   @Test
+   public void testParse() throws Exception
+   {
+      CompilationUnit unit = JavaParser.parse(stream);
+
+      @SuppressWarnings("unchecked")
+      List<ImportDeclaration> imports = unit.imports();
+
+      assertEquals("java.net.URL", imports.get(0).getName().getFullyQualifiedName());
+   }
+
+   @Test
+   public void testAddMethod() throws Exception
+   {
+      CompilationUnit unit = JavaParser.parse(stream);
+      MethodFinderVisitor visitor = new MethodFinderVisitor();
+      unit.accept(visitor);
+      List<MethodDeclaration> methods = visitor.getMethods();
+      TypeDeclaration parent = visitor.getParent();
+      MethodDeclaration newMethod = parent.getAST().newMethodDeclaration();
+      newMethod.setName(parent.getAST().newSimpleName("addedMethod"));
+      newMethod.setConstructor(false);
+      newMethod.setReturnType2(null);
+
+      // http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/dom/rewrite/package-summary.html
+      methods = visitor.getMethods();
+
+      assertTrue(methods.contains(newMethod));
+   }
+
+   public class MethodFinderVisitor extends ASTVisitor
+   {
+      private final List<MethodDeclaration> methods = new ArrayList<MethodDeclaration>();
+      private ASTNode parent;
+
+      @Override
+      public boolean visit(final TypeDeclaration node)
+      {
+         parent = node;
+         methods.addAll(Arrays.asList(node.getMethods()));
+         return super.visit(node);
+      }
+
+      public List<MethodDeclaration> getMethods()
+      {
+         return methods;
+      }
+
+      public TypeDeclaration getParent()
+      {
+         return (TypeDeclaration) parent;
+      }
+   }
+}

Added: sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java
===================================================================
--- sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java	                        (rev 0)
+++ sandbox/encore/core/src/test/resources/org/jboss/encore/grammar/java/MockClassFile.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,22 @@
+package org.jboss.seam.encore.grammar.java;
+
+import java.net.URL;
+
+public class MockClassFile
+{
+   private String field;
+   private URL urlField;
+   
+   public MockClassFile()
+   {
+   }
+   
+   public void method()
+   {
+   }
+   
+   public String valueOf(URL url)
+   {
+      return url.getPath();
+   }
+}

Added: sandbox/encore/pom.xml
===================================================================
--- sandbox/encore/pom.xml	                        (rev 0)
+++ sandbox/encore/pom.xml	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,64 @@
+<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">
+   <modelVersion>4.0.0</modelVersion>
+
+   <groupId>org.jboss.encore</groupId>
+   <artifactId>encore</artifactId>
+   <version>1.0.0-SNAPSHOT</version>
+   <packaging>pom</packaging>
+
+   <name>Encore Framework</name>
+   <description>Simplified project bootstrapping, incremental
+		enhancement framework, and plugins	</description>
+
+   <modules>
+      <module>core</module>
+      <module>shell</module>
+   </modules>
+
+   <properties>
+      <arquillian.version>1.0.0.Alpha2</arquillian.version>
+   </properties>
+
+   <dependencyManagement>
+      <dependencies>
+         <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.8.1</version>
+         </dependency>
+         <dependency>
+            <groupId>org.jboss.arquillian</groupId>
+            <artifactId>arquillian-junit</artifactId>
+            <version>${arquillian.version}</version>
+            <scope>test</scope>
+         </dependency>
+         <dependency>
+            <groupId>javax.enterprise</groupId>
+            <artifactId>cdi-api</artifactId>
+            <version>1.0-SP1</version>
+         </dependency>
+      </dependencies>
+   </dependencyManagement>
+
+   <dependencies>
+      <dependency>
+         <groupId>junit</groupId>
+         <artifactId>junit</artifactId>
+         <scope>test</scope>
+      </dependency>
+   </dependencies>
+
+   <build>
+      <plugins>
+         <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+               <source>1.6</source>
+               <target>1.6</target>
+            </configuration>
+         </plugin>
+      </plugins>
+   </build>
+</project>

Added: sandbox/encore/shell/pom.xml
===================================================================
--- sandbox/encore/shell/pom.xml	                        (rev 0)
+++ sandbox/encore/shell/pom.xml	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,49 @@
+<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>
+
+   <parent>
+      <artifactId>encore</artifactId>
+      <groupId>org.jboss.encore</groupId>
+      <version>1.0.0-SNAPSHOT</version>
+      <relativePath>../pom.xml</relativePath>
+   </parent>
+
+   <artifactId>shell</artifactId>
+   <version>1.0.0-SNAPSHOT</version>
+
+   <name>Encore Shell</name>
+   <description>A CLI runner for the Encore framework</description>
+
+   <dependencies>
+      <!-- CDI Dependencies -->
+      <dependency>
+         <groupId>org.jboss.weld</groupId>
+         <artifactId>weld-se</artifactId>
+         <version>1.0.1-Final</version>
+      </dependency>
+      <dependency>
+         <groupId>org.jboss.weld</groupId>
+         <artifactId>weld-extensions</artifactId>
+         <version>1.0.0.Alpha2</version>
+      </dependency>
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-api</artifactId>
+         <version>1.5.10</version>
+      </dependency>
+      <dependency>
+         <groupId>org.slf4j</groupId>
+         <artifactId>slf4j-simple</artifactId>
+         <version>1.5.10</version>
+      </dependency>
+      
+      <!-- Shell Libraries -->
+      <dependency>
+         <groupId>org.sonatype.jline</groupId>
+         <artifactId>jline</artifactId>
+         <version>2.3</version>
+      </dependency>
+   </dependencies>
+
+</project>
\ No newline at end of file

Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Main.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.shell;
+
+import org.jboss.encore.shell.events.StartupEvent;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+public class Main
+{
+   public static void main(final String[] args)
+   {
+      Weld weld = new Weld();
+      WeldContainer container = weld.initialize();
+      container.event().fire(new StartupEvent());
+      weld.shutdown();
+   }
+
+}

Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/Shell.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.shell;
+
+import java.util.List;
+
+import javax.enterprise.event.Observes;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+import org.jboss.encore.shell.events.StartupEvent;
+import org.jboss.weld.environment.se.bindings.Parameters;
+import org.slf4j.Logger;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+ at Singleton
+public class Shell
+{
+   @Inject
+   @Parameters
+   private List<String> parameters;
+
+   @Inject
+   Logger log;
+
+   public void init(@Observes final StartupEvent event)
+   {
+      System.out.println("Startup");
+      log.info("Encore Shell - Starting up.");
+   }
+}
\ No newline at end of file

Added: sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/StartupEvent.java
===================================================================
--- sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/StartupEvent.java	                        (rev 0)
+++ sandbox/encore/shell/src/main/java/org/jboss/encore/shell/events/StartupEvent.java	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt 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.encore.shell.events;
+
+/**
+ * @author <a href="mailto:lincolnbaxter at gmail.com">Lincoln Baxter, III</a>
+ * 
+ */
+public class StartupEvent
+{
+
+}

Added: sandbox/encore/shell/src/main/resources/META-INF/beans.xml
===================================================================
--- sandbox/encore/shell/src/main/resources/META-INF/beans.xml	                        (rev 0)
+++ sandbox/encore/shell/src/main/resources/META-INF/beans.xml	2010-07-06 17:14:08 UTC (rev 13337)
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans>
+</beans>



More information about the seam-commits mailing list