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/06/14 00:52:19 UTC
git commit: DELTASPIKE-196 revert dropped example
Updated Branches:
refs/heads/master 8deaf4a7d -> 15dde98d6
DELTASPIKE-196 revert dropped example
Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/15dde98d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/15dde98d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/15dde98d
Branch: refs/heads/master
Commit: 15dde98d6ba3174607f2f1a936a7e18245c24ad1
Parents: 8deaf4a
Author: gpetracek <gp...@apache.org>
Authored: Thu Jun 14 00:50:40 2012 +0200
Committer: gpetracek <gp...@apache.org>
Committed: Thu Jun 14 00:50:40 2012 +0200
----------------------------------------------------------------------
.../example/config/ConverterExample.java | 53 +++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/15dde98d/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
new file mode 100644
index 0000000..9574be7
--- /dev/null
+++ b/deltaspike/examples/jse-examples/src/main/java/org/apache/deltaspike/example/config/ConverterExample.java
@@ -0,0 +1,53 @@
+/*
+ * 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 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;
+import java.util.logging.Logger;
+
+public class ConverterExample
+{
+ private static final Logger LOG = Logger.getLogger(ConverterExample.class.getName());
+
+ private ConverterExample()
+ {
+ }
+
+ public static void main(String[] args)
+ {
+ CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
+ cdiContainer.boot();
+
+ ContextControl contextControl = cdiContainer.getContextControl();
+ contextControl.startContext(ApplicationScoped.class);
+
+ SettingsBean settingsBean = BeanProvider.getContextualReference(SettingsBean.class, false);
+
+ LOG.info("configured int-value #1: " + settingsBean.getIntProperty1());
+ LOG.info("configured long-value #2: " + settingsBean.getProperty2());
+
+ contextControl.stopContext(ApplicationScoped.class);
+ cdiContainer.shutdown();
+ }
+}