jgit/org.eclipse.jgit
Shawn O. Pearce 6fc3ecac84 Extract PackFile specific code to ObjectToPack subclass
The ObjectReader class is dual-purposed into being a factory for the
ObjectToPack, permitting specific ObjectDatabase implementations
to override the method and offer their own custom subclass of the
generic ObjectToPack class.  By allowing them to directly extend the
type, each implementation can add custom fields to support tracking
where an object is stored, without incurring any additional penalties
like a parallel Map<ObjectId,Object> would cost.

The reader was chosen to act as a factory rather than the database,
as the reader will eventually be tied more tightly with the
ObjectWalk and TreeWalk.  During object enumeration the reader
would have had to load the object for the RevWalk, and may chose
to cache object position data internally so it can later be reused
and fed into the ObjectToPack instance supplied to the PackWriter.
Since a reader is not thread-safe, and is scoped to this PackWriter
and its internal ObjectWalk, its a great place for the database to
perform caching, if any.

Right now this change goes a bit backwards by changing what should
be generic ObjectToPack references inside of PackWriter to the very
PackFile specific LocalObjectToPack subclass.  We will correct these
in a later commit as we start to refine what the ObjectToPack API
will eventually look like in order to better support the PackWriter.

Change-Id: I9f047d26b97e46dee3bc0ccb4060bbebedbe8ea9
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-25 23:26:19 -07:00
..
.settings Fix line endings 2010-06-18 23:36:18 +02:00
META-INF Redo event listeners to be more generic 2010-06-25 18:03:41 -07:00
findBugs Initial JGit contribution to eclipse.org 2009-09-29 16:47:03 -07:00
resources/org/eclipse/jgit Refactor repository construction to builder class 2010-06-25 17:58:40 -07:00
src/org/eclipse/jgit Extract PackFile specific code to ObjectToPack subclass 2010-06-25 23:26:19 -07:00
.classpath Externalize strings from JGit 2010-05-19 14:37:16 -07:00
.fbprefs Initial JGit contribution to eclipse.org 2009-09-29 16:47:03 -07:00
.gitignore Finish removing Apache Felix maven-bundle-plugin 2010-01-12 11:46:55 -08:00
.project Adding PDE API Tools nature to JGit 2010-01-16 10:00:30 -06:00
about.html Adding some Eclipse-related legal files to JGit 2010-02-03 15:18:06 -06:00
build.properties Add "resources/" as a source folder 2010-06-05 14:39:27 +02:00
plugin.properties Cleaning up provider and feature names 2010-04-27 09:26:25 -05:00
pom.xml Start 0.9 development 2010-06-14 08:11:27 -07:00