Examples of DroolsObjectInputStream


Examples of org.drools.common.DroolsObjectInputStream

                if (context.classLoader != null ){
                    classLoader = context.classLoader;
                } else if(context.ruleBase != null){
                    classLoader = context.ruleBase.getRootClassLoader();
                }
                ctx.read( new DroolsObjectInputStream( _entry.getData().newInput(), classLoader) );
            }
        }
    }
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

    }

    public void readExternal(ObjectInput in) throws IOException,
                                            ClassNotFoundException {
        boolean isDrools = in instanceof DroolsObjectInputStream;
        DroolsObjectInputStream droolsStream;
        ByteArrayInputStream bytes;

        if ( isDrools ) {
            bytes = null;
            droolsStream = (DroolsObjectInputStream) in;
        } else {
            bytes = new ByteArrayInputStream( (byte[]) in.readObject() );
            droolsStream = new DroolsObjectInputStream( bytes );
        }
       
        this.rules = (Map<Rule, BaseNode[]>) droolsStream.readObject();
        this.namedWindows = (Map<String, WindowNode>) droolsStream.readObject();
        this.idGenerator = (IdGenerator) droolsStream.readObject();
        this.ordered = droolsStream.readBoolean();
        if ( !isDrools ) {
            droolsStream.close();
            bytes.close();
        }

    }
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

       
        if ( wasDrools ) {
            droolsStream = (DroolsObjectInput) stream;
        } else {
            bytes = new ByteArrayInputStream( (byte[]) stream.readObject() );
            droolsStream = new DroolsObjectInputStream( bytes );
        }
       
        super.readExternal( droolsStream );
        this.reteooBuilder = (ReteooBuilder) droolsStream.readObject();
        this.reteooBuilder.setRuleBase( this );
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

     *            InputStream
     */
    public void readExternal( ObjectInput stream ) throws IOException,
            ClassNotFoundException {
        boolean isDroolsStream = stream instanceof DroolsObjectInputStream;
        DroolsObjectInputStream in = isDroolsStream ? (DroolsObjectInputStream) stream
                                                   : new DroolsObjectInputStream(
                                                                                  new ByteArrayInputStream(
                                                                                                            (byte[]) stream.readObject() ) );

        // setting parent classloader for dialect datas
        this.dialectRuntimeRegistry = (DialectRuntimeRegistry) in.readObject();

        this.typeDeclarations = (LinkedHashMap) in.readObject();
        this.name = (String) in.readObject();
        this.imports = (Map<String, ImportDeclaration>) in.readObject();
        this.staticImports = (Set) in.readObject();
        this.functions = (Map<String, Function>) in.readObject();
        this.factTemplates = (Map) in.readObject();
        this.ruleFlows = (Map) in.readObject();
        this.globals = (Map<String, String>) in.readObject();
        this.valid = in.readBoolean();
        this.rules = (Map<String, Rule>) in.readObject();
        this.classFieldAccessorStore = (ClassFieldAccessorStore) in.readObject();
        this.entryPointsIds = (Set<String>) in.readObject();
        this.windowDeclarations = (Map<String, WindowDeclaration>) in.readObject();
        this.traitRegistry = (TraitRegistry) in.readObject();
        if (!isDroolsStream) {
            in.close();
        }
    }
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

       
        if ( wasDrools ) {
            droolsStream = (DroolsObjectInput) stream;
        } else {
            bytes = new ByteArrayInputStream( (byte[]) stream.readObject() );
            droolsStream = new DroolsObjectInputStream( bytes );
        }
       
        super.readExternal( droolsStream );
        this.reteooBuilder = (ReteooBuilder) droolsStream.readObject();
        this.reteooBuilder.setRuleBase( this );
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

     *            InputStream
     */
    public void readExternal(ObjectInput stream) throws IOException,
                                                ClassNotFoundException {
        boolean isDroolsStream = stream instanceof DroolsObjectInputStream;
        DroolsObjectInputStream in = isDroolsStream ? (DroolsObjectInputStream) stream : new DroolsObjectInputStream( new ByteArrayInputStream( (byte[]) stream.readObject() ) );
       
        // make sure the evaluators cache is initialised - this is a temporary solution though.
        new EvaluatorRegistry();

        // setting parent classloader for dialect datas
        this.dialectRuntimeRegistry = (DialectRuntimeRegistry) in.readObject();

        this.typeDeclarations = (Map) in.readObject();
        this.name = (String) in.readObject();
        this.imports = (Map<String, ImportDeclaration>) in.readObject();
        this.staticImports = (Set) in.readObject();
        this.functions = (Map<String, Function>) in.readObject();
        this.factTemplates = (Map) in.readObject();
        this.ruleFlows = (Map) in.readObject();
        this.globals = (Map<String, String>) in.readObject();
        this.valid = in.readBoolean();
        this.rules = (Map<String, Rule>) in.readObject();
        this.classFieldAccessorStore = (ClassFieldAccessorStore) in.readObject();
        this.entryPointsIds = (Set<String>) in.readObject();
        if ( !isDroolsStream ) {
            in.close();
        }
    }
View Full Code Here

Examples of org.drools.common.DroolsObjectInputStream

    }

    public void readExternal(ObjectInput in) throws IOException,
                                            ClassNotFoundException {
        boolean isDrools = in instanceof DroolsObjectInputStream;
        DroolsObjectInputStream droolsStream;
        ByteArrayInputStream bytes;

        if ( isDrools ) {
            bytes = null;
            droolsStream = (DroolsObjectInputStream) in;
        } else {
            bytes = new ByteArrayInputStream( (byte[]) in.readObject() );
            droolsStream = new DroolsObjectInputStream( bytes );
        }
       
        this.rules = (Map<Rule, BaseNode[]>) droolsStream.readObject();
        this.namedWindows = (Map<String, WindowNode>) droolsStream.readObject();
        this.idGenerator = (IdGenerator) droolsStream.readObject();
        this.ordered = droolsStream.readBoolean();
        if ( !isDrools ) {
            droolsStream.close();
            bytes.close();
        }

    }
View Full Code Here

Examples of org.drools.core.common.DroolsObjectInputStream

        if (isDrools) {
            droolsStream = (DroolsObjectInput) in;
        } else {
            ByteArrayInputStream bytes = new ByteArrayInputStream((byte[]) in.readObject());
            droolsStream = new DroolsObjectInputStream(bytes);
        }

        boolean classLoaderCacheEnabled = droolsStream.readBoolean();
        Map<String, byte[]> store = (Map<String, byte[]>) droolsStream.readObject();
View Full Code Here

Examples of org.drools.core.common.DroolsObjectInputStream

                if (context.classLoader != null ){
                    classLoader = context.classLoader;
                } else if(context.ruleBase != null){
                    classLoader = context.ruleBase.getRootClassLoader();
                }
                ctx.read( new DroolsObjectInputStream( _entry.getData().newInput(), classLoader) );
            }
        }
    }
View Full Code Here

Examples of org.drools.core.common.DroolsObjectInputStream

        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream oos = new DroolsObjectOutputStream(baos);
            oos.writeObject(origin);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            ObjectInputStream ois = new DroolsObjectInputStream(bais, classLoader);
            Object deepCopy = ois.readObject();
            return (T)deepCopy;
        } catch(IOException ioe) {
            throw new RuntimeException(ioe);
        } catch (ClassNotFoundException cnfe) {
            throw new RuntimeException(cnfe);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.