Package org.kie.api.marshalling

Examples of org.kie.api.marshalling.Marshaller.unmarshall()


                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(new KnowledgeBaseImpl(this), new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;

                if ( keepReference ) {
View Full Code Here


          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          marshaller.marshall(baos, ksession);
          marshaller = MarshallerFactory.newMarshaller(kbase);
          ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
          baos.close();
          ksession = (StatefulKnowledgeSession)marshaller.unmarshall(bais);
          bais.close();
        } catch (Exception e) {
          e.printStackTrace();
          fail("unexpected exception :" + e.getMessage());
        }
View Full Code Here

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(new KnowledgeBaseImpl(this), new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulSession) ((StatefulKnowledgeSessionImpl) ksession).session;

                if ( keepReference ) {
View Full Code Here

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(this, new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulKnowledgeSessionImpl) ksession;

                if ( keepReference ) {
View Full Code Here

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(this, new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulKnowledgeSessionImpl) ksession;

                if ( keepReference ) {
View Full Code Here

                // now unmarshall that byte[]
                ByteArrayInputStream bais = new ByteArrayInputStream( rsession.bytes );
                Marshaller marshaller = MarshallerFactory.newMarshaller(this, new ObjectMarshallingStrategy[]{MarshallerFactory.newSerializeMarshallingStrategy()});

                Environment environment = EnvironmentFactory.newEnvironment();
                KieSession ksession = marshaller.unmarshall( bais,
                                                             conf,
                                                             environment );
                session = (StatefulKnowledgeSessionImpl) ksession;

                if ( keepReference ) {
View Full Code Here

          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          marshaller.marshall(baos, ksession);
          marshaller = MarshallerFactory.newMarshaller(kbase);
          ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
          baos.close();
          ksession = (StatefulKnowledgeSession)marshaller.unmarshall(bais);
          bais.close();
        } catch (Exception e) {
          e.printStackTrace();
          fail("unexpected exception :" + e.getMessage());
        }
View Full Code Here

          ByteArrayOutputStream baos = new ByteArrayOutputStream();
          marshaller.marshall(baos, ksession);
          marshaller = MarshallerFactory.newMarshaller(kbase);
          ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
          baos.close();
          ksession = (StatefulKnowledgeSession)marshaller.unmarshall(bais);
          bais.close();
        } catch (Exception e) {
          e.printStackTrace();
          fail("unexpected exception :" + e.getMessage());
        }
View Full Code Here

        ByteArrayInputStream bais = new ByteArrayInputStream( marshalledData.byteArray );
        SessionConfiguration conf = SessionConfiguration.getDefaultInstance();
        Environment env = EnvironmentFactory.newEnvironment();
   
        // Unmarshall
        KieSession ksession = marshaller.unmarshall( bais, conf, env );
       
        return ksession;
    }

    private static WorkItem unmarshallWorkItem(byte [] marshalledSessionByteArray) throws Exception {
View Full Code Here

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            marshaller.marshall(baos, ksession);
            marshaller = MarshallerFactory.newMarshaller(kbase);
            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            baos.close();
            ksession = (StatefulKnowledgeSession)marshaller.unmarshall(bais);
            bais.close();
        } catch (Exception e) {
            e.printStackTrace();
            fail("unexpected exception :" + e.getMessage());
        }
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.