Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 64369200B74 for ; Thu, 18 Aug 2016 02:37:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5DCC5160AC1; Thu, 18 Aug 2016 00:37:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 62273160A8C for ; Thu, 18 Aug 2016 02:37:13 +0200 (CEST) Received: (qmail 99872 invoked by uid 500); 18 Aug 2016 00:37:12 -0000 Mailing-List: contact commits-help@deltaspike.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltaspike.apache.org Delivered-To: mailing list commits@deltaspike.apache.org Received: (qmail 99863 invoked by uid 99); 18 Aug 2016 00:37:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 00:37:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 109A8C0B9A for ; Thu, 18 Aug 2016 00:37:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id id5T-uV2PIyw for ; Thu, 18 Aug 2016 00:37:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 55EA55FBDE for ; Thu, 18 Aug 2016 00:37:01 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 259DCE5EC1 for ; Thu, 18 Aug 2016 00:36:57 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0B9F43A2B7B for ; Thu, 18 Aug 2016 00:36:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1756698 [12/18] - /deltaspike/site/trunk/content/documentation/ Date: Thu, 18 Aug 2016 00:36:56 -0000 To: commits@deltaspike.apache.org From: johndament@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160818003657.0B9F43A2B7B@svn01-us-west.apache.org> archived-at: Thu, 18 Aug 2016 00:37:15 -0000 Modified: deltaspike/site/trunk/content/documentation/partial-bean.html URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/partial-bean.html?rev=1756698&r1=1756697&r2=1756698&view=diff ============================================================================== --- deltaspike/site/trunk/content/documentation/partial-bean.html (original) +++ deltaspike/site/trunk/content/documentation/partial-bean.html Thu Aug 18 00:36:56 2016 @@ -1,430 +1,430 @@ - - - - - - - - - - - - - Partial-Bean Module - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
-

Partial-Bean Module

-
- -
-
-

Overview

-
-
-

The Partial-Bean module provides means for implementing a generic handler to replace manual implementations of interfaces (or abstract classes).

-
-
-
-
-

Project Setup

-
-
-

The configuration information provided here is for Maven-based projects and it assumes that you have already declared the DeltaSpike version and DeltaSpike Core module for your projects, as detailed in Configure DeltaSpike in Your Projects. For Maven-independent projects, see Configure DeltaSpike in Maven-independent Projects.

-
-
-

Declare Partial-Bean Module Dependencies

-
-

Add the Partial-Bean module to the list of dependencies in the project pom.xml file using this code snippet:

-
-
-
-
<dependency>
-    <groupId>org.apache.deltaspike.modules</groupId>
-    <artifactId>deltaspike-partial-bean-module-api</artifactId>
-    <version>${deltaspike.version}</version>
-    <scope>compile</scope>
-</dependency>
-
-<dependency>
-    <groupId>org.apache.deltaspike.modules</groupId>
-    <artifactId>deltaspike-partial-bean-module-impl</artifactId>
-    <version>${deltaspike.version}</version>
-    <scope>runtime</scope>
-</dependency>
-
-
-
-

Or if you’re using Gradle, add these dependencies to your build.gradle:

-
-
-
-
     runtime 'org.apache.deltaspike.modules:deltaspike-partial-bean-module-impl'
-     compile 'org.apache.deltaspike.modules:deltaspike-partial-bean-module-api'
-
-
-
- - - - - -
- - -Currently CDI Interceptors applied via @Interceptors, @Intercepted and @Decorator are not supported by our proxies! -
-
-
-
-
-
-

@PartialBeanBinding

-
-
-

Partial beans allow you to implement a generic handler to replace manual -implementations of interfaces (or abstract classes).

-
-
-

@PartialBeanBinding is the binding-annotation for creating a custom -interface (/abstract class) to generic handler binding.

-
-
-
-
@PartialBeanBinding
-@Retention(RUNTIME)
-@Target(TYPE)
-public @interface MyPartialBeanBinding {}
-
-
-
-
-
//scope is optional
-@MyPartialBeanBinding
-public interface PartialBean
-{
-    String getValue();
-}
-
-
-
-
-
//scope is optional
-@MyPartialBeanBinding
-public class MyPartialBeanHandler implements java.lang.reflect.InvocationHandler
-{
-    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
-    {
-        //generic handler logic
-    }
-}
-
-
-
-
-
-
- - -
-
-
- -
-
- - - -
- - -
-
-
-
-

Copyright © 2011-2016 The Apache Software Foundation, - Licensed under the Apache License, Version 2.0.

- -

Apache and the Apache feather logo are trademarks of The Apache Software Foundation.

-
-
-
- - + + + + + + + + + + + + + Partial-Bean Module + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+

Partial-Bean Module

+
+ +
+
+

Overview

+
+
+

The Partial-Bean module provides means for implementing a generic handler to replace manual implementations of interfaces (or abstract classes).

+
+
+
+
+

Project Setup

+
+
+

The configuration information provided here is for Maven-based projects and it assumes that you have already declared the DeltaSpike version and DeltaSpike Core module for your projects, as detailed in Configure DeltaSpike in Your Projects. For Maven-independent projects, see Configure DeltaSpike in Maven-independent Projects.

+
+
+

Declare Partial-Bean Module Dependencies

+
+

Add the Partial-Bean module to the list of dependencies in the project pom.xml file using this code snippet:

+
+
+
+
<dependency>
+    <groupId>org.apache.deltaspike.modules</groupId>
+    <artifactId>deltaspike-partial-bean-module-api</artifactId>
+    <version>${deltaspike.version}</version>
+    <scope>compile</scope>
+</dependency>
+
+<dependency>
+    <groupId>org.apache.deltaspike.modules</groupId>
+    <artifactId>deltaspike-partial-bean-module-impl</artifactId>
+    <version>${deltaspike.version}</version>
+    <scope>runtime</scope>
+</dependency>
+
+
+
+

Or if you’re using Gradle, add these dependencies to your build.gradle:

+
+
+
+
     runtime 'org.apache.deltaspike.modules:deltaspike-partial-bean-module-impl'
+     compile 'org.apache.deltaspike.modules:deltaspike-partial-bean-module-api'
+
+
+
+ + + + + +
+ + +Currently CDI Interceptors applied via @Interceptors, @Intercepted and @Decorator are not supported by our proxies! +
+
+
+
+
+
+

@PartialBeanBinding

+
+
+

Partial beans allow you to implement a generic handler to replace manual +implementations of interfaces (or abstract classes).

+
+
+

@PartialBeanBinding is the binding-annotation for creating a custom +interface (/abstract class) to generic handler binding.

+
+
+
+
@PartialBeanBinding
+@Retention(RUNTIME)
+@Target(TYPE)
+public @interface MyPartialBeanBinding {}
+
+
+
+
+
//scope is optional
+@MyPartialBeanBinding
+public interface PartialBean
+{
+    String getValue();
+}
+
+
+
+
+
//scope is optional
+@MyPartialBeanBinding
+public class MyPartialBeanHandler implements java.lang.reflect.InvocationHandler
+{
+    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+    {
+        //generic handler logic
+    }
+}
+
+
+
+
+
+
+ + +
+
+
+ +
+
+ + + +
+ + +
+
+
+
+

Copyright © 2011-2016 The Apache Software Foundation, + Licensed under the Apache License, Version 2.0.

+ +

Apache and the Apache feather logo are trademarks of The Apache Software Foundation.

+
+
+
+ + \ No newline at end of file Modified: deltaspike/site/trunk/content/documentation/projectstage.html URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/projectstage.html?rev=1756698&r1=1756697&r2=1756698&view=diff ============================================================================== --- deltaspike/site/trunk/content/documentation/projectstage.html (original) +++ deltaspike/site/trunk/content/documentation/projectstage.html Thu Aug 18 00:36:56 2016 @@ -1,465 +1,465 @@ - - - - - - - - - - - - - DeltaSpike ProjectStage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
-
-

DeltaSpike ProjectStage

-
- -
-
-

Introduction

-
-
-

Project stages allow to use implementations depending on the current -environment. For example, you can implement a bean which creates sample-data for -system tests which gets activated only in case of ProjectStage -SystemTest.

-
-
-

Besides custom ProjectStages it is possible to use the following -pre-defined ProjectStages:

-
-
-
    -
  • -

    UnitTest

    -
  • -
  • -

    Development

    -
  • -
  • -

    SystemTest

    -
  • -
  • -

    IntegrationTest

    -
  • -
  • -

    Staging

    -
  • -
  • -

    Production

    -
  • -
-
-
-

The core provides a pluggable and type-safe approach for using project -stages in a project (it is also used within the framework). Furthermore, -@Exclude allows use of, for example, implementations annotated with -javax.enterprise.inject.Alternative for specific ProjectStages. -Besides the out-of-the-box ProjectStages it is possible to implement -custom but type-safe ProjectStages which will be exposed by -DeltaSpike.

-
-
-

Resolving and using the ProjectStage:

-
-
-
-
@Inject
-private ProjectStage projectStage;
-
-//...
-
-boolean isDevProjectStage = ProjectStage.Development.equals(this.projectStage);
-
-
-
-
-
-

Custom Project Stages

-
-
-

It is 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 -ProjectStage implementations which have to be -public static final class and it is required to extend ProjectStage. -It is required to provide a public static final instance even though, -you will not use it directly.

-
-
-

ProjectStageHolder for custom project stage implementations:

-
-
-
-
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:

-
-
-
-
ProjectStage customProjectStage;
-customProjectStage = ProjectStage.valueOf("CustomProjectStage");
-//or
-customProjectStage = CustomProjectStageHolder.CustomProjectStage;
-//or
-@Exclude(ifProjectStage = CustomProjectStageHolder.CustomProjectStage.class)
-
-
-
-
-
-

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.

-
-
-
Example
-
-
-Dorg.apache.deltaspike.ProjectStage=Development
-
-
-
-
-
-

ProjectStageProducer (for Third-party Portable Extensions)

-
-
-

ProjectStageProducer provides the producer method which allows to -inject the current ProjectStage. However, in some cases it is needed to -use ProjectStages also during the bootstrapping process of the CDI -container and you can not use injection. In such cases you can use -ProjectStageProducer.getInstance().getProjectStage() to resolve the -current ProjectStage. This helper also contains helpers for unit-tests -- e.g. #setProjectStage. However, those methods should not be needed -for users (we just need them for testing different ProjectStage -scenarios).

-
-
-
-
-
- - - - - -
-
-
-
-

Copyright © 2011-2016 The Apache Software Foundation, - Licensed under the Apache License, Version 2.0.

- -

Apache and the Apache feather logo are trademarks of The Apache Software Foundation.

-
-
-
- - + + + + + + + + + + + + + DeltaSpike ProjectStage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+

DeltaSpike ProjectStage

+
+ +
+
+

Introduction

+
+
+

Project stages allow to use implementations depending on the current +environment. For example, you can implement a bean which creates sample-data for +system tests which gets activated only in case of ProjectStage +SystemTest.

+
+
+

Besides custom ProjectStages it is possible to use the following +pre-defined ProjectStages:

+
+
+
    +
  • +

    UnitTest

    +
  • +
  • +

    Development

    +
  • +
  • +

    SystemTest

    +
  • +
  • +

    IntegrationTest

    +
  • +
  • +

    Staging

    +
  • +
  • +

    Production

    +
  • +
+
+
+

The core provides a pluggable and type-safe approach for using project +stages in a project (it is also used within the framework). Furthermore, +@Exclude allows use of, for example, implementations annotated with +javax.enterprise.inject.Alternative for specific ProjectStages. +Besides the out-of-the-box ProjectStages it is possible to implement +custom but type-safe ProjectStages which will be exposed by +DeltaSpike.

+
+
+

Resolving and using the ProjectStage:

+
+
+
+
@Inject
+private ProjectStage projectStage;
+
+//...
+
+boolean isDevProjectStage = ProjectStage.Development.equals(this.projectStage);
+
+
+
+
+
+

Custom Project Stages

+
+
+

It is 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 +ProjectStage implementations which have to be +public static final class and it is required to extend ProjectStage. +It is required to provide a public static final instance even though, +you will not use it directly.

+
+
+

ProjectStageHolder for custom project stage implementations:

+
+
+
+
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:

+
+
+
+
ProjectStage customProjectStage;
+customProjectStage = ProjectStage.valueOf("CustomProjectStage");
+//or
+customProjectStage = CustomProjectStageHolder.CustomProjectStage;
+//or
+@Exclude(ifProjectStage = CustomProjectStageHolder.CustomProjectStage.class)
+
+
+
+
+
+

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.

+
+
+
Example
+
+
-Dorg.apache.deltaspike.ProjectStage=Development
+
+
+
+
+
+

ProjectStageProducer (for Third-party Portable Extensions)

+
+
+

ProjectStageProducer provides the producer method which allows to +inject the current ProjectStage. However, in some cases it is needed to +use ProjectStages also during the bootstrapping process of the CDI +container and you can not use injection. In such cases you can use +ProjectStageProducer.getInstance().getProjectStage() to resolve the +current ProjectStage. This helper also contains helpers for unit-tests +- e.g. #setProjectStage. However, those methods should not be needed +for users (we just need them for testing different ProjectStage +scenarios).

+
+
+
+
+
+ + + + + +
+
+
+ +
+
+ + \ No newline at end of file