IT. Expert System.

Java Enterprise Edition (EE)

Produces


javax.enterprise.inject
Annotation Type Produces

@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface Produces

Identifies a producer method or field. May be applied to a method or field of a bean class.

A producer method must be a non-abstract method of a managed bean class or session bean class. A producer method may be either static or non-static. If the bean is a session bean, the producer method must be either a business method of the EJB or a static method of the bean class.

 public class Shop {
    @Produces @ApplicationScoped 
    @Catalog @Named("catalog") 
    List<Product> getProducts() { ... }
    ...
 } 
 

A producer field must be a field of a managed bean class or session bean class. A producer field may be either static or non-static. If the bean is a session bean, the producer field must be a static field of the bean class.

 public class Shop { 
    @Produces @ApplicationScoped 
    @Catalog @Named("catalog") 
    List<Product> products = ...;
    ...
 } 
 

If a producer method sometimes returns a null value, or if a producer field sometimes contains a null value when accessed, then the producer method or field must have scope @Dependent.

A producer method return type or producer field type may not be a type variable.

If the producer method return type or producer field type is a parameterized type, it must specify an actual type parameter or type variable for each type parameter.

If the producer method return type or producer field type is a parameterized type with a type variable, it must have scope @Dependent.

A bean may declare multiple producer methods or fields.

Producer methods and fields are not inherited by bean subclasses.

Interceptors and decorators may not declare producer methods or fields.

Author:
Gavin King, Pete Muir
See Also:
@Disposes



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1191 / 159177695. Delta: 0.00179 с