/** * Register <code>factory</code> in the pool under <code>key</code>. * * @since 1.1.0 */ protected static void pool(Object key, AbstractBrokerFactory factory) { synchronized(_pool) { _pool.put(key, factory); factory.setPoolKey(key); factory.makeReadOnly(); } }
/** * Register <code>factory</code> in the pool under <code>key</code>. * * @since 1.1.0 */ protected static void pool(Object key, AbstractBrokerFactory factory) { synchronized(_pool) { _pool.put(key, factory); factory.setPoolKey(key); factory.makeReadOnly(); } }
/** * Register <code>factory</code> in the pool under <code>key</code>. * * @since 1.1.0 */ protected static void pool(Object key, AbstractBrokerFactory factory) { synchronized(_pool) { _pool.put(key, factory); factory.setPoolKey(key); factory.makeReadOnly(); } }
/** * Register <code>factory</code> in the pool under <code>key</code>. * * @since 1.1.0 */ protected static void pool(Object key, AbstractBrokerFactory factory) { synchronized(_pool) { _pool.put(key, factory); factory.setPoolKey(key); factory.makeReadOnly(); } }
/** * Register <code>factory</code> in the pool under <code>key</code>. * * @since 1.1.0 */ protected static void pool(Object key, AbstractBrokerFactory factory) { synchronized(_pool) { _pool.put(key, factory); factory.setPoolKey(key); factory.makeReadOnly(); } }
/** * 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; }
/** * 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; }
/** * 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 Broker newBroker(String user, String pass, boolean managed, int connRetainMode, boolean findExisting) { try { assertOpen(); makeReadOnly(); BrokerImpl broker = null; if (findExisting) broker = findBroker(user, pass, managed); if (broker == null) { broker = newBrokerImpl(user, pass); initializeBroker(managed, connRetainMode, broker, false); } return broker; } catch (OpenJPAException ke) { throw ke; } catch (RuntimeException re) { throw new GeneralException(re); } }
void initializeBroker(boolean managed, int connRetainMode, Broker broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); DelegatingStoreManager dsm = createDelegatingStoreManager(); ((BrokerImpl) broker).initialize(this, dsm, managed, connRetainMode, fromDeserialization); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf.getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }
void initializeBroker(boolean managed, int connRetainMode, Broker broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); DelegatingStoreManager dsm = createDelegatingStoreManager(); ((BrokerImpl) broker).initialize(this, dsm, managed, connRetainMode, fromDeserialization); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf.getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }
void initializeBroker(boolean managed, int connRetainMode, Broker broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); DelegatingStoreManager dsm = createDelegatingStoreManager(); ((BrokerImpl) broker).initialize(this, dsm, managed, connRetainMode, fromDeserialization); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf.getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }
void initializeBroker(boolean managed, int connRetainMode, Broker broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); DelegatingStoreManager dsm = createDelegatingStoreManager(); ((BrokerImpl) broker).initialize(this, dsm, managed, connRetainMode, fromDeserialization); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf.getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }
void initializeBroker(boolean managed, int connRetainMode, BrokerImpl broker, boolean fromDeserialization) { assertOpen(); makeReadOnly(); // decorate the store manager for data caching and custom // result object providers; always make sure it's a delegating // store manager, because it's easier for users to deal with // that way StoreManager sm = newStoreManager(); DelegatingStoreManager dsm = null; if (_conf.getDataCacheManagerInstance().getSystemDataCache() != null) dsm = new DataCacheStoreManager(sm); dsm = new ROPStoreManager((dsm == null) ? sm : dsm); broker.initialize(this, dsm, managed, connRetainMode, fromDeserialization); if (!fromDeserialization) addListeners(broker); // if we're using remote events, register the event manager so // that it can broadcast commit notifications from the broker RemoteCommitEventManager remote = _conf. getRemoteCommitEventManager(); if (remote.areRemoteEventsEnabled()) broker.addTransactionListener(remote); loadPersistentTypes(broker.getClassLoader()); _brokers.add(broker); _conf.setReadOnly(Configuration.INIT_STATE_FROZEN); }