Project

General

Profile

« Previous | Next » 

Revision 93fcde18

Added by Cherian Mathew almost 9 years ago

fix for #4844
CdmVaadinAuthentication : new class used for authentication
AuthenticationPresenter, AbstractAuthenticatedUI, CdmVaadinSessionUtilities, AuthenticationView, IAuthenticationComponent : using new authentication object linked to host and context path
CdmVaadinBaseTest, AuthenticationPresenterTest : test classes for new authentication

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/util/CdmVaadinSessionUtilities.java
9 9
*/
10 10
package eu.etaxonomy.cdm.vaadin.util;
11 11

  
12
import java.util.concurrent.locks.Lock;
13

  
12 14
import org.apache.log4j.Logger;
13 15

  
14 16
import com.vaadin.server.VaadinSession;
......
27 29
    private static final Logger logger = Logger.getLogger(CdmVaadinSessionUtilities.class);
28 30

  
29 31
    public static void setCurrentAttribute(String name, Object value) {
32
        Lock sessionLock = VaadinSession.getCurrent().getLockInstance();
30 33
        try {
31
            VaadinSession.getCurrent().getLockInstance().lock();
34
            if(sessionLock != null) {
35
                sessionLock.lock();
36
            }
32 37
            VaadinSession.getCurrent().setAttribute(name, value);
33 38
        } finally {
34
            VaadinSession.getCurrent().getLockInstance().unlock();
39
            if(sessionLock != null) {
40
                sessionLock.unlock();
41
            }
35 42
        }
36 43
    }
37 44

  

Also available in: Unified diff