Changeset 3871
- Timestamp:
- Oct 22, 2007, 2:21:37 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/config/dist/base.config
r3765 r3871 77 77 # If the internal job queue should be enabled or not 78 78 jobqueue.internal.enabled = true 79 80 # If plugins with useInteralJobQueue = false should be executed or not 81 jobqueue.internal.runallplugins = false 82 83 # The maximum thread priority for any thread executing a plug-in 79 84 #jobqueue.internal.maxthreadpriority = 4 80 85 -
trunk/doc/src/docbook/admindoc/installation_upgrade.xml
r3857 r3871 204 204 <para> 205 205 In the main BASE configuration file, 206 <filename> /path/to/base/www/WEB-INF/classes/base.config</filename>,206 <filename><base-dir>/www/WEB-INF/classes/base.config</filename>, 207 207 fields that needs to be transferred are usually 208 208 <emphasis>db.username</emphasis>, … … 212 212 <para> 213 213 Local settings in the raw data 214 tables, <filename> /path/to/base/www/WEB-INF/classes/raw-data-types.xml</filename>,214 tables, <filename><base-dir>/www/WEB-INF/classes/raw-data-types.xml</filename>, 215 215 may need to be transferred. 216 216 </para> … … 228 228 need to run them. Change directory 229 229 to <filename 230 class="directory"> /path/to/base/bin/</filename> and issue230 class="directory"><base-dir>/bin/</filename> and issue 231 231 <programlisting>sh ./updatedb.sh <emphasis>base_root_password</emphasis> 232 232 sh ./updateindexes.sh <emphasis>base_root_password</emphasis></programlisting> … … 289 289 checking the BASE job queue for jobs awaiting execution. When 290 290 the job agent finds a job that it is enabled to execute, it 291 loads the plug in and executes it. Job agents will in this way291 loads the plug-in and executes it. Job agents will in this way 292 292 free up resources on the BASE application server, and thus allow 293 293 the BASE server to concentrate on serving web pages. Job agents … … 303 303 <listitem> 304 304 <para> 305 Specify exactly which plug ins each job agent should be305 Specify exactly which plug-ins each job agent should be 306 306 able to execute. 307 307 </para> … … 309 309 <listitem> 310 310 <para> 311 Give some plug ins higher priority than other plugins.311 Give some plug-ins higher priority than other plug-ins. 312 312 </para> 313 313 </listitem> … … 320 320 <listitem> 321 321 <para> 322 Override memory settings and more for each plug in.323 </para> 324 </listitem> 325 <listitem> 326 <para> 327 Execute plug ins in separate processes. Thus, a misbehaving328 plug in cannot bring the main application server down.322 Override memory settings and more for each plug-in. 323 </para> 324 </listitem> 325 <listitem> 326 <para> 327 Execute plug-ins in separate processes. Thus, a misbehaving 328 plug-in cannot bring the main application server down. 329 329 </para> 330 330 </listitem> … … 338 338 setup. For example one job agent can be assigned for importing 339 339 data only, another job agent can be assigned for running 340 analysis plug ins for specific project only, and a third may be a340 analysis plug-ins for specific project only, and a third may be a 341 341 catch-all job agent that performs all low-priority jobs. 342 342 </para> … … 347 347 <variablelist> 348 348 <varlistentry> 349 <term> Disable the internal job queue</term>349 <term>Make sure the internal job queue doesn't execute all plug-ins</term> 350 350 <listitem> 351 351 <para> 352 It is not recommended to use the internal job queue 353 when job agents are used. The 354 setting <command>jobqueue.internal.enabled</command> 355 should be changed to <command>false</command> for the 352 The setting <command>jobqueue.internal.runallplugins</command> 353 should be set to <command>false</command> for the 356 354 BASE server. This setting is found in 357 the <filename> /path/to/base/www/WEB-INF/classes/base.config</filename>355 the <filename><base-dir>/www/WEB-INF/classes/base.config</filename> 358 356 file. The changes will not take effect until the 359 357 application server is restarted. 360 358 </para> 359 360 <note> 361 Prior to BASE 2.5 the internal job queue had to be disabled 362 completely. This is no longer the case since it is possible to 363 enable/disable the internal job queue separately for 364 each plug-in. 365 </note> 366 361 367 </listitem> 362 368 </varlistentry> … … 435 441 <listitem> 436 442 <para> 437 The <filename> /path/to/base/www/WEB-INF/classes/base.config</filename>443 The <filename><base-dir>/www/WEB-INF/classes/base.config</filename> 438 444 file must be configured as in regular BASE 439 445 installation, cf. … … 485 491 <listitem> 486 492 <para> 487 The <filename> /path/to/base/www/WEB-INF/classes/jobagent.properties</filename>493 The <filename><base-dir>/www/WEB-INF/classes/jobagent.properties</filename> 488 494 file contains settings for the job agent. The most 489 495 important ones to specify value for are … … 557 563 Before the job agent starts executing jobs for you it must be 558 564 configured. The configuration is done through the BASE web 559 interface. 565 interface. See <xref linkend="plugins.jobagents" /> 560 566 <variablelist> 561 567 <varlistentry> 562 <term>Configure the plug ins the job agent should handle</term>568 <term>Configure the plug-ins the job agent should handle</term> 563 569 <listitem> 564 570 <para> … … 583 589 <para> 584 590 On the <guilabel>Plugins</guilabel> tab you can 585 specify which plug ins the job agent should591 specify which plug-ins the job agent should 586 592 handle. Note that if you have installed external 587 plug ins on the web server, those plugins must be593 plug-ins on the web server, those plug-ins must be 588 594 installed on the job agent as well. It is 589 595 possible to specify different paths to the JAR … … 706 712 <ulink url="http://www.postgresql.org/" />. you must 707 713 edit 708 your <filename> /path/to/base/www/WEB-INF/classes/base.config</filename>714 your <filename><base-dir>/www/WEB-INF/classes/base.config</filename> 709 715 file. Uncomment the settings for Postgres and 710 716 comment out the settings for MySQL. … … 803 809 </para> 804 810 <para> 805 The <filename> /path/to/base/misc/sql/createdb.mysql.sql</filename>811 The <filename><base-dir>/misc/sql/createdb.mysql.sql</filename> 806 812 file contains the above statements and can be used 807 813 by the <filename>mysql</filename> command-line tool … … 833 839 # within the tool and quit with a '\q'. 834 840 CREATE SCHEMA "dynamic" AUTHORIZATION "db_user";</programlisting> 835 The <filename> /path/to/base/misc/sql/createdb.postgresql.sql</filename>841 The <filename><base-dir>/misc/sql/createdb.postgresql.sql</filename> 836 842 file contains the above statements and can be used 837 843 by the <filename>psql</filename> command-line tool: … … 864 870 <para> 865 871 Basic BASE configuration is done in 866 <filename> /path/to/base/www/WEB-INF/classes/base.config</filename>:872 <filename><base-dir>/www/WEB-INF/classes/base.config</filename>: 867 873 <itemizedlist> 868 874 <listitem> … … 893 899 to modify extended properties to fit your needs. Extended 894 900 properties are defined in 895 <filename> /path/to/base/www/WEB-INF/classes/extended-properties.xml</filename>.901 <filename><base-dir>/www/WEB-INF/classes/extended-properties.xml</filename>. 896 902 There is an 897 903 administrator <ulink … … 912 918 <para> 913 919 Change directory to 914 <filename class="directory"> /path/to/base/bin</filename>920 <filename class="directory"><base-dir>/bin</filename> 915 921 and run <filename>initdb.sh</filename> as 916 922 <programlisting>./initdb.sh base_root_password</programlisting> … … 934 940 <para> 935 941 Either move the <filename 936 class="directory"> /path/to/base/www</filename> directory942 class="directory"><base-dir>/www</filename> directory 937 943 to the tomcat <filename class="directory">webapps</filename> 938 944 directory or create a symbolic link from the tomcat 939 945 <filename class="directory">webapps</filename> directory to 940 the <filename class="directory"> /path/to/base/www</filename>946 the <filename class="directory"><base-dir>/www</filename> 941 947 directory 942 948 <programlisting>cd /path/to/tomcat/webapps … … 1118 1124 behaviour), you must have file system access to BASE 1.2 1119 1125 files, <emphasis>i.e.,</emphasis> the <filename 1120 class="directory">/ path/to/base1.2/data</filename>1126 class="directory">/ 1.2/data</filename> 1121 1127 directory containing directories 1122 1128 <filename class="directory">rawdata</filename>, … … 1129 1135 <para> 1130 1136 Change settings in the file 1131 <filename> /path/to/base/dist/www/WEB-INF/classes/migrate.properties</filename>.1137 <filename><base-dir>/dist/www/WEB-INF/classes/migrate.properties</filename>. 1132 1138 The available options are commented: 1133 1139 <itemizedlist> -
trunk/doc/src/docbook/admindoc/plugin_installation.xml
r3866 r3871 693 693 <listitem> 694 694 <para> 695 You may select if the internal job queue should execute the 696 plug-in or not. 697 </para> 698 </listitem> 699 </varlistentry> 700 <varlistentry> 701 <term><guilabel>Job agents</guilabel></term> 702 <listitem> 703 <para> 695 704 A list with the job agents where the plug-in is installed and 696 705 allowed to be executed. Select a plug-in in this list to display -
trunk/doc/src/docbook/appendix/base.config.xml
r3765 r3871 360 360 <para> 361 361 If <userinput>0</userinput> or <userinput>FALSE</userinput> the internal 362 job queue will be disabled. If you are using job agents to execute jobs, 363 the recommendation is to disable the internal job queue. Otherwise you must 364 leave it enabled. 362 job queue will be disabled. 363 </para> 364 </listitem> 365 </varlistentry> 366 367 <varlistentry> 368 <term><property>jobqueue.internal.runallplugins</property></term> 369 <listitem> 370 <para> 371 If <userinput>1</userinput> or <userinput>TRUE</userinput> the internal 372 job queue will ignore the <property>useInternalJobQueue</property> 373 flag specified on plug-ins. If <userinput>0</userinput> or <userinput>FALSE</userinput> 374 the internal job queue will only execute plug-ins which has 375 <property>useInternalJobQueue=true</property> 365 376 </para> 366 377 </listitem> -
trunk/doc/src/docbook/developerdoc/api_overview.xml
r3869 r3871 894 894 <sect2 id="data_api.plugins"> 895 895 <title>Plug-ins, jobs and job agents</title> 896 897 <para> 898 This section gives an overview of plug-ins, jobs and job agents. 899 </para> 900 901 <itemizedlist> 902 <title>See also</title> 903 <listitem><xref linkend="plugins.installation" /></listitem> 904 <listitem><xref linkend="installation_upgrade.jobagents" /></listitem> 905 </itemizedlist> 906 907 <sect3 id="data_api.plugins.uml"> 908 <title>UML diagram</title> 909 910 <figure id="data_api.figures.plugins"> 911 <title>Plug-ins, jobs and job agents</title> 912 <screenshot> 913 <mediaobject> 914 <imageobject> 915 <imagedata 916 fileref="figures/uml/datalayer.plugins.png" format="PNG" /> 917 </imageobject> 918 </mediaobject> 919 </screenshot> 920 </figure> 921 </sect3> 922 923 <sect3 id="data_api.plugins.plugins"> 924 <title>Plug-ins</title> 925 926 <para> 927 The <classname>PluginDefinitionData</classname> holds information of the 928 installed plugin classes. Much of the information is copied from the 929 plug-in itself from the <classname>About</classname> object and by checking 930 which interfaces it implements. 931 </para> 932 933 <para> 934 There are five main types of plug-ins: 935 </para> 936 937 <itemizedlist> 938 <listitem> 939 <para> 940 IMPORT (mainType = 1): A plug-in that imports data to BASE. 941 </para> 942 </listitem> 943 <listitem> 944 <para> 945 EXPORT (mainType = 2): A plug-in that exports data from BASE. 946 </para> 947 </listitem> 948 <listitem> 949 <para> 950 INTENSITY (mainType = 3): A plug-in that calculates intensity values 951 from raw data. 952 </para> 953 </listitem> 954 <listitem> 955 <para> 956 ANALYZE (mainType = 4): A plug-in that analyses data. 957 </para> 958 </listitem> 959 <listitem> 960 <para> 961 OTHER (mainType = 5): Any other plug-in. 962 </para> 963 </listitem> 964 </itemizedlist> 965 966 <para> 967 A plug-in may have different configurations. The flags <property>supportsConfigurations</property> 968 and <property>requiresConfiguration</property> are used to specify if a plug-in 969 must have or can't have any configurations. Configuration parameter values are 970 versioned. Each time anyone updates a configuration the version number 971 is increased and the parameter values are stored as a new entity. 972 This is required because we want to be able to know exactly which 973 parameters a job were using when it was executed. When a job is 974 created we also store the parameter version number 975 (<property>JobData.parameterVersion</property>). This means that even if 976 someone changes the configuration later we will always know which 977 parameters the job used. 978 </para> 979 980 <para> 981 The <classname>PluginTypeData</classname> class is ued to group 982 plug-ins that share some common functionality, by implementing 983 additional (optional) interfaces. For example, the 984 <interfacename>AutoDetectingImporter</interfacename> should be implemented 985 by import plug-ins that supports automatic detection of file formats. 986 Another example is the <interfacename>AnalysisFilterPlugin</interfacename> 987 interface which should be implemented by all analysis plug-ins that 988 only filters data. 989 </para> 990 991 </sect3> 992 993 <sect3 id="data_api.plugins.jobs"> 994 <title>Jobs</title> 995 996 <para> 997 A job represents a single invokation of a plug-in to do some work. 998 The <classname>JobData</classname> class holds information about this. 999 A job is usuallu executed by a plug-in, but doesn't have to be. The 1000 <property>status</property> property holds the current state of a job. 1001 </para> 1002 1003 <itemizedlist> 1004 <listitem> 1005 <para> 1006 UNCONFIGURED (status = 0): The job is not yet ready to be executed. 1007 </para> 1008 </listitem> 1009 <listitem> 1010 <para> 1011 WAITING (status = 1): The job is waiting to be executed. 1012 </para> 1013 </listitem> 1014 <listitem> 1015 <para> 1016 PREPARING (status = 5): The job is about to be executed but hasn't started yet. 1017 </para> 1018 </listitem> 1019 <listitem> 1020 <para> 1021 EXECUTING (status = 2): The job is currently executing. 1022 </para> 1023 </listitem> 1024 <listitem> 1025 <para> 1026 DONE (status = 3): The job finished successfully. 1027 </para> 1028 </listitem> 1029 <listitem> 1030 <para> 1031 ERROR (status = 4): The job finished with an error. 1032 </para> 1033 </listitem> 1034 </itemizedlist> 1035 </sect3> 1036 1037 <sect3 id="data_api.plugins.agents"> 1038 <title>Job agents</title> 1039 1040 <para> 1041 A job agent is a program running on the same or a different server that 1042 is regularly checking for jobs that are waiting to be executed. The 1043 <classname>JobAgentData</classname> holds information about a job agent 1044 and the <classname>JobAgentSettingsData</classname> links the agent 1045 with the plug-ins the agent is able to execute. The job agent will only 1046 execute jobs that are owner by users or projects that the job agent has 1047 been shared to with at least use permission. The <property>priorityBoost</property> 1048 property can be used to give specific plug-ins higher priority. 1049 Thus, for a job agent it is possible to: 1050 </para> 1051 1052 <itemizedlist> 1053 <listitem> 1054 <para> 1055 Specify exactly which plug-ins it will execute. For example, it is possible 1056 to dedicate one agent to only run one plug-in. 1057 </para> 1058 </listitem> 1059 <listitem> 1060 <para> 1061 Give some plug-ins higher priority. For example a job agent that is mainly 1062 used for importing data should give higher priority to all import plug-ins. 1063 Other types of jobs will have to wait until there are no more data to be 1064 imported. 1065 </para> 1066 </listitem> 1067 <listitem> 1068 <para> 1069 Specify exactly which users/groups/projects that may use the agent. For 1070 example, it is possible to dedicate one agent to only run jobs for a certain 1071 project. 1072 </para> 1073 </listitem> 1074 </itemizedlist> 1075 1076 </sect3> 1077 1078 896 1079 </sect2> 897 1080 -
trunk/src/core/common-queries.xml
r3850 r3871 1401 1401 A Hibernate query that loads plugin jobs in the job queue waiting to be 1402 1402 executed sorted by priority and waiting type. 1403 </description> 1404 </query> 1405 1406 <query id="FIND_INTERNAL_JOBS_IN_QUEUE" type="HQL"> 1407 <sql> 1408 SELECT job 1409 FROM JobData job 1410 WHERE job.status = :status 1411 AND job.type = :type 1412 AND job.pluginDefinition.useInternalJobQueue = true 1413 ORDER BY job.priority ASC, job.created ASC 1414 </sql> 1415 <description> 1416 A Hibernate query that loads plugin jobs in the job queue waiting to be 1417 executed sorted by priority and waiting type. It should only return 1418 jobs where the plug-in setting useInternalJobQueue=true 1403 1419 </description> 1404 1420 </query> … … 2955 2971 </query> 2956 2972 2973 <query id="SET_USEJOBQUEUE_ON_PLUGINS" type="HQL"> 2974 <sql> 2975 UPDATE PluginDefinitionData pld 2976 SET pld.useInternalJobQueue = true 2977 WHERE pld.useInternalJobQueue IS NULL 2978 </sql> 2979 <description> 2980 A HQL query that set the useInternalJobQueue property to true 2981 for all plug-ins. 2982 </description> 2983 </query> 2957 2984 2958 2985 </predefined-queries> -
trunk/src/core/net/sf/basedb/core/Install.java
r3857 r3871 107 107 method. 108 108 */ 109 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(4 4).intValue();109 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(45).intValue(); 110 110 111 111 public static synchronized void createTables(boolean update, final ProgressReporter progress) -
trunk/src/core/net/sf/basedb/core/InternalJobQueue.java
r3857 r3871 27 27 import net.sf.basedb.core.plugin.Response; 28 28 import net.sf.basedb.core.data.JobData; 29 import net.sf.basedb.core.data.PluginDefinitionData; 29 30 import net.sf.basedb.core.data.ShareableData; 30 31 import net.sf.basedb.core.data.UserData; … … 196 197 197 198 /** 199 If the {@link PluginDefinitionData#getUseInternalJobQueue()} setting 200 should be ignored or not. 201 */ 202 private boolean ignoreUseInternalJobQueueFlag = false; 203 204 /** 198 205 Create the job queue. The one and only instance is created 199 206 by Application.start … … 204 211 maxSlots = Collections.synchronizedMap(new HashMap<Job.ExecutionTime, Integer>()); 205 212 priorities = Collections.synchronizedMap(new HashMap<Job.ExecutionTime, Integer>()); 206 207 // Read configuration values 213 214 // If we should execute all jobs or only jobs for plug-ins which may use the internal queue 215 ignoreUseInternalJobQueueFlag = Config.getBoolean("jobqueue.internal.runallplugins"); 216 217 // Number of execution slots and thread priorities 208 218 for (Job.ExecutionTime et : Job.ExecutionTime.values()) 209 219 { … … 232 242 Check the database for jobs that are waiting to be executed. 233 243 We sort the jobs by priority and creation time and try to execute 234 them in that order. Each job is encap uslated in a {@link JobRunner}244 them in that order. Each job is encapsulated in a {@link JobRunner} 235 245 object which is started in it's own thread. 236 246 */ … … 242 252 { 243 253 dc = sc.newDbControl(); 254 String hqlName = ignoreUseInternalJobQueueFlag ? 255 "FIND_JOBS_IN_QUEUE" : "FIND_INTERNAL_JOBS_IN_QUEUE"; 256 244 257 org.hibernate.Query query = 245 HibernateUtil.getPredefinedQuery(dc.getHibernateSession(), "FIND_JOBS_IN_QUEUE");258 HibernateUtil.getPredefinedQuery(dc.getHibernateSession(), hqlName); 246 259 /* 247 260 SELECT job … … 249 262 WHERE job.status = :status 250 263 AND job.type = :type 264 [AND job.pluginDefinition.useInternalJobQueue = true] 251 265 ORDER BY job.priority ASC, job.created ASC 252 266 */ -
trunk/src/core/net/sf/basedb/core/PluginDefinition.java
r3857 r3871 775 775 776 776 /** 777 If this plug-in can be executed by the internal job queue or 778 not. If not, the plug-in must be configured to be executed by a 779 job agent. NOTE! The plug-in can always be excuted by job agents, 780 they ignore this value. 781 782 @return TRUE if the internal job queue is used, FALSE if not 783 @since 2.5 784 */ 785 public boolean getUseInternalJobQueue() 786 { 787 return getData().getUseInternalJobQueue(); 788 } 789 /** 790 Set if the plug-in can use the internal job queue or not. 791 @param use TRUE to use the internal job queue, FALSE to only use 792 job agents 793 @since 2.5 794 */ 795 public void setUseInternalJobQueue(boolean use) 796 { 797 checkPermission(Permission.WRITE); 798 getData().setUseInternalJobQueue(use); 799 } 800 801 /** 777 802 Check if it makes sense to use this plugin in the context 778 803 of the specified item. For example, a plugin that imports -
trunk/src/core/net/sf/basedb/core/Update.java
r3858 r3871 522 522 </tr> 523 523 524 524 <tr> 525 <td>45</td> 526 <td> 527 <ul> 528 <li>Added {@link net.sf.basedb.core.data.PluginDefinitionData#getUseInternalJobQueue()} 529 </ul> 530 The update sets all values on existing items to true (if no job agent has been 531 configured for the plug-in) or false (if a job agent is configured). 532 </td> 533 </tr> 525 534 </table> 526 535 … … 741 750 if (progress != null) progress.display((int)(43*progress_factor), "--Updating schema version: " + schemaVersion + " -> 44..."); 742 751 schemaVersion = updateToSchemaVersion44(sc); 752 } 753 754 if (schemaVersion < 45) 755 { 756 if (progress != null) progress.display((int)(44*progress_factor), "--Updating schema version: " + schemaVersion + " -> 45..."); 757 schemaVersion = updateToSchemaVersion45(session); 743 758 } 744 759 … … 1649 1664 // Commit the changes 1650 1665 HibernateUtil.commit(tx); 1651 log.info("updateToSchemaVersion4 0: OK");1666 log.info("updateToSchemaVersion43: OK"); 1652 1667 } 1653 1668 catch (BaseException ex) 1654 1669 { 1655 1670 if (tx != null) HibernateUtil.rollback(tx); 1656 log.error("updateToSchemaVersion4 0: FAILED", ex);1671 log.error("updateToSchemaVersion43: FAILED", ex); 1657 1672 throw ex; 1658 1673 } … … 1866 1881 session.save(pk); 1867 1882 } 1883 } 1884 1885 /** 1886 Update useInternalJobQueue for plug-ins. 1887 @return The new schema version (=45) 1888 */ 1889 private static int updateToSchemaVersion45(org.hibernate.Session session) 1890 { 1891 final int schemaVersion = 45; 1892 org.hibernate.Transaction tx = null; 1893 try 1894 { 1895 tx = HibernateUtil.newTransaction(session); 1896 1897 // Change property values 1898 org.hibernate.Query query = HibernateUtil.createQuery(session, 1899 "SELECT DISTINCT jas.pluginDefinition FROM JobAgentSettingsData jas"); 1900 List<PluginDefinitionData> plugins = 1901 HibernateUtil.loadList(PluginDefinitionData.class, query, null); 1902 1903 for (PluginDefinitionData pd : plugins) 1904 { 1905 pd.setUseInternalJobQueue(false); 1906 } 1907 1908 // Update the schema version number 1909 setSchemaVersion(session, schemaVersion); 1910 1911 // Commit the changes 1912 HibernateUtil.commit(tx); 1913 log.info("updateToSchemaVersion45: OK"); 1914 } 1915 catch (BaseException ex) 1916 { 1917 if (tx != null) HibernateUtil.rollback(tx); 1918 log.error("updateToSchemaVersion45: FAILED", ex); 1919 throw ex; 1920 } 1921 return schemaVersion; 1868 1922 } 1869 1923 … … 2227 2281 } 2228 2282 2283 if (schemaVersion < 45) 2284 { 2285 // Set useInternalJobQueue to true for all plug-ins 2286 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, 2287 "SET_USEJOBQUEUE_ON_PLUGINS"); 2288 /* 2289 UPDATE PluginDefinitionData pld 2290 SET pld.useInternalJobQueue = true 2291 WHERE pld.useInternalJobQueue IS NULL 2292 */ 2293 HibernateUtil.executeUpdate(query); 2294 } 2295 2229 2296 // Commit the changes 2230 2297 HibernateUtil.commit(tx); -
trunk/src/core/net/sf/basedb/core/data/PluginDefinitionData.java
r3679 r3871 449 449 } 450 450 451 452 451 private boolean useInternalJobQueue = true; 452 /** 453 If the plug-in can be executed with the internal job queue or 454 not. If FALSE is used, the plug-in can only be executed by a 455 job agent or other external tool. 456 @since 2.5 457 @hibernate.property column="`use_internal_queue`" type="boolean" not-null="true" 458 */ 459 public boolean getUseInternalJobQueue() 460 { 461 return useInternalJobQueue; 462 } 463 public void setUseInternalJobQueue(boolean useInternalJobQueue) 464 { 465 this.useInternalJobQueue = useInternalJobQueue; 466 } 467 453 468 } -
trunk/www/admin/jobagents/index.jsp
r3675 r3871 165 165 if (pluginId != -1) 166 166 { 167 JobAgentSettings settings = agent.getSettings(PluginDefinition.getById(dc, pluginId), true); 167 PluginDefinition plugin = PluginDefinition.getById(dc, pluginId); 168 if (plugin.hasPermission(Permission.WRITE) && plugin.getUseInternalJobQueue()) 169 { 170 plugin.setUseInternalJobQueue(false); 171 } 172 JobAgentSettings settings = agent.getSettings(plugin, true); 168 173 if (!settings.isInDatabase()) 169 174 { -
trunk/www/admin/plugindefinitions/edit_plugin.jsp
r3679 r3871 239 239 new AgentSetting(agentId, '', '', '', '0'); 240 240 } 241 var numBefore = document.forms['plugin'].agents.length; 241 242 Link.addItem(document.forms['plugin'].agents, item); 243 var numAfter = document.forms['plugin'].agents.length; 244 if (numBefore == 0 && numAfter > 0) 245 { 246 document.forms['plugin'].use_internal_jobqueue.checked = false; 247 } 242 248 agentsOnClick(); 243 249 } … … 276 282 { 277 283 var agents = document.forms['plugin'].agents; 284 Link.addNewSection(agents, new Section('A', 'Job agents')); 278 285 <% 279 286 if (agentQuery != null) … … 715 722 716 723 <h3 class="docked"><%=title%> <base:help tabcontrol="settings" /></h3> 717 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale* 260)+"px;"%>"724 <t:tabcontrol id="settings" contentstyle="<%="height: "+(int)(scale*300)+"px;"%>" 718 725 position="bottom" remember="<%=plugin != null%>" active="<%=selectedAgentId == -1 ? null : "agents" %>"> 719 726 <t:tab id="info" title="Plugin" validate="validatePlugin()" helpid="plugindefinition.edit"> … … 910 917 911 918 <t:tab id="agents" title="Job agents" helpid="plugindefinition.jobagents"> 912 <table >919 <table class="form"> 913 920 <tr valign="top"> 921 <td class="prompt">Run this plugin on</td> 914 922 <td> 915 <b>Run this plugin on</b><br> 916 <select name="agents" size="15" multiple style="width: 15em;" 923 <input type="checkbox" name="use_internal_jobqueue" value="1" 924 <%=plugin == null || plugin.getUseInternalJobQueue() ? "checked" : "" %>> 925 internal job queue 926 </td> 927 </tr> 928 <tr> 929 <td> 930 <select name="agents" size="12" multiple style="width: 15em;" 917 931 onclick="agentsOnClick()"> 918 932 </select> … … 921 935 </td> 922 936 <td> 923 <br>924 937 <table width="150"> 925 938 <tr><td><base:button … … 937 950 <br> 938 951 <div id="agentsettings" style="display: none;"> 952 <b>Settings for the selected job agent</b> 939 953 <table border="0" cellspacing="0" class="form"> 940 954 <tr> -
trunk/www/admin/plugindefinitions/index.jsp
r3832 r3871 283 283 plugin.setMaxMemory(Values.parseBytes(request.getParameter("maxMemory"), null)); 284 284 plugin.setTrusted(Values.getBoolean(request.getParameter("trusted"))); 285 plugin.setUseInternalJobQueue(Values.getBoolean(request.getParameter("use_internal_jobqueue"))); 285 286 String aie = Values.getStringOrNull(request.getParameter("allow_immediate_execution")); 286 287 plugin.setAllowImmediateExecution(aie == null ? -
trunk/www/admin/plugindefinitions/list_plugins.jsp
r3679 r3871 410 410 datatype="boolean" 411 411 title="Trusted" 412 sortable="true" 413 filterable="true" 414 exportable="true" 415 /> 416 <tbl:columndef 417 id="useInternalJobQueue" 418 property="useInternalJobQueue" 419 datatype="boolean" 420 title="Use internal job queue" 412 421 sortable="true" 413 422 filterable="true" … … 666 675 <tbl:cell column="maxMemory"><%=Values.formatBytes(item.getMaxMemory())%></tbl:cell> 667 676 <tbl:cell column="trusted"><%=item.isTrusted() ? "yes" : "no"%></tbl:cell> 677 <tbl:cell column="useInternalJobQueue"><%=item.getUseInternalJobQueue() ? "yes" : "no"%></tbl:cell> 668 678 <tbl:cell column="allowImmediateExecution"><%=item.getAllowImmediateExecution() ? "yes" : "no"%></tbl:cell> 669 679 <tbl:cell column="owner" -
trunk/www/admin/plugindefinitions/view_plugin.jsp
r3679 r3871 319 319 </tr> 320 320 <tr> 321 <td class="prompt">Use internal job queue</td> 322 <td><%=plugin.getUseInternalJobQueue() ? "yes" : "no"%></td> 323 </tr> 324 <tr> 321 325 <td class="prompt" valign="baseline">Items</td> 322 326 <td><%=Values.getString(contexts, ", ", true)%></td> -
trunk/www/include/scripts/main.js
r3847 r3871 422 422 this.controllers['NEWS'] = { url:'admin/news/index.jsp', width:540, height:400 }; 423 423 this.controllers['PLUGINCONFIGURATION'] = { url:'admin/pluginconfigurations/index.jsp', width:500, height:340 }; 424 this.controllers['PLUGINDEFINITION'] = { url:'admin/plugindefinitions/index.jsp', width:7 00, height:400 };424 this.controllers['PLUGINDEFINITION'] = { url:'admin/plugindefinitions/index.jsp', width:720, height:440 }; 425 425 this.controllers['PLUGINTYPE'] = { url:'admin/plugintypes/index.jsp', width:700, height:400 }; 426 426 this.controllers['JOBAGENT'] = { url:'admin/jobagents/index.jsp', width:700, height:400 };
Note: See TracChangeset
for help on using the changeset viewer.