IT. Expert System.

Java Enterprise Edition (EE)

Disposes


javax.enterprise.inject
Annotation Type Disposes

@Target(value=PARAMETER)
@Retention(value=RUNTIME)
@Documented
public @interface Disposes

Identifies the disposed parameter of a disposer method. May be applied to a parameter of a method of a bean class.

 public class UserDatabaseEntityManager {

    @Produces @ConversationScoped @UserDatabase
    public EntityManager create(EntityManagerFactory emf) {
       return emf.createEntityManager();
    }
    
    public void close(@Disposes @UserDatabase EntityManager em) {
       em.close();
    }

 }
 

A disposer method allows the application to perform customized cleanup of an object returned by a producer method.

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

A bean may declare multiple disposer methods.

Each disposer method must have exactly one disposed parameter, of the same type as the corresponding producer method return type. When searching for disposer methods for a producer method, the container considers the type and qualifiers of the disposed parameter. If a disposed parameter resolves to a producer method declared by the same bean class, the container must call this method when destroying any instance returned by that producer method.

A disposer method may resolve to multiple producer methods declared by the bean class, in which case the container must call it when destroying any instance returned by any of these producer methods.

Disposer methods are not inherited by bean subclasses.

Interceptors and decorators may not declare disposer methods.

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



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: 14442 / . Delta: 0.05777 с