Package org.drools.marshalling.impl

Examples of org.drools.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


    public WorkItem getWorkItem(Environment env) {
        this.env = env;
        if ( workItem == null ) {
            try {
                ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray );
                MarshallerReaderContext context = new MarshallerReaderContext( bais,
                                                                               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

    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

    public ProcessInstance getProcessInstance() {
        if (processInstance == null) {
            try {
                ByteArrayInputStream bais = new ByteArrayInputStream(
                        processInstanceByteArray);
                MarshallerReaderContext context = new MarshallerReaderContext(
                        bais, null, null, null);
                ProcessInstanceMarshaller marshaller = getMarshallerFromContext(context);
                processInstance = marshaller.readProcessInstance(context);
                context.close();
            } catch (IOException e) {
                e.printStackTrace();
                throw new IllegalArgumentException(
                        "IOException while loading process instance: "
                                + e.getMessage());
View Full Code Here

    this.env = env;
        if (processInstance == null) {
            try {
        ByteArrayInputStream bais =
          new ByteArrayInputStream(processInstanceByteArray);
                MarshallerReaderContext context = new MarshallerReaderContext(
          bais, (InternalRuleBase) workingMemory.getRuleBase(),
          null, null);
                context.wm = (InternalWorkingMemory) workingMemory;
                ProcessInstanceMarshaller marshaller = getMarshallerFromContext(context);
        processInstance = marshaller.readProcessInstance(context, !externalVariables);
        if (externalVariables) {
          restoreVariables();
        }
                context.close();
            } catch (IOException e) {
                e.printStackTrace();
                throw new IllegalArgumentException(
          "IOException while loading process instance: " + e.getMessage(), e);
            }
View Full Code Here

    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

    public WorkItem getWorkItem(Environment env) {
        this.env = env;
        if ( workItem == null ) {
            try {
                ByteArrayInputStream bais = new ByteArrayInputStream( workItemByteArray );
                MarshallerReaderContext context = new MarshallerReaderContext( bais,
                                                                               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

            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

        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

                = 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

TOP

Related Classes of org.drools.marshalling.impl.MarshallerReaderContext

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.