private void notifyContextCreated(TruffleContext context) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onContextCreated(context); } }
private void notifyContextCreated(TruffleContext context) { for (EventBinding<? extends ContextsListener> binding : contextsBindings) { binding.getElement().onContextCreated(context); } }
void reportAllLanguageContexts(ContextsListener listener) { PolyglotContextImpl[] allContexts; synchronized (this) { if (contexts.isEmpty()) { return; } allContexts = contexts.toArray(new PolyglotContextImpl[contexts.size()]); } for (PolyglotContextImpl context : allContexts) { listener.onContextCreated(context.truffleContext); for (PolyglotLanguageContext lc : context.contexts) { LanguageInfo language = lc.language.info; if (lc.eventsEnabled && lc.env != null) { listener.onLanguageContextCreated(context.truffleContext, language); if (lc.isInitialized()) { listener.onLanguageContextInitialized(context.truffleContext, language); if (lc.finalized) { listener.onLanguageContextFinalized(context.truffleContext, language); } } } } } }
void reportAllLanguageContexts(ContextsListener listener) { List<PolyglotContextImpl> allContexts; synchronized (this) { if (contexts.isEmpty()) { return; } allContexts = collectAliveContexts(); } for (PolyglotContextImpl context : allContexts) { listener.onContextCreated(context.truffleContext); for (PolyglotLanguageContext lc : context.contexts) { LanguageInfo language = lc.language.info; if (lc.eventsEnabled && lc.env != null) { listener.onLanguageContextCreated(context.truffleContext, language); if (lc.isInitialized()) { listener.onLanguageContextInitialized(context.truffleContext, language); if (lc.finalized) { listener.onLanguageContextFinalized(context.truffleContext, language); } } } } } }