Skip to content

Commit

Permalink
move ctx constants to WebRestContextProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Dec 23, 2017
1 parent 58c4e15 commit 8da09b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@
{
private static final long serialVersionUID = 4046535476486036184L;

static final String CTXNAME_IsServerContext = "#IsWebuiServerContext";
static final String CTXNAME_IsWebUI = "#IsWebUI";

// ---------------------------------------------------------------------------------------------
// NOTE: make sure none of those fields are "final" because this will prevent deserialization
// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -110,8 +107,8 @@ public InternalUserSessionData()

// Context
ctx = new Properties();
Env.setContext(ctx, CTXNAME_IsServerContext, false);
Env.setContext(ctx, CTXNAME_IsWebUI, true);
Env.setContext(ctx, WebRestApiContextProvider.CTXNAME_IsServerContext, false);
Env.setContext(ctx, WebRestApiContextProvider.CTXNAME_IsWebUI, true);

UserSession.logger.trace("User session created: {}", this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
@Profile(WebRestApiApplication.PROFILE_Webui)
public final class WebRestApiContextProvider implements ContextProvider, Serializable
{
public static final String CTXNAME_IsServerContext = "#IsWebuiServerContext";
public static final String CTXNAME_IsWebUI = "#IsWebUI";

private static final Logger logger = LogManager.getLogger(WebRestApiContextProvider.class);

private final InheritableThreadLocal<Properties> temporaryCtxHolder = new InheritableThreadLocal<>();
Expand All @@ -66,8 +69,8 @@ public WebRestApiContextProvider()
//
// Create the server context
serverCtx = new Properties();
Env.setContext(serverCtx, InternalUserSessionData.CTXNAME_IsServerContext, true);
Env.setContext(serverCtx, InternalUserSessionData.CTXNAME_IsWebUI, true);
Env.setContext(serverCtx, CTXNAME_IsServerContext, true);
Env.setContext(serverCtx, CTXNAME_IsWebUI, true);
}

@Override
Expand Down

0 comments on commit 8da09b3

Please sign in to comment.