Skip to content

Package: RWTSessionProvider

RWTSessionProvider

nameinstructionbranchcomplexitylinemethod
RWTSessionProvider()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getSessionId()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
registerListenerWithSession(UISessionListener)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Neil Mackenzie - initial implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.core.rap.sessionprovider.rwt;
15:
16: import org.eclipse.emf.ecp.core.rap.SessionProvider;
17: import org.eclipse.rap.rwt.RWT;
18: import org.eclipse.rap.rwt.service.UISession;
19: import org.eclipse.rap.rwt.service.UISessionListener;
20:
21: /**
22: * This class provides the current session ID.
23: *
24: * @author neilmack
25: *
26: */
27: public class RWTSessionProvider implements SessionProvider {
28:
29:         /**
30:          * get the current sessions ID.
31:          *
32:          * @return the current sessions ID
33:          */
34:         @Override
35:         public final String getSessionId() {
36:                 final String sessionId = RWT.getUISession().toString();
37:                 return sessionId;
38:         }
39:
40:         /**
41:          * {@inheritDoc}
42:          *
43:          * @see org.eclipse.emf.ecp.core.rap.SessionProvider#registerListenerWithSession(org.eclipse.rap.rwt.service.UISessionListener)
44:          */
45:         @Override
46:         public void registerListenerWithSession(UISessionListener listener) {
47:                 final UISession uiSession = RWT.getUISession();
48:                 uiSession.addUISessionListener(listener);
49:
50:         }
51:
52: }