当前位置: 首页>>代码示例>>Java>>正文


Java PluginRegistry.getClassLoader方法代码示例

本文整理汇总了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();
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:14,代码来源:DatabaseMeta.java

示例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();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:14,代码来源:DatabaseMeta.java

示例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 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:44,代码来源:GUIResource.java

示例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 );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:47,代码来源:GUIResource.java


注:本文中的org.pentaho.di.core.plugins.PluginRegistry.getClassLoader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。