Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting cdi migration #652

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 7 additions & 133 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
<developerConnection>scm:git:git@github.com:caelum/vraptor.git</developerConnection>
</scm>
<dependencies>

<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>1.1.7.Final</version>
</dependency>

<!-- mandatory -->
<dependency>
<groupId>cglib</groupId>
Expand Down Expand Up @@ -108,90 +115,6 @@
<version>1.3.1</version>
</dependency>

<!-- spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-asm</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.9</version>
</dependency>


<!-- [guice] -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-multibindings</artifactId>
<version>3.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>net.sf.scannotation</groupId>
<artifactId>scannotation</artifactId>
<version>1.0.2</version>
</dependency>
<!-- [/guice] -->

<!-- [pico] -->
<dependency>
<groupId>org.picocontainer</groupId>
<artifactId>picocontainer</artifactId>
<version>2.13.6</version>
<optional>true</optional>
</dependency>
<!-- scannotations -->
<!-- [/pico] -->

<!-- [deserialization] -->
<dependency>
<groupId>org.codehaus.jettison</groupId>
Expand All @@ -207,54 +130,6 @@
</dependency>
<!-- [/deserialization] -->

<!-- [JFreeChart] -->
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.12</version>
</dependency>
<!-- [/JFreeChart] -->

<!-- [hibernate] -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.0.ga</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.3.1.GA</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
<classifier>new</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.1.0.GA</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<optional>true</optional>
</dependency>
<!-- [/hibernate] -->

<dependency>
<groupId>br.com.caelum</groupId>
<artifactId>iogi</artifactId>
Expand Down Expand Up @@ -287,7 +162,6 @@
<optional>true</optional>
</dependency>


<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
Expand Down
11 changes: 2 additions & 9 deletions vraptor-core/src/main/java/br/com/caelum/vraptor/VRaptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,14 @@
* @author Fabio Kung
*/
public class VRaptor implements Filter {
private ContainerProvider provider;

private ServletContext servletContext;

private StaticContentHandler staticHandler;
@Inject private StaticContentHandler staticHandler;

private static final Logger logger = LoggerFactory.getLogger(VRaptor.class);

public void destroy() {
provider.stop();
provider = null;
servletContext = null;
}

Expand Down Expand Up @@ -103,10 +101,5 @@ public void init(FilterConfig cfg) throws ServletException {
logger.info("VRaptor 3.5.0-SNAPSHOT successfuly initialized");
}

void init(ContainerProvider provider) {
this.provider = provider;
this.provider.start(servletContext);
this.staticHandler = provider.getContainer().instanceFor(StaticContentHandler.class);
}

}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,20 @@

import javax.servlet.ServletContext;

import br.com.caelum.vraptor.config.BasicConfiguration;
import br.com.caelum.vraptor.ioc.ApplicationScoped;
import br.com.caelum.vraptor.ioc.ComponentFactory;

@ApplicationScoped
public class EncodingHandlerFactory implements ComponentFactory<EncodingHandler>{

/**
* context parameter that represents application character encoding
*/
public static final String ENCODING = "br.com.caelum.vraptor.encoding";

private final EncodingHandler handler;

public EncodingHandlerFactory(ServletContext context) {
String encoding = new BasicConfiguration(context).getEncoding();
String encoding = context.getInitParameter(ENCODING);
this.handler = encoding == null? new NullEncodingHandler() : new WebXmlEncodingHandler(encoding);
}

Expand Down
Loading