001/* 002 * Complete.java July 2006 003 * 004 * Copyright (C) 2006, Niall Gallagher <niallg@users.sf.net> 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 015 * implied. See the License for the specific language governing 016 * permissions and limitations under the License. 017 */ 018 019package org.simpleframework.xml.core; 020 021import java.lang.annotation.RetentionPolicy; 022import java.lang.annotation.Retention; 023 024/** 025 * The <code>Complete</code> annotation is used to mark a method that 026 * requires a callback from the persister once the serialization of 027 * the object has completed. The complete method is typically used 028 * in combination with the persist method, which is the method that 029 * is annotated with the <code>Persist</code> annotation. 030 * <p> 031 * Typically the complete method will revert any changes made when 032 * the persist method was invoked. For example, should the persist 033 * method acquire a lock to ensure the object is serialized in a 034 * safe state then the commit method can be used to release the lock. 035 * The complete method must be a no argument public method or a 036 * method that takes a single <code>Map</code> object argument. The 037 * complete method is invoked even if deserialization terminates. 038 * 039 * @author Niall Gallagher 040 * 041 * @see org.simpleframework.xml.core.Persist 042 */ 043@Retention(RetentionPolicy.RUNTIME) 044public @interface Complete { 045}