Permalink
Browse files

Cosmetics

  • Loading branch information...
1 parent 9e80bb3 commit 6d04eddac866fa4f8ab4486a00389083a54c50d7 @skuro committed Dec 1, 2011
View
235 pom.xml
@@ -1,85 +1,85 @@
<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>it.sk.spring.surf.clojure</groupId>
- <artifactId>spring-webscripts-addon-clojure</artifactId>
- <packaging>jar</packaging>
- <version>1.0-alpha2</version>
- <name>spring-webscripts-addon-clojure</name>
- <url>http://skuro.tk</url>
+ 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>it.sk.spring.surf.clojure</groupId>
+ <artifactId>spring-webscripts-addon-clojure</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-alpha2</version>
+ <name>spring-webscripts-addon-clojure</name>
+ <url>http://skuro.tk</url>
- <parent>
- <groupId>org.springframework.extensions.surf</groupId>
- <artifactId>spring-surf-parent</artifactId>
- <version>1.0.0</version>
- </parent>
+ <parent>
+ <groupId>org.springframework.extensions.surf</groupId>
+ <artifactId>spring-surf-parent</artifactId>
+ <version>1.0.0</version>
+ </parent>
- <properties>
- <spring.surf.version>1.0.0</spring.surf.version>
- </properties>
+ <properties>
+ <spring.surf.version>1.0.0</spring.surf.version>
+ </properties>
- <scm>
- <connection>scm:git:git://github.com/skuro/spring-webscripts-addon-clojure.git</connection>
- <developerConnection>scm:git:git@github.com:skuro/spring-webscripts-addon-clojure.git</developerConnection>
- <tag>1.0-alpha</tag>
- <url>https://github.com/skuro/spring-webscripts-addon-clojure</url>
- </scm>
+ <scm>
+ <connection>scm:git:git://github.com/skuro/spring-webscripts-addon-clojure.git</connection>
+ <developerConnection>scm:git:git@github.com:skuro/spring-webscripts-addon-clojure.git</developerConnection>
+ <tag>1.0-alpha</tag>
+ <url>https://github.com/skuro/spring-webscripts-addon-clojure</url>
+ </scm>
<repositories>
<repository>
<id>clojars</id>
<url>http://clojars.org/repo/</url>
</repository>
- <repository>
- <id>alfresco-public</id>
- <url>http://maven.alfresco.com/nexus/content/groups/public/</url>
- </repository>
+ <repository>
+ <id>alfresco-public</id>
+ <url>http://maven.alfresco.com/nexus/content/groups/public/</url>
+ </repository>
</repositories>
- <dependencies>
- <!-- Spring Surf and Web Scripts -->
- <dependency>
- <groupId>org.springframework.extensions.surf</groupId>
- <artifactId>spring-surf</artifactId>
- <version>${spring.surf.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.extensions.surf</groupId>
- <artifactId>spring-webscripts</artifactId>
- <version>${spring.surf.version}</version>
- <scope>provided</scope>
- </dependency>
+ <dependencies>
+ <!-- Spring Surf and Web Scripts -->
+ <dependency>
+ <groupId>org.springframework.extensions.surf</groupId>
+ <artifactId>spring-surf</artifactId>
+ <version>${spring.surf.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.extensions.surf</groupId>
+ <artifactId>spring-webscripts</artifactId>
+ <version>${spring.surf.version}</version>
+ <scope>provided</scope>
+ </dependency>
- <!-- Include Web Scripts Test Dependencies during test -->
- <dependency>
- <groupId>org.springframework.extensions.surf</groupId>
- <artifactId>spring-webscripts</artifactId>
- <version>${spring.surf.version}</version>
- <classifier>tests</classifier>
- <scope>test</scope>
- </dependency>
+ <!-- Include Web Scripts Test Dependencies during test -->
+ <dependency>
+ <groupId>org.springframework.extensions.surf</groupId>
+ <artifactId>spring-webscripts</artifactId>
+ <version>${spring.surf.version}</version>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
- <!-- Clojure runtime -->
- <dependency>
- <groupId>org.clojure</groupId>
- <artifactId>clojure</artifactId>
- <version>1.3.0</version>
- </dependency>
+ <!-- Clojure runtime -->
+ <dependency>
+ <groupId>org.clojure</groupId>
+ <artifactId>clojure</artifactId>
+ <version>1.3.0</version>
+ </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.2</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>1.8.5</version>
- <scope>test</scope>
- </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>swank-clojure</groupId>
@@ -88,57 +88,58 @@
</dependency>
</dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>com.theoryinpractise</groupId>
- <artifactId>clojure-maven-plugin</artifactId>
- <version>1.3.8</version>
- <extensions>true</extensions>
- <executions>
- <execution>
- <id>default</id>
- <goals>
- <goal>compile</goal>
- </goals>
- <phase>compile</phase><!--generate-resources</phase-->
- </execution>
- </executions>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.theoryinpractise</groupId>
+ <artifactId>clojure-maven-plugin</artifactId>
+ <version>1.3.8</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>default</id>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <phase>compile</phase>
+ <!--generate-resources</phase-->
+ </execution>
+ </executions>
<dependencies>
</dependencies>
- </plugin>
- </plugins>
- <!-- http://www.mail-archive.com/m2e-users@eclipse.org/msg01187.html -->
- <!-- http://wiki.eclipse.org/M2E_plugin_execution_not_covered -->
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings
- only. It has no influence on the Maven build itself. -->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>com.theoryinpractise</groupId>
- <artifactId>clojure-maven-plugin</artifactId>
- <versionRange>[1.3.2,)</versionRange>
- <goals>
- <goal>compile</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <execute></execute>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
+ </plugin>
+ </plugins>
+ <!-- http://www.mail-archive.com/m2e-users@eclipse.org/msg01187.html -->
+ <!-- http://wiki.eclipse.org/M2E_plugin_execution_not_covered -->
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings
+ only. It has no influence on the Maven build itself. -->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>com.theoryinpractise</groupId>
+ <artifactId>clojure-maven-plugin</artifactId>
+ <versionRange>[1.3.2,)</versionRange>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <execute></execute>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
</project>
@@ -18,7 +18,8 @@
public class ClojureScriptProcessor extends AbstractScriptProcessor {
private static final Log log = LogFactory.getLog(ClojureScriptProcessor.class);
- private Map<String, WebScript> compiledWebScripts = Collections.synchronizedMap(new HashMap<String, WebScript>());
+ private final Map<String, WebScript> compiledWebScripts =
+ Collections.synchronizedMap(new HashMap<String,WebScript>());
/* (non-Javadoc)
* @see org.springframework.extensions.surf.core.processor.Processor#getExtension()
@@ -52,8 +53,7 @@ protected WebScript compileClojureScript(InputStream is, Writer out, Map<String,
this.addProcessorModelExtensions(model);
try {
- WebScript script = (WebScript) clojure.lang.Compiler.load(new InputStreamReader(is));
- return script;
+ return (WebScript) clojure.lang.Compiler.load(new InputStreamReader(is));
} catch (Exception exception) {
throw new ScriptException("Error executing Clojure script", exception);
}
@@ -10,22 +10,19 @@
/**
* @author Carlo Sciolla &lt;skuro@skuro.tk&gt;
*/
-public class ClojureScriptProcessorFactory implements ScriptProcessorFactory, ApplicationContextAware
-{
- private static final Log logger = LogFactory.getLog(ClojureScriptProcessorFactory.class);
-
- protected ApplicationContext applicationContext = null;
-
- public void setApplicationContext(ApplicationContext applicationContext)
- {
- this.applicationContext = applicationContext;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.extensions.webscripts.ScriptProcessorFactory#newInstance()
- */
- public ScriptProcessor newInstance()
- {
- return new ClojureScriptProcessor();
- }
+public class ClojureScriptProcessorFactory implements ScriptProcessorFactory, ApplicationContextAware {
+ private static final Log LOGGER = LogFactory.getLog(ClojureScriptProcessorFactory.class);
+
+ protected ApplicationContext applicationContext = null;
+
+ public void setApplicationContext(ApplicationContext applicationContext) {
+ this.applicationContext = applicationContext;
+ }
+
+ /* (non-Javadoc)
+ * @see org.springframework.extensions.webscripts.ScriptProcessorFactory#newInstance()
+ */
+ public ScriptProcessor newInstance() {
+ return new ClojureScriptProcessor();
+ }
}
@@ -1,26 +1,22 @@
-/*
- * deas - http://www.contentreich.de
- *
- * Created on Nov 29, 2011
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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 spring.surf.webscript;
+/**
+ * The main interface a WebScript must implement.
+ *
+ * Alpha: subject to change
+ * @author Carlo Sciolla
+ * @author Andreas Steffan
+ * @since 1.0
+ */
public interface WebScript {
- // InputStream, Writer, Map<String, Object> model
- public abstract Object run(Object inputStram, Object writer, Object model);
+ /**
+ * Runs the WebScript
+ *
+ * @param inputStream
+ * @param writer
+ * @param model
+ * @return
+ */
+ // TODO better documentation and type safety. Or just migrate everything to pure Clojure
+ Object run(Object inputStream, Object writer, Object model);
}
Oops, something went wrong.

0 comments on commit 6d04edd

Please sign in to comment.