Set prepared access-context on thread.
@param accessContext The context of DB access. (NotNull)
767873
public static void setAccessContextOnThread(AccessContext accessContext) {
        if (accessContext == null) {
            String msg = "The argument[accessContext] must not be null.";
            throw new IllegalArgumentException(msg);
        }
        Stack<AccessContext> stack = threadLocal.get();
        if (stack == null) {
            stack = new Stack<AccessContext>();
            threadLocal.set(stack);
        }
        stack.add(accessContext);
    }
931896
public static void beginAccessContext() {
        if (AccessContext.isExistAccessContextOnThread()) { // suspend
            SuspendedAccessContext.setAccessContextOnThread(AccessContext.getAccessContextOnThread());
        }
        AccessContext.setAccessContextOnThread(getAccessContextOnThread());
    }
1222334
public static boolean isExistAccessContextOnThread() {
        final Stack<AccessContext> stack = threadLocal.get();
        return stack != null ? !stack.isEmpty() : false;
    }
486152
public void createUISharedContext(Context context) {
		if (session != null) {
			uiContexts.put(context.getIndex(), context.duplicate());
		}
	}
747289
public static void setCurrentAnalysisContext(AnalysisContext analysisContext) {
        currentAnalysisContext.set(analysisContext);
        if (Global.getAnalysisCache() != null) {
            currentXFactory.set(new XFactory());
        }
    }
1197032
private static boolean getAccessSetFromDB(final String _sql,
                                              final Object _criteria)
        throws CacheReloadException
    {
        boolean ret = false;
        Connection con = null;
        try {
            AccessSet accessSet = null;
            con = Context.getConnection();
            PreparedStatement stmt = null;
            try {
                stmt = con.prepareStatement(_sql);
                stmt.setObject(1, _criteria);
                final ResultSet rs = stmt.executeQuery();

                if (rs.next()) {
                    final long id = rs.getLong(1);
                    final String uuid = rs.getString(2);
                    final String name = rs.getString(3);
                    AccessSet.LOG.debug("read AccessSet '{}' (id = {}, uuid ={})", name, id, uuid);
                    accessSet = new AccessSet(id, uuid, name);
                }
                ret = true;
                rs.close();
            } finally {
                if (stmt != null) {
                    stmt.close();
                }
            }
            con.commit();
            if (accessSet != null) {
                accessSet.readLinks2AccessTypes();
                accessSet.readLinks2DMTypes();
                accessSet.readLinks2Status();
                accessSet.readLinks2Person();
                // needed due to cluster serialization that does not update automatically
                AccessSet.cacheAccessSet(accessSet);
            }
        } catch (final SQLException e) {
            throw new CacheReloadException("could not read roles", e);
        } catch (final EFapsException e) {
            throw new CacheReloadException("could not read roles", e);
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("could not read child type ids", e);
            }
        }
        return ret;
    }
150973
@SuppressWarnings("unchecked")
    void initThreadContext(WSContextService contextSvc, Map<String, String> execProps) {
        threadContext = contextSvc.captureThreadContext(execProps);
    }
639737
protected function _setContext($context)
    {
        $this->context = ($context !== null)
            ? $this->_normalizeContainer($context)
            : null;
    }
260907
@Override
    public void setContext(DisplayContext context) {
        super.setContext(context);
        if (capitalizationBrkIter == null && (context==DisplayContext.CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE ||
              context==DisplayContext.CAPITALIZATION_FOR_UI_LIST_OR_MENU ||
              context==DisplayContext.CAPITALIZATION_FOR_STANDALONE)) {
            capitalizationBrkIter = BreakIterator.getSentenceInstance(locale);
        }
    }
210796
public void setSbbContext(SbbContext context) {
		sbbContext = (SbbContextExt) context;
		sipActivityContextInterfaceFactory = (SipActivityContextInterfaceFactory) sbbContext
				.getActivityContextInterfaceFactory(sipRATypeID);
		sleeSipProvider = (SleeSipProvider) sbbContext
				.getResourceAdaptorInterface(sipRATypeID, sipRALink);
		addressFactory = sleeSipProvider.getAddressFactory();
		headerFactory = sleeSipProvider.getHeaderFactory();
		messageFactory = sleeSipProvider.getMessageFactory();
		timerFacility = sbbContext.getTimerFacility();
	}
2411
def prepare(self, context):
		""""""
		if __debug__:
			log.debug("Assigning thread local request context.")
		
		self.local.context = context
300585
public void setContext(Context context) {
        context.put(JavacElements.class, this);
        javaCompiler = JavaCompiler.instance(context);
        syms = Symtab.instance(context);
        names = Names.instance(context);
        types = Types.instance(context);
        enter = Enter.instance(context);
    }
1321458
protected void fillContext(final IoSession session, final Map<String, String> context) {
        if (mdcKeys.contains(MdcKey.handlerClass)) {
            context.put(MdcKey.handlerClass.name(), session.getHandler()
                    .getClass().getName());
        }
        if (mdcKeys.contains(MdcKey.remoteAddress)) {
            context.put(MdcKey.remoteAddress.name(), session.getRemoteAddress()
                    .toString());
        }
        if (mdcKeys.contains(MdcKey.localAddress)) {
            context.put(MdcKey.localAddress.name(), session.getLocalAddress()
                    .toString());
        }
        if (session.getTransportMetadata().getAddressType() == InetSocketAddress.class) {
            InetSocketAddress remoteAddress = (InetSocketAddress) session
                    .getRemoteAddress();
            InetSocketAddress localAddress = (InetSocketAddress) session
                    .getLocalAddress();
            if (mdcKeys.contains(MdcKey.remoteIp)) {
                context.put(MdcKey.remoteIp.name(), remoteAddress.getAddress()
                        .getHostAddress());
            }
            if (mdcKeys.contains(MdcKey.remotePort)) {
                context.put(MdcKey.remotePort.name(), String
                        .valueOf(remoteAddress.getPort()));
            }
            if (mdcKeys.contains(MdcKey.localIp)) {
                context.put(MdcKey.localIp.name(), localAddress.getAddress()
                        .getHostAddress());
            }
            if (mdcKeys.contains(MdcKey.localPort)) {
                context.put(MdcKey.localPort.name(), String
                        .valueOf(localAddress.getPort()));
            }
        }
    }
1214124
protected void pushContext(Context c) {
		Stack<Context> stack = threadSafeContextStack.get();
		if (stack == null) {
			stack = new Stack<Context>();
			stack.push(c);
			threadSafeContextStack.set(stack);
		} else {
			threadSafeContextStack.get().push(c);
		}
	}
1277744
private synchronized void removeContext(final EvaluatorContext context) {
    this.contextStack.remove(context);
    this.contextIds.remove(context.getId());
  }
1306939
public PurgeJmsQueuesBuilder withApplicationContext(ApplicationContext applicationContext) {
        if (applicationContext.containsBean("connectionFactory")) {
            connectionFactory(applicationContext.getBean("connectionFactory", ConnectionFactory.class));
        }

        return this;
    }
254942
public void setAccess(String access) {
        if ("public".equals(access)) publicScope = true;
        else if ("protected".equals(access)) protectedScope = true;
        else if ("package".equals(access)) packageScope = true;
        else if ("private".equals(access)) privateScope = true;
    }