|
| 1 | +/* |
| 2 | + * JBoss, Home of Professional Open Source Copyright 2009, Red Hat Middleware |
| 3 | + * LLC, and individual contributors by the @authors tag. See the copyright.txt |
| 4 | + * in the distribution for a full listing of individual contributors. |
| 5 | + * |
| 6 | + * This is free software; you can redistribute it and/or modify it under the |
| 7 | + * terms of the GNU Lesser General Public License as published by the Free |
| 8 | + * Software Foundation; either version 2.1 of the License, or (at your option) |
| 9 | + * any later version. |
| 10 | + * |
| 11 | + * This software is distributed in the hope that it will be useful, but WITHOUT |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 13 | + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
| 14 | + * details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License |
| 17 | + * along with this software; if not, write to the Free Software Foundation, |
| 18 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF |
| 19 | + * site: http://www.fsf.org. |
| 20 | + */ |
| 21 | +package org.switchyard.component.script.config.model; |
| 22 | + |
| 23 | +import org.switchyard.config.model.composite.ComponentImplementationModel; |
| 24 | + |
| 25 | +/** |
| 26 | + * A definition of an 'implementation.script' element. |
| 27 | + * |
| 28 | + * @author Jiri Pechanec |
| 29 | + * @author Daniel Bevenius |
| 30 | + * |
| 31 | + */ |
| 32 | +public interface ScriptComponentImplementationModel extends ComponentImplementationModel { |
| 33 | + |
| 34 | + /** |
| 35 | + * The 'script' namespace. |
| 36 | + */ |
| 37 | + public static final String DEFAULT_NAMESPACE = "urn:switchyard-component-script:config:1.0"; |
| 38 | + |
| 39 | + /** |
| 40 | + * The 'script' implementation type. |
| 41 | + */ |
| 42 | + String SCRIPT = "script"; |
| 43 | + |
| 44 | + /** |
| 45 | + * The 'code' element name. |
| 46 | + */ |
| 47 | + String CODE = "code"; |
| 48 | + |
| 49 | + /** |
| 50 | + * The 'scriptFile' attribute name. |
| 51 | + */ |
| 52 | + String SCRIPT_FILE = "scriptFile"; |
| 53 | + |
| 54 | + /** |
| 55 | + * The 'injectExchange' attribute name. |
| 56 | + */ |
| 57 | + String INJECT_EXCHANGE = "injectExchange"; |
| 58 | + |
| 59 | + /** |
| 60 | + * The 'language' attribute name. |
| 61 | + */ |
| 62 | + String LANGUAGE = "language"; |
| 63 | + |
| 64 | + /** |
| 65 | + * Gets the JSR-223 script that is the actual script code. |
| 66 | + * @return {@link CodeModel} the code configuration model. |
| 67 | + */ |
| 68 | + CodeModel getCodeModel(); |
| 69 | + |
| 70 | + /** |
| 71 | + * Sets the in-line script model. |
| 72 | + * @param codeModel The code configuration model. |
| 73 | + * @return {@link ScriptComponentImplementationModel} to enable method chaining. |
| 74 | + */ |
| 75 | + ScriptComponentImplementationModel setScriptModel(final CodeModel codeModel); |
| 76 | + |
| 77 | + /** |
| 78 | + * Gets the file that is the actual script code. |
| 79 | + * @return String the filename of a script to execute. |
| 80 | + */ |
| 81 | + String getScriptFile(); |
| 82 | + |
| 83 | + /** |
| 84 | + * Sets the scriptFile. |
| 85 | + * |
| 86 | + * @param scriptFile The script file. |
| 87 | + * @return {@link ScriptComponentImplementationModel} to enable method chaining. |
| 88 | + */ |
| 89 | + ScriptComponentImplementationModel setScriptFile(final String scriptFile); |
| 90 | + |
| 91 | + /** |
| 92 | + * Determines whether the complete Exchange should be injected into the script. |
| 93 | + * |
| 94 | + * @return true If the Exchange should be injected. |
| 95 | + */ |
| 96 | + Boolean injectExchange(); |
| 97 | + |
| 98 | + /** |
| 99 | + * Sets the 'injectExchange' property whether the complete Exchange should be injected into the script. |
| 100 | + * |
| 101 | + * @param enable The value to 'injectExchange to. |
| 102 | + * @return {@link ScriptComponentImplementationModel} to enable method chaining. |
| 103 | + */ |
| 104 | + ScriptComponentImplementationModel setInjectExchange(final Boolean enable); |
| 105 | + |
| 106 | + /** |
| 107 | + * Gets the name of script language. |
| 108 | + * @return String the language name. |
| 109 | + */ |
| 110 | + String getLanguage(); |
| 111 | + |
| 112 | + /** |
| 113 | + * Sets the script language. |
| 114 | + * |
| 115 | + * @param language The script language. |
| 116 | + * @return {@link ScriptComponentImplementationModel} to enable method chaining. |
| 117 | + */ |
| 118 | + ScriptComponentImplementationModel setLanguage(final String language); |
| 119 | +} |
0 commit comments