001/* 002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * bstefanescu 011 */ 012package org.nuxeo.ecm.automation.core.annotations; 013 014import java.lang.annotation.ElementType; 015import java.lang.annotation.Retention; 016import java.lang.annotation.RetentionPolicy; 017import java.lang.annotation.Target; 018 019import org.nuxeo.ecm.automation.OperationContext; 020import org.nuxeo.ecm.core.api.CoreSession; 021 022/** 023 * To inject contextual data into an operation field. The following context objects are provided: 024 * <ul> 025 * <li>The context itself. See {@link OperationContext} 026 * <li>A Core Session if available. See {@link CoreSession} 027 * <li>A Principal if available. This is the same as {@link CoreSession#getPrincipal()} 028 * <li>Any registered Nuxeo Service. 029 * <ul> 030 * CoreSession or OperationContext into a library instance field. 031 * 032 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a> 033 */ 034@Retention(RetentionPolicy.RUNTIME) 035@Target(ElementType.FIELD) 036public @interface Context { 037 038}