001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 003 * agreements. See the NOTICE file distributed with this work for additional information regarding 004 * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 005 * "License"); you may not use this file except in compliance with the License. You may obtain a 006 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 007 * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 008 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 009 * for the specific language governing permissions and limitations under the License. 010 */ 011 012 package javax.portlet.faces.annotation; 013 014 import java.lang.annotation.Documented; 015 import java.lang.annotation.ElementType; 016 import java.lang.annotation.Retention; 017 import java.lang.annotation.RetentionPolicy; 018 import java.lang.annotation.Target; 019 020 /** The PreDestroy annotation is used on methods as a callback notification to signal 021 * that the instance is in the process of being removed by the bridge from 022 * the bridge request scope. This method complements one using 023 * <code>javax.annotation.PreDestroy</code> to allow the object to release resources 024 * that it has been holding. It exists because the existing 025 * <code>javax.annotation.PreDestroy</code> method must be ignored as it is called 026 * by the container even though the bridge continues to manage the object in its 027 * request scope. The method on which the PreDestroy annotation is applied MUST 028 * fulfill all of the following criteria - The method MUST NOT have any parameters - 029 * The return type of the method MUST be void. - The method MUST NOT throw a checked 030 * exception. - The method on which PreDestroy is applied MUST be public. - The 031 * method MUST NOT be static. - The method MAY be final. - If the method throws an 032 * unchecked exception it is ignored. 033 */ 034 035 @Documented 036 @Retention(RetentionPolicy.RUNTIME) 037 @Target({ElementType.METHOD}) 038 public @interface BridgePreDestroy { 039 }