log.debug("Reflecting static {}, clazz={} args={}", method, klazz, Arrays.toString(args)); returnValue = MethodUtils.invokeStaticMethod(klazz, method.getName(), args, parameterTypes); } else { if ("<init>".equals(method.getName())) {
public static List<ColumnFamilyDefinition> getCfDefs( Class<? extends CFEnum> cfEnum, List<ColumnFamilyDefinition> cf_defs, String keyspace ) { if ( cf_defs == null ) { cf_defs = new ArrayList<ColumnFamilyDefinition>(); } CFEnum[] values = null; try { values = ( CFEnum[] ) invokeStaticMethod( cfEnum, "values", null); } catch ( Exception e ) { logger.error( "Couldn't get CFEnum values", e ); } if ( values == null ) { return null; } for ( CFEnum cf : values ) { if ( !cf.create() ) { continue; } String defaultValidationClass = cf.getValidator(); List<ColumnDefinition> metadata = cf.getMetadata(); ColumnFamilyDefinition cf_def = HFactory.createColumnFamilyDefinition( keyspace, cf.getColumnFamily(), ComparatorType.getByClassName( cf.getComparator() ), metadata ); if ( defaultValidationClass != null ) { cf_def.setDefaultValidationClass( defaultValidationClass ); } cf_defs.add( cf_def ); } return cf_defs; }
return invokeStaticMethod (objectClass, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeStaticMethod (objectClass, methodName, args, parameterTypes);
return invokeStaticMethod (objectClass, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeStaticMethod (objectClass, methodName, args, parameterTypes);
@Override public void initialize() throws ContainerException { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object[] { bus }); MethodUtils.invokeMethod(jaxrsServerFactoryBean, "create", null); } catch (Exception e) { log.error("Failed to initialize jaxrs server.", e); } finally { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object[] { null }); } catch (Exception ignore) { } } }
private DataSource invokeStaticFactoryMethod( Class<?> factoryClass, String methodName, List<DataSourceConnectionProvider.DataSource.Argument> arguments ) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, ClassNotFoundException { final Object[] javaArgs = getJavaArgs( arguments ); return (DataSource) MethodUtils.invokeStaticMethod( factoryClass, methodName, javaArgs ); }
public Object invokeStaticMethod(String methodName, Object[] args) throws Exception { return MethodUtils.invokeStaticMethod(getStaticClass(), methodName, args); }
@Override public void initialize() throws PipelineException { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object [] { bus }); MethodUtils.invokeMethod(jaxrsServerFactoryBean, "create", null); } catch (Exception e) { log.error("Failed to initialize jaxrs server.", e); } finally { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object [] { null }, new Class[] {bus.getClass()}); } catch (Exception ignore) { } } }
private Object invokeJavaMethod(Class<?> clazz, String methodName, Object... parameters) throws Exception { try{ return MethodUtils.invokeStaticMethod(clazz, methodName, parameters); }catch(InvocationTargetException e){ throw new ScriptException(ResourceBundleUtil.getDefaultMessage("java.run.error4",clazz.getName(),methodName),e.getTargetException()); }catch(Exception e){ //抛出不匹配信息 throw new NotMatchException(e); } }
MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object [] { bus }); MethodUtils.invokeMethod(servletController, "invoke", new Object [] { request.getRequest(), request.getResponse() }); MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object [] { null }, new Class[] {bus.getClass()});
@Override public Object call() throws Exception { Object ret = null; if (target instanceof Class<?>) { Class<?> targetClass = (Class<?>) target; ret = MethodUtils.invokeStaticMethod(targetClass, method, args); } else { ret = MethodUtils.invokeMethod(target, method, args); } messenger.sendReturnAsMsg((ProvaConstant) data[0], ret); return ret; } };
public Object invokeStaticMethod(String methodName, Object[] args) throws Exception { MethodConfig config = findMethodConfig(methodName, args); if (config != null) { return MethodUtils.invokeStaticMethod(getStaticClass(), config.getMethodName(), args, config.getParameterTypes()); } else { return MethodUtils.invokeStaticMethod(getStaticClass(), methodName, args); } }
ret = MethodUtils.invokeStaticMethod(targetClass,method,args.toArray()); } catch (SecurityException e) { throw new RuntimeException(e);
@Override public void invoke(ValveContext context) throws ContainerException { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object[] { bus }); HttpServletRequest request = context.getServletRequest(); ResolvedSiteMount resolvedSiteMount = context.getRequestContext().getResolvedSiteMount(); String servletPath = resolvedSiteMount.getResolvedMountPath(); String pathInfo = HstRequestUtils.getPathInfo(resolvedSiteMount, request); HttpServletRequest adjustedRequest = new PathsAdjustedHttpServletRequestWrapper(context.getServletRequest(), servletPath, pathInfo); MethodUtils.invokeMethod(servletController, "invoke", new Object[] { adjustedRequest, context.getServletResponse() }); } catch (Exception e) { if (log.isDebugEnabled()) { log.error("Failed to invoke jaxrs service.", e); } else { log.error("Failed to invoke jaxrs service. {}", e.toString()); } } finally { try { MethodUtils.invokeStaticMethod(busFactoryClass, "setThreadDefaultBus", new Object[] { null }); } catch (Exception ignore) { } } }
Object result = null; try { result = MethodUtils.invokeStaticMethod(distClass, "quantile", args.toArray()); } catch (Exception ex) { if (log.isErrorEnabled()) {
Object targetObject = ((ProvaConstant) target).getObject(); if( targetObject instanceof Class<?> ) rc = MethodUtils.invokeStaticMethod((Class<?>) targetObject,method,args.toArray()); else rc = MethodUtils.invokeMethod(((ProvaConstant) target).getObject(),method,args.toArray());
return invokeStaticMethod (objectClass, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeStaticMethod (objectClass, methodName, args, parameterTypes);
return invokeStaticMethod (objectClass, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeStaticMethod (objectClass, methodName, args, parameterTypes);
return invokeStaticMethod (objectClass, methodName, args); parameterTypes[i] = args[i].getClass(); return invokeStaticMethod (objectClass, methodName, args, parameterTypes);
Class<?> targetClass = (Class<?>) classRef.getObject(); try { ret = MethodUtils.invokeStaticMethod(targetClass,method,args.toArray()); } catch (SecurityException e) { throw new RuntimeException(e);