Package org.drools.marshalling.impl

Examples of org.drools.marshalling.impl.ObjectMarshallingStrategyStore


        }
    }

    public ObjectMarshallingStrategyStore getObjectMarshallingStrategyStore() {
        if ( this.marshallingStore == null ) {
            this.marshallingStore = new ObjectMarshallingStrategyStore(
                                                                        (ObjectMarshallingStrategy[]) this.environment.get( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES ) );
        }
        return this.marshallingStore;
    }
View Full Code Here


        }
    }

    public ObjectMarshallingStrategyStore getObjectMarshallingStrategyStore() {
        if ( this.marshallingStore == null ) {
            this.marshallingStore = new ObjectMarshallingStrategyStore(
                                                                        (ObjectMarshallingStrategy[]) this.environment.get( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES ) );
        }
        return this.marshallingStore;
    }
View Full Code Here

        }
    }

    public ObjectMarshallingStrategyStore getObjectMarshallingStrategyStore() {
        if ( this.marshallingStore == null ) {
            this.marshallingStore = new ObjectMarshallingStrategyStore( (ObjectMarshallingStrategy[]) this.environment.get( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES ) );
        }
        return this.marshallingStore;
    }
View Full Code Here

            = new ObjectMarshallingStrategy[] { MarshallerFactory.newSerializeMarshallingStrategy() };

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

                    MarshallerFactory.newSerializeMarshallingStrategy(),
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy() };
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null,
                    new ObjectMarshallingStrategyStore(strats), true, true, null);
            OutputMarshaller.writeWorkItem(outContext, workItem);
            byteArray = baos.toByteArray();
        }
      
        // unmarshall/deserialize workItem
        {
            // Reverse the order of strategies
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy(),
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStore(newStrats), true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
        checkWorkItem(workItem, input);
View Full Code Here

                    MarshallerFactory.newSerializeMarshallingStrategy(),
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy() };
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null,
                    new ObjectMarshallingStrategyStore(strats), true, true, null);
            OutputMarshaller.writeWorkItem(outContext, workItem);
            byteArray = baos.toByteArray();
        }
   
        // unmarshall/deserialize workItem
        {
            // Only put serialization strategy in
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStore(newStrats), true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
        checkWorkItem(workItem, input);
View Full Code Here

                    MarshallerFactory.newSerializeMarshallingStrategy(),
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy() };
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null,
                    new ObjectMarshallingStrategyStore(strats), true, true, null);
            OutputMarshaller.writeWorkItem(outContext, workItem);
            byteArray = baos.toByteArray();
        }
   
        // unmarshall/deserialize workItem
        {
            // Only put serialization strategy in
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] { };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStore(newStrats), true, true, null);
          
            try {
                workItem = InputMarshaller.readWorkItem(inContext);
                fail( "An exception was expected here." );
            }
View Full Code Here

                    MarshallerFactory.newSerializeMarshallingStrategy(),
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy() };
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null,
                    new ObjectMarshallingStrategyStore(strats), true, true, null);
            OldOutputMarshallerMethods.writeWorkItem_v1(outContext, workItem);
            byteArray = baos.toByteArray();
        }
       
        // unmarshall/deserialize workItem
        {
            // Only put serialization strategy in
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStore(newStrats), true, true, null);
            workItem = InputMarshaller.readWorkItem(inContext);
        }
       
        // Check
        checkWorkItem(workItem, input);
View Full Code Here

                    MarshallerFactory.newSerializeMarshallingStrategy(),
                    new MarshallerProviderImpl().newIdentityMarshallingStrategy() };
   
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            MarshallerWriteContext outContext = new MarshallerWriteContext( baos, null, null, null,
                    new ObjectMarshallingStrategyStore(strats), true, true, null);
            OldOutputMarshallerMethods.writeFactHandle_v1(outContext, (ObjectOutputStream) outContext,
                    outContext.objectMarshallingStrategyStore, 2, factHandle);
            outContext.close();
            byteArray = baos.toByteArray();
        }
       
        // unmarshall/deserialize workItem
        InternalFactHandle newFactHandle;
        {
            // Only put serialization strategy in
            ObjectMarshallingStrategy[] newStrats
                = new ObjectMarshallingStrategy[] {
                    MarshallerFactory.newSerializeMarshallingStrategy()  };
   
            ByteArrayInputStream bais = new ByteArrayInputStream(byteArray);
            MarshallerReaderContext inContext = new MarshallerReaderContext( bais, null, null,
                new ObjectMarshallingStrategyStore(newStrats), true, true, null);
            inContext.wm = wm;
            newFactHandle = InputMarshaller.readFactHandle(inContext);
            inContext.close();
        }
View Full Code Here

        }
    }

    public ObjectMarshallingStrategyStore getObjectMarshallingStrategyStore() {
        if ( this.marshallingStore == null ) {
            this.marshallingStore = new ObjectMarshallingStrategyStore( (ObjectMarshallingStrategy[]) this.environment.get( EnvironmentName.OBJECT_MARSHALLING_STRATEGIES ) );
        }
        return this.marshallingStore;
    }
View Full Code Here

TOP

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

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.