/*
 * ********************************************************************************************************************
 *  <p/>
 *  BACKENDLESS.COM CONFIDENTIAL
 *  <p/>
 *  ********************************************************************************************************************
 *  <p/>
 *  Copyright 2012 BACKENDLESS.COM. All Rights Reserved.
 *  <p/>
 *  NOTICE: All information contained herein is, and remains the property of Backendless.com and its suppliers,
 *  if any. The intellectual and technical concepts contained herein are proprietary to Backendless.com and its
 *  suppliers and may be covered by U.S. and Foreign Patents, patents in process, and are protected by trade secret
 *  or copyright law. Dissemination of this information or reproduction of this material is strictly forbidden
 *  unless prior written permission is obtained from Backendless.com.
 *  <p/>
 *  ********************************************************************************************************************
 */

package com.backendless.servercode;

import com.backendless.commons.DeviceType;

import java.util.List;

/**
 * Created by oleg on 21.07.15.
 */
public class InvocationContext
{
  private static RunnerContext runnerContext;

  public static RunnerContext getRunnerContext()
  {
    return runnerContext;
  }

  public static void setRunnerContext( RunnerContext runnerContext )
  {
    InvocationContext.runnerContext = runnerContext;
  }

  public static void setRunnerContext(String appId, String userId, List<String> userRoles, DeviceType deviceType)
  {
    RunnerContext runnerContext = new RunnerContext();
    runnerContext.setAppId( appId );
    runnerContext.setUserId( userId );
    runnerContext.setUserRole( userRoles );
    runnerContext.setDeviceType( deviceType );
    InvocationContext.runnerContext = runnerContext;
  }
}

@@ -1203,16 +1203,23 @@
 %7B%0A  
+static 
 private 
 stat
@@ -1218,254 +1218,169 @@
 ate 
-static RunnerContext runnerContext;%0A%0A  public static RunnerContext getRunnerContext()%0A  %7B%0A    return runnerContext;%0A  %7D%0A%0A  public static void setRunnerContext( RunnerContext runnerContext )%0A  %7B%0A    InvocationContext.runnerContext = runnerContext;
+String appId;%0A  static private String userId;%0A  static private List%3CString%3E userRoles;%0A  static private DeviceType deviceType;%0A%0A  private InvocationContext()%0A  %7B
 %0A  %7D
@@ -1384,21 +1384,22 @@
   %7D%0A%0A  p
-ublic
+rivate
  static 
@@ -1406,30 +1406,24 @@
 void set
-Runner
 Context(
 String a
@@ -1414,16 +1414,17 @@
 Context(
+ 
 String a
@@ -1489,16 +1489,17 @@
 viceType
+ 
 )%0A  %7B%0A  
@@ -1504,165 +1504,359 @@
     
-RunnerContext runnerContext = new RunnerContext();%0A    runnerContext.setAppId(
+InvocationContext.appId = appId;%0A    InvocationContext.userId = userId;%0A    InvocationContext.userRoles = userRoles;%0A    InvocationContext.deviceType = deviceType;%0A  %7D%0A%0A  public static String getAppId()%0A  %7B%0A    return
  appId
- )
 ;%0A  
-  runnerContext.setUserId(
+%7D%0A%0A  public static String getUserId()%0A  %7B%0A    return
  userId
- )
 ;%0A  
-  runnerContext.setUserRole(
+%7D%0A%0A  public static List%3CString%3E getUserRoles()%0A  %7B%0A    return
  use
@@ -1865,33 +1865,31 @@
 oles
- )
 ;%0A  
-  runnerContext.set
+%7D%0A%0A  public static 
 Devi
@@ -1898,11 +1898,13 @@
 Type
-( d
+ getD
 evic
@@ -1912,63 +1912,36 @@
 Type
- );%0A    InvocationContext.runnerContext = runnerContext
+()%0A  %7B%0A    return deviceType
 ;%0A  

Change in InvocationContext