private BrokerFactory getBrokerFactory(ConfigurationProvider cp, Object poolValue, ClassLoader loader) { // handle "true" and "false" if (poolValue instanceof String && ("true".equalsIgnoreCase((String) poolValue) || "false".equalsIgnoreCase((String) poolValue))) poolValue = Boolean.valueOf((String) poolValue); if (poolValue != null && !(poolValue instanceof Boolean)) { // we only support boolean settings for this option currently. throw new IllegalArgumentException(poolValue.toString()); } if (poolValue == null || !((Boolean) poolValue).booleanValue()) return Bootstrap.newBrokerFactory(cp, loader); else return Bootstrap.getBrokerFactory(cp, loader); }
private static String getFactoryClassName(ConfigurationProvider conf, ClassLoader loader) { try { return getFactoryClass(conf, loader).getName(); } catch (Exception e) { return "<" + e.toString() + ">"; } }
/** * Return a new factory for the default configuration. */ public static BrokerFactory newBrokerFactory() { return Bootstrap.newBrokerFactory(null, null); }
/** * Return a new factory for the given configuration. The classloader * will be used to load the factory class. If no classloader is given, * the thread's context classloader is used. */ public static BrokerFactory newBrokerFactory(ConfigurationProvider conf, ClassLoader loader) { try { return invokeFactory(conf, loader, "newInstance"); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); if (cause instanceof OpenJPAException) throw (OpenJPAException) cause; throw new InternalException(s_loc.get("new-brokerfactory-excep", getFactoryClassName(conf, loader)), cause); } catch (Exception e) { throw new UserException(s_loc.get("bad-new-brokerfactory", getFactoryClassName(conf, loader)), e).setFatal(true); } }
/** * Return a pooled factory for the default configuration. */ public static BrokerFactory getBrokerFactory() { return Bootstrap.getBrokerFactory(null, null); }
/** * Return a new factory for the default configuration. */ public static BrokerFactory newBrokerFactory() { return Bootstrap.newBrokerFactory(null, null); }
/** * Return a pooled factory for the given configuration. The classloader * will be used to load the factory class. If no classloader is given, * the thread's context classloader is used. */ public static BrokerFactory getBrokerFactory(ConfigurationProvider conf, ClassLoader loader) { try { return invokeFactory(conf, loader, "getInstance"); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); if (cause instanceof OpenJPAException) throw (OpenJPAException) cause; throw new InternalException(s_loc.get("brokerfactory-excep", getFactoryClassName(conf, loader)), cause); } catch (Exception e) { throw new UserException(s_loc.get("bad-brokerfactory", getFactoryClassName(conf, loader)), e).setFatal(true); } }
/** * Return a pooled factory for the default configuration. */ public static BrokerFactory getBrokerFactory() { return Bootstrap.getBrokerFactory(null, null); }
private BrokerFactory getBrokerFactory(ConfigurationProvider cp, Object poolValue, ClassLoader loader) { // handle "true" and "false" if (poolValue instanceof String && ("true".equalsIgnoreCase((String) poolValue) || "false".equalsIgnoreCase((String) poolValue))) poolValue = Boolean.valueOf((String) poolValue); if (poolValue != null && !(poolValue instanceof Boolean)) { // we only support boolean settings for this option currently. throw new IllegalArgumentException(poolValue.toString()); } if (poolValue == null || !((Boolean) poolValue).booleanValue()) return Bootstrap.newBrokerFactory(cp, loader); else return Bootstrap.getBrokerFactory(cp, loader); }
/** * Return a new factory for the default configuration. */ public static BrokerFactory newBrokerFactory() { return Bootstrap.newBrokerFactory(null, null); }
/** * Return a pooled factory for the given configuration. The classloader * will be used to load the factory class. If no classloader is given, * the thread's context classloader is used. */ public static BrokerFactory getBrokerFactory(ConfigurationProvider conf, ClassLoader loader) { try { return invokeFactory(conf, loader, "getInstance", CONFIGURATION_CLASSLOADER_ARGS, new Object[] { conf, loader }); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); if (cause instanceof OpenJPAException) throw (OpenJPAException) cause; throw new InternalException(s_loc.get("brokerfactory-excep", getFactoryClassName(conf, loader)), cause); } catch (Exception e) { throw new UserException(s_loc.get("bad-brokerfactory", getFactoryClassName(conf, loader)), e).setFatal(true); } }
/** * Return a pooled factory for the default configuration. */ public static BrokerFactory getBrokerFactory() { return Bootstrap.getBrokerFactory(null, null); }
private static String getFactoryClassName(ConfigurationProvider conf, ClassLoader loader) { try { return getFactoryClass(conf, loader).getName(); } catch (Exception e) { return "<" + e.toString() + ">"; } }
private BrokerFactory getBrokerFactory(ConfigurationProvider cp, Object poolValue, ClassLoader loader) { // handle "true" and "false" if (poolValue instanceof String && ("true".equalsIgnoreCase((String) poolValue) || "false".equalsIgnoreCase((String) poolValue))) poolValue = Boolean.valueOf((String) poolValue); if (poolValue != null && !(poolValue instanceof Boolean)) { // we only support boolean settings for this option currently. throw new IllegalArgumentException(poolValue.toString()); } if (poolValue == null || !((Boolean) poolValue).booleanValue()) return Bootstrap.newBrokerFactory(cp, loader); else return Bootstrap.getBrokerFactory(cp, loader); }
/** * Return a new factory for the default configuration. */ public static BrokerFactory newBrokerFactory() { return Bootstrap.newBrokerFactory(null, null); }
/** * Return a pooled factory for the given configuration. The classloader * will be used to load the factory class. If no classloader is given, * the thread's context classloader is used. */ public static BrokerFactory getBrokerFactory(ConfigurationProvider conf, ClassLoader loader) { try { return invokeFactory(conf, loader, "getInstance", CONFIGURATION_CLASSLOADER_ARGS, new Object[] { conf, loader }); } catch (InvocationTargetException ite) { Throwable cause = ite.getTargetException(); if (cause instanceof OpenJPAException) throw (OpenJPAException) cause; throw new InternalException(s_loc.get("brokerfactory-excep", getFactoryClassName(conf, loader)), cause); } catch (Exception e) { throw new UserException(s_loc.get("bad-brokerfactory", getFactoryClassName(conf, loader)), e).setFatal(true); } }
/** * Return a pooled factory for the default configuration. */ public static BrokerFactory getBrokerFactory() { return Bootstrap.getBrokerFactory(null, null); }
private static String getFactoryClassName(ConfigurationProvider conf, ClassLoader loader) { try { return getFactoryClass(conf, loader).getName(); } catch (Exception e) { return "<" + e.toString() + ">"; } }
private BrokerFactory getBrokerFactory(ConfigurationProvider cp, Object poolValue, ClassLoader loader) { // handle "true" and "false" if (poolValue instanceof String && ("true".equalsIgnoreCase((String) poolValue) || "false".equalsIgnoreCase((String) poolValue))) poolValue = Boolean.valueOf((String) poolValue); if (poolValue != null && !(poolValue instanceof Boolean)) { // we only support boolean settings for this option currently. throw new IllegalArgumentException(poolValue.toString()); } if (poolValue == null || !((Boolean) poolValue).booleanValue()) return Bootstrap.newBrokerFactory(cp, loader); else return Bootstrap.getBrokerFactory(cp, loader); }
/** * Return a new factory for the default configuration. */ public static BrokerFactory newBrokerFactory() { return Bootstrap.newBrokerFactory(null, null); }