aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-13 13:37:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-13 13:37:44 +1300
commitf49790953e6f9c3f9aa88564caf72a3bf002a801 (patch)
tree17911c5f7546379b841c00f0119b140514f5862f /src/org/traccar/web
parent74c93c7cef8fe3ef53ba17b3c9da7b374003d042 (diff)
downloadtraccar-server-f49790953e6f9c3f9aa88564caf72a3bf002a801.tar.gz
traccar-server-f49790953e6f9c3f9aa88564caf72a3bf002a801.tar.bz2
traccar-server-f49790953e6f9c3f9aa88564caf72a3bf002a801.zip
Fix some more style problems
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/AsyncServlet.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/org/traccar/web/AsyncServlet.java b/src/org/traccar/web/AsyncServlet.java
index d541e29c5..73803ab91 100644
--- a/src/org/traccar/web/AsyncServlet.java
+++ b/src/org/traccar/web/AsyncServlet.java
@@ -113,8 +113,8 @@ public class AsyncServlet extends BaseServlet {
destroyed = true;
}
Context.getConnectionManager().removeListener(devices, dataListener);
- synchronized (asyncSessions) {
- asyncSessions.remove(userId);
+ synchronized (ASYNC_SESSIONS) {
+ ASYNC_SESSIONS.remove(userId);
}
}
};
@@ -175,17 +175,17 @@ public class AsyncServlet extends BaseServlet {
}
- private static final Map<Long, AsyncSession> asyncSessions = new HashMap<>();
+ private static final Map<Long, AsyncSession> ASYNC_SESSIONS = new HashMap<>();
public static void sessionRefreshUser(long userId) {
- synchronized (asyncSessions) {
- asyncSessions.remove(userId);
+ synchronized (ASYNC_SESSIONS) {
+ ASYNC_SESSIONS.remove(userId);
}
}
public static void sessionRefreshDevice(long deviceId) {
- synchronized (asyncSessions) {
- Iterator<Entry<Long, AsyncSession>> iterator = asyncSessions.entrySet().iterator();
+ synchronized (ASYNC_SESSIONS) {
+ Iterator<Entry<Long, AsyncSession>> iterator = ASYNC_SESSIONS.entrySet().iterator();
while (iterator.hasNext()) {
if (iterator.next().getValue().hasDevice(deviceId)) {
iterator.remove();
@@ -199,14 +199,14 @@ public class AsyncServlet extends BaseServlet {
context.setTimeout(ASYNC_TIMEOUT);
HttpServletRequest req = (HttpServletRequest) context.getRequest();
- synchronized (asyncSessions) {
+ synchronized (ASYNC_SESSIONS) {
- if (Boolean.parseBoolean(req.getParameter("first")) || !asyncSessions.containsKey(userId)) {
+ if (Boolean.parseBoolean(req.getParameter("first")) || !ASYNC_SESSIONS.containsKey(userId)) {
Collection<Long> devices = Context.getPermissionsManager().allowedDevices(userId);
- asyncSessions.put(userId, new AsyncSession(userId, devices));
+ ASYNC_SESSIONS.put(userId, new AsyncSession(userId, devices));
}
- asyncSessions.get(userId).request(context);
+ ASYNC_SESSIONS.get(userId).request(context);
}
}