summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2013-08-30 14:38:48 +0300
committerLeif Åstrand <leif@vaadin.com>2013-08-30 14:38:48 +0300
commitd8b0b504894255543e68f074b30051a91f8a1154 (patch)
treea2ce2afbd4d8eceb660903537ef81095ce16f02e /server
parentad669c39c603650cc8193eef83fe1b6a39be0e45 (diff)
downloadvaadin-framework-d8b0b504894255543e68f074b30051a91f8a1154.tar.gz
vaadin-framework-d8b0b504894255543e68f074b30051a91f8a1154.zip
Always unlock the same session instance that was locked (#12481)
Change-Id: I15ff1177d827bc8fee9f8f723f9a288b0c3aea71
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/server/AbstractClientConnector.java5
-rw-r--r--server/src/com/vaadin/server/FileDownloader.java6
-rw-r--r--server/src/com/vaadin/ui/AbstractMedia.java6
3 files changed, 11 insertions, 6 deletions
diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java
index 91a9e41522..a73ca3d985 100644
--- a/server/src/com/vaadin/server/AbstractClientConnector.java
+++ b/server/src/com/vaadin/server/AbstractClientConnector.java
@@ -625,7 +625,8 @@ public abstract class AbstractClientConnector implements ClientConnector,
String[] parts = path.split("/", 2);
String key = parts[0];
- getSession().lock();
+ VaadinSession session = getSession();
+ session.lock();
try {
ConnectorResource resource = (ConnectorResource) getResource(key);
if (resource == null) {
@@ -633,7 +634,7 @@ public abstract class AbstractClientConnector implements ClientConnector,
}
stream = resource.getStream();
} finally {
- getSession().unlock();
+ session.unlock();
}
stream.writeResponse(request, response);
return true;
diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java
index 9b49ad8edd..bd7d9caafd 100644
--- a/server/src/com/vaadin/server/FileDownloader.java
+++ b/server/src/com/vaadin/server/FileDownloader.java
@@ -129,7 +129,9 @@ public class FileDownloader extends AbstractExtension {
// Ignore if it isn't for us
return false;
}
- getSession().lock();
+ VaadinSession session = getSession();
+
+ session.lock();
DownloadStream stream;
try {
@@ -151,7 +153,7 @@ public class FileDownloader extends AbstractExtension {
stream.setContentType("application/octet-stream;charset=UTF-8");
}
} finally {
- getSession().unlock();
+ session.unlock();
}
stream.writeResponse(request, response);
return true;
diff --git a/server/src/com/vaadin/ui/AbstractMedia.java b/server/src/com/vaadin/ui/AbstractMedia.java
index 97947b568d..d7d593c29e 100644
--- a/server/src/com/vaadin/ui/AbstractMedia.java
+++ b/server/src/com/vaadin/ui/AbstractMedia.java
@@ -30,6 +30,7 @@ import com.vaadin.server.Resource;
import com.vaadin.server.ResourceReference;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinResponse;
+import com.vaadin.server.VaadinSession;
import com.vaadin.shared.communication.URLReference;
import com.vaadin.shared.ui.AbstractMediaState;
import com.vaadin.shared.ui.MediaControl;
@@ -90,7 +91,8 @@ public abstract class AbstractMedia extends AbstractComponent {
DownloadStream stream;
- getSession().lock();
+ VaadinSession session = getSession();
+ session.lock();
try {
List<URLReference> sources = getState().sources;
@@ -108,7 +110,7 @@ public abstract class AbstractMedia extends AbstractComponent {
.getResource(reference);
stream = resource.getStream();
} finally {
- getSession().unlock();
+ session.unlock();
}
stream.writeResponse(request, response);