Package java.io

Examples of java.io.ObjectOutputStream.writeShort()


        for ( org.drools.runtime.process.ProcessInstance processInstance : processInstances ) {
            stream.writeShort( PersisterEnums.PROCESS_INSTANCE );
            writeProcessInstance( context,
                                  (RuleFlowProcessInstance) processInstance );
        }
        stream.writeShort( PersisterEnums.END );
    }

    public static void writeProcessInstance(MarshallerWriteContext context,
                                            RuleFlowProcessInstance processInstance) throws IOException {
        ObjectOutputStream stream = context.stream;
View Full Code Here


   public ByteBuffer objectToBuffer(Object obj) throws Exception
   {
      ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(128);
      ObjectOutputStream out = new ObjectOutputStream(baos);

      out.writeShort(versionInt);
      if (trace) log.trace("Wrote version " + versionInt);

      //now marshall the contents of the object
      defaultMarshaller.objectToObjectStream(obj, out);
      out.close();
View Full Code Here

                                                 NodeInstance o2) {
                                  return (int) (o1.getId() - o2.getId());
                              }
                          } );
        for ( NodeInstance nodeInstance : nodeInstances ) {
            stream.writeShort( PersisterEnums.NODE_INSTANCE );
            writeNodeInstance( context,
                               nodeInstance );
        }
        stream.writeShort( PersisterEnums.END );
    }
View Full Code Here

        for ( NodeInstance nodeInstance : nodeInstances ) {
            stream.writeShort( PersisterEnums.NODE_INSTANCE );
            writeNodeInstance( context,
                               nodeInstance );
        }
        stream.writeShort( PersisterEnums.END );
    }

    public static void writeNodeInstance(MarshallerWriteContext context,
                                         NodeInstance nodeInstance) throws IOException {
        ObjectOutputStream stream = context.stream;
View Full Code Here

                                         NodeInstance nodeInstance) throws IOException {
        ObjectOutputStream stream = context.stream;
        stream.writeLong( nodeInstance.getId() );
        stream.writeLong( nodeInstance.getNodeId() );
        if ( nodeInstance instanceof RuleSetNodeInstance ) {
            stream.writeShort( PersisterEnums.RULE_SET_NODE_INSTANCE );
        } else if ( nodeInstance instanceof HumanTaskNodeInstance ) {
            stream.writeShort( PersisterEnums.HUMAN_TASK_NODE_INSTANCE );
            stream.writeLong( ((HumanTaskNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof WorkItemNodeInstance ) {
            stream.writeShort( PersisterEnums.WORK_ITEM_NODE_INSTANCE );
View Full Code Here

        stream.writeLong( nodeInstance.getId() );
        stream.writeLong( nodeInstance.getNodeId() );
        if ( nodeInstance instanceof RuleSetNodeInstance ) {
            stream.writeShort( PersisterEnums.RULE_SET_NODE_INSTANCE );
        } else if ( nodeInstance instanceof HumanTaskNodeInstance ) {
            stream.writeShort( PersisterEnums.HUMAN_TASK_NODE_INSTANCE );
            stream.writeLong( ((HumanTaskNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof WorkItemNodeInstance ) {
            stream.writeShort( PersisterEnums.WORK_ITEM_NODE_INSTANCE );
            stream.writeLong( ((WorkItemNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof SubProcessNodeInstance ) {
View Full Code Here

            stream.writeShort( PersisterEnums.RULE_SET_NODE_INSTANCE );
        } else if ( nodeInstance instanceof HumanTaskNodeInstance ) {
            stream.writeShort( PersisterEnums.HUMAN_TASK_NODE_INSTANCE );
            stream.writeLong( ((HumanTaskNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof WorkItemNodeInstance ) {
            stream.writeShort( PersisterEnums.WORK_ITEM_NODE_INSTANCE );
            stream.writeLong( ((WorkItemNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof SubProcessNodeInstance ) {
            stream.writeShort( PersisterEnums.SUB_PROCESS_NODE_INSTANCE );
            stream.writeLong( ((SubProcessNodeInstance) nodeInstance).getProcessInstanceId() );
        } else if ( nodeInstance instanceof MilestoneNodeInstance ) {
View Full Code Here

            stream.writeLong( ((HumanTaskNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof WorkItemNodeInstance ) {
            stream.writeShort( PersisterEnums.WORK_ITEM_NODE_INSTANCE );
            stream.writeLong( ((WorkItemNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof SubProcessNodeInstance ) {
            stream.writeShort( PersisterEnums.SUB_PROCESS_NODE_INSTANCE );
            stream.writeLong( ((SubProcessNodeInstance) nodeInstance).getProcessInstanceId() );
        } else if ( nodeInstance instanceof MilestoneNodeInstance ) {
            stream.writeShort( PersisterEnums.MILESTONE_NODE_INSTANCE );
            List<Long> timerInstances =
              ((MilestoneNodeInstance) nodeInstance).getTimerInstances();
View Full Code Here

            stream.writeLong( ((WorkItemNodeInstance) nodeInstance).getWorkItem().getId() );
        } else if ( nodeInstance instanceof SubProcessNodeInstance ) {
            stream.writeShort( PersisterEnums.SUB_PROCESS_NODE_INSTANCE );
            stream.writeLong( ((SubProcessNodeInstance) nodeInstance).getProcessInstanceId() );
        } else if ( nodeInstance instanceof MilestoneNodeInstance ) {
            stream.writeShort( PersisterEnums.MILESTONE_NODE_INSTANCE );
            List<Long> timerInstances =
              ((MilestoneNodeInstance) nodeInstance).getTimerInstances();
            if (timerInstances != null) {
              stream.writeInt(timerInstances.size());
              for (Long id: timerInstances) {
View Full Code Here

              }
            } else {
              stream.writeInt(0);
            }
        } else if ( nodeInstance instanceof TimerNodeInstance ) {
            stream.writeShort( PersisterEnums.TIMER_NODE_INSTANCE );
            stream.writeLong( ((TimerNodeInstance) nodeInstance).getTimerId() );
        } else if ( nodeInstance instanceof JoinInstance ) {
            stream.writeShort( PersisterEnums.JOIN_NODE_INSTANCE );
            Map<Long, Integer> triggers = ((JoinInstance) nodeInstance).getTriggers();
            stream.writeInt( triggers.size() );
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.