Package org.drools

Examples of org.drools.RuntimeDroolsException


    public short getShortValue(InternalWorkingMemory workingMemory,
                               final Object object) {
        if ( this.objectType.getValueType().isNumber() ) {
            return ((Number) object).shortValue();
        }
        throw new RuntimeDroolsException( "Conversion to short not supported for type: " + object.getClass() );
    }
View Full Code Here


    public Method getNativeReadMethod() {
        try {
            return this.getClass().getDeclaredMethod( "getValue",
                                                      new Class[]{InternalWorkingMemory.class, Object.class} );
        } catch ( final Exception e ) {
            throw new RuntimeDroolsException( "This is a bug. Please report to development team: " + e.getMessage(),
                                              e );
        }
    }
View Full Code Here

            if ( wireable.getClassType() == null || ! wireable.getClassType().isPrimitive() ) {
                Class cls = this.cache.getClassLoader().loadClass( wireable.getClassName() );
                wireable.wire( cls );
            }
        } catch ( ClassNotFoundException e ) {
            throw new RuntimeDroolsException( "Unable to load ClassObjectType class '" + wireable.getClassName() + "'" );
        }
    }
View Full Code Here

                        while ( (action = actionQueue.poll()) != null ) {
                            try {
                                action.execute( this );
                            } catch ( Exception e ) {
                                throw new RuntimeDroolsException( "Unexpected exception executing action " + action.toString(),
                                                                  e );
                            }
                        }
                    }
                } finally {
View Full Code Here

                                                                  ruleDescr.getLhs(),
                                                                  prefixPattern );

            context.getRule().setLhs( ce );
        } else {
            throw new RuntimeDroolsException( "BUG: builder not found for descriptor class " + ruleDescr.getLhs().getClass() );
        }

        // build all the rule's attributes
        // must be after building LHS because some attributes require bindings from the LHS
        buildAttributes( context );
View Full Code Here

                // builder will return null. Ex: ClassNotFound for the pattern type
                if ( element != null ) {
                    ge.addChild( element );
                }
            } else {
                throw new RuntimeDroolsException( "BUG: no builder found for descriptor class " + child.getClass() );
            }

        }

        context.getBuildStack().pop();
View Full Code Here

        } else if ( NotDescr.class.isAssignableFrom( descr ) ) {
            return GroupElementFactory.newNotInstance();
        } else if ( ExistsDescr.class.isAssignableFrom( descr ) ) {
            return GroupElementFactory.newExistsInstance();
        } else {
            throw new RuntimeDroolsException( "BUG: Not able to create a group element for descriptor: " + descr.getName() );
        }
    }
View Full Code Here

            KeyStoreHelper helper,
            byte[] buff ) {
        try {
            stream.writeObject( helper.signDataWithPrivateKey( buff ) );
        } catch (Exception e) {
            throw new RuntimeDroolsException( "Error signing object store: " + e.getMessage(),
                                              e );
        }
    }
View Full Code Here

    public void readExternal( ObjectInput stream ) throws IOException,
            ClassNotFoundException {
        KeyStoreHelper helper = new KeyStoreHelper();
        boolean signed = stream.readBoolean();
        if (helper.isSigned() != signed) {
            throw new RuntimeDroolsException( "This environment is configured to work with " +
                                              ( helper.isSigned() ? "signed" : "unsigned" ) +
                                              " serialized objects, but the given object is " +
                                              ( signed ? "signed" : "unsigned" ) + ". Deserialization aborted." );
        }
        String pubKeyAlias = null;
        if (signed) {
            pubKeyAlias = (String) stream.readObject();
            if (helper.getPubKeyStore() == null) {
                throw new RuntimeDroolsException(
                                                  "The package was serialized with a signature. Please configure a public keystore with the public key to check the signature. Deserialization aborted." );
            }
        }

        // Return the object stored as a byte[]
View Full Code Here

        byte[] signature = (byte[]) stream.readObject();
        try {
            if (!helper.checkDataWithPublicKey( pubKeyAlias,
                                                bytes,
                                                signature )) {
                throw new RuntimeDroolsException(
                                                  "Signature does not match serialized package. This is a security violation. Deserialisation aborted." );
            }
        } catch (InvalidKeyException e) {
            throw new RuntimeDroolsException( "Invalid key checking signature: " + e.getMessage(),
                                              e );
        } catch (KeyStoreException e) {
            throw new RuntimeDroolsException( "Error accessing Key Store: " + e.getMessage(),
                                              e );
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeDroolsException( "No algorithm available: " + e.getMessage(),
                                              e );
        } catch (SignatureException e) {
            throw new RuntimeDroolsException( "Signature Exception: " + e.getMessage(),
                                              e );
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.RuntimeDroolsException

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.