public void writeExternal(ObjectOutput out) throws IOException { try { // this requires that only AbstractBrokerFactory-sourced // brokers can be serialized Object factoryKey = ((AbstractBrokerFactory) _broker .getBrokerFactory()).getPoolKey(); out.writeObject(factoryKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream innerOut = new ObjectOutputStream(baos); innerOut.writeObject(_broker.getDelegate()); innerOut.flush(); out.writeObject(baos.toByteArray()); } catch (RuntimeException re) { try { re = ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void writeExternal(ObjectOutput out) throws IOException { try { // this requires that only AbstractBrokerFactory-sourced // brokers can be serialized Object factoryKey = ((AbstractBrokerFactory) _broker .getBrokerFactory()).getPoolKey(); out.writeObject(factoryKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream innerOut = new ObjectOutputStream(baos); _broker.getDelegate().putUserObject(JPAFacadeHelper.EM_KEY, null); innerOut.writeObject(_broker.getDelegate()); innerOut.flush(); out.writeObject(baos.toByteArray()); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void writeExternal(ObjectOutput out) throws IOException { try { // this requires that only AbstractBrokerFactory-sourced // brokers can be serialized Object factoryKey = ((AbstractBrokerFactory) _broker .getBrokerFactory()).getPoolKey(); out.writeObject(factoryKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream innerOut = new ObjectOutputStream(baos); _broker.getDelegate().putUserObject(JPAFacadeHelper.EM_KEY, null); innerOut.writeObject(_broker.getDelegate()); innerOut.flush(); out.writeObject(baos.toByteArray()); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void writeExternal(ObjectOutput out) throws IOException { try { // this requires that only AbstractBrokerFactory-sourced // brokers can be serialized Object factoryKey = ((AbstractBrokerFactory) _broker .getBrokerFactory()).getPoolKey(); out.writeObject(factoryKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream innerOut = new ObjectOutputStream(baos); _broker.getDelegate().putUserObject(JPAFacadeHelper.EM_KEY, null); innerOut.writeObject(_broker.getDelegate()); innerOut.flush(); out.writeObject(baos.toByteArray()); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void writeExternal(ObjectOutput out) throws IOException { try { // this requires that only AbstractBrokerFactory-sourced // brokers can be serialized Object factoryKey = ((AbstractBrokerFactory) _broker .getBrokerFactory()).getPoolKey(); out.writeObject(factoryKey); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream innerOut = new ObjectOutputStream(baos); _broker.getDelegate().putUserObject(JPAFacadeHelper.EM_KEY, null); innerOut.writeObject(_broker.getDelegate()); innerOut.flush(); out.writeObject(baos.toByteArray()); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
private void writeObject(ObjectOutputStream out) throws IOException { assertOpen(); lock(); try { if (isActive()) { if (!getOptimistic()) throw new InvalidStateException( _loc.get("cant-serialize-pessimistic-broker")); if (hasFlushed()) throw new InvalidStateException( _loc.get("cant-serialize-flushed-broker")); if (hasConnection()) throw new InvalidStateException( _loc.get("cant-serialize-connected-broker")); } try { _isSerializing = true; out.writeObject(_factory.getPoolKey()); out.defaultWriteObject(); } finally { _isSerializing = false; } } finally { unlock(); } }
private void writeObject(ObjectOutputStream out) throws IOException { assertOpen(); lock(); try { if (isActive()) { if (!getOptimistic()) throw new InvalidStateException( _loc.get("cant-serialize-pessimistic-broker")); if (hasFlushed()) throw new InvalidStateException( _loc.get("cant-serialize-flushed-broker")); if (hasConnection()) throw new InvalidStateException( _loc.get("cant-serialize-connected-broker")); } try { _isSerializing = true; out.writeObject(_factory.getPoolKey()); out.defaultWriteObject(); } finally { _isSerializing = false; } } finally { unlock(); } }
private void writeObject(ObjectOutputStream out) throws IOException { assertOpen(); lock(); try { if (isActive()) { if (!getOptimistic()) throw new InvalidStateException( _loc.get("cant-serialize-pessimistic-broker")); if (hasFlushed()) throw new InvalidStateException( _loc.get("cant-serialize-flushed-broker")); if (hasConnection()) throw new InvalidStateException( _loc.get("cant-serialize-connected-broker")); } try { _isSerializing = true; out.writeObject(_factory.getPoolKey()); out.defaultWriteObject(); } finally { _isSerializing = false; } } finally { unlock(); } }
private void writeObject(ObjectOutputStream out) throws IOException { assertOpen(); lock(); try { if (isActive()) { if (!getOptimistic()) throw new InvalidStateException( _loc.get("cant-serialize-pessimistic-broker")); if (hasFlushed()) throw new InvalidStateException( _loc.get("cant-serialize-flushed-broker")); if (hasConnection()) throw new InvalidStateException( _loc.get("cant-serialize-connected-broker")); } try { _isSerializing = true; out.writeObject(_factory.getPoolKey()); out.defaultWriteObject(); } finally { _isSerializing = false; } } finally { unlock(); } }
private void writeObject(ObjectOutputStream out) throws IOException { assertOpen(); lock(); try { if (isActive()) { if (!getOptimistic()) throw new InvalidStateException( _loc.get("cant-serialize-pessimistic-broker")); if (hasFlushed()) throw new InvalidStateException( _loc.get("cant-serialize-flushed-broker")); if (hasConnection()) throw new InvalidStateException( _loc.get("cant-serialize-connected-broker")); } try { _isSerializing = true; out.writeObject(_factory.getPoolKey()); out.defaultWriteObject(); } finally { _isSerializing = false; } } finally { unlock(); } }