private void setDiagnosticContext(OpenJPAConfiguration conf) { LogFactory logFactory = conf.getLogFactory(); try { Method setter = AccessController.doPrivileged(J2DoPrivHelper. getDeclaredMethodAction(logFactory.getClass(), "setDiagnosticContext", new Class[]{String.class})); setter.invoke(logFactory, conf.getId()); } catch (Throwable t) { // no contextual logging } }
private void setDiagnosticContext(OpenJPAConfiguration conf) { LogFactory logFactory = conf.getLogFactory(); try { Method setter = AccessController.doPrivileged(J2DoPrivHelper. getDeclaredMethodAction(logFactory.getClass(), "setDiagnosticContext", new Class[]{String.class})); setter.invoke(logFactory, conf.getId()); } catch (Throwable t) { // no contextual logging } }
private void setDiagnosticContext(OpenJPAConfiguration conf) { LogFactory logFactory = conf.getLogFactory(); try { Method setter = AccessController.doPrivileged(J2DoPrivHelper. getDeclaredMethodAction(logFactory.getClass(), "setDiagnosticContext", new Class[]{String.class})); setter.invoke(logFactory, conf.getId()); } catch (Throwable t) { // no contextual logging } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { boolean isField = in.readBoolean(); Class<?> cls = (Class<?>) in.readObject(); String memberName = (String) in.readObject(); try { if (isField) _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredFieldAction( cls, memberName)); else { Class<?>[] parameterTypes = (Class[]) in.readObject(); _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( cls, memberName, parameterTypes)); } } catch (SecurityException e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } catch (PrivilegedActionException pae) { IOException ioe = new IOException( pae.getException().getMessage()); ioe.initCause(pae); throw ioe; } }
/** * Convenience method to return the given method / arg. */ private static Method getMethodSafe(Class iface, String name, Class arg) { try { return (Method) AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( iface, name, arg == null ? null : new Class[]{arg})); } catch (PrivilegedActionException pae) { throw new InternalException (_loc.get ("interface-mismatch", name)); } }
/** * Convenience method to return the given method / arg. */ private static Method getMethodSafe(Class<?> iface, String name, Class<?> arg) { try { return AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( iface, name, arg == null ? null : new Class[]{arg})); } catch (PrivilegedActionException pae) { throw new InternalException (_loc.get ("interface-mismatch", name)); } }
/** * Convenience method to return the given method / arg. */ private static Method getMethodSafe(Class<?> iface, String name, Class<?> arg) { try { return AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( iface, name, arg == null ? null : new Class[]{arg})); } catch (PrivilegedActionException pae) { throw new InternalException (_loc.get ("interface-mismatch", name)); } }
/** * Convenience method to return the given method / arg. */ private static Method getMethodSafe(Class<?> iface, String name, Class<?> arg) { try { return AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( iface, name, arg == null ? null : new Class[]{arg})); } catch (PrivilegedActionException pae) { throw new InternalException (_loc.get ("interface-mismatch", name)); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { boolean isField = in.readBoolean(); Class<?> cls = (Class<?>) in.readObject(); String memberName = (String) in.readObject(); try { if (isField) _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredFieldAction( cls, memberName)); else { Class<?>[] parameterTypes = (Class[]) in.readObject(); _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( cls, memberName, parameterTypes)); } } catch (SecurityException e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } catch (PrivilegedActionException pae) { IOException ioe = new IOException( pae.getException().getMessage()); ioe.initCause(pae); throw ioe; } }
/** * Convenience method to return the given method / arg. */ private static Method getMethodSafe(Class<?> iface, String name, Class<?> arg) { try { return AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( iface, name, arg == null ? null : new Class[]{arg})); } catch (PrivilegedActionException pae) { throw new InternalException (_loc.get ("interface-mismatch", name)); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { boolean isField = in.readBoolean(); Class<?> cls = (Class<?>) in.readObject(); String memberName = (String) in.readObject(); try { if (isField) _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredFieldAction( cls, memberName)); else { Class<?>[] parameterTypes = (Class[]) in.readObject(); _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( cls, memberName, parameterTypes)); } } catch (SecurityException e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } catch (PrivilegedActionException pae) { IOException ioe = new IOException( pae.getException().getMessage()); ioe.initCause(pae); throw ioe; } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { boolean isField = in.readBoolean(); Class cls = (Class) in.readObject(); String memberName = (String) in.readObject(); try { if (isField) _member = (Field) AccessController.doPrivileged( J2DoPrivHelper.getDeclaredFieldAction( cls, memberName)); else { Class[] parameterTypes = (Class[]) in.readObject(); _member = (Method) AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( cls, memberName, parameterTypes)); } } catch (SecurityException e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } catch (PrivilegedActionException pae) { IOException ioe = new IOException( pae.getException().getMessage()); ioe.initCause(pae); throw ioe; } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { boolean isField = in.readBoolean(); Class<?> cls = (Class<?>) in.readObject(); String memberName = (String) in.readObject(); try { if (isField) _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredFieldAction( cls, memberName)); else { Class<?>[] parameterTypes = (Class[]) in.readObject(); _member = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction( cls, memberName, parameterTypes)); } } catch (SecurityException e) { IOException ioe = new IOException(e.getMessage()); ioe.initCause(e); throw ioe; } catch (PrivilegedActionException pae) { IOException ioe = new IOException( pae.getException().getMessage()); ioe.initCause(pae); throw ioe; } }
private static boolean isGetter(Class<?> iface, FieldMetaData fmd) { if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class) return true; try { Method meth = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction(iface, "is" + StringUtils.capitalize(fmd.getName()), (Class[]) null)); return meth == null; } catch (PrivilegedActionException pae) {} return true; }
private static boolean isGetter(Class iface, FieldMetaData fmd) { if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class) return true; try { Method meth = (Method) AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction(iface, "is" + StringUtils.capitalize(fmd.getName()), (Class[]) null)); return meth == null; } catch (PrivilegedActionException pae) {} return true; }
J2DoPrivHelper.getDeclaredMethodAction(owner, name, params)); } catch (PrivilegedActionException pae) { throw (NoSuchMethodException) pae.getException();
private static boolean isGetter(Class<?> iface, FieldMetaData fmd) { if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class) return true; try { Method meth = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction(iface, "is" + StringUtils.capitalize(fmd.getName()), (Class[]) null)); return meth == null; } catch (PrivilegedActionException pae) {} return true; }
J2DoPrivHelper.getDeclaredMethodAction(owner, name, params)); } catch (PrivilegedActionException pae) { throw (NoSuchMethodException) pae.getException();
private static boolean isGetter(Class<?> iface, FieldMetaData fmd) { if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class) return true; try { Method meth = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction(iface, "is" + StringUtil.capitalize(fmd.getName()), (Class[]) null)); return meth == null; } catch (PrivilegedActionException pae) {} return true; }
private static boolean isGetter(Class<?> iface, FieldMetaData fmd) { if (fmd.getType() != boolean.class && fmd.getType() != Boolean.class) return true; try { Method meth = AccessController.doPrivileged( J2DoPrivHelper.getDeclaredMethodAction(iface, "is" + StringUtil.capitalize(fmd.getName()), (Class[]) null)); return meth == null; } catch (PrivilegedActionException pae) {} return true; }