Returns the MediaTracker for the current AppContext, creating a new
MediaTracker if necessary.
508219
private MediaTracker getTracker() {
        // Opt: Only synchronize if trackerObj comes back null?
        // If null, synchronize, re-check for null, and put new tracker
        synchronized(this) {
            if (tracker == null) {
                @SuppressWarnings("serial")
                Component comp = new Component() {};
                tracker = new MediaTracker(comp);
            }
        }
        return (MediaTracker) tracker;
    }
754072
private static StackTraceElementsFiller getStackTraceElementsFiller() {
		try {
			Method method = VMStack.class.getDeclaredMethod("fillStackTraceElements", Thread.class, StackTraceElement[].class);
			method.setAccessible(true);
			StackTraceElement[] trace = new StackTraceElement[STACK_TRACE_SIZE];
			method.invoke(null, Thread.currentThread(), trace);
			for (int i = 0; i < STACK_TRACE_SIZE; ++i) {
				StackTraceElement element = trace[i];
				if (element != null && AndroidRuntime.class.getName().equals(element.getClassName())
					&& "getStackTraceElementsFiller".equals(element.getMethodName())) {
					return new StackTraceElementsFiller(method, i);
				}
			}
			return new StackTraceElementsFiller(null, -1);
		} catch (NoClassDefFoundError error) {
			return new StackTraceElementsFiller(null, -1);
		} catch (Exception ex) {
			return new StackTraceElementsFiller(null, -1);
		}
	}
789965
public SoundCloudTrack getCurrentTrack() {
        if (mCurrentTrackIndex > -1 && mCurrentTrackIndex < mSoundCloudPlaylist.getTracks().size()) {
            return mSoundCloudPlaylist.getTracks().get(mCurrentTrackIndex);
        }
        return null;
    }
123192
public static void ensureScopeUsesRequestContext(Tracing tracing) {
        final PingPongExtra extra = new PingPongExtra();
        // trace contexts are not recorded until Tracer.toSpan, so this won't end up as junk data
        final TraceContext dummyContext = TraceContext.newBuilder().traceId(1).spanId(1)
                                                      .extra(Collections.singletonList(extra)).build();
        final boolean scopeUsesRequestContext;
        try (Scope scope = tracing.currentTraceContext().newScope(dummyContext)) {
            scopeUsesRequestContext = extra.isPong();
        }
        if (!scopeUsesRequestContext) {
            throw new IllegalStateException(
                    "Tracing.currentTraceContext is not a " + RequestContextCurrentTraceContext.class
                            .getSimpleName() + " scope. " +
                    "Please call Tracing.Builder.currentTraceContext(" + RequestContextCurrentTraceContext.class
                            .getSimpleName() + ".INSTANCE).");
        }
    }
633091
def from_current(cls):
        
        if properties.application_id is None:
            raise context.ValueError("Not running inside a container")

        return cls(properties.appmaster_address,
                   properties.application_id,
                   security=Security.from_default())
712720
public static String getTrackerData() {

        // loop through all the contexts
        Enumeration vEnum = scrSessionContexts.elements();

        StringBuffer bigStrbuf = new StringBuffer();

        bigStrbuf.append("<center><h3>Session Tracking Internals</h3></center>" + "<UL>\n");

        while (vEnum.hasMoreElements()) {
            SessionContext localContext = (SessionContext) vEnum.nextElement();
            String contextData = localContext.toHTML();
            bigStrbuf.append(contextData).append("</UL>\n");

        }

        return (bigStrbuf.toString());
    }
1150359
private void trackServletContextHelper(final BundleContext bundleContext, ExtendedHttpServiceRuntime httpServiceRuntime) {
		final ServiceTracker<ServletContextHelper, ServletContextHelperElement> servletContextHelperTracker =
				ServletContextHelperTracker.createTracker(extenderContext, bundleContext, httpServiceRuntime);

		servletContextHelperTracker.open();
		trackers.add(0, servletContextHelperTracker);

	}
626277
public static Context getApplicationContext() {
        com.ardikars.jxnet.context.Context context = com.ardikars.jxnet.context.Application.getApplicationContext();
        return new ApplicationContext(context);
    }
175748
def get(self):
        
        return StepContextContext(
            self._version,
            flow_sid=self._solution['flow_sid'],
            engagement_sid=self._solution['engagement_sid'],
            step_sid=self._solution['step_sid'],
        )
221495
private void registerLockScreenReceiver(Context context) {
        mLockScreenReceiver = new LockScreenReceiver();
        IntentFilter intentFilter = new IntentFilter();
        intentFilter.addAction(ACTION_TOGGLE_PLAYBACK);
        intentFilter.addAction(ACTION_NEXT_TRACK);
        intentFilter.addAction(ACTION_PREVIOUS_TRACK);
        mLocalBroadcastManager = LocalBroadcastManager.getInstance(context);
        mLocalBroadcastManager.registerReceiver(mLockScreenReceiver, intentFilter);
    }
377670
def get(self, sid):
        
        return MediaContext(
            self._version,
            account_sid=self._solution['account_sid'],
            message_sid=self._solution['message_sid'],
            sid=sid,
        )
357140
static Executor makeContextAware(Executor delegate, CurrentTraceContext currentTraceContext) {
    class TracingCurrentRequestContextExecutor implements Executor {
      @Override public void execute(Runnable task) {
        delegate.execute(RequestContext.current().makeContextAware(currentTraceContext.wrap(task)));
      }
    }
    return new TracingCurrentRequestContextExecutor();
  }
429146
public static StatsTraceContext newServerContext(
      List<? extends ServerStreamTracer.Factory> factories,
      String fullMethodName,
      Metadata headers) {
    if (factories.isEmpty()) {
      return NOOP;
    }
    StreamTracer[] tracers = new StreamTracer[factories.size()];
    for (int i = 0; i < tracers.length; i++) {
      tracers[i] = factories.get(i).newServerStreamTracer(fullMethodName, headers);
    }
    return new StatsTraceContext(tracers);
  }
668793
public static App getAuthenticatedApp() {
		App app = null;
		if (SecurityContextHolder.getContext().getAuthentication() != null) {
			Authentication auth = SecurityContextHolder.getContext().getAuthentication();
			if (auth.isAuthenticated() && auth.getPrincipal() instanceof App) {
				app = (App) auth.getPrincipal();
			}
		}
		return app;
	}
414900
protected Environment startEnvironment(ApplicationContext applicationContext) {
        if (!applicationContext.isRunning()) {
            if (this instanceof PropertySource) {
                applicationContext.getEnvironment().addPropertySource((PropertySource) this);
            }

            return applicationContext
                    .start()
                    .getEnvironment();
        } else {
            return applicationContext.getEnvironment();
        }
    }
709022
public final ServiceTracker<T, ServletContextHelperElement> create(final Class<? extends T> trackedClass) {
		return new ServiceTracker<>(bundleContext, createFilter(bundleContext, trackedClass), this);
	}
1198961
function() {
		gui.TrackerPlugin.prototype.onconstruct.call(this);
		this.context = self; // TODO: deprecate this whole thing...
		this._watches = [];
		this._matches = [];
		this._needing = [];
	}