Package org.pentaho.platform.api.engine

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


  private AlgorithmParameterSpec paramSpec;
  private SecretKey secretKey;

  public void afterPropertiesSet() throws ObjectFactoryException {
    if ( ( saltString == null ) || ( algorithm == null ) || ( encryptionKey == null ) ) {
      throw new ObjectFactoryException( "Required properties not set - need Salt, algorithm and encryption key" );
    }
    if ( saltString.length() != this.saltLength ) {
      // Make sure that the salt length is 8 bytes - the PBEParameterSpec doesn't anything but
      if ( saltString.length() < saltLength ) {
        saltString = ( saltString + "!@#$%^&*" ).substring( 0, saltLength ); // postfix bytes to pad it out
      } else if ( saltString.length() > saltLength ) {
        saltString = saltString.substring( 0, saltLength ); // Trim off longer than 8-bytes
      }
    }
    byte[] saltBytes = saltString.getBytes();
    paramSpec = new PBEParameterSpec( saltBytes, getIterations() );
    PBEKeySpec skeySpec = new PBEKeySpec( getEncryptionKey().toCharArray(), saltBytes, getIterations() );
    try {
      secretKey = SecretKeyFactory.getInstance( getAlgorithm() ).generateSecret( skeySpec );
    } catch ( Exception ex ) {
      ex.printStackTrace();
      throw new ObjectFactoryException( "Encryption requested not available" );
    }

  }
View Full Code Here


  public IContentGenerator getContentGeneratorForType( String type, IPentahoSession session )
    throws ObjectFactoryException {
    try {
      return getContentGenerator( type, (String) null );
    } catch ( NoSuchBeanDefinitionException e ) {
      throw new ObjectFactoryException( e );
    }
  }
View Full Code Here

    SimpleUrlFactory urlFactory = new SimpleUrlFactory( "" ); //$NON-NLS-1$
    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, userSession );
    ISystemSettings systemSettings = PentahoSystem.getSystemSettings();

    if ( solutionEngine == null ) {
      throw new ObjectFactoryException( "No Solution Engine" );
    }

    boolean instanceEnds = "true".equalsIgnoreCase(
      requestParams.getStringParameter( "instanceends", "true" ) ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    String parameterXsl = systemSettings
View Full Code Here

        instance = classObject.newInstance();
      } catch ( Exception e ) {
        if ( e instanceof RuntimeException ) {
          throw (RuntimeException) e;
        }
        throw new ObjectFactoryException( e );
      }

      return instance;
    }
View Full Code Here

        return loader.loadClass( className );
      } catch ( Exception e ) {
        if ( e instanceof RuntimeException ) {
          throw (RuntimeException) e;
        }
        throw new ObjectFactoryException( e );
      }
    }
View Full Code Here

    }

    String msg =
      Messages.getInstance().getString( "AbstractSpringPentahoObjectFactory.WARN_FAILED_TO_RETRIEVE_OBJECT",
        interfaceClass.getSimpleName() );
    throw new ObjectFactoryException( msg );

  }
View Full Code Here

      readLock.unlock();
    }
    String msg =
      Messages.getInstance().getString( "AbstractSpringPentahoObjectFactory.WARN_FAILED_TO_RETRIEVE_OBJECT",
        clazz.getSimpleName() );
    throw new ObjectFactoryException( msg );

  }
View Full Code Here

  @Override protected T createObject() throws ObjectFactoryException {
    final IPentahoSession session = PentahoSessionHolder.getSession();
    try {
      return creator.create( session );
    } catch ( Exception e ) {
      throw new ObjectFactoryException( "Error creating instance", e );
    }
  }
View Full Code Here

    ObjectCreator creator = creators.get( key );
    if ( creator == null ) {
      String msg =
        Messages.getInstance()
          .getString( "AbstractSpringPentahoObjectFactory.WARN_FAILED_TO_CREATE_OBJECT", key ); //$NON-NLS-1$
      throw new ObjectFactoryException( msg );
    }

    Object instance = creator.getInstance( key, session );

    return instance;
View Full Code Here

      if ( t instanceof IPentahoInitializer ) {
        ( (IPentahoInitializer) t ).init( session );
      }
      return t;
    } catch ( Throwable th ) {
      throw new ObjectFactoryException( "Could not create instance for class " + classname, th );
    }
  }
View Full Code Here

TOP

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

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.