001/* 002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl-2.1.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Nicolas Chapurlat <nchapurlat@nuxeo.com> 016 */ 017 018package org.nuxeo.ecm.core.io.registry.reflect; 019 020import org.nuxeo.ecm.core.io.registry.context.RenderingContext; 021 022/** 023 * Define the instantiation mode for this a marshaller. 024 * <p> 025 * The use of {@link #SINGLETON} is highly recommended. 026 * </p> 027 * <p> 028 * {@link #SINGLETON} marshallers are more priority than others. 029 * </p> 030 * 031 * @since 7.2 032 */ 033public enum Instantiations { 034 035 /** 036 * The marshaller is instantiated once. 037 * <p> 038 * Each class with this instantiation mode should just have thread safe properties, or injected properties. 039 * </p> 040 * <p> 041 * Please note that injected {@link RenderingContext} is thread safe. 042 * </p> 043 */ 044 SINGLETON, 045 046 /** 047 * One instance of the marshaller is created per thread. 048 */ 049 PER_THREAD, 050 051 /** 052 * One instance of marshaller is created for each marshalling request. 053 */ 054 EACH_TIME; 055 056}