deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject deltaspike git commit: DELTASPIKE-823 updated documentation
Date Fri, 27 Feb 2015 09:22:11 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master c58aae597 -> 0208611fb


DELTASPIKE-823 updated documentation

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/0208611f
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/0208611f
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/0208611f

Branch: refs/heads/master
Commit: 0208611fbe3d249f044cad2a21b69944fc72ac8e
Parents: c58aae5
Author: tandraschko <tandraschko@apache.org>
Authored: Fri Feb 27 10:21:49 2015 +0100
Committer: tandraschko <tandraschko@apache.org>
Committed: Fri Feb 27 10:21:49 2015 +0100

----------------------------------------------------------------------
 .../src/main/asciidoc/partial-bean.adoc         | 189 ++++++++-----------
 1 file changed, 75 insertions(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/0208611f/documentation/src/main/asciidoc/partial-bean.adoc
----------------------------------------------------------------------
diff --git a/documentation/src/main/asciidoc/partial-bean.adoc b/documentation/src/main/asciidoc/partial-bean.adoc
index 5f449e8..9bdeb15 100644
--- a/documentation/src/main/asciidoc/partial-bean.adoc
+++ b/documentation/src/main/asciidoc/partial-bean.adoc
@@ -1,114 +1,75 @@
-= Partial-Bean Module
-
-: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:
-
-== Overview
-The Partial-Bean module provides means for implementing a generic handler to replace manual
implementations of interfaces (or abstract classes).
-
-== Configure Your Projects
-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#, Configure DeltaSpike in Your Projects>>. For Maven-independent
projects, see <<configure#config-maven-indep,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:
-
-[source,xml]
-----
-<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>
-----
-
-== Use the Module Features
-
-IMPORTANT: Currently CDI Interceptors can only by applied to beans which will be registred
via the PartialBeanProvider.
-
-
-=== @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.
-
-[source,java]
--------------------------------------------------------------------------------------
-@PartialBeanBinding
-@Retention(RUNTIME)
-@Target(TYPE)
-public @interface MyPartialBeanBinding {}
--------------------------------------------------------------------------------------
-
-[source,java]
--------------------------------------------------------------------------------------
-//scope is optional
-@MyPartialBeanBinding
-public interface PartialBean
-{
-    String getValue();
-}
--------------------------------------------------------------------------------------
-
-[source,java]
--------------------------------------------------------------------------------------
-//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
-    }
-}
--------------------------------------------------------------------------------------
-
-
-=== PartialBeanProvider
-
-Due the CDI nature, to support CDI Interceptors, we need to register the partial beans in
BeforeBeanDiscovery as a completely new AnnotatedType.
-
-This is possible if you provide a PartialBeanProvider via the ServiceLoader approach.
-
-The following example shows how to enable your repositories to support interceptors like
@Transactional:
-
-
-[source,java]
--------------------------------------------------------------------------------------
-package de.test;
-
-public class RepositoryPartialBeanProvider extends AbstractPartialBeanProvider
-{
-    public RepositoryPartialBeanProvider()
-    {
-		PartialBeanBuilder partialBeanBuilder = new PartialBeanBuilder(
-			org.apache.deltaspike.data.api.Repository.class,
-			org.apache.deltaspike.data.impl.handler.QueryHandler.class);
-		partialBeanBuilder.addClasses(UserRepository.class, CompanyRepository.class, CountryRepository.class);
-        add(partialBeanBuilder);
-    }
-}
--------------------------------------------------------------------------------------
-
-
-Config file `#META-INF/services/org.apache.deltaspike.partialbean.spi.PartialBeanProvider`:
-
-[source]
--------------------------------------------------------------------------------------
-de.test.RepositoryPartialBeanProvider
--------------------------------------------------------------------------------------
-
-Custom implementations might use a classpath scanner like xbeans-finder, scannotations, reflections.
-
-We didn't found an completely portable way, therefore we didn't include it directly in DeltaSpike.
+= Partial-Bean Module
+
+: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:
+
+== Overview
+The Partial-Bean module provides means for implementing a generic handler to replace manual
implementations of interfaces (or abstract classes).
+
+== Configure Your Projects
+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#, Configure DeltaSpike in Your Projects>>. For Maven-independent
projects, see <<configure#config-maven-indep,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:
+
+[source,xml]
+----
+<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>
+----
+
+== Use the Module Features
+
+IMPORTANT: Currently CDI Interceptors applied via @Interceptors and @Decorator are not supported
by partial beans!
+
+
+=== @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.
+
+[source,java]
+-------------------------------------------------------------------------------------
+@PartialBeanBinding
+@Retention(RUNTIME)
+@Target(TYPE)
+public @interface MyPartialBeanBinding {}
+-------------------------------------------------------------------------------------
+
+[source,java]
+-------------------------------------------------------------------------------------
+//scope is optional
+@MyPartialBeanBinding
+public interface PartialBean
+{
+    String getValue();
+}
+-------------------------------------------------------------------------------------
+
+[source,java]
+-------------------------------------------------------------------------------------
+//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
+    }
+}
+-------------------------------------------------------------------------------------


Mime
View raw message