KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > SharkEngineManager


1 package org.enhydra.shark;
2
3 import java.util.Properties JavaDoc;
4 import org.enhydra.shark.api.RootError;
5 import org.enhydra.shark.api.internal.appmappersistence.ApplicationMappingManager;
6 import org.enhydra.shark.api.internal.assignment.AssignmentManager;
7 import org.enhydra.shark.api.internal.authentication.AuthenticationManager;
8 import org.enhydra.shark.api.internal.caching.CacheMgr;
9 import org.enhydra.shark.api.internal.eventaudit.EventAuditManagerInterface;
10 import org.enhydra.shark.api.internal.instancepersistence.PersistentManagerInterface;
11 import org.enhydra.shark.api.internal.interoperability.WfEngineInteroperability;
12 import org.enhydra.shark.api.internal.limitagent.LimitAgentManager;
13 import org.enhydra.shark.api.internal.logging.LoggingManager;
14 import org.enhydra.shark.api.internal.partmappersistence.ParticipantMappingManager;
15 import org.enhydra.shark.api.internal.processlocking.LockMaster;
16 import org.enhydra.shark.api.internal.repositorypersistence.RepositoryPersistenceManager;
17 import org.enhydra.shark.api.internal.scripting.ScriptingManager;
18 import org.enhydra.shark.api.internal.scriptmappersistence.ScriptMappingManager;
19 import org.enhydra.shark.api.internal.security.SecurityManager;
20 import org.enhydra.shark.api.internal.toolagent.ToolAgentFactory;
21 import org.enhydra.shark.api.internal.transaction.TransactionFactory;
22 import org.enhydra.shark.api.internal.usergroup.UserGroupManager;
23 import org.enhydra.shark.api.internal.usertransaction.UserTransactionFactory;
24 import org.enhydra.shark.api.internal.working.CallbackUtilities;
25 import org.enhydra.shark.api.internal.working.ObjectFactory;
26 import org.enhydra.shark.api.internal.working.ToolAgentManager;
27 import org.enhydra.shark.xpdl.XMLInterface;
28 import org.enhydra.shark.xpdl.XMLInterfaceForJDK13;
29
30 /**
31  * This class is internally used to get all shark's managers.
32  * @author Sasa Bojanic, Nenad Stefanovic, Vladimir Puskas
33  */

34 public final class SharkEngineManager {
35    private CallbackUtilities callbackUtilities;
36    private ObjectFactory objectFactory;
37    private ToolAgentManager toolAgentManager;
38    private XMLInterface xmlInterface;
39
40
41    private AssignmentManager assManager;
42    private AuthenticationManager authManager;
43    private CacheMgr cacheManager;
44    private PersistentManagerInterface instancePersistenceMgr;
45    private EventAuditManagerInterface instanceEventAuditMgr;
46    private LimitAgentManager limitAgentManager;
47    private LockMaster lockMaster;
48    private LoggingManager logManager;
49    private RepositoryPersistenceManager repPersistenceMgr;
50    private ScriptingManager scriptingManager;
51    private SecurityManager JavaDoc securityManager;
52    private ToolAgentFactory toolAgentFactory;
53    private TransactionFactory transactionFactory;
54    private UserGroupManager userGroupManager;
55    private UserTransactionFactory userTransactionFactory;
56    private ParticipantMappingManager participantMappings;
57    private ApplicationMappingManager applicationMappings;
58    private ScriptMappingManager scriptMappings;
59    private WfEngineInteroperability wfEngineInteroperabilityMgr;
60
61    // the one and only instance of this class
62
private static SharkEngineManager engineManager;
63
64    static SharkEngineManager getInstance () {
65       if (engineManager==null) {
66          engineManager=new SharkEngineManager();
67       }
68       return engineManager;
69    }
70
71
72    void init (Properties JavaDoc properties) {
73       String JavaDoc cbuClassName = properties.getProperty
74          ("CallbackUtilitiesClassName",
75           "org.enhydra.shark.CallbackUtil");
76
77       String JavaDoc objectFactoryClassName=properties.getProperty
78          ("ObjectFactoryClassName",
79           "org.enhydra.shark.SharkObjectFactory");
80
81       String JavaDoc tamClassName = properties.getProperty
82          ("ToolAgentManagerClassName",
83           "org.enhydra.shark.ToolAgentManagerImpl");
84
85       String JavaDoc amClassName =properties.getProperty
86          ("AssignmentManagerClassName");
87
88       String JavaDoc auClassName =properties.getProperty
89          ("AuthenticationManagerClassName");
90
91       String JavaDoc cmClassName =properties.getProperty
92          ("CacheManagerClassName");
93
94       String JavaDoc persistentManagerClassName=properties.getProperty
95          ("InstancePersistenceManagerClassName");
96
97       String JavaDoc eventauditManagerClassName=properties.getProperty
98          ("EventAuditManagerClassName");
99
100       String JavaDoc lmClassName = properties.getProperty
101          ("LimitAgentManagerClassName");
102
103       String JavaDoc lockMasterClassName=properties.getProperty
104          ("LockMasterClassName");
105
106       String JavaDoc logClassName =properties.getProperty
107          ("LoggingManagerClassName");
108
109       String JavaDoc pmmClassName=properties.getProperty
110          ("ParticipantMapPersistenceManagerClassName");
111
112       String JavaDoc ammClassName=properties.getProperty
113          ("ApplicationMapPersistenceManagerClassName");
114
115       String JavaDoc smmClassName=properties.getProperty
116          ("ScriptMapPersistenceManagerClassName");
117
118       String JavaDoc rpClassName=properties.getProperty
119          ("RepositoryPersistenceManagerClassName");
120
121       String JavaDoc smClassName =properties.getProperty
122          ("ScriptingManagerClassName");
123
124       String JavaDoc seClassName =properties.getProperty
125          ("SecurityManagerClassName");
126
127       String JavaDoc tafClassName=properties.getProperty
128          ("ToolAgentFactoryClassName");
129
130       String JavaDoc tfClassName =properties.getProperty
131          ("TransactionManagerClassName");
132
133       String JavaDoc ugClassName =properties.getProperty
134          ("UserGroupManagerClassName");
135
136       String JavaDoc utfClassName =properties.getProperty
137          ("UserTransactionManagerClassName");
138
139       String JavaDoc wfEIClassName=properties.getProperty
140          ("WfEngineInteroperabilityManagerClassName");
141
142       ClassLoader JavaDoc cl=getClass().getClassLoader();
143
144       try {
145          callbackUtilities=(CallbackUtilities)cl.loadClass(cbuClassName).newInstance();
146          callbackUtilities.setProperties(properties);
147          objectFactory =(ObjectFactory)cl.loadClass(objectFactoryClassName).newInstance();
148          toolAgentManager = (ToolAgentManager) cl.loadClass(tamClassName).newInstance();
149          xmlInterface=new XMLInterfaceForJDK13();
150       } catch (Throwable JavaDoc ex) {
151          String JavaDoc msg="SharkEngineManager -> Problems instantiating core managers - ";
152          if (callbackUtilities==null) {
153             msg+="Can't find CallbackUtilities class '"+cbuClassName+"' in classpath!";
154          } else if (objectFactory==null) {
155             msg+="Can't find ObjectFactory class '"+objectFactoryClassName+"' in classpath!";
156          } else if (toolAgentManager==null) {
157             msg+="Can't find ToolAgentManager class '"+tamClassName+"' in classpath!";
158          } else {
159             msg+="Unknown problem!";
160          }
161          System.err.println(msg);
162          throw new RootError(msg,ex);
163       }
164
165       try {
166          logManager = (LoggingManager)cl.loadClass(logClassName).newInstance();
167          logManager.configure(callbackUtilities);
168          callbackUtilities.info("SharkEngineManager -> Working with '"+cbuClassName+"' implementation of core CallbackUtilities API");
169          callbackUtilities.info("SharkEngineManager -> Working with '"+objectFactoryClassName+"' implementation of core SharkObjectFactory API");
170          callbackUtilities.info("SharkEngineManager -> Working with '"+tamClassName+"' implementation of core ToolAgentManager API");
171          callbackUtilities.info("SharkEngineManager -> Working with '"+logClassName+"' implementation of Logging API");
172       } catch (Exception JavaDoc ex) {
173          boolean throwError=true;
174          String JavaDoc msg="SharkEngineManager -> Can't work - ";
175          if (logClassName==null || logClassName.trim().equals("")) {
176             msg="SharkEngineManager -> Working without Logging API implementation - ";
177             msg+="LoggingManager is not specified.";
178             throwError=false;
179          } else if (logManager==null) {
180             msg+="Can't find LoggingManager class '"+logClassName+"' in classpath!";
181          } else {
182             msg+="Problems while configuring LoggingManager!";
183          }
184          callbackUtilities.info(msg);
185          if (throwError) {
186             throw new RootError(msg,ex);
187          }
188       }
189
190       try {
191          assManager=(AssignmentManager)cl.loadClass(amClassName).newInstance();
192          assManager.configure(callbackUtilities);
193          callbackUtilities.info("SharkEngineManager -> Working with '"+amClassName+"' implementation of Assignment API");
194       } catch (Exception JavaDoc ex) {
195          boolean throwError=true;
196          String JavaDoc msg="SharkEngineManager -> Can't work - ";
197          if (amClassName==null || amClassName.trim().equals("")) {
198             msg="SharkEngineManager -> Working without Assignment API implementation - ";
199             msg+="AssignmentManager is not specified.";
200             throwError=false;
201          } else if (assManager==null) {
202             msg+="Can't find AssignmentManager class '"+amClassName+"' in classpath!";
203          } else {
204             msg+="Problems while configuring AssignmentManager!";
205          }
206          callbackUtilities.info(msg);
207          if (throwError) {
208             throw new RootError(msg,ex);
209          }
210       }
211
212       try {
213          authManager=(AuthenticationManager)cl.loadClass(auClassName).newInstance();
214          authManager.configure(callbackUtilities);
215          callbackUtilities.info("SharkEngineManager -> Working with '"+auClassName+"' implementation of Authentication API");
216       } catch (Exception JavaDoc ex) {
217          boolean throwError=true;
218          String JavaDoc msg="SharkEngineManager -> Can't work - ";
219          if (auClassName==null || auClassName.trim().equals("")) {
220             msg="SharkEngineManager -> Working without Authentication API implementation - ";
221             msg+="AuthenticationManager is not specified.";
222             throwError=false;
223          } else if (authManager==null) {
224             msg+="Can't find AuthenticationManager class '"+auClassName+"' in classpath!";
225          } else {
226             msg+="Problems while configuring AuthenticationManager!";
227          }
228          callbackUtilities.info(msg);
229          if (throwError) {
230             throw new RootError(msg,ex);
231          }
232       }
233
234       try {
235          cacheManager=(CacheMgr)cl.loadClass(cmClassName).newInstance();
236          cacheManager.configure(callbackUtilities);
237          callbackUtilities.info("SharkEngineManager -> Working with '"+cmClassName+"' implementation of Caching API");
238       } catch (Exception JavaDoc ex) {
239          boolean throwError=true;
240          String JavaDoc msg="SharkEngineManager -> Can't work - ";
241          if (cmClassName==null || cmClassName.trim().equals("")) {
242             msg="SharkEngineManager -> Working without Caching API implementation - ";
243             msg+="CacheManager is not specified.";
244             throwError=false;
245          } else if (cacheManager==null) {
246             msg+="Can't find CacheManager class '"+cmClassName+"' in classpath!";
247          } else {
248             msg+="Problems while configuring CacheManager!";
249          }
250          callbackUtilities.info(msg);
251          if (throwError) {
252             throw new RootError(msg,ex);
253          }
254       }
255
256       try {
257          instancePersistenceMgr=(PersistentManagerInterface)cl.loadClass(persistentManagerClassName).newInstance();
258          instancePersistenceMgr.configure(callbackUtilities);
259          callbackUtilities.info("SharkEngineManager -> Working with '"+persistentManagerClassName+"' implementation of InstancePersistence API");
260       } catch (Exception JavaDoc ex) {
261          boolean throwError=true;
262          String JavaDoc msg="SharkEngineManager -> Can not work - ";
263          if (persistentManagerClassName==null || persistentManagerClassName.trim().equals("")) {
264             msg+="InstancePersistenceManager is not specified.";
265          } else if (instancePersistenceMgr==null) {
266             msg+="Can't find InstancePersistenceManager class '"+persistentManagerClassName+"' in classpath";
267          } else {
268             msg+="Problems while configuring InstancePersistenceManager!";
269          }
270          callbackUtilities.error(msg,ex.getMessage());
271          throw new RootError(msg,ex);
272       }
273
274       try {
275          instanceEventAuditMgr=(EventAuditManagerInterface)cl.loadClass(eventauditManagerClassName).newInstance();
276          instanceEventAuditMgr.configure(callbackUtilities);
277          callbackUtilities.info("SharkEngineManager -> Working with '"+eventauditManagerClassName+"' implementation of EventAudit API");
278       } catch (Exception JavaDoc ex) {
279          boolean throwError=true;
280          String JavaDoc msg="SharkEngineManager -> Can't work - ";
281          if (eventauditManagerClassName==null || eventauditManagerClassName.trim().equals("")) {
282             msg="SharkEngineManager -> Working without EventAudit API implementation - ";
283             msg+="EventAuditManager is not specified.";
284             throwError=false;
285          } else if (instanceEventAuditMgr==null) {
286             msg+="Can't find EventAuditManager class '"+eventauditManagerClassName+"' in classpath!";
287          } else {
288             msg+="Problems while configuring EventAuditManager!";
289          }
290          callbackUtilities.info(msg);
291          if (throwError) {
292             throw new RootError(msg,ex);
293          }
294       }
295
296       try {
297          limitAgentManager=(LimitAgentManager)cl.loadClass(lmClassName).newInstance();
298          limitAgentManager.configure(callbackUtilities);
299          callbackUtilities.info("SharkEngineManager -> Working with '"+lmClassName+"' implementation of Limit API");
300       } catch (Exception JavaDoc ex) {
301          boolean throwError=true;
302          String JavaDoc msg="SharkEngineManager -> Can't work - ";
303          if (lmClassName==null || lmClassName.trim().equals("")) {
304             msg="SharkEngineManager -> Working without Limit API implementation - ";
305             msg+="LimitAgentManager is not specified.";
306             throwError=false;
307          } else if (limitAgentManager==null) {
308             msg+="Can't find LimitAgentManager class '"+lmClassName+"' in classpath!";
309          } else {
310             msg+="Problems while configuring LimitAgentManager!";
311          }
312          callbackUtilities.info(msg);
313          if (throwError) {
314             throw new RootError(msg,ex);
315          }
316       }
317
318       try {
319          lockMaster = (LockMaster)cl.loadClass(lockMasterClassName).newInstance();
320          lockMaster.configure(callbackUtilities);
321          callbackUtilities.info("SharkEngineManager -> Working with '"+lockMasterClassName+"' implementation of ProcessLocking API");
322       } catch (Exception JavaDoc ex) {
323          boolean throwError=true;
324          String JavaDoc msg="SharkEngineManager -> Can't work - ";
325          if (lockMasterClassName==null || lockMasterClassName.trim().equals("")) {
326             msg="SharkEngineManager -> Working without ProcessLocking API implementation - ";
327             msg+="LockMaster is not specified.";
328             throwError=false;
329          } else if (lockMaster==null) {
330             msg+="Can't find LockMaster class '"+lockMasterClassName+"' in classpath!";
331          } else {
332             msg+="Problems while configuring LockMaster!";
333          }
334          callbackUtilities.info(msg);
335          if (throwError) {
336             throw new RootError(msg,ex);
337          }
338       }
339
340       try {
341          participantMappings =(ParticipantMappingManager)cl.loadClass(pmmClassName).newInstance();
342          participantMappings.configure(callbackUtilities);
343          callbackUtilities.info("SharkEngineManager -> Working with '"+pmmClassName+"' implementation of ParticipantMapPersistence API");
344       } catch (Exception JavaDoc ex) {
345          boolean throwError=true;
346          String JavaDoc msg="SharkEngineManager -> Can't work - ";
347          if (pmmClassName==null || pmmClassName.trim().equals("")) {
348             msg="SharkEngineManager -> Working without ParticipantMapPersistence API implementation - ";
349             msg+="ParticipantMapPersistenceManager is not specified.";
350             throwError=false;
351          } else if (participantMappings==null) {
352             msg+="Can't find ParticipantMapPersistenceManager class '"+pmmClassName+"' in classpath!";
353          } else {
354             msg+="Problems while configuring ParticipantMapPersistenceManager!";
355          }
356          callbackUtilities.info(msg);
357          if (throwError) {
358             throw new RootError(msg,ex);
359          }
360       }
361
362       try {
363          applicationMappings=(ApplicationMappingManager)cl.loadClass(ammClassName).newInstance();
364          applicationMappings.configure(callbackUtilities);
365          callbackUtilities.info("SharkEngineManager -> Working with '"+ammClassName+"' implementation of ApplicationMapPersistence API");
366       } catch (Exception JavaDoc ex) {
367          boolean throwError=true;
368          String JavaDoc msg="SharkEngineManager -> Can't work - ";
369          if (ammClassName==null || ammClassName.trim().equals("")) {
370             msg="SharkEngineManager -> Working without ApplicationMapPersistence API implementation - ";
371             msg+="ApplicationMapPersistenceManager is not specified.";
372             throwError=false;
373          } else if (applicationMappings==null) {
374             msg+="Can't find ApplicationMapPersistenceManager class '"+ammClassName+"' in classpath!";
375          } else {
376             msg+="Problems while configuring ApplicationMapPersistenceManager!";
377          }
378          callbackUtilities.info(msg);
379          if (throwError) {
380             throw new RootError(msg,ex);
381          }
382       }
383
384       try {
385          scriptMappings=(ScriptMappingManager)cl.loadClass(smmClassName).newInstance();
386          scriptMappings.configure(callbackUtilities);
387          callbackUtilities.info("SharkEngineManager -> Working with '"+smmClassName+"' implementation of ScriptMapPersistence API");
388       } catch (Exception JavaDoc ex) {
389          boolean throwError=false;
390          //String msg="SharkEngineManager -> Can't work - ";
391
String JavaDoc msg="SharkEngineManager -> ";
392          if (smmClassName==null || smmClassName.trim().equals("")) {
393             msg="SharkEngineManager -> Working without ScriptMapPersistence API implementation - ";
394             msg+="ScriptMapPersistenceManager is not specified.";
395             throwError=false;
396          } else if (scriptMappings==null) {
397             msg+="Can't find ScriptMapPersistenceManager class '"+smmClassName+"' in classpath!";
398          } else {
399             msg+="Problems while configuring ScriptMapPersistenceManager!";
400          }
401          callbackUtilities.info(msg);
402          if (throwError) {
403             throw new RootError(msg,ex);
404          }
405       }
406
407       try {
408          repPersistenceMgr =(RepositoryPersistenceManager)cl.loadClass(rpClassName).newInstance();
409          repPersistenceMgr.configure(callbackUtilities);
410          callbackUtilities.info("SharkEngineManager -> Working with '"+rpClassName+"' implementation of RepositoryPersistence API");
411       } catch (Exception JavaDoc ex) {
412          boolean throwError=true;
413          String JavaDoc msg="SharkEngineManager -> Can not work - ";
414          if (rpClassName==null || rpClassName.trim().equals("")) {
415             msg+="RepositoryPersistenceManager is not specified.";
416          } else if (repPersistenceMgr==null) {
417             msg+="Can't find RepositoryPersistenceManager class '"+rpClassName+"' in classpath";
418          } else {
419             msg+="Problems while configuring RepositoryPersistenceManager!";
420          }
421          callbackUtilities.error(msg,ex.getMessage());
422          throw new RootError(msg,ex);
423       }
424
425       try {
426          scriptingManager=(ScriptingManager)cl.loadClass(smClassName).newInstance();
427          scriptingManager.configure(callbackUtilities);
428          callbackUtilities.info("SharkEngineManager -> Working with '"+smClassName+"' implementation of Scripting API");
429       } catch (Exception JavaDoc ex) {
430          boolean throwError=true;
431          String JavaDoc msg="SharkEngineManager -> Can not work - ";
432          if (smClassName==null || smClassName.trim().equals("")) {
433             msg+="ScriptingManager is not specified.";
434          } else if (scriptingManager==null) {
435             msg+="Can't find ScriptingManager class '"+smClassName+"' in classpath";
436          } else {
437             msg+="Problems while configuring ScriptingManager!";
438          }
439          callbackUtilities.error(msg,ex.getMessage());
440          throw new RootError(msg,ex);
441       }
442
443       try {
444          securityManager=(SecurityManager JavaDoc)cl.loadClass(seClassName).newInstance();
445          securityManager.configure(callbackUtilities);
446          callbackUtilities.info("SharkEngineManager -> Working with '"+seClassName+"' implementation of Security API");
447       } catch (Exception JavaDoc ex) {
448          boolean throwError=true;
449          String JavaDoc msg="SharkEngineManager -> Can't work - ";
450          if (seClassName==null || seClassName.trim().equals("")) {
451             msg="SharkEngineManager -> Working without Security API implementation - ";
452             msg+="SecurityManager is not specified.";
453             throwError=false;
454          } else if (securityManager==null) {
455             msg+="Can't find SecurityManager class '"+seClassName+"' in classpath!";
456          } else {
457             msg+="Problems while configuring SecurityManager!";
458          }
459          callbackUtilities.info(msg);
460          if (throwError) {
461             throw new RootError(msg,ex);
462          }
463       }
464
465       try {
466          toolAgentFactory=(ToolAgentFactory)cl.loadClass(tafClassName).newInstance();
467          toolAgentFactory.configure(callbackUtilities);
468          callbackUtilities.info("SharkEngineManager -> Working with '"+tafClassName+"' implementation of ToolAgent API");
469       } catch (Exception JavaDoc ex) {
470          boolean throwError=true;
471          String JavaDoc msg="SharkEngineManager -> Can't work - ";
472          if (tafClassName==null || tafClassName.trim().equals("")) {
473             msg="SharkEngineManager -> Working without ToolAgent API implementation - ";
474             msg+="ToolAgentFactory is not specified.";
475             throwError=false;
476          } else if (toolAgentFactory==null) {
477             msg+="Can't find ToolAgentFactory class '"+tafClassName+"' in classpath!";
478          } else {
479             msg+="Problems while configuring ToolAgentFactory!";
480          }
481          callbackUtilities.info(msg);
482          if (throwError) {
483             throw new RootError(msg,ex);
484          }
485       }
486
487       try {
488          transactionFactory=(TransactionFactory)cl.loadClass(tfClassName).newInstance();
489          transactionFactory.configure(callbackUtilities);
490          callbackUtilities.info("SharkEngineManager -> Working with '"+tfClassName+"' implementation of Transaction API");
491       } catch (Exception JavaDoc ex) {
492          boolean throwError=true;
493          String JavaDoc msg="SharkEngineManager -> Can't work - ";
494          if (tfClassName==null || tfClassName.trim().equals("")) {
495             msg="SharkEngineManager -> Working without Transaction API implementation - ";
496             msg+="TransactionManager is not specified.";
497             throwError=false;
498          } else if (transactionFactory==null) {
499             msg+="Can't find TransactionManager class '"+tfClassName+"' in classpath!";
500          } else {
501             msg+="Problems while configuring TransactionManager!";
502          }
503          callbackUtilities.info(msg);
504          if (throwError) {
505             throw new RootError(msg,ex);
506          }
507       }
508
509       try {
510          userGroupManager=(UserGroupManager)cl.loadClass(ugClassName).newInstance();
511          userGroupManager.configure(callbackUtilities);
512          callbackUtilities.info("SharkEngineManager -> Working with '"+ugClassName+"' implementation of UserGroup API");
513       } catch (Exception JavaDoc ex) {
514          boolean throwError=true;
515          String JavaDoc msg="SharkEngineManager -> Can't work - ";
516          if (ugClassName==null || ugClassName.trim().equals("")) {
517             msg="SharkEngineManager -> Working without UserGroup API implementation - ";
518             msg+="UserGroupManager is not specified.";
519             throwError=false;
520          } else if (userGroupManager==null) {
521             msg+="Can't find UserGroupManager class '"+ugClassName+"' in classpath!";
522          } else {
523             msg+="Problems while configuring UserGroupManager!";
524          }
525          callbackUtilities.info(msg);
526          if (throwError) {
527             throw new RootError(msg,ex);
528          }
529       }
530
531       try {
532          userTransactionFactory=(UserTransactionFactory)cl.loadClass(utfClassName).newInstance();
533          userTransactionFactory.configure(callbackUtilities);
534          callbackUtilities.info("SharkEngineManager -> Working with '"+utfClassName+"' implementation of UserTransaction API");
535       } catch (Exception JavaDoc ex) {
536          boolean throwError=true;
537          String JavaDoc msg="SharkEngineManager -> Can't work - ";
538          if (utfClassName==null || utfClassName.trim().equals("")) {
539             msg="SharkEngineManager -> Working without UserTransaction API implementation - ";
540             msg+="UserTransactionManager is not specified.";
541             throwError=false;
542          } else if (userTransactionFactory==null) {
543             msg+="Can't find UserTransactionManager class '"+utfClassName+"' in classpath!";
544          } else {
545             msg+="Problems while configuring UserTransactionManager!";
546          }
547          callbackUtilities.info(msg);
548          if (throwError) {
549             throw new RootError(msg,ex);
550          }
551       }
552
553       try {
554          wfEngineInteroperabilityMgr=(WfEngineInteroperability)cl.loadClass(wfEIClassName).newInstance();
555          wfEngineInteroperabilityMgr.configure(callbackUtilities);
556          callbackUtilities.info("SharkEngineManager -> Working with '"+wfEIClassName+"' implementation of WfEngineInteroperability API");
557       } catch (Exception JavaDoc ex) {
558          boolean throwError=true;
559          String JavaDoc msg="SharkEngineManager -> Can't work - ";
560          if (wfEIClassName==null || wfEIClassName.trim().equals("")) {
561             msg="SharkEngineManager -> Working without wfEngineInteroperability API implementation - ";
562             msg+="WfEngineInteroperability implementation is not specified.";
563             throwError=false;
564          } else if (wfEngineInteroperabilityMgr==null) {
565             msg+="Can't find WfEngineInteroperability class '"+wfEIClassName+"' in classpath!";
566          } else {
567             msg+="Problems while configuring wfEngineInteroperability implementation "+wfEIClassName+"!";
568          }
569          callbackUtilities.info(msg);
570          if (throwError) {
571             throw new RootError(msg,ex);
572          }
573       }
574
575    }
576
577    CallbackUtilities getCallbackUtilities () {
578       return callbackUtilities;
579    }
580
581    ObjectFactory getObjectFactory () {
582       return objectFactory;
583    }
584
585    ToolAgentManager getToolAgentManager () {
586       return toolAgentManager;
587    }
588
589    XMLInterface getXMLInterface () {
590       return xmlInterface;
591    }
592
593
594
595    AssignmentManager getAssignmentManager(){
596       return assManager;
597    }
598
599    AuthenticationManager getAuthenticationManager(){
600       return authManager;
601    }
602
603    CacheMgr getCacheManager () {
604       return cacheManager;
605    }
606
607    PersistentManagerInterface getInstancePersistenceManager() {
608       return instancePersistenceMgr;
609    }
610
611    EventAuditManagerInterface getEventAuditManager() {
612       return instanceEventAuditMgr;
613    }
614
615    LimitAgentManager getLimitAgentManager () {
616       return limitAgentManager;
617    }
618
619    LockMaster getLockMaster() {
620       return lockMaster;
621    }
622
623    ParticipantMappingManager getParticipantMapPersistenceManager(){
624       return participantMappings;
625    }
626
627    ApplicationMappingManager getApplicationMapPersistenceManager(){
628       return applicationMappings;
629    }
630
631    ScriptMappingManager getScriptMapPersistenceManager(){
632       return scriptMappings;
633    }
634
635    RepositoryPersistenceManager getRepositoryPersistenceManager(){
636       return repPersistenceMgr;
637    }
638
639    ScriptingManager getScriptingManager () {
640       return scriptingManager;
641    }
642
643    SecurityManager JavaDoc getSecurityManager(){
644       return securityManager;
645    }
646
647    ToolAgentFactory getToolAgentFactory() {
648       return toolAgentFactory;
649    }
650
651    TransactionFactory getTransactionFactory() {
652       return transactionFactory;
653    }
654
655    UserGroupManager getUserGroupManager(){
656       return userGroupManager;
657    }
658
659    UserTransactionFactory getUserTransactionFactory() {
660       return userTransactionFactory;
661    }
662
663    LoggingManager getLoggingManager(){
664       return logManager;
665    }
666
667    WfEngineInteroperability getWfEngineInteroperabilityMgr () {
668       return wfEngineInteroperabilityMgr;
669    }
670
671 }
672
Popular Tags