com.sun.faces.spi.InjectionProvider Maven / Gradle / Ivy
/*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://javaserverfaces.dev.java.net/CDDL.html or
* legal/CDDLv1.0.txt.
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* [Name of File] [ver.__] [Date]
*
* Copyright 2006 Sun Microsystems Inc. All Rights Reserved
*/
package com.sun.faces.spi;
/**
* This interface defines an integration point for Java EE vendors.
* Each vendor will need to provide an implementation of this interface
* which will provide the JSF implementation the necessary hooks to
* perform resource injection.
*
* The implementation of this interface *must* be thread-safe and must
* have a no-arg constructor.
*/
public interface InjectionProvider {
/**
* The implementation of this method must perform the following
* steps:
*
* - Inject the supported resources per the Servlet 2.5
* specification into the provided object
* - Inoke any method marked with the
@PostConstruct
* annotation (per the Common Annotations Specification)
*
*
* @param managedBean the target managed bean
* @throws InjectionProviderException if an error occurs during
* resource injection
*/
public void inject(Object managedBean) throws InjectionProviderException;
/**
* The implemenation of this method must invoke any
* method marked with the @PreDestroy
annotation
* (per the Common Annotations Specification).
* @param managedBean the target managed bean
* @throws InjectionProviderException if an error occurs when invoking
* the method annotated by the @PreDestroy
annotation
*/
public void invokePreDestroy(Object managedBean)
throws InjectionProviderException;
}