Package java.io

Examples of java.io.ObjectInputStream.readShort()


   {
      VersionAwareMarshaller marshaller = createVAMandRestartCache("2.0.0.GA");

      byte[] bytes = marshaller.objectToByteBuffer("Hello");
      ObjectInputStream in = new MarshalledValueInputStream(new ByteArrayInputStream(bytes));
      assertEquals("Version header short should be '20'", 20, in.readShort());
   }
}
View Full Code Here


      ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));

      // test that the first thing on the stream is the fqn!
      byte magic = ois.readByte();
      short ref = ois.readShort();
      System.out.println("Magic number is " + magic);

      assert magic == CacheMarshaller200.MAGICNUMBER_FQN;

      // now the chunks of an Fqn
View Full Code Here

                     out.close();
                     // test that the output stream has got "/hello" as it's region Fqn.
                     ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(out.toByteArray()));
                     assert in.readByte() == CacheMarshaller200.MAGICNUMBER_FQN : "The stream should start with an Fqn";
                     // discard the nest refId short
                     in.readShort();
                     Fqn f = cm200.unmarshallFqn(in, new UnmarshalledReferences());
                     assert region.equals(f) : "Should use the same region for the response as was used for the request!";

                  }
                  catch (Throwable t)
View Full Code Here

                                         pc );
    }

    public static void readProcessInstances(MarshallerReaderContext context) throws IOException {
        ObjectInputStream stream = context.stream;
        while ( stream.readShort() == PersisterEnums.PROCESS_INSTANCE ) {
            readProcessInstance( context );
        }
    }

    public static ProcessInstance readProcessInstance(MarshallerReaderContext context) throws IOException {
View Full Code Here

                swimlaneContextInstance.setActorId( name,
                                                    value );
            }
        }

        while ( stream.readShort() == PersisterEnums.NODE_INSTANCE ) {
            readNodeInstance( context,
                              processInstance,
                              processInstance );
        }
View Full Code Here

                                                RuleFlowProcessInstance processInstance) throws IOException {
        ObjectInputStream stream = context.stream;
        NodeInstanceImpl nodeInstance = null;
        long id = stream.readLong();
        long nodeId = stream.readLong();
        int nodeType = stream.readShort();
        switch ( nodeType ) {
            case PersisterEnums.RULE_SET_NODE_INSTANCE :
                nodeInstance = new RuleSetNodeInstance();
                break;
            case PersisterEnums.HUMAN_TASK_NODE_INSTANCE :
View Full Code Here

                        } catch ( ClassNotFoundException e ) {
                            throw new IllegalArgumentException( "Could not reload variable " + name );
                        }
                    }
                }
                while ( stream.readShort() == PersisterEnums.NODE_INSTANCE ) {
                    readNodeInstance( context,
                                      (CompositeContextNodeInstance) nodeInstance,
                                      processInstance );
                }
                break;
View Full Code Here

                                      (CompositeContextNodeInstance) nodeInstance,
                                      processInstance );
                }
                break;
            case PersisterEnums.FOR_EACH_NODE_INSTANCE :
                while ( stream.readShort() == PersisterEnums.NODE_INSTANCE ) {
                    readNodeInstance( context,
                                      (ForEachNodeInstance) nodeInstance,
                                      processInstance );
                }
                break;
View Full Code Here

    }

    public static void readWorkItems(MarshallerReaderContext context) throws IOException {
        InternalWorkingMemory wm = context.wm;
        ObjectInputStream stream = context.stream;
        while ( stream.readShort() == PersisterEnums.WORK_ITEM ) {
            WorkItem workItem = readWorkItem( context );
            ((WorkItemManager) wm.getWorkItemManager()).internalAddWorkItem( workItem );
        }
    }
View Full Code Here

       
        // still need to think on how to fix this.
//        TimerService service = (TimerService) stream.readObject();
//        timerManager.setTimerService( service );

        while ( stream.readShort() == PersisterEnums.TIMER ) {
            TimerInstance timer = readTimer( context );
            timerManager.internalAddTimer( timer );
        }
    }
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.