Package java.io

Examples of java.io.ObjectOutputStream.writeShort()


            }
        } 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() );
            List<Long> keys = new ArrayList<Long>( triggers.keySet() );
            Collections.sort( keys,
                              new Comparator<Long>() {
View Full Code Here


            for ( Long key : keys ) {
                stream.writeLong( key );
                stream.writeInt( triggers.get( key ) );
            }
        } else if ( nodeInstance instanceof CompositeContextNodeInstance ) {
            stream.writeShort( PersisterEnums.COMPOSITE_NODE_INSTANCE );
            CompositeContextNodeInstance compositeNodeInstance = (CompositeContextNodeInstance) nodeInstance;
            VariableScopeInstance variableScopeInstance = (VariableScopeInstance) compositeNodeInstance.getContextInstance( VariableScope.VARIABLE_SCOPE );
            Map<String, Object> variables = variableScopeInstance.getVariables();
            List<String> keys = new ArrayList<String>( variables.keySet() );
            Collections.sort( keys,
View Full Code Here

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

            for ( NodeInstance subNodeInstance : nodeInstances ) {
                stream.writeShort( PersisterEnums.NODE_INSTANCE );
                writeNodeInstance( context,
                                   subNodeInstance );
            }
            stream.writeShort( PersisterEnums.END );
        } else if ( nodeInstance instanceof ForEachNodeInstance ) {
            stream.writeShort( PersisterEnums.FOR_EACH_NODE_INSTANCE );
            ForEachNodeInstance forEachNodeInstance = (ForEachNodeInstance) nodeInstance;
            List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>( forEachNodeInstance.getNodeInstances() );
            Collections.sort( nodeInstances,
View Full Code Here

                writeNodeInstance( context,
                                   subNodeInstance );
            }
            stream.writeShort( PersisterEnums.END );
        } else if ( nodeInstance instanceof ForEachNodeInstance ) {
            stream.writeShort( PersisterEnums.FOR_EACH_NODE_INSTANCE );
            ForEachNodeInstance forEachNodeInstance = (ForEachNodeInstance) nodeInstance;
            List<NodeInstance> nodeInstances = new ArrayList<NodeInstance>( forEachNodeInstance.getNodeInstances() );
            Collections.sort( nodeInstances,
                              new Comparator<NodeInstance>() {
                                  public int compare(NodeInstance o1,
View Full Code Here

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

                    stream.writeShort( PersisterEnums.NODE_INSTANCE );
                    writeNodeInstance( context,
                                       subNodeInstance );
                }
            }
            stream.writeShort( PersisterEnums.END );
        } else {
            // TODO ForEachNodeInstance
            // TODO timer manager
            throw new IllegalArgumentException( "Unknown node instance type: " + nodeInstance );
        }
View Full Code Here

                                                 WorkItem o2) {
                                  return (int) (o2.getId() - o1.getId());
                              }
                          } );
        for ( WorkItem workItem : workItems ) {
            stream.writeShort( PersisterEnums.WORK_ITEM );
            writeWorkItem( context,
                           workItem );
        }
        stream.writeShort( PersisterEnums.END );
    }
View Full Code Here

        for ( WorkItem workItem : workItems ) {
            stream.writeShort( PersisterEnums.WORK_ITEM );
            writeWorkItem( context,
                           workItem );
        }
        stream.writeShort( PersisterEnums.END );
    }

    public static void writeWorkItem(MarshallerWriteContext context,
                                     WorkItem workItem) throws IOException {
        ObjectOutputStream stream = context.stream;
View Full Code Here

                                                 TimerInstance o2) {
                                  return (int) (o2.getId() - o1.getId());
                              }
                          } );
        for ( TimerInstance timer : timers ) {
            stream.writeShort( PersisterEnums.TIMER );
            writeTimer( context,
                        timer );
        }
        stream.writeShort( PersisterEnums.END );
    }
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.