deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r909071 - in /websites/staging/deltaspike/trunk/content: ./ partial-bean.html
Date Sat, 17 May 2014 12:29:54 GMT
Author: buildbot
Date: Sat May 17 12:29:53 2014
New Revision: 909071

Log:
Staging update by buildbot for deltaspike

Added:
    websites/staging/deltaspike/trunk/content/partial-bean.html
Modified:
    websites/staging/deltaspike/trunk/content/   (props changed)

Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Sat May 17 12:29:53 2014
@@ -1 +1 @@
-1595445
+1595454

Added: websites/staging/deltaspike/trunk/content/partial-bean.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/partial-bean.html (added)
+++ websites/staging/deltaspike/trunk/content/partial-bean.html Sat May 17 12:29:53 2014
@@ -0,0 +1,147 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - </title>
+
+    
+
+    
+    <!-- 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 &quot;License&quot;); 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 &quot;AS IS&quot; 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. -->
+
+    <!-- Styles -->
+    
+    <link href="./resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand" href="index.html"><img src="./resources/images/deltaspike-logo-medium.png"/></a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./index.html">Home</a></li>
+                        <li><a href="./documentation.html">Documentation</a></li>
+                        <li><a href="./source.html">Source</a></li>
+                        <!-- <li><a href="./download.html">Download</a></li>
-->
+                        <li><a href="./community.html">Community</a></li>
+                        <!-- <li><a href="./support.html">Support</a></li>
 -->
+                        <li><a href="./news.html">News</a></li>
+                        <li><a href="./migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"
 class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1></h1>
+              </div>
+              <div class="toc">
+<ul></ul>
+</div>
+<hr />
+<p>Partial beans allow you to implement a generic handler to replace manual implementations
of interfaces (or abstract classes).</p>
+<p>@PartialBeanBinding is the binding-annotation for creating a custom interface (/abstract
class) to generic handler binding.</p>
+<div class="codehilite"><pre><span class="nd">@PartialBeanBinding</span>
+
+<span class="nd">@Retention</span><span class="o">(</span><span
class="n">RUNTIME</span><span class="o">)</span>
+<span class="nd">@Target</span><span class="o">(</span><span class="n">TYPE</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="nd">@interface</span>
<span class="n">MyPartialBeanBinding</span> <span class="o">{}</span>
+
+<span class="nd">@MyPartialBeanBinding</span>
+<span class="c1">//scope is optional</span>
+<span class="kd">public</span> <span class="kd">interface</span>
<span class="nc">PartialBean</span>
+<span class="o">{</span>
+<span class="n">String</span> <span class="nf">getValue</span><span
class="o">();</span>
+<span class="o">}</span>
+
+<span class="nd">@MyPartialBeanBinding</span>
+<span class="nd">@Dependent</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">TestPartialBeanHandler</span> <span class="kd">implements</span>
<span class="n">java</span><span class="o">.</span><span class="na">lang</span><span
class="o">.</span><span class="na">reflect</span><span class="o">.</span><span
class="na">InvocationHandler</span>
+<span class="o">{</span>
+    <span class="kd">public</span> <span class="n">Object</span>
<span class="nf">invoke</span><span class="o">(</span><span class="n">Object</span>
<span class="n">proxy</span><span class="o">,</span> <span class="n">Method</span>
<span class="n">method</span><span class="o">,</span> <span class="n">Object</span><span
class="o">[]</span> <span class="n">args</span><span class="o">)</span>
<span class="kd">throws</span> <span class="n">Throwable</span>
+    <span class="o">{</span>
+        <span class="c1">//generic handler logic</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Using an abstract class as partial-bean requires javassist as an additional dependency
and allows to implement some methods manually.</p>
+<p>Attention:
+Currently CDI-Interceptors can't be used for partial-beans.</p>
+          </div>
+      </div>
+
+      <hr>
+
+      <footer>
+        <p>Copyright © 2011-2013 The Apache Software Foundation, Licensed under
the Apache License, Version 2.0.</p>
+        <p>Apache and the Apache feather logo are trademarks of The Apache Software
Foundation.</p>
+      </footer>
+
+    </div> <!-- /.container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <!--<script src="./resources/js/prettyfy.js"></script> -->
+    <script src="./resources/js/prettyprint.js"></script>
+    <script src="./resources/js/jquery.js"></script>
+    <script src="./resources/js/bootstrap-transition.js"></script>
+    <script src="./resources/js/bootstrap-alert.js"></script>
+    <script src="./resources/js/bootstrap-modal.js"></script>
+    <script src="./resources/js/bootstrap-dropdown.js"></script>
+    <script src="./resources/js/bootstrap-scrollspy.js"></script>
+    <script src="./resources/js/bootstrap-tab.js"></script>
+    <script src="./resources/js/bootstrap-tooltip.js"></script>
+    <script src="./resources/js/bootstrap-popover.js"></script>
+    <script src="./resources/js/bootstrap-button.js"></script>
+    <script src="./resources/js/bootstrap-collapse.js"></script>
+    <script src="./resources/js/bootstrap-carousel.js"></script>
+    <script src="./resources/js/bootstrap-typeahead.js"></script>
+
+</body>
+</html>



Mime
View raw message