| 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | // API class |
| 8 | |
| 9 | package org.mozilla.javascript; |
| 10 | |
| 11 | /** |
| 12 | * Interface to represent arbitrary action that requires to have Context |
| 13 | * object associated with the current thread for its execution. |
| 14 | */ |
| 15 | public interface ContextAction |
| 16 | { |
| 17 | /** |
| 18 | * Execute action using the supplied Context instance. |
| 19 | * When Rhino runtime calls the method, <tt>cx</tt> will be associated |
| 20 | * with the current thread as active context. |
| 21 | * |
| 22 | * @see ContextFactory#call(ContextAction) |
| 23 | */ |
| 24 | public Object run(Context cx); |
| 25 | } |
| 26 |