1 37 38 39 40 41 42 package com.lutris.appserver.debugger.applet.io; 43 44 import java.io.Serializable ; 45 46 47 public class Snapshot implements Serializable { 48 49 public long stateId; 50 public ServletDescription[] servlets; 51 public TransactionDescription[] transactions; 52 53 public Snapshot() { 54 stateId = -1; 55 servlets = new ServletDescription[0]; 56 transactions = new TransactionDescription[0]; 57 58 } 59 60 public String toString() { 61 String s = "Snapshot id=" + stateId + " servlets = {"; 62 if (servlets.length > 0) 63 s += servlets[0]; 64 for (int i=1; i<servlets.length; i++) 65 s += ", " + servlets[i]; 66 s += "} " + transactions.length + " transactions"; 67 if (transactions.length > 0) { 68 int min = transactions[0].id; 69 int max = min; 70 for (int i=0; i<transactions.length; i++) { 71 if (transactions[i].id > max) 72 max = transactions[i].id; 73 if (transactions[i].id < min) 74 min = transactions[i].id; 75 } 76 s += " minId=" + min + ", maxId=" + max; 77 } 78 return s; 79 } 80 81 } 82 | Popular Tags |