Examples of MarshallerReaderContext


Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

    public WorkItem getWorkItem(Environment env, InternalRuleBase ruleBase) {
        this.env = env;
        if ( workItem == null ) {
            try {
                ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray );
                MarshallerReaderContext context = new MarshallerReaderContext( bais,
                                                                               ruleBase,
                                                                               null,
                                                                               null,
                                                                               null,
                                                                               env);
                workItem = InputMarshaller.readWorkItem( context );
                context.close();
            } catch ( IOException e ) {
                e.printStackTrace();
                throw new IllegalArgumentException( "IOException while loading process instance: " + e.getMessage() );
            }
        }
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            }

            if( pctx.getReaderContext() != null ) {
                // we are deserializing a session, so we might need to evaluate
                // rule activations immediately
                MarshallerReaderContext mrc = (MarshallerReaderContext) pctx.getReaderContext();
                mrc.filter.fireRNEAs( wm );
            }

            return;
        }
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

        }

        if( context.getReaderContext() != null /*&& sm != null*/ ) {
            // we are deserializing a session, so we might need to evaluate
            // rule activations immediately
            MarshallerReaderContext mrc = (MarshallerReaderContext) context.getReaderContext();
            mrc.filter.fireRNEAs( wm );
        }
    }
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

        OutputMarshaller.writeWorkItem(outContext, workItem);
       
        // unmarshall/deserialize workItem
        byte [] byteArray = baos.toByteArray();
        ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
        MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(strats), Collections.EMPTY_MAP, true, true, null);
        workItem = InputMarshaller.readWorkItem(inContext);
      
        // Check
        checkWorkItem(workItem, input);
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

                = new ObjectMarshallingStrategy[] {
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy(),
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP, true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP, true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            // Only put serialization strategy in
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] { };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP, true, true, null);
          
            try {
                workItem = InputMarshaller.readWorkItem(inContext);
                fail( "An exception was expected here." );
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP, true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP,
                true, true, null);
            inContext.wm = wm;
            newFactHandle = InputMarshaller.readFactHandle(inContext);
            inContext.close();
        }

        assertTrue( "Serialized FactHandle not the same as the original.", compareInstances(factHandle, newFactHandle) );
    }
View Full Code Here

Examples of org.drools.core.marshalling.impl.MarshallerReaderContext

            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStoreImpl(newStrats), Collections.EMPTY_MAP,
                true, true, null);
            inContext.wm = wm;
            newFactHandle = InputMarshaller.readFactHandle(inContext);
            inContext.close();
        }

        assertTrue( "Serialized FactHandle not the same as the original.", compareInstances(factHandle, newFactHandle) );
    }
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.