You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by gp...@apache.org on 2012/03/17 22:55:36 UTC
git commit: DELTASPIKE-92 updated examples
Updated Branches:
refs/heads/master fd790135a -> bf266f55a
DELTASPIKE-92 updated examples
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/bf266f55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/bf266f55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/bf266f55
Branch: refs/heads/master
Commit: bf266f55a2eba3d39f540c6c6e940252521de057
Parents: fd79013
Author: gpetracek <gp...@apache.org>
Authored: Sat Mar 17 22:52:56 2012 +0100
Committer: gpetracek <gp...@apache.org>
Committed: Sat Mar 17 22:52:56 2012 +0100
----------------------------------------------------------------------
deltaspike/examples/jse-examples/pom.xml | 12 ++++++------
.../beanmanagement/SimpleBeanLookupExample.java | 10 +++++++---
.../example/config/ConverterExample.java | 11 +++++++----
deltaspike/parent/pom.xml | 12 ++++++------
4 files changed, 26 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/bf266f55/deltaspike/examples/jse-examples/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/examples/jse-examples/pom.xml b/deltaspike/examples/jse-examples/pom.xml
index e57d929..965e662 100644
--- a/deltaspike/examples/jse-examples/pom.xml
+++ b/deltaspike/examples/jse-examples/pom.xml
@@ -50,8 +50,8 @@
</dependency>
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-owb</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-owb</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
@@ -60,8 +60,8 @@
<id>Weld</id>
<dependencies>
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-weld</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-weld</artifactId>
<scope>runtime</scope>
</dependency>
@@ -121,8 +121,8 @@
<!-- Dependencies for Java-SE -->
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-api</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-api</artifactId>
<scope>compile</scope>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/bf266f55/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/beanmanagement/SimpleBeanLookupExample.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/beanmanagement/SimpleBeanLookupExample.java b/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/beanmanagement/SimpleBeanLookupExample.java
index ffe224d..d26da0b 100644
--- a/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/beanmanagement/SimpleBeanLookupExample.java
+++ b/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/beanmanagement/SimpleBeanLookupExample.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.example.beanmanagement;
import org.apache.deltaspike.cdise.api.CdiContainer;
import org.apache.deltaspike.cdise.api.CdiContainerLoader;
+import org.apache.deltaspike.cdise.api.ContextControl;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import org.apache.deltaspike.example.echo.DefaultEchoService;
import org.apache.deltaspike.example.echo.EchoService;
@@ -49,8 +50,10 @@ public class SimpleBeanLookupExample
{
CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
- cdiContainer.bootContainer();
- cdiContainer.startContext(ApplicationScoped.class);
+ cdiContainer.boot();
+
+ ContextControl contextControl = cdiContainer.getContextControl();
+ contextControl.startContext(ApplicationScoped.class);
//containerControl.startContexts();
//or:
@@ -93,7 +96,8 @@ public class SimpleBeanLookupExample
LOG.severe("Unexpected implementation found: " + optionalService.getClass().getName());
}
- cdiContainer.stop();
+ contextControl.stopContext(ApplicationScoped.class);
+ cdiContainer.shutdown();
//or:
//containerControl.stopContexts();
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/bf266f55/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java
----------------------------------------------------------------------
diff --git a/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java b/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java
index 05f076c..2f440ab 100644
--- a/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java
+++ b/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java
@@ -20,6 +20,7 @@ package org.apache.deltaspike.example.config;
import org.apache.deltaspike.cdise.api.CdiContainer;
import org.apache.deltaspike.cdise.api.CdiContainerLoader;
+import org.apache.deltaspike.cdise.api.ContextControl;
import org.apache.deltaspike.core.api.provider.BeanProvider;
import javax.enterprise.context.ApplicationScoped;
@@ -35,10 +36,11 @@ public class ConverterExample
public static void main(String[] args)
{
-
CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
- cdiContainer.bootContainer();
- cdiContainer.startContext(ApplicationScoped.class);
+ cdiContainer.boot();
+
+ ContextControl contextControl = cdiContainer.getContextControl();
+ contextControl.startContext(ApplicationScoped.class);
SettingsBean settingsBean = BeanProvider.getContextualReference(SettingsBean.class, false);
@@ -46,6 +48,7 @@ public class ConverterExample
LOG.info("configured long-value #2: " + settingsBean.getProperty2());
LOG.info("configured inverse-value #2: " + settingsBean.getInverseProperty());
- cdiContainer.stop();
+ contextControl.stopContext(ApplicationScoped.class);
+ cdiContainer.shutdown();
}
}
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/bf266f55/deltaspike/parent/pom.xml
----------------------------------------------------------------------
diff --git a/deltaspike/parent/pom.xml b/deltaspike/parent/pom.xml
index e33caae..7eb5619 100644
--- a/deltaspike/parent/pom.xml
+++ b/deltaspike/parent/pom.xml
@@ -349,22 +349,22 @@
<!-- Dependencies for Java-SE -->
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-api</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-api</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-owb</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-owb</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.apache.deltaspike.cdise</groupId>
- <artifactId>deltaspike-cdise-weld</artifactId>
+ <groupId>org.apache.deltaspike.cdictrl</groupId>
+ <artifactId>deltaspike-cdictrl-weld</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>