PageRenderTime 57ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/projects/flux/src/java/org/springmodules/scheduling/flux/EngineBean.java

https://github.com/chololo/spring-modules
Java | 358 lines | 220 code | 69 blank | 69 comment | 0 complexity | 820911bb7ab726ca2de3e97a44d5a366 MD5 | raw file
  1. package org.springmodules.scheduling.flux;
  2. import flux.Configuration;
  3. import flux.Engine;
  4. import flux.EngineException;
  5. import flux.Factory;
  6. import flux.FlowChart;
  7. import flux.FlowChartElementIterator;
  8. import flux.FlowChartIterator;
  9. import flux.ForecastIterator;
  10. import flux.SubState;
  11. import flux.SuperState;
  12. import flux.TransactionalSession;
  13. import flux.Version;
  14. import flux.agent.AgentAdministrator;
  15. import flux.audittrail.AuditTrailIterator;
  16. import flux.bpm.BusinessProcessAdministrator;
  17. import flux.logging.Level;
  18. import flux.logging.LogIterator;
  19. import flux.messaging.MessageAdministrator;
  20. import flux.messaging.PublisherAdministrator;
  21. import flux.runtimeconfiguration.RuntimeConfigurationNode;
  22. import flux.security.SecurityAdministrator;
  23. import java.rmi.NotBoundException;
  24. import java.rmi.RemoteException;
  25. import java.util.Date;
  26. import java.util.Properties;
  27. import java.util.Set;
  28. /**
  29. * A JavaBean for the Flux job scheduler. Flux is also a workflow
  30. * engine and a business process management (BPM) engine.
  31. *
  32. * @author Copyright 2000-2006 Flux Corporation. All rights reserved.
  33. */
  34. public class EngineBean implements Engine {
  35. private Engine engine;
  36. /**
  37. * Creates an engine with a default in-memory database.
  38. *
  39. * @throws flux.EngineException If a system error occurs.
  40. * @see flux.Factory#makeEngine
  41. */
  42. public EngineBean() throws EngineException {
  43. engine = Factory.makeInstance().makeEngine();
  44. } // constructor
  45. /**
  46. * Creates an engine using the supplied configuration.
  47. *
  48. * @param configuration A specification of how to make an engine.
  49. * @throws flux.EngineException If a system error occurs.
  50. * @throws java.rmi.RemoteException If a networking error occurs.
  51. * @see flux.Factory#makeEngine(flux.Configuration)
  52. */
  53. public EngineBean(Configuration configuration) throws EngineException, RemoteException {
  54. engine = Factory.makeInstance().makeEngine(configuration);
  55. } // constructor
  56. /**
  57. * Creates an engine using the supplied configuration properties.
  58. *
  59. * @param configuration A specification of how to make an engine.
  60. * @throws flux.EngineException If a system error occurs.
  61. * @throws java.rmi.RemoteException If a networking error occurs.
  62. * @see flux.Factory#makeConfiguration(java.util.Properties)
  63. * @see flux.Factory#makeEngine(flux.Configuration)
  64. */
  65. public EngineBean(Properties configuration) throws EngineException, RemoteException {
  66. Factory factory = Factory.makeInstance();
  67. Configuration config = factory.makeConfiguration(configuration);
  68. engine = Factory.makeInstance().makeEngine(config);
  69. } // constructor
  70. /**
  71. * Creates an engine using the supplied configuration properties.
  72. *
  73. * @param configurationPropertiesFile A path to a file that contains
  74. * configuration properties.
  75. * @throws flux.EngineException If a system error occurs.
  76. * @throws java.rmi.RemoteException If a networking error occurs.
  77. * @see flux.Factory#makeConfigurationFromProperties(String)
  78. * @see flux.Factory#makeEngine(flux.Configuration)
  79. */
  80. public EngineBean(String configurationPropertiesFile) throws EngineException, RemoteException {
  81. Factory factory = Factory.makeInstance();
  82. Configuration config = factory.makeConfigurationFromProperties(configurationPropertiesFile);
  83. engine = Factory.makeInstance().makeEngine(config);
  84. } // constructor
  85. // note: there is no constructor for a properties input stream, an XML input stream, an XML config file, or a literal XML configuration
  86. /**
  87. * Looks up an RMI engine at the specified host and RMI registry port
  88. * using the default RMI registry bind name. This engine bean acts as
  89. * a proxy to the remote RMI engine.
  90. *
  91. * @param host The host where the remote RMI engine is located.
  92. * @param port The RMI registry port on the specified host.
  93. * @throws flux.EngineException If a system error occurs.
  94. * @throws java.rmi.RemoteException If a networking error occurs.
  95. * @throws java.rmi.NotBoundException If there is no object in the RMI
  96. * registry under the default bind name.
  97. * @see flux.Factory#lookupRmiEngine(String, int)
  98. */
  99. public EngineBean(String host, int port) throws EngineException, RemoteException, NotBoundException {
  100. engine = Factory.makeInstance().lookupRmiEngine(host, port);
  101. } // constructor
  102. /**
  103. * Looks up an RMI engine at the specified host and RMI registry port
  104. * using the specified RMI registry bind name. This engine bean acts as
  105. * a proxy to the remote RMI engine.
  106. *
  107. * @param host The host where the remote RMI engine is located.
  108. * @param port The RMI registry port on the specified host.
  109. * @param bindName The name under which the remote engine is registered
  110. * in the RMI registry.
  111. * @throws flux.EngineException If a system error occurs.
  112. * @throws java.rmi.RemoteException If a networking error occurs.
  113. * @throws java.rmi.NotBoundException If there is no object in the RMI
  114. * registry under the specified bind name.
  115. * @see flux.Factory#lookupRmiEngine(String, int, String)
  116. */
  117. public EngineBean(String host, int port, String bindName) throws EngineException, RemoteException, NotBoundException {
  118. engine = Factory.makeInstance().lookupRmiEngine(host, port, bindName);
  119. } // constructor
  120. // fixme: these contructors don't allow pointing at an XML config file or an XML literal configuration
  121. public void clearAuditTrail() throws EngineException, RemoteException {
  122. engine.clearAuditTrail();
  123. }
  124. public void clearLogs() throws EngineException, RemoteException {
  125. engine.clearLogs();
  126. }
  127. public void dispose() throws EngineException, RemoteException {
  128. engine.dispose();
  129. }
  130. public AgentAdministrator getAgentAdministrator() throws EngineException, RemoteException {
  131. return engine.getAgentAdministrator();
  132. }
  133. public String getAuditTrailExpiration() throws EngineException, RemoteException {
  134. return engine.getAuditTrailExpiration();
  135. }
  136. public BusinessProcessAdministrator getBusinessProcessAdministrator() throws EngineException, RemoteException {
  137. return engine.getBusinessProcessAdministrator();
  138. }
  139. public int getConcurrencyLevel() throws EngineException, RemoteException {
  140. return engine.getConcurrencyLevel();
  141. }
  142. public Configuration getConfiguration() throws EngineException, RemoteException {
  143. return engine.getConfiguration();
  144. }
  145. public String getLogExpiration() throws EngineException, RemoteException {
  146. return engine.getLogExpiration();
  147. }
  148. public MessageAdministrator getMessageAdministrator() throws EngineException, RemoteException {
  149. return engine.getMessageAdministrator();
  150. }
  151. public PublisherAdministrator getPublisherAdministrator() throws EngineException, RemoteException {
  152. return engine.getPublisherAdministrator();
  153. }
  154. public RuntimeConfigurationNode getRuntimeConfiguration() throws EngineException, RemoteException {
  155. return engine.getRuntimeConfiguration();
  156. }
  157. public SecurityAdministrator getSecurityAdministrator() throws EngineException, RemoteException {
  158. return engine.getSecurityAdministrator();
  159. }
  160. public Version getVersion() throws RemoteException, EngineException {
  161. return engine.getVersion();
  162. }
  163. public boolean isBpmModuleEnabled() throws RemoteException {
  164. return engine.isBpmModuleEnabled();
  165. }
  166. public boolean isDisposed() throws EngineException, RemoteException {
  167. return engine.isDisposed();
  168. }
  169. public boolean isRunning() throws EngineException, RemoteException {
  170. return engine.isRunning();
  171. }
  172. public boolean join(String namespace, String timeoutTimeExpression) throws EngineException, RemoteException {
  173. return engine.join(namespace, timeoutTimeExpression);
  174. }
  175. public void ping() throws EngineException, RemoteException {
  176. engine.ping();
  177. }
  178. public void setAuditTrailExpiration(String s) throws EngineException, RemoteException {
  179. engine.setAuditTrailExpiration(s);
  180. }
  181. public void setConcurrencyLevel(int i) throws EngineException, RemoteException {
  182. engine.setConcurrencyLevel(i);
  183. }
  184. public void setLogExpiration(String s) throws EngineException, RemoteException {
  185. engine.setLogExpiration(s);
  186. }
  187. public void setRuntimeConfiguration(RuntimeConfigurationNode runtimeConfigurationNode) throws EngineException, RemoteException {
  188. engine.setRuntimeConfiguration(runtimeConfigurationNode);
  189. }
  190. public void start() throws EngineException, RemoteException {
  191. engine.start();
  192. }
  193. public void stop() throws EngineException, RemoteException {
  194. engine.stop();
  195. }
  196. public boolean isSecured() throws RemoteException {
  197. return engine.isSecured();
  198. }
  199. public TransactionalSession makeJ2seSession() throws EngineException, RemoteException {
  200. return engine.makeJ2seSession();
  201. }
  202. public long clear() throws EngineException, RemoteException {
  203. return engine.clear();
  204. }
  205. public long clearSignal(String s, String s1) throws EngineException, RemoteException {
  206. return engine.clearSignal(s, s1);
  207. }
  208. public long clearSignals(String s) throws EngineException, RemoteException {
  209. return engine.clearSignals(s);
  210. }
  211. public long expedite(String s) throws EngineException, RemoteException {
  212. return engine.expedite(s);
  213. }
  214. public long interrupt(String s) throws EngineException, RemoteException {
  215. return engine.interrupt(s);
  216. }
  217. public long pause(String s) throws EngineException, RemoteException {
  218. return engine.pause(s);
  219. }
  220. public long raiseSignal(String s, String s1) throws EngineException, RemoteException {
  221. return engine.raiseSignal(s, s1);
  222. }
  223. public long recover(String s) throws EngineException, RemoteException {
  224. return engine.recover(s);
  225. }
  226. public long remove(String s) throws EngineException, RemoteException {
  227. return engine.remove(s);
  228. }
  229. public long rename(String s, String s1) throws EngineException, RemoteException {
  230. return engine.rename(s, s1);
  231. }
  232. public long resume(String s) throws EngineException, RemoteException {
  233. return engine.resume(s);
  234. }
  235. public long size() throws EngineException, RemoteException {
  236. return engine.size();
  237. }
  238. public long size(String s) throws EngineException, RemoteException {
  239. return engine.size(s);
  240. }
  241. public long sizeByState(String s, SuperState superState, SubState subState) throws EngineException, RemoteException {
  242. return engine.sizeByState(s, superState, subState);
  243. }
  244. public ForecastIterator forecast(String s, Date date, Date date1) throws EngineException, RemoteException {
  245. return engine.forecast(s, date, date1);
  246. }
  247. public FlowChartIterator get() throws EngineException, RemoteException {
  248. return engine.get();
  249. }
  250. public FlowChartIterator getByState(String s, SuperState superState, SubState subState) throws EngineException, RemoteException {
  251. return engine.getByState(s, superState, subState);
  252. }
  253. public FlowChartIterator getFlowCharts(String s) throws EngineException, RemoteException {
  254. return engine.getFlowCharts(s);
  255. }
  256. public FlowChartElementIterator getFlowChartElements(String s) throws EngineException, RemoteException {
  257. return engine.getFlowChartElements(s);
  258. }
  259. public FlowChartElementIterator getFlowChartElements(String s, SuperState superState, SubState subState) throws EngineException, RemoteException {
  260. return engine.getFlowChartElements(s, superState, subState);
  261. }
  262. public AuditTrailIterator scanAuditTrail(String s, Date date, Date date1, Set set, String s1) throws EngineException, RemoteException {
  263. return engine.scanAuditTrail(s, date, date1, set, s1);
  264. }
  265. public AuditTrailIterator scanAuditTrailByGroup(String s, Date date, Date date1, Set set, String s1, String s2) throws EngineException, RemoteException {
  266. return engine.scanAuditTrailByGroup(s, date, date1, set, s1, s2);
  267. }
  268. public AuditTrailIterator scanAuditTrailByUser(String s, Date date, Date date1, Set set, String s1, String s2) throws EngineException, RemoteException {
  269. return engine.scanAuditTrailByUser(s, date, date1, set, s1, s2);
  270. }
  271. public LogIterator scanLogs(String s, Date date, Date date1, Level level, String s1, String s2, String s3) throws EngineException, RemoteException {
  272. return engine.scanLogs(s, date, date1, level, s1, s2, s3);
  273. }
  274. public LogIterator scanLogsByGroup(String s, Date date, Date date1, Level level, String s1, String s2, String s3, String s4) throws EngineException, RemoteException {
  275. return engine.scanLogsByGroup(s, date, date1, level, s1, s2, s3, s4);
  276. }
  277. public LogIterator scanLogsByUser(String s, Date date, Date date1, Level level, String s1, String s2, String s3, String s4) throws EngineException, RemoteException {
  278. return engine.scanLogsByUser(s, date, date1, level, s1, s2, s3, s4);
  279. }
  280. public FlowChart get(String s) throws EngineException, RemoteException {
  281. return engine.get(s);
  282. }
  283. public FlowChart get(String s, String s1) throws EngineException, RemoteException {
  284. return engine.get(s, s1);
  285. }
  286. public String put(FlowChart flowChart) throws EngineException, RemoteException {
  287. return engine.put(flowChart);
  288. }
  289. } // class EngineBean