public Object newInstance(Class cls) { assertOpen(); if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes without a true Class.forName if (!PCRegistry.isRegistered(cls)) { try { Class.forName(cls.getName(), true, AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction(cls))); } catch (Throwable t) { } } if (_repo.getMetaData(cls, getClassLoader(), false) == null) throw new IllegalArgumentException( _loc.get("no-interface-metadata", cls.getName()).getMessage()); try { return PCRegistry.newInstance(cls, null, false); } catch (IllegalStateException ise) { IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage()); iae.setStackTrace(ise.getStackTrace()); throw iae; } }
public Object newInstance(Class cls) { assertOpen(); if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes without a true Class.forName if (!PCRegistry.isRegistered(cls)) { try { Class.forName(cls.getName(), true, (ClassLoader) AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction(cls))); } catch (Throwable t) { } } if (_conf.getMetaDataRepositoryInstance().getMetaData(cls, getClassLoader(), false) == null) throw new IllegalArgumentException( _loc.get("no-interface-metadata", cls.getName()).getMessage()); try { return PCRegistry.newInstance(cls, null, false); } catch (IllegalStateException ise) { IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage()); iae.setStackTrace(ise.getStackTrace()); throw iae; } }
public Object newInstance(Class cls) { assertOpen(); if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes without a true Class.forName if (!PCRegistry.isRegistered(cls)) { try { Class.forName(cls.getName(), true, AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction(cls))); } catch (Throwable t) { } } if (_repo.getMetaData(cls, getClassLoader(), false) == null) throw new IllegalArgumentException( _loc.get("no-interface-metadata", cls.getName()).getMessage()); try { return PCRegistry.newInstance(cls, null, false); } catch (IllegalStateException ise) { IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage()); iae.setStackTrace(ise.getStackTrace()); throw iae; } }
public Object newInstance(Class cls) { assertOpen(); if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes without a true Class.forName if (!PCRegistry.isRegistered(cls)) { try { Class.forName(cls.getName(), true, AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction(cls))); } catch (Throwable t) { } } if (_repo.getMetaData(cls, getClassLoader(), false) == null) throw new IllegalArgumentException( _loc.get("no-interface-metadata", cls.getName()).getMessage()); try { return PCRegistry.newInstance(cls, null, false); } catch (IllegalStateException ise) { IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage()); iae.setStackTrace(ise.getStackTrace()); throw iae; } }
public Object newInstance(Class cls) { assertOpen(); if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers())) throw new UnsupportedOperationException(_loc.get ("new-abstract", cls).getMessage()); // 1.5 doesn't initialize classes without a true Class.forName if (!PCRegistry.isRegistered(cls)) { try { Class.forName(cls.getName(), true, AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction(cls))); } catch (Throwable t) { } } if (_repo.getMetaData(cls, getClassLoader(), false) == null) throw new IllegalArgumentException( _loc.get("no-interface-metadata", cls.getName()).getMessage()); try { return PCRegistry.newInstance(cls, null, false); } catch (IllegalStateException ise) { IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage()); iae.setStackTrace(ise.getStackTrace()); throw iae; } }
/** * Return the {@link Class} for the given name, or null if name not valid. */ private Class toClass(String name) { if (_loader == null) _loader = _broker.getConfiguration().getClassResolverInstance(). getClassLoader(_class, _broker.getClassLoader()); try { return ClassUtil.toClass(name, _loader); } catch (RuntimeException re) { } catch (NoClassDefFoundError ncdfe) { } return null; }
/** * Return the {@link Class} for the given name, or null if name not valid. */ private Class toClass(String name) { if (_loader == null) _loader = _broker.getConfiguration().getClassResolverInstance(). getClassLoader(_class, _broker.getClassLoader()); try { return ClassUtil.toClass(name, _loader); } catch (RuntimeException re) { } catch (NoClassDefFoundError ncdfe) { } return null; }
/** * Return the {@link Class} for the given name, or null if name not valid. */ private Class toClass(String name) { if (_loader == null) _loader = _broker.getConfiguration().getClassResolverInstance(). getClassLoader(_class, _broker.getClassLoader()); try { return Strings.toClass(name, _loader); } catch (RuntimeException re) { } catch (NoClassDefFoundError ncdfe) { } return null; }
/** * Return the {@link Class} for the given name, or null if name not valid. */ private Class toClass(String name) { if (_loader == null) _loader = _broker.getConfiguration().getClassResolverInstance(). getClassLoader(_class, _broker.getClassLoader()); try { return Strings.toClass(name, _loader); } catch (RuntimeException re) { } catch (NoClassDefFoundError ncdfe) { } return null; }
/** * Return the {@link Class} for the given name, or null if name not valid. */ private Class toClass(String name) { if (_loader == null) _loader = _broker.getConfiguration().getClassResolverInstance(). getClassLoader(_class, _broker.getClassLoader()); try { return Strings.toClass(name, _loader); } catch (RuntimeException re) { } catch (NoClassDefFoundError ncdfe) { } return null; }
protected BrokerImpl newBrokerImpl(String user, String pass) { BrokerImpl broker = super.newBrokerImpl(user, pass); lock(); try { // synchronize mappings; we wait until now to do this so that // we can use the first broker user/pass for connection if no // global login is given if (!_synchronizedMappings) { _synchronizedMappings = true; synchronizeMappings(broker.getClassLoader()); } return broker; } finally { unlock(); } }
protected BrokerImpl newBrokerImpl(String user, String pass) { BrokerImpl broker = super.newBrokerImpl(user, pass); lock(); try { // synchronize mappings; we wait until now to do this so that // we can use the first broker user/pass for connection if no // global login is given if (!_synchronizedMappings) { _synchronizedMappings = true; synchronizeMappings(broker.getClassLoader()); } return broker; } finally { unlock(); } }
protected BrokerImpl newBrokerImpl(String user, String pass) { BrokerImpl broker = super.newBrokerImpl(user, pass); lock(); try { // synchronize mappings; we wait until now to do this so that // we can use the first broker user/pass for connection if no // global login is given if (!_synchronizedMappings) { _synchronizedMappings = true; synchronizeMappings(broker.getClassLoader()); } return broker; } finally { unlock(); } }
protected BrokerImpl newBrokerImpl(String user, String pass) { BrokerImpl broker = super.newBrokerImpl(user, pass); lock(); try { // synchronize mappings; we wait until now to do this so that // we can use the first broker user/pass for connection if no // global login is given if (!_synchronizedMappings) { _synchronizedMappings = true; synchronizeMappings(broker.getClassLoader()); } return broker; } finally { unlock(); } }
protected BrokerImpl newBrokerImpl(String user, String pass) { BrokerImpl broker = super.newBrokerImpl(user, pass); lock(); try { // synchronize mappings; we wait until now to do this so that // we can use the first broker user/pass for connection if no // global login is given if (!_synchronizedMappings) { _synchronizedMappings = true; synchronizeMappings(broker.getClassLoader()); } return broker; } finally { unlock(); } }
getMetaDataRepositoryInstance().getMetaData( ImplHelper.getManagedInstance(toAttach).getClass(), _broker.getClassLoader(), true); return getStrategy(toAttach).attach(this, toAttach, meta, into, owner, ownerMeta, explicit);
getMetaDataRepositoryInstance().getMetaData( ImplHelper.getManagedInstance(toAttach).getClass(), _broker.getClassLoader(), true); return getStrategy(toAttach).attach(this, toAttach, meta, into, owner, ownerMeta, explicit);
/** * Attach. * * @param toAttach the detached object * @param into the instance we're attaching into * @param owner state manager for <code>into</code> * @param ownerMeta the field we traversed to find <code>toAttach</code> * @param explicit whether to make new instances explicitly persistent */ Object attach(Object toAttach, PersistenceCapable into, OpenJPAStateManager owner, ValueMetaData ownerMeta, boolean explicit) { if (toAttach == null) return null; // check if already attached Object attached = _attached.get(toAttach); if (attached != null) return attached; //### need to handle ACT_CASCADE int action = processArgument(toAttach); if ((action & OpCallbacks.ACT_RUN) == 0) return toAttach; //### need to handle ACT_RUN without also ACT_CASCADE ClassMetaData meta = _broker.getConfiguration(). getMetaDataRepositoryInstance().getMetaData( ImplHelper.getManagedInstance(toAttach).getClass(), _broker.getClassLoader(), true); return getStrategy(toAttach).attach(this, toAttach, meta, into, owner, ownerMeta, explicit); }
(cls, _broker.getClassLoader(), true); if (_oid != null) { if (_meta.getIdentityType() == ClassMetaData.ID_DATASTORE)
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); }