Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.PluginBeanDefinition


  protected void processBeans( PlatformPlugin plugin, Document doc ) {
    List<?> nodes = doc.selectNodes( "//bean" ); //$NON-NLS-1$
    for ( Object obj : nodes ) {
      Element node = (Element) obj;
      if ( node != null ) {
        plugin.addBean( new PluginBeanDefinition( node.attributeValue( "id" ), node.attributeValue( "class" ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
      }
    }
  }
View Full Code Here


    Collection<PluginBeanDefinition> beans = plugin.getBeans();

    assertEquals( "FooComponent was not loaded", 1, CollectionUtils.countMatches( beans, new Predicate() {
      public boolean evaluate( Object object ) {
        PluginBeanDefinition bean = (PluginBeanDefinition) object;
        return bean.getBeanId().equals( "FooComponent" )
            && bean.getClassname().equals( "org.pentaho.test.platform.plugin.pluginmgr.FooComponent" );
      }
    } ) );
    assertEquals( "genericBean was not loaded", 1, CollectionUtils.countMatches( beans, new Predicate() {
      public boolean evaluate( Object object ) {
        PluginBeanDefinition bean = (PluginBeanDefinition) object;
        return bean.getBeanId().equals( "genericBean" ) && bean.getClassname().equals( "java.lang.Object" );
      }
    } ) );
  }
View Full Code Here

    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      // need to set source description - classloader needs it
      p.setId( "good-plugin1" );
      p.setSourceDescription( "good-plugin1" );
      p.addBean( new PluginBeanDefinition( "TestMockComponent",
        "org.pentaho.test.platform.engine.core.MockComponent" ) );
      p.addBean( new PluginBeanDefinition( "TestPojo", "java.lang.String" ) );
      p.addBean( new PluginBeanDefinition( "TestClassNotFoundComponent", "org.pentaho.test.NotThere" ) );
      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

  public static class Tst6PluginProvider implements IPluginProvider {
    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin();
      p.setId( "test6Plugin" );
      p.addBean( new PluginBeanDefinition( "bean1", "java.lang.String" ) );
      p.addBean( new PluginBeanDefinition( "bean1", "java.lang.Object" ) );
      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

    public List<IPlatformPlugin> getPlugins( IPentahoSession session ) throws PlatformPluginRegistrationException {
      PlatformPlugin p = new PlatformPlugin( new DefaultListableBeanFactory() );
      p.setId( "test8Plugin" );
      // need to set source description - classloader needs it
      p.setSourceDescription( "good-plugin1" );
      p.addBean( new PluginBeanDefinition( "PluginOnlyClass", "org.pentaho.nowhere.PluginOnlyClass" ) );
      // PluginOnlyClassSpringFile
      BeanDefinition beanDef =
        BeanDefinitionBuilder.rootBeanDefinition( "org.pentaho.nowhere.PluginOnlyClass" ).setScope(
          BeanDefinition.SCOPE_PROTOTYPE ).getBeanDefinition();
      p.getBeanFactory().registerBeanDefinition( "PluginOnlyClassSpringFile", beanDef );
View Full Code Here

      pws.setDescription( "ws11description" );
      pws.setServiceBeanId( "org.pentaho.test.platform.engine.core.EchoServiceBean" );
      p.addWebservice( pws );

      // defining bean with null id, the classname will be used as the id
      p.addBean( new PluginBeanDefinition( null, "org.pentaho.test.platform.engine.core.EchoServiceBean" ) );

      return Arrays.asList( (IPlatformPlugin) p );
    }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.PluginBeanDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.