[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model SurfaceFacade.java,1.7,1.8
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-09-20 12:38:22
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8675 Modified Files: SurfaceFacade.java Log Message: removed 50millis sleep and now makes sure to remove surface from its front and back domain when removed Index: SurfaceFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/SurfaceFacade.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SurfaceFacade.java 13 Sep 2005 17:28:48 -0000 1.7 --- SurfaceFacade.java 20 Sep 2005 12:38:11 -0000 1.8 *************** *** 57,69 **** Transaction tx = session.beginTransaction(); - session.save(s); tx.commit(); ! ! //a sleep here seems to help making everything not crash(as badly) ! //not sure why though, someone should find out! ! Thread.sleep(50); ! Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); Notifier.getInstance().sendNotification(n); --- 57,64 ---- Transaction tx = session.beginTransaction(); session.save(s); tx.commit(); ! Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); Notifier.getInstance().sendNotification(n); *************** *** 108,126 **** //from any domain to which it belongs. ! //This breaks the decoupling and should be changed! ! Set fsSet = FunctionalSpaceFacade.getInstance().findBySurface(s); ! Iterator fsIt = fsSet.iterator(); ! while (fsIt.hasNext()) { ! FunctionalSpace fs = (FunctionalSpace)fsIt.next(); ! fs.removeSurface(s); ! FunctionalSpaceFacade.getInstance().update(fs); } ! ! Set csSet = ConstructionSpaceFacade.getInstance().findBySurface(s); ! Iterator csIt = csSet.iterator(); ! while (csIt.hasNext()) { ! ConstructionSpace cs = (ConstructionSpace)csIt.next(); ! cs.removeSurface(s); ! ConstructionSpaceFacade.getInstance().update(cs); } --- 103,113 ---- //from any domain to which it belongs. ! Domain back = s.getBackDomain(); ! if (back != null) { ! back.removeSurface(s); } ! Domain front = s.getFrontDomain(); ! if (front != null) { ! front.removeSurface(s); } |