deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1492584 - in /deltaspike/site/trunk/content: core.mdtext projectstage.mdtext
Date Thu, 13 Jun 2013 09:05:36 GMT
Author: struberg
Date: Thu Jun 13 09:05:36 2013
New Revision: 1492584

URL: http://svn.apache.org/r1492584
Log:
move the ProjectStage documentation to an own page.

Added:
    deltaspike/site/trunk/content/projectstage.mdtext   (with props)
Modified:
    deltaspike/site/trunk/content/core.mdtext

Modified: deltaspike/site/trunk/content/core.mdtext
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/core.mdtext?rev=1492584&r1=1492583&r2=1492584&view=diff
==============================================================================
--- deltaspike/site/trunk/content/core.mdtext (original)
+++ deltaspike/site/trunk/content/core.mdtext Thu Jun 13 09:05:36 2013
@@ -117,74 +117,9 @@ Resolving the Bean-Manager:
 
 ## Type-safe ProjectStage
 
-Project stages allow to use implementations depending on the current environment. E.g. you
can implement a bean which creates sample-data for system tests which gets activated only
in case of project-stage `SystemTest`.
-
-*Besides custom project-stages* it's possible to use the following pre-defined project-stages:
-
-  - UnitTest
-  - Development
-  - SystemTest
-  - IntegrationTest
-  - Staging
-  - Production
-
-The core provides a pluggable and type-safe approach for using project stages in a project
(it's also used within the framework). Furthermore, `@Exclude` allows to use e.g. implementations
annotated with `javax.enterprise.inject.Alternative` for specific project-stages. Besides
the out-of-the-box project-stages it's possible to implement *custom but type-safe* project-stages
which will be exposed by DeltaSpike.
-
-Resolving and using the Project-Stage:
-
-    :::java
-    @Inject
-    private ProjectStage projectStage;
-
-    //...
-
-    boolean isDevProjectStage = ProjectStage.Development.equals(this.projectStage);
-
-### Custom Project Stages
-
-It's possible to provide custom project stage implementations.
-Therefore, you have to provide an implementation of the `ProjectStageHolder` interface.
-In this class you nest the custom project-stage implementations which have to be `public
static final class` and it's required to extend `ProjectStage`.
-It's required to provide a `public static final` instance even though, you won't use it directly.
-
-ProjectStageHolder for custom project stage implementations:
-
-    :::java
-    public class CustomProjectStageHolder implements ProjectStageHolder
-    {
-        public static final class CustomProjectStage extends ProjectStage
-        {
-            private static final long serialVersionUID = 1029094387976167179L;
-        }
-
-        public static final CustomProjectStage CustomProjectStage = new CustomProjectStage();
-    }
-
-Configure your custom `ProjectStageHolder` in `META-INF/services/org.apache.deltaspike.core.api.projectstage.ProjectStageHolder`.
The file has to provide the *fully qualified* class name of the custom implementation of the
`ProjectStageHolder` interface.
-
-Usage of a custom project stage:
-
-    :::java
-    ProjectStage customProjectStage;
-    customProjectStage = ProjectStage.valueOf("CustomProjectStage");
-    //or
-    customProjectStage = CustomProjectStageHolder.CustomProjectStage;
-    //or
-    @Exclude(ifProjectStage = CustomProjectStageHolder.CustomProjectStage.class)
-
-## ProjectStageProducer (for 3rd party portable extensions)
-
-`ProjectStageProducer` provides the producer method which allows to inject the current project-stage.
However, in some cases it's needed to use project-stages also during the bootstrapping process
of the CDI container and you can't use injection. In such cases you can use `ProjectStageProducer.getInstance().getProjectStage()`
to resolve the current project-stage. This helper also contains helpers for unit-tests - e.g.
`#setProjectStage`. However, those methods shouldn't be needed for users (we just need them
for testing different project-stage scenarios).
-
-### Setting the active ProjectStage
-
-For setting the ProjectStage which shall get used in your application you can specify
-it in a few ways. The underlying mechanism used to determine the string is the ConfigResolver.
-E.g.:
-    
-    :::java 
-    -Dorg.apache.deltaspike.ProjectStage=Development
-
+The [DeltaSpike ProjectStage](projectstage.html) mechanism allows
+to use configuration and implementations depending on the
+server environment you currently run on.
 
 ## @Exclude
 

Added: deltaspike/site/trunk/content/projectstage.mdtext
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/projectstage.mdtext?rev=1492584&view=auto
==============================================================================
--- deltaspike/site/trunk/content/projectstage.mdtext (added)
+++ deltaspike/site/trunk/content/projectstage.mdtext Thu Jun 13 09:05:36 2013
@@ -0,0 +1,108 @@
+Title: DeltaSpike ProjectStage
+Notice:    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.
+
+[TOC]
+
+***
+
+# Introduction
+
+Project stages allow to use implementations depending on the current environment.
+E.g. you can implement a bean which creates sample-data for system tests which
+gets activated only in case of project-stage `SystemTest`.
+
+*Besides custom project-stages* it's possible to use the following pre-defined project-stages:
+
+  - UnitTest
+  - Development
+  - SystemTest
+  - IntegrationTest
+  - Staging
+  - Production
+
+The core provides a pluggable and type-safe approach for using project stages in a project
+(it's also used within the framework). Furthermore, `@Exclude` allows to use e.g. i
+mplementations annotated with `javax.enterprise.inject.Alternative` for specific project-stages.
+Besides the out-of-the-box project-stages it's possible to implement *custom but type-safe*
+project-stages which will be exposed by DeltaSpike.
+
+Resolving and using the Project-Stage:
+
+    :::java
+    @Inject
+    private ProjectStage projectStage;
+
+    //...
+
+    boolean isDevProjectStage = ProjectStage.Development.equals(this.projectStage);
+
+### Custom Project Stages
+
+It's possible to provide custom project stage implementations.
+Therefore, you have to provide an implementation of the `ProjectStageHolder` interface.
+In this class you nest the custom project-stage implementations which have to be
+`public static final class` and it's required to extend `ProjectStage`.
+It's required to provide a `public static final` instance even though, you won't use it directly.
+
+ProjectStageHolder for custom project stage implementations:
+
+    :::java
+    public class CustomProjectStageHolder implements ProjectStageHolder
+    {
+        public static final class CustomProjectStage extends ProjectStage
+        {
+            private static final long serialVersionUID = 1029094387976167179L;
+        }
+
+        public static final CustomProjectStage CustomProjectStage = new CustomProjectStage();
+    }
+
+Configure your custom `ProjectStageHolder` in
+`META-INF/services/org.apache.deltaspike.core.api.projectstage.ProjectStageHolder`.
+The file has to provide the *fully qualified* class name of the custom implementation
+of the `ProjectStageHolder` interface.
+
+Usage of a custom project stage:
+
+    :::java
+    ProjectStage customProjectStage;
+    customProjectStage = ProjectStage.valueOf("CustomProjectStage");
+    //or
+    customProjectStage = CustomProjectStageHolder.CustomProjectStage;
+    //or
+    @Exclude(ifProjectStage = CustomProjectStageHolder.CustomProjectStage.class)
+
+## ProjectStageProducer (for 3rd party portable extensions)
+
+`ProjectStageProducer` provides the producer method which allows to inject the current project-stage.
+However, in some cases it's needed to use project-stages also during the bootstrapping process
+of the CDI container and you can't use injection. In such cases you can use
+`ProjectStageProducer.getInstance().getProjectStage()` to resolve the current project-stage.
+This helper also contains helpers for unit-tests - e.g. `#setProjectStage`. However,
+those methods shouldn't be needed for users
+(we just need them for testing different project-stage scenarios).
+
+### Setting the active ProjectStage
+
+For setting the ProjectStage which shall get used in your application you can specify
+it in a few ways. The underlying mechanism used to determine the string is the ConfigResolver.
+E.g.:
+
+    :::java
+    -Dorg.apache.deltaspike.ProjectStage=Development
+

Propchange: deltaspike/site/trunk/content/projectstage.mdtext
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message