01: /*
02: * Timer: The timer class
03: * Copyright (C) 2006-2007 Rift IT Contracting
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18: *
19: * JythonDaemon.java
20: */
21:
22: package com.rift.coad.daemon.jython;
23:
24: import java.rmi.Remote;
25: import java.rmi.RemoteException;
26: import java.util.Map;
27:
28: /**
29: * The Jython Daemon integrates Jython into Coadunation which give a user the
30: * ability to run Python scripts within Coadunation.
31: *
32: * @author Glynn Chaldecott
33: */
34: public interface JythonDaemon extends Remote {
35:
36: /**
37: * This method is called when a user wants to run a stored script. It will
38: * then return the requested value.
39: *
40: * @param name This is the name of the script that a user wishes to run.
41: * Please note that on a windows installation this will need to include
42: * the file extension ".py".
43: * @param returnValue This is the name of the value a user wishes to have
44: * returned.
45: * @param javaclass This is the type of object a user wants the returned
46: * value to returned as.
47: * @return Returns a value from the script.
48: */
49: public Object runScript(String name, String returnValue,
50: Class javaclass) throws RemoteException;
51:
52: /**
53: * This method is called when a user wants to run a stored script. It will
54: * then return the requested value. A user can also specify value for
55: * variables within the script.
56: *
57: * @param name This is the name of the script that a user wishes to run.
58: * Please note that on a windows installation this will need to include
59: * the file extension ".py".
60: * @param returnValue This is the name of the value a user wishes to have
61: * returned.
62: * @param javaclass This is the type of object a user wants the returned
63: * value to returned as.
64: * @param arguments This is a Map object containing as the key the name of
65: * the variable and the value for that variable.
66: * @return Returns a value from the script.
67: */
68: public Object runScript(String name, String returnValue,
69: Class javaclass, Map arguments) throws RemoteException;
70:
71: /**
72: * This script is called in order to register a new script within
73: * Coadunation.
74: *
75: * @param script This is a string containing the script that will be
76: * inserted in a python file.
77: * @param name This is what the script will be called as well as what the
78: * python file will be named. Please note that on a windows installation
79: * this will need to include the file extension ".py".
80: */
81: public void registerScript(byte[] file, String name)
82: throws RemoteException, JythonDaemonException;
83: }
|