Checks to see if Mac OS is available. If so,
goes ahead and loads the class by name that
actually performs the initialization. If not,
the class is never loaded. This helps prevent
classloader problems on non-Mac OS systems.
if(System.getProperty("mrj.version") != null)
isMacOS = true;
if(isMacOS)
{
try
{
// This requests the classloader to find a
// given class by name. We are using this to
// establish a firewall between the application
// and Mac OS X dependencies. This helps isolate
// the application logic for organizational purposes,
// as well as ensure that we won't try to drag Mac OS
// references into our crossplatform code.
Class myClass = Class.forName("com.wiverson.macosbook.plugin.FinderIntegration");
Object myObject = myClass.getConstructor(null).newInstance(null);
myClass.getDeclaredMethod("execute", null).invoke(myObject, null);;
} catch (Exception e)
{
System.out.println("Unable to load FinderIntegration module.");
e.printStackTrace();
}
}