Package org.drools.common

Examples of org.drools.common.DroolsObjectOutputStream.writeObject()


            //ksession.fireAllRules();
            Marshaller marshaller = createSerializableMarshaller( knowledgeBase );
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ObjectOutputStream out = new DroolsObjectOutputStream( baos );
            out.writeObject( knowledgeBase );
            marshaller.marshall( out,
                                 ksession );
            out.flush();
            out.close();
View Full Code Here


            bytes = new ByteArrayOutputStream();
            droolsStream = new DroolsObjectOutputStream( bytes );
        }
       
        super.writeExternal( droolsStream );
        droolsStream.writeObject( this.reteooBuilder );
        droolsStream.writeObject( this.rete );

        if ( !isDrools ) {
            droolsStream.flush();
            droolsStream.close();
View Full Code Here

            droolsStream = new DroolsObjectOutputStream( bytes );
        }
       
        super.writeExternal( droolsStream );
        droolsStream.writeObject( this.reteooBuilder );
        droolsStream.writeObject( this.rete );

        if ( !isDrools ) {
            droolsStream.flush();
            droolsStream.close();
            bytes.close();
View Full Code Here

            out = new GZIPOutputStream(out);
        }
        DroolsObjectOutputStream doos = null;
        try {
            doos = new DroolsObjectOutputStream(out);
            doos.writeObject(object);
        } finally {
            if( doos != null ) {
                doos.close();
            }
            if (compressed) {
View Full Code Here

            bytes = new ByteArrayOutputStream();
            droolsStream = new DroolsObjectOutputStream( bytes );
        }
       
        super.writeExternal( droolsStream );
        droolsStream.writeObject( this.reteooBuilder );
        droolsStream.writeObject( this.rete );
       
        if ( !isDrools ) {
            droolsStream.flush();
            droolsStream.close();
View Full Code Here

            droolsStream = new DroolsObjectOutputStream( bytes );
        }
       
        super.writeExternal( droolsStream );
        droolsStream.writeObject( this.reteooBuilder );
        droolsStream.writeObject( this.rete );
       
        if ( !isDrools ) {
            droolsStream.flush();
            droolsStream.close();
            bytes.close();
View Full Code Here

        File local = getLocalCacheFileForURL( localCacheDir, u );
        if (local.exists()) local.delete();

        try {
            ObjectOutput out = new DroolsObjectOutputStream(new FileOutputStream(local));
            out.writeObject( p );
            out.flush();
            out.close();
        } catch (IOException e) {
            listener.exception( e );
            listener.warning( "Was an error with the local cache directory " + localCacheDir.getPath() );
View Full Code Here

    private void updatePackageBinaries(PackageItem item,
                                       PackageAssembler packageAssembler) throws DetailedSerializationException {
        try {
            ByteArrayOutputStream bout = new ByteArrayOutputStream();
            ObjectOutput out = new DroolsObjectOutputStream( bout );
            out.writeObject( packageAssembler.getBinaryPackage() );

            item.updateCompiledPackage( new ByteArrayInputStream( bout.toByteArray() ) );
            out.flush();
            out.close();
View Full Code Here

     */
    public byte[] toByteArray() throws IOException{
      if (pkg!=null){
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      DroolsObjectOutputStream doos = new DroolsObjectOutputStream(baos);
      doos.writeObject(pkg);
      return baos.toByteArray();
      }else{
        return new byte[]{};
//        throw new IOException("Package not built yet");
      }
View Full Code Here

        Marshaller marshaller = createSerializableMarshaller( knowledgeBase );

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        ObjectOutputStream out = new DroolsObjectOutputStream( baos );
        out.writeObject( bob );
        out.writeObject( knowledgeBase );
        marshaller.marshall( out,
                             session );
        out.flush();
        out.close();
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.