aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-09-10 12:02:14 +0300
committerLeif Åstrand <leif@vaadin.com>2012-09-10 12:02:50 +0300
commitdef6b2fee7f8922e73858b15c956c11276adf176 (patch)
treebfb18caac9a421a67f37d9985120127d4c25d2a6 /server/src/com
parent88f77a4e7c1b6e0a92a58c9d9bd175120684ef2f (diff)
downloadvaadin-framework-def6b2fee7f8922e73858b15c956c11276adf176.tar.gz
vaadin-framework-def6b2fee7f8922e73858b15c956c11276adf176.zip
Revert "Verify that lock is held when accessing state (#9515)"
This reverts commit 998c9c97b4b7d9531028b442df4c38a33b60e5f0.
Diffstat (limited to 'server/src/com')
-rw-r--r--server/src/com/vaadin/server/AbstractClientConnector.java2
-rw-r--r--server/src/com/vaadin/server/VaadinSession.java11
-rw-r--r--server/src/com/vaadin/ui/ConnectorTracker.java3
3 files changed, 3 insertions, 13 deletions
diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java
index 2fb468bd1c..4c22a96782 100644
--- a/server/src/com/vaadin/server/AbstractClientConnector.java
+++ b/server/src/com/vaadin/server/AbstractClientConnector.java
@@ -146,8 +146,6 @@ public abstract class AbstractClientConnector implements ClientConnector {
}
protected SharedState getState() {
- assert getSession() == null
- || getSession().getLock().isHeldByCurrentThread() : VaadinSession.SESSION_LOCK_MESSAGE;
if (null == sharedState) {
sharedState = createState();
}
diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java
index 03e6420008..a91c011ddf 100644
--- a/server/src/com/vaadin/server/VaadinSession.java
+++ b/server/src/com/vaadin/server/VaadinSession.java
@@ -28,6 +28,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.logging.Logger;
@@ -70,8 +71,6 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
*/
public static final String UI_PARAMETER = "UI";
- public static final String SESSION_LOCK_MESSAGE = "You are accessing UI state without proper synchronization!";
-
private static final Method BOOTSTRAP_FRAGMENT_METHOD = ReflectTools
.findMethod(BootstrapListener.class, "modifyBootstrapFragment",
BootstrapFragmentResponse.class);
@@ -79,7 +78,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
.findMethod(BootstrapListener.class, "modifyBootstrapPage",
BootstrapPageResponse.class);
- private final ReentrantLock lock = new ReentrantLock();
+ private final Lock lock = new ReentrantLock();
/**
* An event sent to {@link #start(SessionStartEvent)} when a new Application
@@ -207,10 +206,6 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
private final Map<String, Object> attributes = new HashMap<String, Object>();
- public VaadinSession() {
- // TODO Auto-generated constructor stub
- }
-
/**
* @see javax.servlet.http.HttpSessionBindingListener#valueBound(HttpSessionBindingEvent)
*/
@@ -1309,7 +1304,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
*
* @return the lock that should be used for synchronization
*/
- public ReentrantLock getLock() {
+ public Lock getLock() {
return lock;
}
diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java
index dbada63a47..d454df98ee 100644
--- a/server/src/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/com/vaadin/ui/ConnectorTracker.java
@@ -29,7 +29,6 @@ import com.vaadin.server.AbstractClientConnector;
import com.vaadin.server.AbstractCommunicationManager;
import com.vaadin.server.ClientConnector;
import com.vaadin.server.GlobalResourceHandler;
-import com.vaadin.server.VaadinSession;
/**
* A class which takes care of book keeping of {@link ClientConnector}s for a
@@ -287,8 +286,6 @@ public class ConnectorTracker implements Serializable {
* The connector that should be marked clean.
*/
public void markDirty(ClientConnector connector) {
- assert uI.getSession() == null
- || uI.getSession().getLock().isHeldByCurrentThread() : VaadinSession.SESSION_LOCK_MESSAGE;
if (isWritingResponse()) {
throw new IllegalStateException(
"A connector should not be marked as dirty while a response is being written.");