Hitachi Vantara Pentaho Community Wiki

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
titleIn OSGI Bundle
BundleContext cxt = ...
IContentInfo infoInstance = new ContentInfo();
HashTableHashtable props = new HashTableHashtable( { put("prop1", "value"); } );
cxt.registerService( IContentInfo.class, infoInstance, props );


Code Block
import static org.pentaho.platform.api.engine.IPentahoRegistrableObjectFactory.Types;

// Session-Based will call the IObjectCreator for each unique IPentahoSession it's called with. Subsequent calls with the same session will return the same Object
SessionBoundPentahoObjectReference sessionReference = new SessionBoundPentahoObjectReference.Builder<UUID>( UUID.class ).creator(
  new IObjectCreator<UUID>() {
    @Override public UUID create( IPentahoSession session ) {
      return UUID.randomUUID();
PentahoSystem.registerReference( sessionReference, UUID.class );


Both PentahoSystem.registerObject and PentahoSystem.registerReference return a IPentahoObjectRegistration handle. This can be used later to de-register the Object or Reference

Code Block
titleRegistration Handles

IPentahoObjectRegistration handle = PentahoSystem.registerObject( "Testing", Types.CLASSES );

// later when you want to remove this registration

The new EEPluginManager uses these methods to store plugin objects in the PentahoSystem instead of keeping them hidden within, as was done in the DefaultPluginManager. The result is that you no longer have to make calls to the IPluginManager and can instead query the PentahoSystem: