[libbluray-devel] org.dvb.event.EventManager: catch exceptions when calling ResourceClient.requestRelease()

hpi1 git at videolan.org
Sat Dec 21 08:52:26 CET 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Dec 19 10:57:54 2013 +0200| [33fadfde0c481c88fd1575ee3ee0e31ffc86e993] | committer: hpi1

org.dvb.event.EventManager: catch exceptions when calling ResourceClient.requestRelease()

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=33fadfde0c481c88fd1575ee3ee0e31ffc86e993
---

 .../bdj/java/org/dvb/event/EventManager.java       |   20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/libbluray/bdj/java/org/dvb/event/EventManager.java b/src/libbluray/bdj/java/org/dvb/event/EventManager.java
index f5d8fcc..36fde6f 100644
--- a/src/libbluray/bdj/java/org/dvb/event/EventManager.java
+++ b/src/libbluray/bdj/java/org/dvb/event/EventManager.java
@@ -189,8 +189,14 @@ public class EventManager implements ResourceServer {
                 if (item.context == context)
                     continue;
                 if (hasOverlap(userEvents, item.userEvents)) {
-                    if (!item.client.requestRelease(item.userEvents, null))
+                    try {
+                        if (!item.client.requestRelease(item.userEvents, null))
+                            return false;
+                    } catch (Exception e) {
+                        logger.error("requestRelease() failed: " + e.getClass());
+                        logger.info("" + e.getStackTrace());
                         return false;
+                    }
                     sendResourceStatusEvent(new UserEventAvailableEvent(item.userEvents));
                     it.remove();
                 }
@@ -200,8 +206,14 @@ public class EventManager implements ResourceServer {
             if (item.context == context)
                 continue;
             if (hasOverlap(userEvents, item.userEvents)) {
-                if (!item.client.requestRelease(item.userEvents, null))
+                try {
+                    if (!item.client.requestRelease(item.userEvents, null))
+                        return false;
+                } catch (Exception e) {
+                    logger.error("requestRelease() failed: " + e.getClass());
+                    logger.info("" + e.getStackTrace());
                     return false;
+                }
                 sendResourceStatusEvent(new UserEventAvailableEvent(item.userEvents));
                 it.remove();
             }
@@ -231,7 +243,7 @@ public class EventManager implements ResourceServer {
             this.client = client;
             this.userEvents = userEvents.getNewInstance();
             if (context == null) {
-                Logger.getLogger(EventManager.class.getName()).error("Missing xlet context: " + Logger.dumpStack());
+                logger.error("Missing xlet context: " + Logger.dumpStack());
             }
         }
 
@@ -261,4 +273,6 @@ public class EventManager implements ResourceServer {
     private LinkedList resourceStatusEventListeners = new LinkedList();
 
     private static EventManager instance = null;
+
+    private static final Logger logger = Logger.getLogger(EventManager.class.getName());
 }



More information about the libbluray-devel mailing list