/* package */ static void destroy() { ParseEventuallyQueue queue; synchronized (MUTEX) { queue = eventuallyQueue; eventuallyQueue = null; } if (queue != null) { queue.onDestroy(); } ParseCorePlugins.getInstance().reset(); ParsePlugins.reset(); }
// Initialize all necessary http clients and add interceptors to these http clients private static void initializeParseHttpClientsWithParseNetworkInterceptors() { // This means developers have not called addInterceptor method so we should do nothing. if (interceptors == null) { return; } List<ParseHttpClient> clients = new ArrayList<>(); // Rest http client clients.add(ParsePlugins.get().restClient()); // AWS http client clients.add(ParseCorePlugins.getInstance().getFileController().awsClient()); // Add interceptors to http clients for (ParseHttpClient parseHttpClient : clients) { for (ParseNetworkInterceptor interceptor : interceptors) { parseHttpClient.addExternalInterceptor(interceptor); } } // Remove interceptors reference since we do not need it anymore interceptors = null; }
@After public void tearDown() { ParseCorePlugins.getInstance().reset(); }
/* package for tests */ static void disableLocalDatastore() { setLocalDatastore(null); // We need to re-register ParseCurrentInstallationController otherwise it is still offline // controller ParseCorePlugins.getInstance().reset(); }