本文整理汇总了Java中org.pentaho.di.core.plugins.PluginRegistry.getClassLoader方法的典型用法代码示例。如果您正苦于以下问题:Java PluginRegistry.getClassLoader方法的具体用法?Java PluginRegistry.getClassLoader怎么用?Java PluginRegistry.getClassLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.plugins.PluginRegistry
的用法示例。
在下文中一共展示了PluginRegistry.getClassLoader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDatabaseFactory
import org.pentaho.di.core.plugins.PluginRegistry; //导入方法依赖的package包/类
public DatabaseFactoryInterface getDatabaseFactory() throws Exception
{
PluginRegistry registry = PluginRegistry.getInstance();
PluginInterface plugin = registry.getPlugin(DatabasePluginType.class, databaseInterface.getPluginId());
if (plugin==null) {
throw new KettleDatabaseException("database type with plugin id ["+databaseInterface.getPluginId()+"] couldn't be found!");
}
ClassLoader loader = registry.getClassLoader(plugin);
Class<?> clazz = Class.forName(databaseInterface.getDatabaseFactoryName(),true,loader);
return (DatabaseFactoryInterface)clazz.newInstance();
}
示例2: getDatabaseFactory
import org.pentaho.di.core.plugins.PluginRegistry; //导入方法依赖的package包/类
public DatabaseFactoryInterface getDatabaseFactory() throws Exception {
PluginRegistry registry = PluginRegistry.getInstance();
PluginInterface plugin = registry.getPlugin( DatabasePluginType.class, databaseInterface.getPluginId() );
if ( plugin == null ) {
throw new KettleDatabaseException( "database type with plugin id ["
+ databaseInterface.getPluginId() + "] couldn't be found!" );
}
ClassLoader loader = registry.getClassLoader( plugin );
Class<?> clazz = Class.forName( databaseInterface.getDatabaseFactoryName(), true, loader );
return (DatabaseFactoryInterface) clazz.newInstance();
}
示例3: loadStepImages
import org.pentaho.di.core.plugins.PluginRegistry; //导入方法依赖的package包/类
/**
* Load all step images from files.
*/
private void loadStepImages() {
// imagesSteps.clear();
// imagesStepsSmall.clear();
//
// STEP IMAGES TO LOAD
//
PluginRegistry registry = PluginRegistry.getInstance();
List<PluginInterface> steps = registry.getPlugins( StepPluginType.class );
for ( PluginInterface step : steps ) {
if ( imagesSteps.get( step.getIds()[ 0 ] ) != null ) {
continue;
}
SwtUniversalImage image = null;
Image small_image = null;
String filename = step.getImageFile();
try {
ClassLoader classLoader = registry.getClassLoader( step );
image = SwtSvgImageUtil.getUniversalImage( display, classLoader, filename );
} catch ( Throwable t ) {
log.logError( "Error occurred loading image [" + filename + "] for plugin " + step, t );
} finally {
if ( image == null ) {
log.logError( "Unable to load image file [" + filename + "] for plugin " + step );
image = SwtSvgImageUtil.getMissingImage( display );
}
}
// Calculate the smaller version of the image @ 16x16...
// Perhaps we should make this configurable?
//
small_image = image.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE );
imagesSteps.put( step.getIds()[ 0 ], image );
imagesStepsSmall.put( step.getIds()[ 0 ], small_image );
}
}
示例4: loadJobEntryImages
import org.pentaho.di.core.plugins.PluginRegistry; //导入方法依赖的package包/类
/**
* Load all step images from files.
*/
private void loadJobEntryImages() {
imagesJobentries = new Hashtable<String, SwtUniversalImage>();
imagesJobentriesSmall = new Hashtable<String, Image>();
// //
// // JOB ENTRY IMAGES TO LOAD
// //
PluginRegistry registry = PluginRegistry.getInstance();
List<PluginInterface> plugins = registry.getPlugins( JobEntryPluginType.class );
for ( int i = 0; i < plugins.size(); i++ ) {
PluginInterface plugin = plugins.get( i );
if ( "SPECIAL".equals( plugin.getIds()[ 0 ] ) ) {
continue;
}
SwtUniversalImage image = null;
Image small_image = null;
String filename = plugin.getImageFile();
try {
ClassLoader classLoader = registry.getClassLoader( plugin );
image = SwtSvgImageUtil.getUniversalImage( display, classLoader, filename );
} catch ( Throwable t ) {
log.logError( "Error occurred loading image [" + filename + "] for plugin " + plugin.getIds()[ 0 ], t );
} finally {
if ( image == null ) {
log.logError( "Unable to load image [" + filename + "] for plugin " + plugin.getIds()[ 0 ] );
image = SwtSvgImageUtil.getMissingImage( display );
}
}
// Calculate the smaller version of the image @ 16x16...
// Perhaps we should make this configurable?
//
if ( image != null ) {
small_image = image.getAsBitmapForSize( display, ConstUI.MEDIUM_ICON_SIZE, ConstUI.MEDIUM_ICON_SIZE );
}
imagesJobentries.put( plugin.getIds()[ 0 ], image );
imagesJobentriesSmall.put( plugin.getIds()[ 0 ], small_image );
}
}