You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2006/05/03 16:38:44 UTC
svn commit: r399316 - in /tapestry/tapestry5/tapestry-core/trunk: ./
src/main/java/org/apache/tapestry/internal/structure/
Author: hlship
Date: Wed May 3 07:38:42 2006
New Revision: 399316
URL: http://svn.apache.org/viewcvs?rev=399316&view=rev
Log:
Make use of the Eclipse Maven2 plugin.
Update pom.xml to build using AspectJ.
Begin adding classes and interfaces related to page structure.
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Component.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Page.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
Modified:
tapestry/tapestry5/tapestry-core/trunk/.classpath
tapestry/tapestry5/tapestry-core/trunk/.project
tapestry/tapestry5/tapestry-core/trunk/pom.xml
Modified: tapestry/tapestry5/tapestry-core/trunk/.classpath
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/.classpath?rev=399316&r1=399315&r2=399316&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/.classpath (original)
+++ tapestry/tapestry5/tapestry-core/trunk/.classpath Wed May 3 07:38:42 2006
@@ -7,16 +7,7 @@
<classpathentry kind="lib" path="src/test/resources"/>
<classpathentry kind="lib" path="src/test/conf"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="M2_REPO/org/testng/testng/4.7/testng-4.7-jdk15.jar"/>
- <classpathentry sourcepath="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4-sources.jar" kind="var" path="M2_REPO/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/easymock/easymock/2.0/easymock-2.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/qdox/qdox/1.5/qdox-1.5.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.1/javassist-3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/bsh/bsh/2.0b1/bsh-2.0b1.jar"/>
- <classpathentry kind="var" path="M2_REPO/hivemind/hivemind/1.1.1/hivemind-1.1.1.jar"/>
<classpathentry kind="var" path="ASPECTJRT_LIB"/>
- <classpathentry sourcepath="/M2_REPO/oro/oro/2.0.8/oro-2.0.8-sources.jar" kind="var" path="M2_REPO/oro/oro/2.0.8/oro-2.0.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/hivemind/hivemind-lib/1.1.1/hivemind-lib-1.1.1.jar"/>
- <classpathentry sourcepath="/M2_REPO/log4j/log4j/1.2.8/log4j-1.2.8-sources.jar" kind="var" path="M2_REPO/log4j/log4j/1.2.13/log4j-1.2.13.jar"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: tapestry/tapestry5/tapestry-core/trunk/.project
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/.project?rev=399316&r1=399315&r2=399316&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/.project (original)
+++ tapestry/tapestry5/tapestry-core/trunk/.project Wed May 3 07:38:42 2006
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>tapestry-core</name>
+ <name>tapestry5</name>
<comment></comment>
<projects>
</projects>
@@ -10,9 +10,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
- <nature>org.eclipse.ajdt.ui.ajnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
</natures>
</projectDescription>
Modified: tapestry/tapestry5/tapestry-core/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/pom.xml?rev=399316&r1=399315&r2=399316&view=diff
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/pom.xml (original)
+++ tapestry/tapestry5/tapestry-core/trunk/pom.xml Wed May 3 07:38:42 2006
@@ -31,14 +31,14 @@
<artifactId>hivemind-lib</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
- </dependency>
- <!-- Really, a transitive dependency of hivemind. -->
- <dependency>
- <groupId>oro</groupId>
- <artifactId>oro</artifactId>
- <version>2.0.8</version>
- <scope>runtime</scope>
- </dependency>
+ </dependency>
+ <!-- Really, a transitive dependency of hivemind. -->
+ <dependency>
+ <groupId>oro</groupId>
+ <artifactId>oro</artifactId>
+ <version>2.0.8</version>
+ <scope>runtime</scope>
+ </dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
@@ -62,8 +62,13 @@
<classifier>jdk15</classifier>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.0</version>
+ </dependency>
</dependencies>
- <build>
+ <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -72,6 +77,20 @@
<source>1.5</source>
<target>1.5</target>
</configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>aspectj-maven-plugin</artifactId>
+ <configuration>
+ <complianceLevel>1.5</complianceLevel>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Component.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Component.java?rev=399316&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Component.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Component.java Wed May 3 07:38:42 2006
@@ -0,0 +1,14 @@
+package org.apache.tapestry.internal.structure;
+
+/**
+ * A component provides the structure of a page. Each component is aware of its immediate container,
+ * and of the page that ultimately contains it.
+ *
+ * @author Howard M. Lewis Ship
+ */
+public interface Component
+{
+ Page getPage();
+
+ Component getContainer();
+}
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Page.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Page.java?rev=399316&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Page.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/Page.java Wed May 3 07:38:42 2006
@@ -0,0 +1,42 @@
+package org.apache.tapestry.internal.structure;
+
+import java.util.Locale;
+
+import org.apache.tapestry.events.ComponentLifecycle;
+
+/**
+ * Represents a unique page within the application.
+ * <p>
+ * One of the most important aspects of a Page is that it <em>does not</em> have to be coded in a
+ * thread-safe manner. Pages are always accessed within a single thread, associated with a single
+ * incoming request.
+ *
+ * @author Howard M. Lewis Ship
+ */
+public interface Page
+{
+ /**
+ * Returns the name of the page which is typically the FQCN of the root component's peer class.
+ * The name is unique within the application, though it is modified with the locale to select
+ * and pool page instances.
+ */
+ String getName();
+
+ /**
+ * The locale for which the page is localized. This is set when the page is created and does not
+ * change.
+ */
+ Locale getLocale();
+
+ /**
+ * Invoked during page construction time to connect the page's root component to the page
+ * instance.
+ */
+ void setRootComponent(Component component);
+
+ /** The root component of the page. */
+ Component getRootComponent();
+
+ /** Adds a lifecycle listener to the page. This is most often a component or a component peer. */
+ void addComponentLifecycle(ComponentLifecycle lifecycle);
+}
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java
URL: http://svn.apache.org/viewcvs/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java?rev=399316&view=auto
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/structure/PageImpl.java Wed May 3 07:38:42 2006
@@ -0,0 +1,52 @@
+package org.apache.tapestry.internal.structure;
+
+import java.util.List;
+import java.util.Locale;
+
+import org.apache.tapestry.events.ComponentLifecycle;
+
+import static org.apache.tapestry.util.CollectionFactory.newList;
+
+/** @author Howard M. Lewis Ship */
+public class PageImpl implements Page
+{
+ private final String _name;
+
+ private final Locale _locale;
+
+ private final List<ComponentLifecycle> _lifecycles = newList();
+
+ private Component _rootComponent;
+
+ public PageImpl(String name, Locale locale)
+ {
+ _name = name;
+ _locale = locale;
+ }
+
+ public String getName()
+ {
+ return _name;
+ }
+
+ public Locale getLocale()
+ {
+ return _locale;
+ }
+
+ public void setRootComponent(Component component)
+ {
+ _rootComponent = component;
+ }
+
+ public Component getRootComponent()
+ {
+ return _rootComponent;
+ }
+
+ public void addComponentLifecycle(ComponentLifecycle lifecycle)
+ {
+ _lifecycles.add(lifecycle);
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org