public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror(xid)); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror()); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror(xid)); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror(xid)); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror(xid)); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public static final void pack(OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException(jtaLogger.i18NLogger.get_xid_packerror()); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
/** * @message com.arjuna.ats.jta.xid.packerror Could not pack XidImple. */ public static final void pack (OutputObjectState os, Xid xid) throws IOException { if (xid instanceof XidImple) { XidImple x = (XidImple) xid; os.packBoolean(true); if (!x.packInto(os)) throw new IOException( jtaLogger.logMesg.getString("com.arjuna.ats.jta.xid.packerror")); } else { os.packBoolean(false); ByteArrayOutputStream s = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream(s); o.writeObject(xid); o.close(); os.packBytes(s.toByteArray()); } }
public boolean save_state (OutputObjectState os, int t) { if (_theXid != null) { try { os.packBoolean(true); ((XidImple) _theXid).packInto(os); } catch (IOException ex) { return false; } } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int ot) { try { if (_theXid != null) os.packBoolean(true); else os.packBoolean(false); _theXid.packInto(os); return super.save_state(os, ot); } catch (IOException e) { e.printStackTrace(); } return false; }
public boolean save_state (OutputObjectState os, int ot) { try { if (_theXid != null) { os.packBoolean(true); _theXid.packInto(os); } else { os.packBoolean(false); } return super.save_state(os, ot); } catch (IOException e) { jtaxLogger.i18NLogger.warn_cant_save_state(os, ot, e); } return false; }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
public boolean save_state (OutputObjectState os, int t) { try { // pack the header first for the benefit of the tooling packHeader(os, new Header(get_uid(), Utility.getProcessUid())); if (_theXid != null) { os.packBoolean(true); ((XidImple) _theXid).packInto(os); os.packString(_parentNodeName); } else os.packBoolean(false); } catch (IOException ex) { return false; } return super.save_state(os, t); }
@Test public void testPackUnpack () throws Exception { XidImple xid1 = new XidImple(new Uid()); OutputObjectState os = new OutputObjectState(); assertTrue(xid1.packInto(os)); InputObjectState is = new InputObjectState(os); XidImple xid2 = new XidImple(); assertTrue(xid2.unpackFrom(is)); assertTrue(xid1.equals(xid2)); os = new OutputObjectState(); XidImple.pack(os, xid1); is = new InputObjectState(os); xid2 = (XidImple) XidImple.unpack(is); assertTrue(xid1.equals(xid2)); } }