Call from within your activity or fragment onCreate method.

@param bundle the onSaveInstance bundle
@param callbackHandlers an array of callback handlers to mange
@return an instance of {@link CallbacksManager}
353136
public static CallbacksManager init(Bundle bundle, Object... callbackHandlers) {
    if (bundle == null) {
      return new CallbacksManager();
    }

    CallbacksManager callbacksManager = new CallbacksManager();
    ArrayList<TaskHandler> taskProxies = bundle.getParcelableArrayList(TASK_PROXY_LIST);
    if (taskProxies != null) {
      callbacksManager.proxyTasks.addAll(taskProxies);
    }

    if (callbackHandlers != null) {
      for (TaskHandler proxyTask : new ArrayList<TaskHandler>(callbacksManager.proxyTasks)) {
        proxyTask.clearCallbacks();
        proxyTask.appendCallbacks(callbackHandlers);
      }
    }
    return callbacksManager;
  }
127753
public <T> ISyncHandler<? super T, ? extends ISyncableData> getHandler(T caller)
	{
		@SuppressWarnings("unchecked")
		ISyncHandler<? super T, ? extends ISyncableData> handler = (ISyncHandler<? super T, ? extends ISyncableData>) handlers.get(caller.getClass());
		if (handler == null)
		{
			MalisisCore.log.error("No ISyncHandler registered for type '{}'", caller.getClass());
			return null;
		}

		return handler;
	}
873525
public <T extends IEntity> void voidRequestAsync(T entity, CallbackHandler callbackHandler) throws FMSException {

        IntuitMessage intuitMessage = prepareVoidRequest(entity);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }
927561
public static CallbackHandler deactivateCallbackHandler(GSSCredential cred) {
	if (cred == null) {
	    return null;
	}
	CallbackHandler handler =
	    (CallbackHandler)callbackHandlers.remove(cred);
	if (handler == null) {
	    return null;
	}
	handler.shutdown();
	return handler;
    }
674414
public static <T> CallbackList<T> create(Callback<T> callback) {
    CallbackList<T> list = new CallbackList<T>();
    list.add(callback);
    return list;
  }
1082443
@Override
	public synchronized void initialize(Manager manager) {
		if (this.manager != null) {
			throw new IllegalStateException("Callback was already initialized");
		}
		this.manager = manager;
		for (Callback callback : callbacks) {
			try {
				callback.initialize(manager);
			} catch (Exception e) {
				onManagerWarning("Callback initialization error", e);
			}
		}
	}
880373
private static <T extends Callback> T getCallbackByType(Iterable<Callback> callbacks, Class<T> callbackType) {
		T foundCallback = null;
		Iterator<Callback> callbackIterator = callbacks.iterator();
		while (foundCallback == null && callbackIterator.hasNext()) {
			Callback callback = callbackIterator.next();
			// Remove callback wrappers
			while ((callback instanceof Delegating) && (!callbackType.isInstance(callback))) {
				callback = ((Delegating<Callback>) callback).getDelegate();
			}
			if (callbackType.isInstance(callback)) {
				// Callback found
				foundCallback = callbackType.cast(callback);
			} else if (callback instanceof CompositeCallback) {
				// Visit the composite callback
				foundCallback = getCallbackByType(((CompositeCallback) callback).callbacks(), callbackType);
			}
		}
		return foundCallback;
	}
1323662
@Override
	public void processBundles(GlobalPostProcessingContext ctx, List<JoinableResourceBundle> bundles) {

		if (ctx.hasBundleToBeProcessed()) {
			String workingDir = ctx.getRsReaderHandler().getWorkingDirectory();

			if (srcDir == null || destDir == null || tempDir == null || srcZipDir == null || destZipDir == null) {
				srcDir = ctx.getBundleHandler().getBundleTextDirPath();
				srcZipDir = ctx.getBundleHandler().getBundleZipDirPath();
				destDir = workingDir + GOOGLE_CLOSURE_RESULT_TEXT_DIR;
				destZipDir = workingDir + GOOGLE_CLOSURE_RESULT_ZIP_DIR;
				tempDir = workingDir + GOOGLE_CLOSURE_TEMP_DIR;
			}

			// Create result directory
			File dir = new File(destDir);
			if (!dir.exists() && !dir.mkdirs()) {
				throw new BundlingProcessException("Impossible to create temporary directory :" + destDir);
			}

			// Create result directory
			dir = new File(destZipDir);
			if (!dir.exists() && !dir.mkdirs()) {
				throw new BundlingProcessException("Impossible to create temporary directory :" + destZipDir);
			}

			// Create temporary directory
			dir = new File(tempDir);
			if (!dir.exists() && !dir.mkdirs()) {
				throw new BundlingProcessException("Impossible to create temporary directory :" + tempDir);
			}

			// Copy the bundle files in a temp directory
			try {
				FileUtils.copyDirectory(new File(srcDir), new File(tempDir));

				Map<String, String> resultBundleMapping = new HashMap<>();
				JawrClosureCommandLineRunner cmdRunner = new JawrClosureCommandLineRunner(ctx, bundles,
						resultBundleMapping);
				cmdRunner.doRun();
				// Copy compiled bundles
				FileUtils.copyDirectory(new File(destDir), new File(srcDir));

				// Copy zipped compiled bundles
				FileUtils.copyDirectory(new File(destZipDir), new File(srcZipDir));

			} catch (Exception e) {

				throw new BundlingProcessException(e);
			}
		}
	}
904289
@Override
    public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
        for (Callback callback : callbacks) {
            if (callback instanceof WSManagedConnectionFactoryCallback) {
                ((WSManagedConnectionFactoryCallback) callback).setManagedConnectionFactory(managedConnectionFactory);
            } else if (callback instanceof WSMappingPropertiesCallback) {
                ((WSMappingPropertiesCallback) callback).setProperties(properties);
            } else {
                // TODO: Issue a warning with translated message
                // Use translated message for the the UnsupportedCallbackException
                throw new UnsupportedCallbackException(callback, "Unrecognized Callback");
            }
        }
    }
1289079
public <T extends IEntity> void addAsync(T entity, CallbackHandler callbackHandler) throws FMSException {

        IntuitMessage intuitMessage = prepareAdd(entity);

        //set callback handler
        intuitMessage.getRequestElements().setCallbackHandler(callbackHandler);

        //execute async interceptors
        executeAsyncInterceptors(intuitMessage);
    }
324317
public static void loadAsync(final ThemeBundle bundle, final ThemeAsyncCallback callback) {
        GWT.runAsync(new RunAsyncCallback() {
            @Override
            public void onSuccess() {
                if(bundle != null) {
                    if(elements == null) {
                        elements = new ArrayList<>();
                    } else {
                        unload();
                    }

                    // More resources might be loaded in the future.
                    elements.add(StyleInjector.injectStylesheet(bundle.style().getText()));
                    elements.add(StyleInjector.injectStylesheet(bundle.overrides().getText()));
                }

                if(callback != null) {
                    callback.onSuccess(elements.size());
                }
            }
            @Override
            public void onFailure(Throwable reason) {
                if(callback != null) {
                    callback.onFailure(reason);
                }
            }
        });
    }
283083
@Override
	public void setBundlingProcessLifeCycleListeners(List<BundlingProcessLifeCycleListener> listeners) {
		this.lifeCycleListeners.clear();
		this.lifeCycleListeners.addAll(listeners);
	}
115943
protected static MethodHandle makeFallBack(MutableCallSite mc, Class<?> sender, String name, int callID, MethodType type, boolean safeNavigation, boolean thisCall, boolean spreadCall) {
            MethodHandle mh = MethodHandles.insertArguments(SELECT_METHOD, 0, mc, sender, name, callID, safeNavigation, thisCall, spreadCall, /*dummy receiver:*/ 1);
            mh =    mh.asCollector(Object[].class, type.parameterCount()).
                    asType(type);
            return mh;
        }
266791
public void onCreate(Bundle bundle) {
		if (mParentDelegate == null && bundle != null) {
			bundle = bundle.getBundle(MOXY_DELEGATE_TAGS_KEY);
		}

		mIsAttached = false;
		mBundle = bundle != null ? bundle : new Bundle();

		//get base tag for presenters
		if (bundle == null || !mBundle.containsKey(mKeyTag)) {
			mDelegateTag = generateTag();
		} else {
			mDelegateTag = bundle.getString(mKeyTag);
		}

		//bind presenters to view
		mPresenters = MvpFacade.getInstance().getMvpProcessor().getMvpPresenters(mDelegated, mDelegateTag);

		for (MvpDelegate childDelegate : mChildDelegates) {
			childDelegate.onCreate(bundle);
		}
	}
998296
public void onCreate(Bundle savedInstanceState) {
        Session session = Session.getActiveSession();
        if (session == null) {
            if (savedInstanceState != null) {
                session = Session.restoreSession(activity, null, callback, savedInstanceState);
            }
            if (session == null) {
                session = new Session(activity);
            }
            Session.setActiveSession(session);
        }
        if (savedInstanceState != null) {
            pendingFacebookDialogCall = savedInstanceState.getParcelable(DIALOG_CALL_BUNDLE_SAVE_KEY);
        }
    }
886052
final public void saveAsync(final OnSavedCallback callback) {
		new AsyncTask<Model, Void, Boolean>() {

			protected Boolean doInBackground(Model... params) {
				return params[0].save();
			}

			protected void onPostExecute(Boolean result) {
				if (result && callback != null) {
					callback.onSaved();
				}
			}

		}.execute(this);
	}
1300788
@Override
	public void initAllBundles() {

		stopProcessIfNeeded();

		if (config.getUseBundleMapping()) {
			bundleMapping = resourceBundleHandler.getJawrBundleMapping();
		}

		boolean mappingFileExists = resourceBundleHandler.isExistingMappingFile();
		boolean processBundleFlag = !config.getUseBundleMapping() || !mappingFileExists;

		StopWatch stopWatch = ThreadLocalJawrContext.getStopWatch();

		List<JoinableResourceBundle> bundleToProcess = this.bundles;
		boolean forceStoreJawrBundleMapping = false;
		if (!processBundleFlag) {
			String storeJawrConfigHashcode = resourceBundleHandler.getJawrBundleMapping()
					.getProperty(JawrConstant.JAWR_CONFIG_HASHCODE);
			String jawrConfigHashcode = getJawrConfigHashcode();
			boolean rebuildAllBundles = !config.getUseSmartBundling()
					|| (!jawrConfigHashcode.equals(storeJawrConfigHashcode));
			if (!rebuildAllBundles) {
				bundleToProcess = getBundlesToRebuild();
				if (!bundleToProcess.isEmpty() && LOGGER.isDebugEnabled()) {

					StringBuilder msg = new StringBuilder(
							"Jawr has detect changes on the following bundles, which will be updated :\n");
					for (JoinableResourceBundle b : bundleToProcess) {
						msg.append(b.getName()).append("\n");
					}
					LOGGER.debug(msg.toString());
				}
			} else {
				bundleMapping.clear();
				if (LOGGER.isDebugEnabled() && !jawrConfigHashcode.equals(storeJawrConfigHashcode)) {
					LOGGER.debug("Jawr config has changed since last bundling process. All bundles will be processed.");
				}
			}

			forceStoreJawrBundleMapping = !bundleToProcess.isEmpty();
		}

		// Execute processing
		build(bundleToProcess, forceStoreJawrBundleMapping, stopWatch);
	}