-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
206 lines (203 loc) · 20.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="description" content="Latest news about CDI 2.0 , JCP pages, Servers supporting CDI, Overview of Contexts and Dependency Injection for Java EE (CDI),"><title>Contexts and Dependency Injection for Java Specification | Contexts and Dependency Injection</title><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="/stylesheets/asciidoctor.css"><link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css"><link rel="stylesheet" href="/stylesheets/styles.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"><script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script><script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js"></script><!--[if lt IE 9]><script type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--><script>hljs.initHighlightingOnLoad(); </script></head><body><div class="container"><div class="row"><div class="col-md-12"><div class="bannerhome"><div class="container"><div class="row"><div class="col-md-3"><a href="http://www.cdi-spec.org"><img src="/images/cdi_herologo.png" style="max-height: 100px;"></a></div><div class="col-md-9"><h1>Contexts & Dependency Injection for Java</h1></div></div></div></div><nav class="navbar navbar-default navbar-static-top" role="navigation"><div class="container-fluid"><div class="navbar-header"><button class="navbar-toggle collasped" type="button" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="http://www.cdi-spec.org"><i class="fa fa-home fa-fw"></i></a></div><div class="navbar-collapse collapse"><ul class="nav navbar-nav"><li><a href="http://www.cdi-spec.org/download/"><i class="fa fa-download fa-fw"></i> Download </a></li><li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-university fa-fw"></i> Learn <b class="caret"></b><ul class="dropdown-menu" role="menu"><li><a href="http://www.cdi-spec.org/learn/"><i class="fa fa-graduation-cap fa-fw"></i> Learning resources </a></li><li><a href="http://www.cdi-spec.org/faq/"><i class="fa fa-question-circle fa-fw"></i> FAQ </a></li></ul></a></li><li><a href="http://www.cdi-spec.org/ecosystem/"><i class="fa fa-plug fa-fw"></i> Ecosystem </a></li><li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-expanded="false">Contribute <b class="caret"></b><ul class="dropdown-menu" role="menu"><li><a href="http://www.cdi-spec.org/contribute/"><i class="fa fa-edit fa-fw"></i> How to contribute </a></li><li><a href="https://github.com/eclipse-ee4j/cdi/issues" target="_BLANK"><i class="fa fa-tasks fa-fw"></i> Bug tracker </a></li></ul></a></li><li><a href="http://www.cdi-spec.org/cditck/"><i class="fa fa-tag fa-fw"></i> CDI TCK </a></li><li><a href="http://www.cdi-spec.org/news/"><i class="fa fa-bullhorn fa-fw"></i> Blog </a></li><li><a href="http://www.cdi-spec.org/mailinglist/"><i class="fa fa-envelope fa-fw"></i> Mailing List </a></li></ul></div></div></nav><script>var indexOfSharp = window.location.pathname.indexOf('#');
var pathname = indexOfSharp > 0 ? window.location.pathname.substring(0, indexOfSharp) : window.location.pathname;
var selector = "body > .container > .row > .col-md-12 > .navbar > .container-fluid > .navbar-collapse a[href='http://www.cdi-spec.org" + pathname + "']";
$(selector).closest("li").addClass("active");</script></div></div><div class="row content-wrapper"><div class="col-md-12"><div class="col-md-8"><ul class="nav nav-tabs-center" id="front-menu"><li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Highlights <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="#cdi3_0" data-toggle="tab">CDI 3.0</a></li><li><a href="#cdi_jakarta_2_0" data-toggle="tab">CDI 2.0(Jakarta)</a></li><li><a href="#cdi2_0" data-toggle="tab">CDI 2.0</a></li><li><a href="#cdi1_1" data-toggle="tab">CDI 1.1 & 1.2</a></li><li><a href="#cdi1_0" data-toggle="tab">CDI 1.0</a></li></ul></li><li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown">Spec pages <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="https://jakarta.ee/specifications/cdi/3.0/" target="_blank">CDI 3.0 - Jakarta EE 9 <i class="fa fa-external-link fa-w"></i></a></li><li><a href="https://jakarta.ee/specifications/cdi/2.0/" target="_blank">CDI 2.0 - Jakarta EE 8 <i class="fa fa-external-link fa-w"></i></a></li><li><a href="http://jcp.org/en/jsr/detail?id=365" target="_blank">CDI 2.0 - JSR 365 <i class="fa fa-external-link fa-w"></i></a></li><li><a href="http://jcp.org/en/jsr/detail?id=346" target="_blank">CDI 1.2 - JSR 346 <i class="fa fa-external-link fa-w"></i></a></li><li><a href="http://jcp.org/en/jsr/detail?id=299" target="_blank">CDI 1.0 - JSR 299 <i class="fa fa-external-link fa-w"></i></a></li></ul></li><li><a href="#servers" data-toggle="tab">Servers</a></li><li class="active"><a href="#overview" data-toggle="tab">Overview</a></li></ul><div class="tab-content"><div class="tab-pane fade" id="cdi1_1"><h2>CDI 1.1 & 1.2</h2>
<p>CDI 1.1 focuses on improving CDI 1.0 and CDI 1.2 is a minor update correcting issues in 1.1:</p>
<ul>
<li>Add global enablement of interceptors (see the <a href="http://interceptors-spec.java.net/">Java Interceptors Specification 1.2</a>), global enablement of decorators (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#enabled_decorators_priority">read more</a>) and alternatives (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#declaring_selected_alternatives">read more</a>) using the <code>@Priority</code> annotation</li>
<li>Add support for <code>@AroundConstruct</code> lifecycle callback for constructors (see the Java Interceptors Specification 1.2)</li>
<li>Allow binding interceptors to constructors</li>
<li>Moved interceptor binding to interceptors spec, allowing for reuse by other specifications</li>
<li>Support decorators on built in beans (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#decorators">read more</a>)</li>
<li>Add <code>EventMetadata</code> (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#event_metadata">read more</a>) to allow inspection of event metadata</li>
<li>Add <code>@Vetoed</code> annotation allowing easy programmatic disablement of classes (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#what_classes_are_beans">read more</a>)</li>
<li>Many improvements for passivation capable beans, including <code>@TransientReference</code> allowing instances to be retained only for use within the invoked method or constructor (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#passivation_capable_injection_points">read more</a> and <a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#passivating_scope">read more</a>)</li>
<li>Add scope activation and destruction callback events (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#builtin_contexts">read more</a>)</li>
<li>Add <code>AlterableContext</code> allowing bean instances to be explicitly destroyed (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#context">read more</a>)</li>
<li>Add automatic enablement of CDI for beans with a scope annotation, and EJBs, in Java EE (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#type_discovery_steps">read more</a>)</li>
<li>Add class exclusion filters to <code>beans.xml</code> to prevent scanning of classes and packages (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#exclude_filters">read more</a>)</li>
<li>Add <code>Unmanaged</code> allowing easy access to non-contexutal instances of beans (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#bm_obtain_unmanaged_instance">read more</a>)</li>
<li>Add <code>CDI</code> allowing easy accesss to the current CDI container (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#provider">read more</a>)</li>
<li>Add <code>AfterTypeDiscovery</code> event, allowing extensions to register additional types after type discovery (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#after_type_discovery">read more</a>)</li>
<li>Add <code>@WithAnnotations</code> as a way of improving extension loading performance (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#process_annotated_type">read more</a>)</li>
<li>Many minor improvements to portable extensions (<a href="http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#spi">read more</a>)</li>
</ul>
</div><div class="tab-pane fade" id="cdi3_0"><div class="sect1">
<h2 id="cdi-3-0"><a class="anchor" href="#cdi-3-0"></a>CDI 3.0</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CDI 3.0 is part of Jakarta EE 9. The Jakarta EE 9 release is source
code incompatible with previous releases as the package name has
changed from javax.enterprise.* to jakarta.enterprise.*</p>
</div>
<div class="paragraph">
<p>There were no functional or semantic changes in the specification or APIs.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jakarta-cdi-3-0-page"><a class="anchor" href="#jakarta-cdi-3-0-page"></a>Jakarta CDI 3.0 Page</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See the <a href="https://jakarta.ee/specifications/cdi/3.0/">Jakarta Context Dependency Injection 3.0</a>
for more information on the Jakarta release.</p>
</div>
</div>
</div></div><div class="tab-pane fade" id="cdi_jakarta_2_0"><div class="sect1">
<h2 id="cdi-2-0-jakarta"><a class="anchor" href="#cdi-2-0-jakarta"></a>CDI 2.0 (Jakarta)</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CDI 2.0 is part of move of Java EE 8 to Jakarta EE 8. The API and specification remain semantically the same,
but references to Java EE and associated technologies have been updated
to use Jakarta EE and the related updated names.</p>
</div>
<div class="paragraph">
<p>The source repositories have moved under the Eclipse EE4J organization
to the following repositories:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="https://github.com/eclipse-ee4j/cdi">CDI Api and Spec</a></p>
</li>
<li>
<p><a href="https://github.com/eclipse-ee4j/cdi-tck">CDI TCK</a></p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="jakarta-cdi-2-0-page"><a class="anchor" href="#jakarta-cdi-2-0-page"></a>Jakarta CDI 2.0 Page</h2>
<div class="sectionbody">
<div class="paragraph">
<p>See the <a href="https://jakarta.ee/specifications/cdi/2.0/">Jakarta Context Dependency Injection 2.0</a>
for more information on the Jakarta release.</p>
</div>
</div>
</div></div><div class="tab-pane fade" id="cdi2_0"><div class="sect1">
<h2 id="cdi-2-0"><a class="anchor" href="#cdi-2-0"></a>CDI 2.0</h2>
<div class="sectionbody">
<div class="paragraph">
<p>CDI 2.0 is part of Java EE 8 but is also the first CDI version that support standalone mode on Java SE.</p>
</div>
<div class="paragraph">
<p>In this version major enhancements are:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The spec was split into <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#doc_organisation" target="_blank">3 parts</a> to add the support for Java SE.</p>
</li>
<li>
<p>API to <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#se_bootstrap" target="_blank">boot CDI in Java SE</a>.</p>
</li>
<li>
<p>Observers (i.e. events) <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#observer_ordering" target="_blank">ordering</a>.</p>
</li>
<li>
<p><a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#firing_events_asynchronously" target="_blank">Asynchronous event</a>.</p>
</li>
<li>
<p><a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#configurators" target="_blank">Configurators</a> for major SPI elements</p>
</li>
<li>
<p>Possibility to <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#process_observer_method" target="_blank">configure or veto observer methods</a>.</p>
</li>
<li>
<p>Add <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#built_in_annotation_literals" target="_blank">built-in annotation literals</a></p>
</li>
<li>
<p>Make possible to <a href="http://docs.jboss.org/cdi/spec/2.0-PRD/cdi-spec.html#interception_factory" target="_blank">apply interceptor on producers</a>.</p>
</li>
<li>
<p>Alignment on Java 8 features (streams, lambdas, repeating qualifiers)</p>
</li>
</ul>
</div>
</div>
</div></div><div class="tab-pane fade in active" id="overview"><h2>What is CDI?</h2><div class="paragraph">
<p>Contexts and Dependency Injection for Java EE (CDI) 1.0 was introduced as part of the Java EE 6 platform, and has quickly become one of the most important and popular components of the platform.</p>
</div>
<div class="paragraph">
<p>CDI defines a powerful set of complementary services that help improve the structure of application code.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible</p>
</li>
<li>
<p>A sophisticated, typesafe dependency injection mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration</p>
</li>
<li>
<p>Support for Java EE modularity and the Java EE component architecture?the modular structure of a Java EE application is taken into account when resolving dependencies between Java EE components</p>
</li>
<li>
<p>Integration with the Unified Expression Language (EL), allowing any contextual object to be used directly within a JSF or JSP page</p>
</li>
<li>
<p>The ability to decorate injected objects</p>
</li>
<li>
<p>The ability to associate interceptors to objects via typesafe interceptor bindings</p>
</li>
<li>
<p>An event notification model</p>
</li>
<li>
<p>A web conversation context in addition to the three standard web contexts defined by the Java Servlets specification</p>
</li>
<li>
<p>An SPI allowing portable extensions to integrate cleanly with the container</p>
</li>
</ul>
</div><h2>Latest Release</h2>
<p>The latest release of CDI is 3.0. You can <a href="https://jakarta.ee/specifications/cdi/3.0/">download</a> the spec or <a href="https://jakarta.ee/specifications/cdi/3.0/apidocs/">browse the javadoc</a>.</p>
</div><div class="tab-pane fade" id="cdi1_0"><h2>CDI 1.0</h2><div class="paragraph">
<p>Contexts and Dependency Injection for Java EE (CDI) 1.0 was introduced as part of the Java EE 6 platform, and has quickly become one of the most important and popular components of the platform.</p>
</div>
<div class="paragraph">
<p>CDI defines a powerful set of complementary services that help improve the structure of application code.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A well-defined lifecycle for stateful objects bound to lifecycle contexts, where the set of contexts is extensible</p>
</li>
<li>
<p>A sophisticated, typesafe dependency injection mechanism, including the ability to select dependencies at either development or deployment time, without verbose configuration</p>
</li>
<li>
<p>Support for Java EE modularity and the Java EE component architecture?the modular structure of a Java EE application is taken into account when resolving dependencies between Java EE components</p>
</li>
<li>
<p>Integration with the Unified Expression Language (EL), allowing any contextual object to be used directly within a JSF or JSP page</p>
</li>
<li>
<p>The ability to decorate injected objects</p>
</li>
<li>
<p>The ability to associate interceptors to objects via typesafe interceptor bindings</p>
</li>
<li>
<p>An event notification model</p>
</li>
<li>
<p>A web conversation context in addition to the three standard web contexts defined by the Java Servlets specification</p>
</li>
<li>
<p>An SPI allowing portable extensions to integrate cleanly with the container</p>
</li>
</ul>
</div></div><div class="tab-pane fade" id="servers"><p>Below is the current list of servers supporting CDI, also listed is the implementation used. Only the last servers major version are listed</p><div class="row"><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/glassfish.gif"><div class="caption"><h4>Oracle GlassFish 4.1+</h4><h5>using Weld 2.2.x / CDI 1.2</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/tmax_soft.jpg"><div class="caption"><h4>TMAX JEUS 8</h4><h5>using Weld 2.0 / CDI 1.1</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/wildfly.png"><div class="caption"><h4>WildFly 8.2.0</h4><h5>using Weld 2.2.6 / CDI 1.2</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/cosminexus.png"><div class="caption"><h4>Hitachi Cosminexus v 1.0</h4><h5>using Weld 2.0 / CDI 1.1</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/jbosseap6.png"><div class="caption"><h4>JBoss EAP 6.3</h4><h5>using Weld 1.1.23 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/IBM.gif"><div class="caption"><h4>IBM WebSphere 8.5.x & Liberty profile</h4><h5>using OpenWebBeans 1.2.x / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/fujitsu.png"><div class="caption"><h4>Fujitsu Interstage v10.1 / Windows Azure</h4><h5>using Weld 1.1.x / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/oracle.gif"><div class="caption"><h4>Oracle WebLogic 12</h4><h5>using Weld 1.1.3 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/geronimo.jpg"><div class="caption"><h4>Apache Geronimo 3.0.1</h4><h5>using OpenWebBeans 1.1.1 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/jbossas7.jpg"><div class="caption"><h4>JBoss AS 7.1.1</h4><h5>using Weld 1.1.5 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/caucho.jpg"><div class="caption"><h4>Caucho Resin 4.0.17</h4><h5>using CanDI 1.0 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/tomee.gif"><div class="caption"><h4>Apache TomEE 1.6</h4><h5>using OpenWebBeans 1.2.6 / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/sap-logo.jpg"><div class="caption"><h4>SAP NetWeaver Cloud</h4><h5>using OpenWebBeans 1.x / CDI 1.0</h5></div></div></div><div class="col-md-4"><div class="thumbnail"><img src="http://www.cdi-spec.org/images/servers/jonas.png"><div class="caption"><h4>JOnAS 5.3.0</h4><h5>using Weld 1.1.10 / CDI 1.0</h5></div></div></div></div></div></div></div><div class="col-md-4"><a class="twitter-timeline" data-widget-id="564817995261026304" href="https://twitter.com/cdispec"> Tweets by @cdispec</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div></div></div></div><hr><footer></footer><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount','UA-37580744-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>
</body></html>