/** * Make the given member accessible if it isn't already. */ private static void makeAccessible(AccessibleObject ao, int mods) { try { if (!Modifier.isPublic(mods) && !ao.isAccessible()) AccessController.doPrivileged(J2DoPrivHelper .setAccessibleAction(ao, true)); } catch (SecurityException se) { throw new UserException(_loc.get("reflect-security", ao)). setFatal(true); } }
/** * Make the given member accessible if it isn't already. */ private static void makeAccessible(AccessibleObject ao, int mods) { try { if (!Modifier.isPublic(mods) && !ao.isAccessible()) AccessController.doPrivileged(J2DoPrivHelper .setAccessibleAction(ao, true)); } catch (SecurityException se) { throw new UserException(_loc.get("reflect-security", ao)). setFatal(true); } }
/** * Make the given member accessible if it isn't already. */ private static void makeAccessible(AccessibleObject ao, int mods) { try { if (!Modifier.isPublic(mods) && !ao.isAccessible()) AccessController.doPrivileged(J2DoPrivHelper .setAccessibleAction(ao, true)); } catch (SecurityException se) { throw new UserException(_loc.get("reflect-security", ao)). setFatal(true); } }
/** * Make the given member accessible if it isn't already. */ private static void makeAccessible(AccessibleObject ao, int mods) { try { if (!Modifier.isPublic(mods) && !ao.isAccessible()) AccessController.doPrivileged(J2DoPrivHelper .setAccessibleAction(ao, true)); } catch (SecurityException se) { throw new UserException(_loc.get("reflect-security", ao)). setFatal(true); } }
/** * Make the given member accessible if it isn't already. */ private static void makeAccessible(AccessibleObject ao, int mods) { try { if (!Modifier.isPublic(mods) && !ao.isAccessible()) AccessController.doPrivileged(J2DoPrivHelper .setAccessibleAction(ao, true)); } catch (SecurityException se) { throw new UserException(_loc.get("reflect-security", ao)). setFatal(true); } }
private int[] parse(String token, int min, int max) { if ("*".equals(token.trim())) return WILDCARD; String[] tokens = Strings.split(token, ",", 0); int [] times = new int[tokens.length]; for (int i = 0; i < tokens.length; i++) { try { times[i] = Integer.parseInt(tokens[i]); } catch (Throwable t) { throw new UserException(_loc.get("not-number", token)). setFatal(true); } if (times[i] < min || times[i] >= max) throw new UserException(_loc.get("not-range", token, String.valueOf(min), String.valueOf(max))). setFatal(true); } return times; }
private int[] parse(String token, int min, int max) { if ("*".equals(token.trim())) return WILDCARD; String[] tokens = StringUtil.split(token, ",", 0); int [] times = new int[tokens.length]; for (int i = 0; i < tokens.length; i++) { try { times[i] = Integer.parseInt(tokens[i]); } catch (Throwable t) { throw new UserException(_loc.get("not-number", token)). setFatal(true); } if (times[i] < min || times[i] >= max) throw new UserException(_loc.get("not-range", token, String.valueOf(min), String.valueOf(max))). setFatal(true); } return times; }
public Schedule(String date) { StringTokenizer token = new StringTokenizer(date, " \t"); if (token.countTokens() != 5) throw new UserException(_loc.get("bad-count", date)). setFatal(true); try { min = parse(token.nextToken(), 0, 60); hour = parse(token.nextToken(), 0, 24); dayOfMonth = parse(token.nextToken(), 1, 31); month = parse(token.nextToken(), 1, 13); dayOfWeek = parse(token.nextToken(), 1, 8); } catch (Throwable t) { throw new UserException(_loc.get("bad-schedule", date), t). setFatal(true); } }
private static AbstractStoreManager createStoreManager(String cls, String props) { AbstractStoreManager store = (AbstractStoreManager) Configurations.newInstance(cls, AccessController.doPrivileged(J2DoPrivHelper .getClassLoaderAction(AbstractStoreManager.class))); Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE); if (store == null) throw new UserException(s_loc.get("no-store-manager", PROP_ABSTRACT_STORE)).setFatal(true); return store; } }
private static AbstractStoreManager createStoreManager(String cls, String props) { AbstractStoreManager store = (AbstractStoreManager) Configurations. newInstance(cls, (ClassLoader) AccessController.doPrivileged( J2DoPrivHelper.getClassLoaderAction( AbstractStoreManager.class))); Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE); if (store == null) throw new UserException(s_loc.get("no-store-manager", PROP_ABSTRACT_STORE)).setFatal(true); return store; } }
private static AbstractStoreManager createStoreManager(String cls, String props) { AbstractStoreManager store = (AbstractStoreManager) Configurations.newInstance(cls, AccessController.doPrivileged(J2DoPrivHelper .getClassLoaderAction(AbstractStoreManager.class))); Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE); if (store == null) throw new UserException(s_loc.get("no-store-manager", PROP_ABSTRACT_STORE)).setFatal(true); return store; } }
private static AbstractStoreManager createStoreManager(String cls, String props) { AbstractStoreManager store = (AbstractStoreManager) Configurations.newInstance(cls, AccessController.doPrivileged(J2DoPrivHelper .getClassLoaderAction(AbstractStoreManager.class))); Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE); if (store == null) throw new UserException(s_loc.get("no-store-manager", PROP_ABSTRACT_STORE)).setFatal(true); return store; } }
private static AbstractStoreManager createStoreManager(String cls, String props) { AbstractStoreManager store = (AbstractStoreManager) Configurations.newInstance(cls, AccessController.doPrivileged(J2DoPrivHelper .getClassLoaderAction(AbstractStoreManager.class))); Configurations.configureInstance(store, null, props, PROP_ABSTRACT_STORE); if (store == null) throw new UserException(s_loc.get("no-store-manager", PROP_ABSTRACT_STORE)).setFatal(true); return store; } }
/** * Set a value from the given object after validating. * * @param obj can be null to set the Specification to null. */ @Override public void set(Object obj) { if (obj == null) { super.set(null); return; } if (obj instanceof Specification == false) { throw new UserException(_loc.get("spec-wrong-obj", obj, obj.getClass())).setFatal(true); } validateOverwrite((Specification)obj); super.set(obj); }
/** * Set a value from the given object after validating. * * @param obj can be null to set the Specification to null. */ @Override public void set(Object obj) { if (obj == null) { super.set(null); return; } if (obj instanceof Specification == false) { throw new UserException(_loc.get("spec-wrong-obj", obj, obj.getClass())).setFatal(true); } validateOverwrite((Specification)obj); super.set(obj); }
/** * Set a value from the given object after validating. * * @param obj can be null to set the Specification to null. */ @Override public void set(Object obj) { if (obj == null) { super.set(null); return; } if (obj instanceof Specification == false) { throw new UserException(_loc.get("spec-wrong-obj", obj, obj.getClass())).setFatal(true); } validateOverwrite((Specification)obj); super.set(obj); }
static OpenJPAException newConnectException(JDBCConfiguration conf, boolean factory2, Exception cause) { return new UserException(_eloc.get("poolds-null", factory2 ? new Object[]{conf.getConnection2DriverName(), conf.getConnection2URL()} : new Object[]{conf.getConnectionDriverName(), conf.getConnectionURL()}), cause).setFatal(true); }
static OpenJPAException newConnectException(JDBCConfiguration conf, boolean factory2, Exception cause) { return new UserException(_eloc.get("poolds-null", factory2 ? new Object[]{conf.getConnection2DriverName(), conf.getConnection2URL()} : new Object[]{conf.getConnectionDriverName(), conf.getConnectionURL()}), cause).setFatal(true); }
static OpenJPAException newConnectException(JDBCConfiguration conf, boolean factory2, Exception cause) { return new UserException(_eloc.get("poolds-null", factory2 ? new Object[]{conf.getConnection2DriverName(), conf.getConnection2URL()} : new Object[]{conf.getConnectionDriverName(), conf.getConnectionURL()}), cause).setFatal(true); }
static OpenJPAException newConnectException(JDBCConfiguration conf, boolean factory2, Exception cause) { return new UserException(_eloc.get("poolds-null", factory2 ? new Object[]{conf.getConnection2DriverName(), conf.getConnection2URL()} : new Object[]{conf.getConnectionDriverName(), conf.getConnectionURL()}), cause).setFatal(true); }