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


Java Platform类代码示例

本文整理汇总了Java中org.eclipse.birt.core.framework.Platform的典型用法代码示例。如果您正苦于以下问题:Java Platform类的具体用法?Java Platform怎么用?Java Platform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Platform类属于org.eclipse.birt.core.framework包,在下文中一共展示了Platform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
@PostConstruct
public void init() {
    EngineConfig engineConfig = new EngineConfig();
    engineConfig.setLogConfig("logs", Level.WARNING);

    try {
        Platform.startup(engineConfig);
    } catch(Exception e) {
        logger.error("Birt platform startup error", e);
        System.exit(2);
    }

    IReportEngineFactory factory =
            (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
    reportEngine = factory.createReportEngine(engineConfig);
}
 
开发者ID:n-at,项目名称:arbirter,代码行数:17,代码来源:BirtEngine.java

示例2: getObject

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
@Override
public IReportEngine getObject() throws Exception {
	try {
		EngineConfig config = getEngineConfig();

		Platform.startup(config);
		IReportEngineFactory factory = (IReportEngineFactory) Platform
				.createFactoryObject(
						IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
		birtEngine = factory.createReportEngine(config);
		return birtEngine;
	} catch (BirtException be) {
		throw new BirtSystemException("Failed to start birt engine.", be);
	}

}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:17,代码来源:BirtEngineFactory.java

示例3: getDesignEngine

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
private IDesignEngine getDesignEngine( )
{

	DesignConfig config = new DesignConfig( );
	try
	{
		Platform.startup( config );
	}
	catch ( BirtException e )
	{
		e.printStackTrace( );
	}

	Object factory = Platform.createFactoryObject( IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );

	return ( (IDesignEngineFactory) factory ).createDesignEngine( config );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:GroupOnYAxis.java

示例4: getDesignEngine

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
private IDesignEngine getDesignEngine( )
{
	DesignConfig config = new DesignConfig( );
	try
	{
		Platform.startup( config );
	}
	catch ( BirtException e )
	{
		e.printStackTrace( );
	}

	Object factory = Platform.createFactoryObject( IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );

	return ( (IDesignEngineFactory) factory ).createDesignEngine( config );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:MeterChartExample.java

示例5: newSession

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * @param platformConfig
 * @param context
 * @return an instance of data adaptor
 * @throws BirtException
 */
public static DataRequestSession newSession( PlatformConfig platformConfig,
		DataSessionContext context ) throws BirtException
{
	ULocale locale = context.getDataEngineContext().getLocale( );
	if( locale != null && locale != ULocale.getDefault( ) )
		AdapterException.setULocale( locale );
	
	Platform.startup( platformConfig );

	Object factory = Platform.createFactoryObject( IDataAdapterFactory.EXTENSION_DATA_ADAPTER_FACTORY );
	if ( factory instanceof IDataAdapterFactory )
	{
		return ( (IDataAdapterFactory) factory ).createSession( context );
	}
	else
	{
		throw new AdapterException( ResourceConstants.LOAD_FACTORY_ERROR );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:26,代码来源:DataRequestSession.java

示例6: newDataEngine

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
    * @param context
    * @return
    * @throws BirtException 
    */
   public static DataEngine newDataEngine( PlatformConfig platformConfig,
		DataEngineContext dataContext ) throws BirtException
{
	Platform.startup( platformConfig );

	Object factory = Platform.createFactoryObject( IDataEngineFactory.EXTENSION_DATA_ENGINE_FACTORY );
	if ( factory instanceof IDataEngineFactory )
	{
		return ( (IDataEngineFactory) factory ).createDataEngine( dataContext );
	}
	else
	{
		throw new DataException( ResourceConstants.LOAD_FACTORY_ERROR );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:DataEngine.java

示例7: ReportEngine

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * Constructor. If config is null, engine derives BIRT_HOME from the
 * location of the engine jar file, and derives data driver directory as
 * $BIRT_HOME/drivers. For a simple report with no images and links, engine
 * will run without complaining. If the report has image/chart defined, the
 * engine has to be configured with relevant image and chart handlers.
 * 
 * @param config
 *            an engine configuration object used to configure the engine
 */
public ReportEngine( EngineConfig config )
{
	try
	{
		Platform.startup( config );
	}
	catch ( BirtException ex )
	{
		logger.log( Level.SEVERE, ex.getMessage( ), ex );
	}

	Object factory = Platform
			.createFactoryObject(  IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
	if ( factory instanceof IReportEngineFactory )
	{
		engine = ( (IReportEngineFactory) factory )
				.createReportEngine( config );
	}
	if ( engine == null )
	{
		System.out.println( "Can not load the report engine" );
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:34,代码来源:ReportEngine.java

示例8: createReportEngine

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
public IReportEngine createReportEngine( )
{
	EngineConfig config = new EngineConfig( );
	HashMap map = new HashMap( );
	File jar = new File( JAR );
	map.put( EngineConstants.PROJECT_CLASSPATH_KEY, jar.getAbsolutePath( ));
	config.setAppContext( map );
	// assume we has in the platform
	Object factory = Platform
			.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
	if ( factory instanceof IReportEngineFactory )
	{
		return ( (IReportEngineFactory) factory )
				.createReportEngine( config );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:PageScriptHandlerTest.java

示例9: testCreateFactoryObject

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
public void testCreateFactoryObject()
{
	try
	{
		EngineConfig config = new EngineConfig( );
		Object factory = Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
		assertTrue( factory instanceof IReportEngineFactory );
		IReportEngine engine = null;
		if( factory instanceof IReportEngineFactory )
		{
			engine = ((IReportEngineFactory)factory).createReportEngine( config );
			assert( engine != null);
		}
	}
	catch(Exception ex)
	{
		ex.printStackTrace( );
		fail();
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:ReportEngineFactoryTest.java

示例10: ModelOdaAdapter

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * Constructs a DesignEngine with the given platform config.
 * 
 * @param config
 *            the platform config.
 */

public ModelOdaAdapter( )
{
	Object factory = Platform
			.createFactoryObject( IAdapterFactory.EXTENSION_MODEL_ADAPTER_ODA_FACTORY );
	if ( factory instanceof IAdapterFactory )
	{
		adapter = ( (IAdapterFactory) factory ).createModelOdaAdapter( );
	}
	if ( adapter == null )
	{
		errorLogger.log( Level.INFO,
				"Can not start the model adapter oda factory." ); //$NON-NLS-1$
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:ModelOdaAdapter.java

示例11: getFactory

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * @return the factory
 */

public static IODAFactory getFactory( )
{
	if ( factory != null )
		return factory;

	Object adapterFactory = Platform
			.createFactoryObject( IAdapterFactory.EXTENSION_MODEL_ADAPTER_ODA_FACTORY );

	if ( adapterFactory == null )
	{
		errorLogger
				.log( Level.SEVERE,
						"The platform has not yet been started. Must start it first..." ); //$NON-NLS-1$
		return null;
	}

	if ( adapterFactory instanceof IAdapterFactory )
	{
		factory = ( (IAdapterFactory) adapterFactory ).getODAFactory( );
	}

	return factory;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:28,代码来源:ODAFactory.java

示例12: getFactory

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * @return the factory
 */

public synchronized static IODADesignFactory getFactory( )
{
	if ( factory != null )
		return factory;

	Object adapterFactory = Platform
			.createFactoryObject( IAdapterFactory.EXTENSION_MODEL_ADAPTER_ODA_FACTORY );

	if ( adapterFactory == null )
	{
		errorLogger
				.log( Level.SEVERE,
						"The platform has not yet been started. Must start it first..." ); //$NON-NLS-1$
		return null;
	}

	if ( adapterFactory instanceof IAdapterFactory )
	{
		factory = ( (IAdapterFactory) adapterFactory )
				.getODADesignFactory( );
	}

	return factory;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:29,代码来源:ODADesignFactory.java

示例13: ReportParameterAdapter

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * Default constructor.
 */

public ReportParameterAdapter( )
{
	Object factory = Platform
			.createFactoryObject( IAdapterFactory.EXTENSION_MODEL_ADAPTER_ODA_FACTORY );
	if ( factory instanceof IAdapterFactory )
	{
		adapter = ( (IAdapterFactory) factory )
				.createReportParameterAdapter( );
	}
	if ( adapter == null )
	{
		errorLogger.log( Level.INFO,
				"Can not start the model adapter oda factory." ); //$NON-NLS-1$
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ReportParameterAdapter.java

示例14: getExtensionElements

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
private static List getExtensionElements( String extensionPointID )
{
	IExtensionRegistry registry = Platform.getExtensionRegistry( );

	if ( registry == null )
	{
		return Collections.EMPTY_LIST;
	}

	IExtensionPoint extensionPoint = registry.getExtensionPoint( extensionPointID );

	if ( extensionPoint == null )
	{
		return Collections.EMPTY_LIST;
	}

	return Arrays.asList( extensionPoint.getExtensions( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ViewerExtensionManager.java

示例15: start

import org.eclipse.birt.core.framework.Platform; //导入依赖的package包/类
/**
 * This method is called upon plug-in activation.
 */
public void start( BundleContext context ) throws Exception
{
	super.start( context );
	ClassLoader contextClassLoader = (ClassLoader) AccessController
			.doPrivileged( new PrivilegedAction<Object>( ) {

				public Object run( )
				{
					return Thread.currentThread( ).getContextClassLoader( );
				}
			} );

	Platform.setPlatform( new EclipsePlatform( context, contextClassLoader ) );
	FunctionProvider.setFunctionProvider( new FunctionProviderImpl( ) );
	ScriptEngineFactoryManager
			.setInstance( new ScriptEngineFactoryManagerImpl( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:CorePlugin.java


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