Sunday, January 16, 2011

Plugging 3rd party jars into DiffKit

With the 0.8.10 release, you can add third-party jars to DiffKit. DiffKit will recognize JDBC drivers found in those jars, as well as custom Sources, Sinks, and Diffors.
The DiffKit distribution includes a directory "dropin". It’s directly under the DIFFKIT_HOME directory, which is normally the same directory that the diffkit-app.jar is in after you have unzipped the binary download. The directory in the distribution is empty. Any extra jars that you want DiffKit to recognized you can simply copy into the dropin directory. DiffKit will automatically load all jars within dropin each time it runs. Note well that the only archive type that DiffKit recognizes is jar-- it does not recognize zip, war, ear, etc.
All jars within dropin are loaded before any of the third-party jars that are embedded within DiffKit. That means you can override JDBC drivers that are part of the DiffKit binary distribution. You might need to do this in the case of HyperSQL DB, where the version of the JDBC driver must match the version of the DB server. You might also want to add a new JDBC driver in the case where the vendor supplies a newer version of the driver than the one that DiffKit embeds, and that newer version is higher performance.
The principal use for dropins is to allow the user to write custom Source/Sink/Diffor java classes, and then plug those custom implementations into DiffKit. Source/Sink/Diff are documented in the User Guide. Those three key abstractions are represented as Java Interfaces within DiffKit. You can write your own Java classes that implement those Interfaces. You will need to use a PassthroughPlan to reference the custom classes, because MagicPlan does not recognize them. Custom classes are referenced within the Passthrough plan in exactly the same way that DiffKit native classes are.
As a trivial example of a custom Sink, the DiffKit source distribution includes class org.diffkit.contrib.DKSimpleCustomSink. org.diffkit.contrib is a package that is not included in the binary distribution. You can plug that custom Sink into your plan with, for instance, this specification:
...
<bean id="plan" class="org.diffkit.diff.conf.DKPassthroughPlan">
   <property name="lhsSource" ref="lhs.source" />
   <property name="rhsSource" ref="rhs.source" />
   <property name="sink" ref="customSink" />
   <property name="tableComparison" ref="table.comparison" />
</bean>
...
<bean id="customSink" class="org.diffkit.contrib.DKSimpleCustomSink">
   <constructor-arg index="0" value="./custom_report.diff" />
</bean>
...
Having DiffKit recognize your custom Sink is simply a matter of compiling and archiving the org.diffkit.contrib.DKSimpleCustomSink into a jar file, and the dropping that jar file into the dropin directory.

30 comments:

  1. In the particular article You might understand how for getting started building net applications services web design

    ReplyDelete
  2. Thanks for the good words! Really appreciated. Great post. I ve been commenting a lot on a few blogs recently, but I had nt thought about my approach until you brought it up.

    SAP training in Chennai

    ReplyDelete
  3. A nice article here, i think that people who have grown up with the idea of using computers are showing more responsibility towards writing posts that are thoughtful, do not have grammar mistakes and pertinent to the post..

    Online Training in Chennai

    ReplyDelete
  4. Your tips are really wonderful and its ideas are really well good and it makes me to think a very well good ideas. thus it is informative and it is really interesting.

    Online Reputation Management

    ReplyDelete
  5. very useful information provided in this blog. concepts were explained in a detailed manner. Keep giving these types of information.
    SEO company in Chennai

    ReplyDelete
  6. Thank you for sharing such a nice and interesting blog with us. Hope it might be much useful for us. keep on updating...!!
    seo company in india
    digital marketing company in india
    seo company in chennai
    digital marketing company in chennai

    ReplyDelete
  7. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have Keep up the good work you are doing here.Well, got a good knowledge.

    Laser Root Canal Treatment In Chennai

    Best Dental Clinic In Velachery

    ReplyDelete
  8. Imagine to browse the map and get the most relevant pictures with a magnifying glass through a tiled view composed of three concentric levels. kakskachatsoftnatelefon.ru Baby Minder is a timer application that has been developed by a mom with a newborn.

    ReplyDelete
  9. IN the forum he tells us to e-mail the developer who is in help. download tv shows New this versionMajor user interface & graphics upgrade.

    ReplyDelete
  10. To get the item needing to travel to the moon that has a much stronger stone than steel, dwarf goes on a various and fantastic puzzle expedition. download music For the past few months, shes been on her own in the yellow house, managing somehow, knowing that her mother will probably never return.

    ReplyDelete
  11. Whenever you launch the app or switch back to the app, you need to authenticate. Try this! Meditation has been a remedy for thousands of years, not only in eastern religions.

    ReplyDelete
  12. Do you want to get out of bed early and be on time for your appointments. download activation codes Compete against your peers or even parents by setting different levels of difficulty.

    ReplyDelete
  13. Category: Productivity Released: January 2010 Version: 1. link for you From Nathan Fennel: Color Springboard provides a simple set of tools for finding the perfect color for your design projects.

    ReplyDelete
  14. As a vague image forms in your mind, sketch it as best as possible in step one. http://novico.ru High contrast colored maps to quickly pinpoint problems on the road.

    ReplyDelete
  15. "This app completely re-invents the round timer, and every. http://uborka-kvartir-krasnodar.ru From DC-Matic: Comic book reader designed to display your purchased or scanned comic books in their proper size.

    ReplyDelete
  16. Great info! I recently came across your blog and have been reading along.
    eCommerce Supply Chain Management

    ReplyDelete
  17. Practice Mode: Hone your skills in this free play mode. neerajanam telugu movie songs This feature is only available on the deluxe version.

    ReplyDelete
  18. Great info! I recently came across your blog and have been reading along.

    Dot Net Training Institute in Chennai

    ReplyDelete
  19. Great info! I recently came across your blog and have been reading along.

    Android Training Institute in Chennai

    ReplyDelete
  20. Click the popover button on the top left to change the image. downlodable games I Saw Mommy Kissing Santa Claus Frosty The Snowman2.

    ReplyDelete
  21. - Windows 7 only: View a currently played Video, jump to a position inside it. downloadsoftwarefromskylar.club Exam Tips: Ideas of what to do before, during and after an exam.

    ReplyDelete