protected boolean findPersistenceUnit() { // START - ALLOW PRINT STATEMENTS if (_emf == null) { System.err.println("Discovering auxiliary Persistent Unit " + _unit); BrokerFactory bf = AbstractBrokerFactory.getPooledFactoryForKey(_unit); if (bf != null) { _emf = (OpenJPAEntityManagerFactory)bf.getUserObject(JPAFacadeHelper.EMF_KEY); } System.err.println("Discovered auxiliary Persistent Unit " + _unit + ":" + _emf); } // STOP - ALLOW PRINT STATEMENTS return _emf != null; }
/** * Replaces the factory with this JVMs pooled version if it exists. Also * freezes the factory. */ protected Object readResolve() throws ObjectStreamException { AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey); if (factory != null) return factory; // reset these transient fields to empty values _transactional = new ConcurrentHashMap(); _brokers = newBrokerSet(); makeReadOnly(); return this; }
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException { Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); // this needs to happen before defaultReadObject so that it's // available for calls to broker.getConfiguration() during // StateManager deserialization _conf = factory.getConfiguration(); in.defaultReadObject(); factory.initializeBroker(_managed, _connRetainMode, this, true); // re-initialize the lock if needed. setMultithreaded(_multithreaded); if (isActive() && _runtime instanceof LocalManagedRuntime) ((LocalManagedRuntime) _runtime).begin(); }
/** * Replaces the factory with this JVMs pooled version if it exists. Also * freezes the factory. */ protected Object readResolve() throws ObjectStreamException { AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey); if (factory != null) return factory; // reset these transient fields to empty values _transactional = new ConcurrentHashMap<Object,Collection<Broker>>(); _brokers = newBrokerSet(); // turn off logging while de-serializing BrokerFactory String saveLogConfig = _conf.getLog(); _conf.setLog("none"); makeReadOnly(); // re-enable any logging which was in effect _conf.setLog(saveLogConfig); return this; }
/** * Replaces the factory with this JVMs pooled version if it exists. Also * freezes the factory. */ protected Object readResolve() throws ObjectStreamException { AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey); if (factory != null) return factory; // reset these transient fields to empty values _transactional = new ConcurrentHashMap<Object,Collection<Broker>>(); _brokers = newBrokerSet(); // turn off logging while de-serializing BrokerFactory String saveLogConfig = _conf.getLog(); _conf.setLog("none"); makeReadOnly(); // re-enable any logging which was in effect _conf.setLog(saveLogConfig); return this; }
/** * Replaces the factory with this JVMs pooled version if it exists. Also * freezes the factory. */ protected Object readResolve() throws ObjectStreamException { AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey); if (factory != null) return factory; // reset these transient fields to empty values _transactional = new ConcurrentHashMap<Object,Collection<Broker>>(); _brokers = newBrokerSet(); // turn off logging while de-serializing BrokerFactory String saveLogConfig = _conf.getLog(); _conf.setLog("none"); makeReadOnly(); // re-enable any logging which was in effect _conf.setLog(saveLogConfig); return this; }
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException { Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); // this needs to happen before defaultReadObject so that it's // available for calls to broker.getConfiguration() during // StateManager deserialization _conf = factory.getConfiguration(); _repo = _conf.getMetaDataRepositoryInstance(); in.defaultReadObject(); factory.initializeBroker(_managed, _connRetainMode, this, true); // re-initialize the lock if needed. setMultithreaded(_multithreaded); // force recreation of set _operatingDirty = true; initializeOperatingSet(); if (isActive() && _runtime instanceof LocalManagedRuntime) ((LocalManagedRuntime) _runtime).begin(); }
/** * Replaces the factory with this JVMs pooled version if it exists. Also * freezes the factory. */ protected Object readResolve() throws ObjectStreamException { AbstractBrokerFactory factory = getPooledFactoryForKey(_poolKey); if (factory != null) return factory; // reset these transient fields to empty values _transactional = new ConcurrentHashMap<Object,Collection<Broker>>(); _brokers = newBrokerSet(); // turn off logging while de-serializing BrokerFactory String saveLogConfig = _conf.getLog(); _conf.setLog("none"); makeReadOnly(); // re-enable any logging which was in effect _conf.setLog(saveLogConfig); return this; }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { _ret = PersistenceExceptions.getRollbackTranslator(this); // this assumes that serialized Brokers are from something // that extends AbstractBrokerFactory. Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); byte[] brokerBytes = (byte[]) in.readObject(); ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes, factory.getConfiguration()); Broker broker = (Broker) innerIn.readObject(); EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) JPAFacadeHelper.toEntityManagerFactory( broker.getBrokerFactory()); broker.putUserObject(JPAFacadeHelper.EM_KEY, this); initialize(emf, broker); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException { Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); // this needs to happen before defaultReadObject so that it's // available for calls to broker.getConfiguration() during // StateManager deserialization _conf = factory.getConfiguration(); _repo = _conf.getMetaDataRepositoryInstance(); in.defaultReadObject(); factory.initializeBroker(_managed, _connRetainMode, this, true); // re-initialize the lock if needed. setMultithreaded(_multithreaded); // force recreation of set _operatingDirty = true; initializeOperatingSet(); if (isActive() && _runtime instanceof LocalManagedRuntime) ((LocalManagedRuntime) _runtime).begin(); }
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException { Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); // this needs to happen before defaultReadObject so that it's // available for calls to broker.getConfiguration() during // StateManager deserialization _conf = factory.getConfiguration(); _repo = _conf.getMetaDataRepositoryInstance(); in.defaultReadObject(); factory.initializeBroker(_managed, _connRetainMode, this, true); // re-initialize the lock if needed. setMultithreaded(_multithreaded); // force recreation of set _operatingDirty = true; initializeOperatingSet(); if (isActive() && _runtime instanceof LocalManagedRuntime) ((LocalManagedRuntime) _runtime).begin(); }
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException { Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); // this needs to happen before defaultReadObject so that it's // available for calls to broker.getConfiguration() during // StateManager deserialization _conf = factory.getConfiguration(); _repo = _conf.getMetaDataRepositoryInstance(); in.defaultReadObject(); factory.initializeBroker(_managed, _connRetainMode, this, true); // re-initialize the lock if needed. setMultithreaded(_multithreaded); // force recreation of set _operatingDirty = true; initializeOperatingSet(); if (isActive() && _runtime instanceof LocalManagedRuntime) ((LocalManagedRuntime) _runtime).begin(); }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { _ret = PersistenceExceptions.getRollbackTranslator(this); // this assumes that serialized Brokers are from something // that extends AbstractBrokerFactory. Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); byte[] brokerBytes = (byte[]) in.readObject(); ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes, factory.getConfiguration()); Broker broker = (Broker) innerIn.readObject(); EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) JPAFacadeHelper.toEntityManagerFactory( broker.getBrokerFactory()); broker.putUserObject(JPAFacadeHelper.EM_KEY, this); initialize(emf, broker); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { ret = PersistenceExceptions.getRollbackTranslator(this); // this assumes that serialized Brokers are from something // that extends AbstractBrokerFactory. Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); byte[] brokerBytes = (byte[]) in.readObject(); ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes, factory.getConfiguration()); Broker broker = (Broker) innerIn.readObject(); EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) JPAFacadeHelper.toEntityManagerFactory( broker.getBrokerFactory()); broker.putUserObject(JPAFacadeHelper.EM_KEY, this); initialize(emf, broker); } catch (RuntimeException re) { try { re = ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { _ret = PersistenceExceptions.getRollbackTranslator(this); // this assumes that serialized Brokers are from something // that extends AbstractBrokerFactory. Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); byte[] brokerBytes = (byte[]) in.readObject(); ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes, factory.getConfiguration()); Broker broker = (Broker) innerIn.readObject(); EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) JPAFacadeHelper.toEntityManagerFactory( broker.getBrokerFactory()); broker.putUserObject(JPAFacadeHelper.EM_KEY, this); initialize(emf, broker); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { try { _ret = PersistenceExceptions.getRollbackTranslator(this); // this assumes that serialized Brokers are from something // that extends AbstractBrokerFactory. Object factoryKey = in.readObject(); AbstractBrokerFactory factory = AbstractBrokerFactory.getPooledFactoryForKey(factoryKey); byte[] brokerBytes = (byte[]) in.readObject(); ObjectInputStream innerIn = new BrokerBytesInputStream(brokerBytes, factory.getConfiguration()); Broker broker = (Broker) innerIn.readObject(); EntityManagerFactoryImpl emf = (EntityManagerFactoryImpl) JPAFacadeHelper.toEntityManagerFactory( broker.getBrokerFactory()); broker.putUserObject(JPAFacadeHelper.EM_KEY, this); initialize(emf, broker); } catch (RuntimeException re) { try { re = _ret.translate(re); } catch (Exception e) { // ignore } throw re; } }