- Timestamp:
- 07/05/08 22:16:06 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/blitz/src/ome/services/blitz/impl/ServiceFactoryI.java
r2596 r2597 21 21 import ome.api.JobHandle; 22 22 import ome.api.ServiceInterface; 23 import ome.conditions.InternalException;24 23 import ome.logic.HardWiredInterceptor; 25 24 import ome.services.blitz.fire.AopContextInitializer; … … 516 515 517 516 } 517 518 // All resources cleaned up or not based on the reference count. 519 // Now we can remove the current session. If an exception if thrown, 520 // there's not much we can do. 521 try { 522 current.adapter.remove(sessionId(principal.getName())); 523 } catch (Throwable t) { 524 // FIXME 525 log.error("Possible memory leak: can't remove service factory", t); 526 } 527 518 528 } 519 529 520 530 /** 521 * Performs the actual cleanup operation. Since {@link #destroy()} is called 522 * non-discriminantly by the router, even when a client has just died, we 523 * have this internal method for handling the actual closing of resources. 531 * Performs the actual cleanup operation on all the resources shared between 532 * this and other {@link ServiceFactoryI} instances in the same 533 * {@link Session}. Since {@link #destroy()} is called regardless by the 534 * router, even when a client has just died, we have this internal method 535 * for handling the actual closing of resources. 524 536 */ 525 537 public void doDestroy(Ice.ObjectAdapter adapter) { … … 534 546 Set<String> ipIds = interactiveSlots.keySet(); 535 547 for (String id : ipIds) { 536 InteractiveProcessorI ip = (InteractiveProcessorI) interactiveSlots 537 .get(id); 538 ip.stop(); 539 adapter.remove(Ice.Util.stringToIdentity(id)); 540 interactiveSlots.remove(id); 548 InteractiveProcessorI ip = null; 549 try { 550 ip = (InteractiveProcessorI) interactiveSlots.get(id); 551 ip.stop(); 552 } catch (Exception e) { 553 log.error("Error stopping interactive processor: " + ip); 554 } finally { 555 adapter.remove(Ice.Util.stringToIdentity(id)); 556 interactiveSlots.remove(id); 557 } 541 558 } 542 559 … … 568 585 } 569 586 570 // All resources cleaned up to the best of our ability,571 // now we can remove the current session. If an exception if thrown,572 // there's not much we can do.573 try {574 adapter.remove(sessionId(principal.getName()));575 } catch (Throwable t) {576 // FIXME577 InternalException ie = new InternalException(t.getMessage());578 ie.setStackTrace(t.getStackTrace());579 }580 587 } 581 588 … … 710 717 if (null == already) { 711 718 current.adapter.add(servant, id); 719 if (log.isInfoEnabled()) { 720 log.info("Created servant:" + servantString(id, servant)); 721 } 712 722 } else { 713 723 current.adapter.remove(id); 714 724 current.adapter.add(servant, id); 715 } 716 if (log.isInfoEnabled()) { 717 log.info("Created servant:" + servantString(id, servant)); 725 if (already.hashCode() != servant.hashCode()) { 726 log.info(String.format("Replacing %s with %s", 727 servantString(id, already), servantString(id, 728 servant))); 729 } 718 730 } 719 731 } catch (Exception e) {
