How do I load classes using the ctools plugin class loader? Perhaps, the question should be how do I implement ctools plugins using classes to extend different types of an object? I can't find a simple explanation.
mymodule.module:

&lt;?php
/**
 * Implements hook_ctools_plugin_api().
 */
function mymodule_ctools_plugin_api() {
    list($module, $api) = func_get_args();

    if ($module == 'mymodule' &amp;&amp; ($api == 'plugins')) {
        return array('version' =&gt; 1.0);
    }
}

/**
 * Implements hook_ctools_plugin_type().
 */
function mymodule_ctools_plugin_type() {
    return array(
        'plugin_type' =&gt; array(
            'classes' =&gt; array('handler'),
        ),
    );
}

/**
 * Implements hook_ctools_plugin_directory().
 */
function mymodule_ctools_plugin_directory($owner, $plugin_type) {
    if ($owner == 'mymodule') {
        return "plugins/$plugin_type";
    }
}


plugins/plugin_type/example.inc:

&lt;?php
$plugin = array(
    'title' =&gt; t('Example'),
    'handler' =&gt; array(
        'class' =&gt; 'ExamplePlugin',
    ),
);


plugins/plugin_type/ExamplePlugin.class.inc:

&lt;?php
class ExamplePlugin {
function __construct($plugin){

}
}


Anywhere:

&lt;?php
// Get all available plugins
$plugins = ctools_get_plugins('mymodule', 'plugin_type');

// Load a specific plugin
ctools_include('plugins');
$plugin = ctools_get_plugins('mymodule', 'plugin_type', 'example');
$class_name = ctools_plugin_get_class($plugin, 'handler');
$example = new ExamplePlugin($plugin);