This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
forked from VaclavDedik/jboss-seam
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Annotations.xml
executable file
·1572 lines (1513 loc) · 68.8 KB
/
Annotations.xml
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<chapter id="annotations">
<title>Seam annotations</title>
<para>
When you write a Seam application, you'll use a lot of annotations. Seam
lets you use annotations to achieve a declarative style of programming.
Most of the annotations you'll use are defined by the EJB 3.0
specification. The annotations for data validation are defined by the
Bean Validation standard. Finally, Seam defines its own set of
annotations, which we'll describe in this chapter.
</para>
<para>
All of these annotations are defined in the package
<literal>org.jboss.seam.annotations</literal>.
</para>
<section>
<title>Annotations for component definition</title>
<para>
The first group of annotations lets you define a Seam component. These
annotations appear on the component class.
</para>
<variablelist>
<varlistentry id="name-annotation">
<term>
<literal>@Name</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Name("componentName")]]></programlisting>
<para>
Defines the Seam component name for a class. This annotation
is required for all Seam components.
</para>
</listitem>
</varlistentry>
<varlistentry id="scope-annotation">
<term>
<literal>@Scope</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Scope(ScopeType.CONVERSATION)]]></programlisting>
<para>
Defines the default context of the component. The possible
values are defined by the <literal>ScopeType</literal>
enumeration: <literal>EVENT, PAGE, CONVERSATION, SESSION, BUSINESS_PROCESS, APPLICATION, STATELESS</literal>.
</para>
<para>
When no scope is explicitly specified, the default depends
upon the component type. For stateless session beans, the
default is <literal>STATELESS</literal>. For entity beans and
stateful session beans, the default is
<literal>CONVERSATION</literal>. For JavaBeans, the default is
<literal>EVENT</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="role-annotation">
<term>
<literal>@Role</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Role(name="roleName", scope=ScopeType.SESSION)]]></programlisting>
<para>
Allows a Seam component to be bound to multiple contexts
variables. The <literal>@Name</literal>/<literal>@Scope</literal>
annotations define a "default role". Each <literal>@Role</literal>
annotation defines an additional role.
</para>
<itemizedlist>
<listitem>
<para>
<literal>name</literal> — the context variable
name.
</para>
</listitem>
<listitem>
<para>
<literal>scope</literal> — the context variable
scope. When no scope is explicitly specified, the
default depends upon the component type, as above.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="roles-annotation">
<term>
<literal>@Roles</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Roles({
@Role(name="user", scope=ScopeType.CONVERSATION),
@Role(name="currentUser", scope=ScopeType.SESSION)
})]]></programlisting>
<para>
Allows specification of multiple additional roles.
</para>
</listitem>
</varlistentry>
<varlistentry id="intercept-annotation">
<term>
<literal>@BypassInterceptors</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@BypassInterceptors]]></programlisting>
<para>
Disables Seam all interceptors on a particular component or
method of a component.
</para>
</listitem>
</varlistentry>
<varlistentry id="jndiname-annotation">
<term>
<literal>@JndiName</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@JndiName("my/jndi/name")]]></programlisting>
<para>
Specifies the JNDI name that Seam will use to look up the EJB
component. If no JNDI name is explicitly specified, Seam will
use the JNDI pattern specified by
<literal>org.jboss.seam.core.init.jndiPattern</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry id="conversational-annotation">
<term>
<literal>@Conversational</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Conversational]]></programlisting>
<para>
Specifies that a conversation scope component is
conversational, meaning that no method of the component may be
called unless a long-running conversation is active.
</para>
</listitem>
</varlistentry>
<varlistentry id="pernestedconversation-annotation">
<term>
<literal>@PerNestedConversation</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@PerNestedConversation]]></programlisting>
<para>
Limits the scope of a CONVERSATION-scoped component to just
the parent conversation in which it was instantiated. The
component instance will not be visible to nested child
conversations, which will get their own instance.
</para>
<para>
Warning: this is ill-defined, since it implies that a
component will be visible for some part of a request cycle,
and invisible after that. It is not recommended that
applications use this feature!
</para>
</listitem>
</varlistentry>
<varlistentry id="startup-annotation">
<term>
<literal>@Startup</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Scope(APPLICATION) @Startup(depends="org.jboss.seam.bpm.jbpm")]]></programlisting>
<para>
Specifies that an application scope component is started
immediately at initialization time. This is mainly used for
certain built-in components that bootstrap critical
infrastructure such as JNDI, datasources, etc.
</para>
<programlisting role="JAVA"><![CDATA[@Scope(SESSION) @Startup]]></programlisting>
<para>
Specifies that a session scope component is started
immediately at session creation time.
</para>
<itemizedlist>
<listitem>
<para>
<literal>depends</literal> — specifies that the
named components must be started first, if they are
installed.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="install-annotation">
<term>
<literal>@Install</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Install(false)]]></programlisting>
<para>
Specifies whether or not a component should be installed by
default. The lack of an <literal>@Install</literal> annotation
indicates a component should be installed.
</para>
<programlisting role="JAVA"><![CDATA[@Install(dependencies="org.jboss.seam.bpm.jbpm")]]></programlisting>
<para>
Specifies that a component should only be installed if the
components listed as dependencies are also installed.
</para>
<programlisting role="JAVA"><![CDATA[@Install(genericDependencies=ManagedQueueSender.class)]]></programlisting>
<para>
Specifies that a component should only be installed if a
component that is implemented by a certain class is installed.
This is useful when the dependency doesn't have a single
well-known name.
</para>
<programlisting role="JAVA"><![CDATA[@Install(classDependencies="org.hibernate.Session")]]></programlisting>
<para>
Specifies that a component should only be installed if the
named class is in the classpath.
</para>
<programlisting role="JAVA"><![CDATA[@Install(precedence=BUILT_IN)]]></programlisting>
<para>
Specifies the precedence of the component. If multiple
components with the same name exist, the one with the higher
precedence will be installed. The defined precedence values
are (in ascending order):
</para>
<itemizedlist>
<listitem>
<para>
<literal>BUILT_IN</literal> — Precedence of all
built-in Seam components
</para>
</listitem>
<listitem>
<para>
<literal>FRAMEWORK</literal> — Precedence to use
for components of frameworks which extend Seam
</para>
</listitem>
<listitem>
<para>
<literal>APPLICATION</literal> — Precedence of
application components (the default precedence)
</para>
</listitem>
<listitem>
<para>
<literal>DEPLOYMENT</literal> — Precedence to use
for components which override application components in
a particular deployment
</para>
</listitem>
<listitem>
<para>
<literal>MOCK</literal> — Precedence for mock
objects used in testing
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="synchronized-annotation">
<term>
<literal>@Synchronized</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Synchronized(timeout=1000)]]></programlisting>
<para>
Specifies that a component is accessed concurrently by
multiple clients, and that Seam should serialize requests. If
a request is not able to obtain its lock on the component in
the given timeout period, an exception will be raised.
</para>
</listitem>
</varlistentry>
<varlistentry id="readonly-annotation">
<term>
<literal>@ReadOnly</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@ReadOnly]]></programlisting>
<para>
Specifies that a JavaBean component or component method does
not require state replication at the end of the invocation.
</para>
</listitem>
</varlistentry>
<varlistentry id="autocreate-annotation">
<term>
<literal>@AutoCreate</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@AutoCreate]]></programlisting>
<para>
Specifies that a component will be automatically created, even
if the client does not specify <literal>create=true</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>Annotations for bijection</title>
<para>
The next two annotations control bijection. These attributes occur on
component instance variables or property accessor methods.
</para>
<variablelist>
<varlistentry id="in-annotation">
<term>
<literal>@In</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@In]]></programlisting>
<para>
Specifies that a component attribute is to be injected from a
context variable at the beginning of each component
invocation. If the context variable is null, an exception
will be thrown.
</para>
<programlisting role="JAVA"><![CDATA[@In(required=false)]]></programlisting>
<para>
Specifies that a component attribute is to be injected from a
context variable at the beginning of each component
invocation. The context variable may be null.
</para>
<programlisting role="JAVA"><![CDATA[@In(create=true)]]></programlisting>
<para>
Specifies that a component attribute is to be injected from a
context variable at the beginning of each component
invocation. If the context variable is null, an instance of
the component is instantiated by Seam.
</para>
<programlisting role="JAVA"><![CDATA[@In(value="contextVariableName")]]></programlisting>
<para>
Specifies the name of the context variable explicitly, instead
of using the annotated instance variable name.
</para>
<programlisting role="JAVA"><![CDATA[@In(value="#{customer.addresses['shipping']}")]]></programlisting>
<para>
Specifies that a component attribute is to be injected by
evaluating a JSF EL expression at the beginning of each
component invocation.
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — specifies the name of
the context variable. Default to the name of the
component attribute. Alternatively, specifies a JSF EL
expression, surrounded by <literal>#{...}</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>create</literal> — specifies that Seam
should instantiate the component with the same name as
the context variable if the context variable is
undefined (null) in all contexts. Default to false.
</para>
</listitem>
<listitem>
<para>
<literal>required</literal> — specifies Seam
should throw an exception if the context variable is
undefined in all contexts.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="out-annotation">
<term>
<literal>@Out</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Out]]></programlisting>
<para>
Specifies that a component attribute that is a Seam component
is to be outjected to its context variable at the end of the
invocation. If the attribute is null, an exception is thrown.
</para>
<programlisting role="JAVA"><![CDATA[@Out(required=false)]]></programlisting>
<para>
Specifies that a component attribute that is a Seam component
is to be outjected to its context variable at the end of the
invocation. The attribute may be null.
</para>
<programlisting role="JAVA"><![CDATA[@Out(scope=ScopeType.SESSION)]]></programlisting>
<para>
Specifies that a component attribute that is
<emphasis>not</emphasis> a Seam component type is to be
outjected to a specific scope at the end of the invocation.
</para>
<para>
Alternatively, if no scope is explicitly specified, the scope
of the component with the <literal>@Out</literal> attribute is
used (or the <literal>EVENT</literal> scope if the component
is stateless).
</para>
<programlisting role="JAVA"><![CDATA[@Out(value="contextVariableName")]]></programlisting>
<para>
Specifies the name of the context variable explicitly, instead
of using the annotated instance variable name.
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — specifies the name of
the context variable. Default to the name of the
component attribute.
</para>
</listitem>
<listitem>
<para>
<literal>required</literal> — specifies Seam
should throw an exception if the component attribute is
null during outjection.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
<para>
Note that it is quite common for these annotations to occur together,
for example:
</para>
<programlisting role="JAVA"><![CDATA[@In(create=true) @Out private User currentUser;]]></programlisting>
<para>
The next annotation supports the <emphasis>manager component</emphasis>
pattern; a Seam component manages the lifecycle of an
instance of some other class that is to be injected. It appears on a
component getter method.
</para>
<variablelist>
<varlistentry id="unwrap-annotation">
<term>
<literal>@Unwrap</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Unwrap]]></programlisting>
<para>
Specifies that the object returned by the annotated getter
method is the thing that is injected instead of the component
instance itself.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
The next annotation supports the <emphasis>factory component</emphasis>
pattern; a Seam component is responsible for initializing the
value of a context variable. This is especially useful for initializing
any state needed for rendering the response to a non-faces request. It
appears on a component method.
</para>
<variablelist >
<varlistentry id="factory-annotation">
<term>
<literal>@Factory</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Factory("processInstance") public void createProcessInstance() { ... }]]></programlisting>
<para>
Specifies that the method of the component is used to
initialize the value of the named context variable, when the
context variable has no value. This style is used with methods
that return <literal>void</literal>.
</para>
<programlisting role="JAVA"><![CDATA[@Factory("processInstance", scope=CONVERSATION) public ProcessInstance createProcessInstance() { ... }]]></programlisting>
<para>
Specifies that the method returns a value that Seam should use
to initialize the value of the named context variable, when
the context variable has no value. This style is used with
methods that return a value. If no scope is explicitly
specified, the scope of the component with the
<literal>@Factory</literal> method is used (unless the
component is stateless, in which case the <literal>EVENT</literal>
context is used).
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — specifies the name of
the context variable. If the method is a getter method,
default to the JavaBeans property name.
</para>
</listitem>
<listitem>
<para>
<literal>scope</literal> — specifies the scope
that Seam should bind the returned value to. Only
meaningful for factory methods which return a value.
</para>
</listitem>
<listitem>
<para>
<literal>autoCreate</literal> — specifies that
this factory method should be automatically called
whenever the variable is asked for, even if
<literal>@In</literal> does not specify
<literal>create=true</literal>.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
<para>
This annotation lets you inject a <literal>Log</literal>:
</para>
<variablelist>
<varlistentry id="logger-annotation">
<term>
<literal>@Logger</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Logger("categoryName")]]></programlisting>
<para>
Specifies that a component field is to be injected with an
instance of <literal>org.jboss.seam.log.Log</literal>. For
entity beans, the field must be declared as static.
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — specifies the name of
the log category. Default to the name of the component
class.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
<para>
The last annotation lets you inject a request parameter value:
</para>
<variablelist>
<varlistentry id="requestparameter-annotation">
<term>
<literal>@RequestParameter</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@RequestParameter("parameterName")]]></programlisting>
<para>
Specifies that a component attribute is to be injected with the
value of a request parameter. Basic type conversions are
performed automatically.
</para>
<itemizedlist>
<listitem>
<para>
<literal>value</literal> — specifies the name of
the request parameter. Default to the name of the
component attribute.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>Annotations for component lifecycle methods</title>
<para>
These annotations allow a component to react to its own lifecycle
events. They occur on methods of the component. There may be only one
of each per component class.
</para>
<variablelist>
<varlistentry id="create-annotation">
<term>
<literal>@Create</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Create]]></programlisting>
<para>
Specifies that the method should be called when an instance of
the component is instantiated by Seam. Note that create
methods are only supported for JavaBeans and stateful session
beans.
</para>
</listitem>
</varlistentry>
<varlistentry id="destroy-annotation">
<term>
<literal>@Destroy</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Destroy]]></programlisting>
<para>
Specifies that the method should be called when the context
ends and its context variables are destroyed. Note that
destroy methods are only supported for JavaBeans and stateful session
beans.
</para>
<para>
Destroy methods should be used only for cleanup.
<emphasis>Seam catches, logs and swallows any exception that
propagates out of a destroy method.</emphasis>
</para>
</listitem>
</varlistentry>
<varlistentry id="observer-annotation">
<term>
<literal>@Observer</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Observer("somethingChanged")]]></programlisting>
<para>
Specifies that the method should be called when a
component-driven event of the specified type occurs.
</para>
<programlisting role="JAVA"><![CDATA[@Observer(value="somethingChanged",create=false)]]></programlisting>
<para>
Specifies that the method should be called when an event of
the specified type occurs but that an instance should not be
created if one doesn't exist. If an instance does not exist
and create is false, the event will not be observed. The
default value for create is true.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>Annotations for context demarcation</title>
<para>
These annotations provide declarative conversation demarcation. They
appear on methods of Seam components, usually action listener methods.
</para>
<para>
Every web request has a conversation context associated with it. Most
of these conversations end at the end of the request. If you want a
conversation that span multiple requests, you must "promote" the
current conversation to a <emphasis>long-running conversation</emphasis>
by calling a method marked with <literal>@Begin</literal>.
</para>
<variablelist id="begin-annotation">
<varlistentry>
<term>
<literal>@Begin</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Begin]]></programlisting>
<para>
Specifies that a long-running conversation begins when this
method returns a non-null outcome without exception.
</para>
<programlisting role="JAVA"><![CDATA[@Begin(join=true)]]></programlisting>
<para>
Specifies that if a long-running conversation is already in
progress, the conversation context is simply propagated.
</para>
<programlisting role="JAVA"><![CDATA[@Begin(nested=true)]]></programlisting>
<para>
Specifies that if a long-running conversation is already in
progress, a new <emphasis>nested</emphasis> conversation
context begins. The nested conversation will end when the next
<literal>@End</literal> is encountered, and the outer
conversation will resume. It is perfectly legal for multiple
nested conversations to exist concurrently in the same outer
conversation.
</para>
<programlisting role="JAVA"><![CDATA[@Begin(pageflow="process definition name")]]></programlisting>
<para>
Specifies a jBPM process definition name that defines the
pageflow for this conversation.
</para>
<programlisting role="JAVA"><![CDATA[@Begin(flushMode=FlushModeType.MANUAL)]]></programlisting>
<para>
Specify the flush mode of any Seam-managed persistence
contexts. <literal>flushMode=FlushModeType.MANUAL</literal>
supports the use of <emphasis>atomic conversations</emphasis>
where all write operations are queued in the conversation
context until an explicit call to <literal>flush()</literal>
(which usually occurs at the end of the conversation).
</para>
<itemizedlist>
<listitem>
<para>
<literal>join</literal> — determines the behavior
when a long-running conversation is already in progress.
If <literal>true</literal>, the context is propagated.
If <literal>false</literal>, an exception is thrown.
Default to <literal>false</literal>. This setting is
ignored when <literal>nested=true</literal> is
specified.
</para>
</listitem>
<listitem>
<para>
<literal>nested</literal> — specifies that a
nested conversation should be started if a long-running
conversation is already in progress.
</para>
</listitem>
<listitem>
<para>
<literal>flushMode</literal> — set the flush mode
of any Seam-managed Hibernate sessions or JPA
persistence contexts that are created during this
conversation.
</para>
</listitem>
<listitem>
<para>
<literal>pageflow</literal> — a process definition
name of a jBPM process definition deployed via
<literal>org.jboss.seam.bpm.jbpm.pageflowDefinitions.</literal>
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="end-annotation">
<term>
<literal>@End</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@End]]></programlisting>
<para>
Specifies that a long-running conversation ends when this
method returns a non-null outcome without exception.
</para>
<itemizedlist>
<listitem>
<para>
<literal>beforeRedirect</literal> — by default,
the conversation will not actually be destroyed until
after any redirect has occurred. Setting
<literal>beforeRedirect=true</literal> specifies that
the conversation should be destroyed at the end of
the current request, and that the redirect will be
processed in a new temporary conversation context.
</para>
</listitem>
<listitem>
<para>
<literal>root</literal> — by default,
ending a nested conversation simply pops the conversation
stack and resumes the outer conversation. Setting
<literal>root=true</literal> specifies that the root
conversation should be destroyed which effectively destroys
the entire conversation stack. If the conversation is not
nested, the current conversation is simply ended.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="starttask-annotation">
<term>
<literal>@StartTask</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@StartTask]]></programlisting>
<para>
"Starts" a jBPM task. Specifies that a long-running
conversation begins when this method returns a non-null
outcome without exception. This conversation is associated
with the jBPM task specified in the named request
parameter. Within the context of this conversation, a
business process context is also defined, for the business
process instance of the task instance.
</para>
<itemizedlist>
<listitem>
<para>
The jBPM <literal>TaskInstance</literal> will be
available in a request context variable named
<literal>taskInstance</literal>. The jBPM
<literal>ProcessInstance</literal> will be available
in a request context variable named
<literal>processInstance</literal>. (Of course, these
objects are available for injection via
<literal>@In</literal>.)
</para>
</listitem>
<listitem>
<para>
<literal>taskIdParameter</literal> — the name
of a request parameter which holds the id of the
task. Default to <literal>"taskId"</literal>, which
is also the default used by the Seam
<literal>taskList</literal> JSF component.
</para>
</listitem>
<listitem>
<para>
<literal>flushMode</literal> — set the flush
mode of any Seam-managed Hibernate sessions or JPA
persistence contexts that are created during this
conversation.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="begintask-annotation">
<term>
<literal>@BeginTask</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@BeginTask]]></programlisting>
<para>
Resumes work on an incomplete jBPM task. Specifies that a
long-running conversation begins when this method returns a
non-null outcome without exception. This conversation is
associated with the jBPM task specified in the named
request parameter. Within the context of this conversation,
a business process context is also defined, for the
business process instance of the task instance.
</para>
<itemizedlist>
<listitem>
<para>
The jBPM <literal>org.jbpm.taskmgmt.exe.TaskInstance</literal>
will be available in a request context variable named
<literal>taskInstance</literal>. The jBPM
<literal>org.jbpm.graph.exe.ProcessInstance</literal>
will be available in a request context variable named
<literal>processInstance</literal>.
</para>
</listitem>
<listitem>
<para>
<literal>taskIdParameter</literal> — the name
of a request parameter which holds the id of the
task. Default to <literal>"taskId"</literal>, which
is also the default used by the Seam
<literal>taskList</literal> JSF component.
</para>
</listitem>
<listitem>
<para>
<literal>flushMode</literal> — set the flush
mode of any Seam-managed Hibernate sessions or JPA
persistence contexts that are created during this
conversation.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="endtask-annotation">
<term>
<literal>@EndTask</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@EndTask]]></programlisting>
<para>
"Ends" a jBPM task. Specifies that a long-running
conversation ends when this method returns a non-null
outcome, and that the current task is complete. Triggers a
jBPM transition. The actual transition triggered will be
the default transition unless the application has called
<literal>Transition.setName()</literal> on the built-in
component named <literal>transition</literal>.
</para>
<programlisting role="JAVA"><![CDATA[@EndTask(transition="transitionName")]]></programlisting>
<para>
Triggers the given jBPM transition.
</para>
<itemizedlist>
<listitem>
<para>
<literal>transition</literal> — the name of the
jBPM transition to be triggered when ending the task.
Defaults to the default transition.
</para>
</listitem>
<listitem>
<para>
<literal>beforeRedirect</literal> — by default,
the conversation will not actually be destroyed until
after any redirect has occurred. Setting
<literal>beforeRedirect=true</literal> specifies that
the conversation should be destroyed at the end of
the current request, and that the redirect will be
processed in a new temporary conversation context.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="createprocess-annotation">
<term>
<literal>@CreateProcess</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@CreateProcess(definition="process definition name")]]></programlisting>
<para>
Creates a new jBPM process instance when the method returns
a non-null outcome without exception. The
<literal>ProcessInstance</literal> object will be available
in a context variable named
<literal>processInstance</literal>.
</para>
<itemizedlist>
<listitem>
<para>
<literal>definition</literal> — the name of the
jBPM process definition deployed via
<literal>org.jboss.seam.bpm.jbpm.processDefinitions</literal>.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="resumeprocess-annotation">
<term>
<literal>@ResumeProcess</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@ResumeProcess(processIdParameter="processId")]]></programlisting>
<para>
Re-enters the scope of an existing jBPM process instance
when the method returns a non-null outcome without
exception. The <literal>ProcessInstance</literal> object
will be available in a context variable named
<literal>processInstance</literal>.
</para>
<itemizedlist>
<listitem>
<para>
<literal>processIdParameter</literal> — the name
a request parameter holding the process id. Default to
<literal>"processId"</literal>.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry id="transition-annotation">
<term>
<literal>@Transition</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Transition("cancel")]]></programlisting>
<para>
Marks a method as signaling a transition in the current jBPM
process instance whenever the method returns a non-null
result.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
<section>
<title>Annotations for use with Seam JavaBean components in a J2EE environment</title>
<para>
Seam provides an annotation that lets you force a rollback of the JTA
transaction for certain action listener outcomes.
</para>
<variablelist>
<varlistentry id="transactional-annotation">
<term>
<literal>@Transactional</literal>
</term>
<listitem>
<programlisting role="JAVA"><![CDATA[@Transactional]]></programlisting>
<para>
Specifies that a JavaBean component should have a similar
transactional behavior to the default behavior of a session
bean component. ie. method invocations should take place in a
transaction, and if no transaction exists when the method is
called, a transaction will be started just for that method.
This annotation may be applied at either class or method level.
</para>
<para>
<emphasis>Do not use this annotation on EJB 3.0 components,