KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > daemon > jython > JythonDaemon


1 /*
2  * Timer: The timer class
3  * Copyright (C) 2006-2007 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
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 JavaDoc;
25 import java.rmi.RemoteException JavaDoc;
26 import java.util.Map JavaDoc;
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 JavaDoc {
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 JavaDoc runScript(String JavaDoc name, String JavaDoc returnValue, Class JavaDoc javaclass)
50             throws RemoteException JavaDoc;
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 JavaDoc runScript(String JavaDoc name, String JavaDoc returnValue, Class JavaDoc javaclass,
69             Map JavaDoc arguments) throws RemoteException JavaDoc;
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 JavaDoc name)
82             throws RemoteException JavaDoc, JythonDaemonException;
83 }
84
Popular Tags