protected void setMuleContext(final MuleContext muleContext) throws NotificationException { statusListener = new MuleContextNotificationListener<MuleContextNotification>() { @Override public void onNotification(MuleContextNotification notification) { int action = notification.getAction(); if (action == MuleContextNotification.CONTEXT_INITIALISED || action == MuleContextNotification.CONTEXT_STARTED || action == MuleContextNotification.CONTEXT_STOPPED || action == MuleContextNotification.CONTEXT_DISPOSED) { updateStatusFor(muleContext.getLifecycleManager().getCurrentPhase()); } } }; muleContext.registerListener(statusListener); this.muleContext = muleContext; }
public void register() { try { if (muleContext != null) { muleContext.registerListener(this); } } catch (NotificationException e) { throw new RuntimeException("Unable to register listener", e); } }
/** Do not instantiate JmxRegistrationContext. */ private JmxRegistrationContext(MuleContext context) { try { // register the cleanup hook, otherwise server stop/start cycles may produce // Mule JMX domains with ever increasing suffix. context.registerListener(new MuleContextNotificationListener<MuleContextNotification>() { @Override public void onNotification(MuleContextNotification notification) { MuleContextNotification mn = notification; if (MuleContextNotification.CONTEXT_DISPOSED == mn.getAction()) { // just in case someone is holding a ref to the context instance resolvedDomain = null; // disassociate contexts.set(null); } } }); } catch (NotificationException e) { logger.warn("Did not cleanup properly.", e); } }
this.muleContext.registerListener(new MuleContextNotificationListener<MuleContextNotification>()
this.muleContext.registerListener(new MuleContextNotificationListener<MuleContextNotification>(){
try muleContext.registerListener(l); try muleContext.registerListener(l); try muleContext.registerListener(l); try muleContext.registerListener(l); muleContext.registerListener(l); muleContext.registerListener(l); muleContext.registerListener(l); muleContext.registerListener(l); muleContext.registerListener(l); muleContext.registerListener(l);
private static void registerAppDisposeListener(MuleContext muleContext) { if (!disposeListenerRegistered.containsKey(muleContext.getConfiguration().getId())) { try { muleContext.registerListener(createClearCacheListenerOnContextDispose(muleContext)); disposeListenerRegistered.put(muleContext.getConfiguration().getId(),true); } catch (NotificationException e) { throw new MuleRuntimeException(e); } } }
muleContext.registerListener(muleContextStartedListener); muleContext.registerListener(muleContextStoppedListener);
muleContext.registerListener(contextStartListener);
muleContext.registerListener(new MuleContextNotificationListener<MuleContextNotification>(){ @Override public void onNotification(MuleContextNotification notification)