Exemplo n.º 1
0
  /* package */ static void destroy() {
    ParseEventuallyQueue queue;
    synchronized (MUTEX) {
      queue = eventuallyQueue;
      eventuallyQueue = null;
    }
    if (queue != null) {
      queue.onDestroy();
    }

    ParseCorePlugins.getInstance().reset();
    ParsePlugins.reset();
  }
Exemplo n.º 2
0
  // 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();
 }
Exemplo n.º 4
0
 /* package for tests */ static void disableLocalDatastore() {
   setLocalDatastore(null);
   // We need to re-register ParseCurrentInstallationController otherwise it is still offline
   // controller
   ParseCorePlugins.getInstance().reset();
 }