Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-858

Deprecate callbacks

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: API
    • Labels:
      None

      If we look at the usage of the following classes, we will see that they are actually used only by corresponding decoders.

      • org.bson.BSONCallback
      • org.bson.EmptyBSONCallback
      • org.bson.LazyBSONCallback
      • org.bson.BasicBSONCallback
      • com.mongodb.DBCallback
      • com.mongodb.DefaultDBCallback
      • com.mongodb.LazyDBCallback
      • com.mongodb.LazyWritableDBCallback
      • com.mongodb.util.JSONCallback
      • com.mongodb.DBCallbackFactory

      At the same time com.mongodb.DBCallbackFactory is used only by DefaultDBCallback, where it is a public static field. So I think that it's better to hide all this from public api in future releases, and for now we can deprecate them.

      Also we will be able to deprecate the following methods:

      • org.bson.BSONDecoder
        • int decode( byte[] b , BSONCallback callback );
        • int decode( InputStream in , BSONCallback callback ) throws IOException;
      • com.mongodb.DBDecoder
        • DBCallback getDBCallback(DBCollection collection);

      As for com.mongodb.util.JSONCallback, we can just make it package-private and use directly in com.mongodb.util.JSON.JSONParser.

            Assignee:
            Unassigned Unassigned
            Reporter:
            uladzimir_mihura@epam.com Uladzimir Mihura
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: