Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Commit

Permalink
Trying Solder. Doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceefour committed Mar 29, 2012
1 parent d568274 commit 61d4ecb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ear/.settings/org.eclipse.wst.common.component
Expand Up @@ -18,5 +18,14 @@
<dependent-module archiveName="soluvas-jaxrs-1.0.0-SNAPSHOT.jar" deploy-path="/lib/" handle="module:/resource/soluvas-jaxrs/soluvas-jaxrs"> <dependent-module archiveName="soluvas-jaxrs-1.0.0-SNAPSHOT.jar" deploy-path="/lib/" handle="module:/resource/soluvas-jaxrs/soluvas-jaxrs">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="solder-impl-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-impl/3.1.0.Final/solder-impl-3.1.0.Final.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="solder-api-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-api/3.1.0.Final/solder-api-3.1.0.Final.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="solder-logging-3.1.0.Final.jar" deploy-path="/lib/" handle="module:/classpath/var/M2_REPO/org/jboss/solder/solder-logging/3.1.0.Final/solder-logging-3.1.0.Final.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
</wb-module> </wb-module>
</project-modules> </project-modules>
3 changes: 3 additions & 0 deletions ear/src/main/resources/ear-sample.properties
@@ -0,0 +1,3 @@
here=is
configuration=for
the=webapps
7 changes: 7 additions & 0 deletions parent/pom.xml
Expand Up @@ -36,6 +36,13 @@
</repositories> </repositories>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>seam-bom</artifactId>
<version>3.1.0.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency> <dependency>
<groupId>org.jboss.spec</groupId> <groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId> <artifactId>jboss-javaee-6.0</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions rs/pom.xml
Expand Up @@ -22,6 +22,11 @@
<artifactId>soluvas-jaxrs</artifactId> <artifactId>soluvas-jaxrs</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</dependency> </dependency>

<dependency>
<groupId>org.jboss.solder</groupId>
<artifactId>solder-impl</artifactId>
</dependency>
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions rs/src/main/java/org/soluvas/earsample/rs/ArticleResource.java
Expand Up @@ -2,17 +2,23 @@


import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Properties;


import javax.inject.Inject;
import javax.ws.rs.GET; import javax.ws.rs.GET;
import javax.ws.rs.Path; import javax.ws.rs.Path;
import javax.ws.rs.Produces; import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;


import org.jboss.solder.resourceLoader.Resource;
import org.soluvas.earsample.data.Article; import org.soluvas.earsample.data.Article;


@Path("article") @Path("article")
public class ArticleResource { public class ArticleResource {


@Inject @Resource("ear-sample.properties") Properties props;

@GET @Produces(MediaType.APPLICATION_JSON) @GET @Produces(MediaType.APPLICATION_JSON)
public List<Article> getIndex() { public List<Article> getIndex() {
ArrayList<Article> articles = new ArrayList<Article>(); ArrayList<Article> articles = new ArrayList<Article>();
Expand All @@ -22,4 +28,11 @@ public List<Article> getIndex() {
"Makin bagus dan selalu mantab gan.", "Cinta Sejati")); "Makin bagus dan selalu mantab gan.", "Cinta Sejati"));
return articles; return articles;
} }

@GET @Produces(MediaType.APPLICATION_JSON)
@Path("props")
public Properties getProps() {
return props;
}

} }

0 comments on commit 61d4ecb

Please sign in to comment.