blob: eeb618c18e091b0152af52f66a4c274562981b83 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pierre Allard,
* Regent L'Archeveque,
* Olivier L. Larouche - initial API and implementation
*
* SPDX-License-Identifier: EPL-1.0
*
*******************************************************************************/
package org.eclipse.apogy.core.invocator.delegates;
import org.eclipse.apogy.core.invocator.AbstractTypeImplementation;
import org.eclipse.apogy.core.invocator.Environment;
import org.eclipse.apogy.core.invocator.OperationCall;
import org.eclipse.apogy.core.invocator.OperationCallResult;
import org.eclipse.apogy.core.invocator.Type;
import org.eclipse.apogy.core.invocator.TypeApiAdapter;
import org.eclipse.apogy.core.invocator.Variable;
import org.eclipse.emf.ecore.EObject;
public interface InvocatorDelegate {
/**
* Perform the required steps to instantiate the specified Variable.
*
* @param environment The ExecutionEnvironment that will make use of the
* EObject.
* @param variable Variable to instantiate.
*/
public void newInstance(Environment environment, Variable variable);
/**
* Creates a new instance of {@link AbstractTypeImplementation}.
*
* @param environment
* @param type
* @param typeImplementation
*/
public void newInstance(Environment environment, AbstractTypeImplementation typeImplementation);
/**
* Perform the required steps to cleanup the specified Variable before it being
* disposed.
*
* @param environment The ExecutionEnvironment currently making use of the
* Variable.
* @param variable The specified Variable
*/
public void dispose(Environment environment, Variable variable);
/**
* Disposes the {@link TypeImplementation}.
*
* @param typeImplementation Type implementation to dispose.
*/
public void dispose(AbstractTypeImplementation typeImplementation);
/**
* Invokes the specified OperationCall and returns the Result
*
* @param instance The object onto which to call the operation.
* @param operationCall The specified OperationCall
* @param saveResult If true then the result will be stored.
* @param Reference to the result.
*/
public OperationCallResult execute(EObject instance, OperationCall operationCall, boolean saveResult);
/**
* Returns the {@link Type} class handled by this InvocatorDelegate.
*
* @return the class that is adapted by this adapter.
*/
Class<? extends Type> getHandledTypeClass();
/**
* Creates and returns a new {@link TypeApiAdapter}.
*
* @return New instance of {@link TypeApiAdapter}.
*/
TypeApiAdapter newDefaultTypeApiAdapter();
}