|
From: <pka...@us...> - 2009-08-02 18:02:50
|
Revision: 425
http://cse-ip.svn.sourceforge.net/cse-ip/?rev=425&view=rev
Author: pkasprzak
Date: 2009-08-02 18:02:13 +0000 (Sun, 02 Aug 2009)
Log Message:
-----------
* DependencyManager wsdl adaptations
Modified Paths:
--------------
trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/DependencyManagerImpl.java
Modified: trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/DependencyManagerImpl.java
===================================================================
--- trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/DependencyManagerImpl.java 2009-08-02 17:59:32 UTC (rev 424)
+++ trunk/sandbox/lsf-adapter-demo/CSECore-ejb/src/java/de/campussource/cse/core/DependencyManagerImpl.java 2009-08-02 18:02:13 UTC (rev 425)
@@ -7,15 +7,17 @@
import de.campussource.cse.core.pdm.Relation;
import de.campussource.cse.core.pdm.RelationType;
import de.campussource.cse.core.pdm.WaitingProcess;
-import de.campussource.cse.ejb.dependencymanager.DependencyManagerNotificationService;
+
+import de.campussource.cse.ejb.dependencymanager.DependencyManagerAccountNotificationService;
+import de.campussource.cse.ejb.dependencymanager.DependencyManagerCategoryNotificationService;
+import de.campussource.cse.ejb.dependencymanager.DependencyManagerCourseNotificationService;
+
import java.util.HashSet;
import java.util.List;
import java.util.logging.Logger;
-import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.ejb.EJB;
import javax.ejb.EJBContext;
-import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
import javax.ejb.Timer;
@@ -30,8 +32,14 @@
public class DependencyManagerImpl implements DependencyManagerRemote, DependencyManager {
@WebServiceRef(wsdlLocation = "META-INF/wsdl/client/DependencyManager/DependencyManager.wsdl")
- private DependencyManagerNotificationService service;
+ private DependencyManagerAccountNotificationService accountService;
+ @WebServiceRef(wsdlLocation = "META-INF/wsdl/client/DependencyManager/DependencyManager.wsdl")
+ private DependencyManagerCategoryNotificationService categoryService;
+
+ @WebServiceRef(wsdlLocation = "META-INF/wsdl/client/DependencyManager/DependencyManager.wsdl")
+ private DependencyManagerCourseNotificationService courseService;
+
@Resource
private EJBContext ctx;
@@ -195,19 +203,30 @@
// ----------------------------------------------------------------------------------------------------------------
protected void wakeUpWaitingProcess(WaitingProcess process) {
- /* Call process */
+
+ Entity entity = em.find(Entity.class, process.getEntityId());
+
+ int entityId = process.getEntityId();
+ String system = process.getSystem();
+
try {
- de.campussource.cse.ejb.dependencymanager.DependencyManagerNotification port = service.getDependencyManagerNotificationPort();
-
- int entityId = process.getEntityId();
- String system = process.getSystem();
+ if (entity.getType().equals(EntityType.COURSE.toString())) {
+ de.campussource.cse.ejb.dependencymanager.DependencyManagerCourseNotification port = courseService.getDependencyManagerCourseNotificationPort();
+ port.notify(entityId, system);
+ }
- logger.info("*** Waking up process (" + system + ": " + entityId + ")");
+ if (entity.getType().equals(EntityType.CATEGORY.toString())) {
+ de.campussource.cse.ejb.dependencymanager.DependencyManagerCategoryNotification port = categoryService.getDependencyManagerCategoryNotificationPort();
+ port.notify(entityId, system);
- port.notify(entityId, system);
+ }
+ if (entity.getType().equals(EntityType.ACCOUNT.toString())) {
+ de.campussource.cse.ejb.dependencymanager.DependencyManagerAccountNotification port = accountService.getDependencyManagerAccountNotificationPort();
+ port.notify(entityId, system);
+ }
} catch (Exception ex) {
- logger.severe("*** Exception while notifying process: " + ex.getMessage());
+ logger.severe("*** Exception while notifying process [" + entity.getType() + ": " + entity.getId() + "]: " + ex.getMessage());
}
/* Remove dependencies */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|