• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ClassLoaderUtils类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kuali.rice.core.api.util.ClassLoaderUtils的典型用法代码示例。如果您正苦于以下问题:Java ClassLoaderUtils类的具体用法?Java ClassLoaderUtils怎么用?Java ClassLoaderUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ClassLoaderUtils类属于org.kuali.rice.core.api.util包,在下文中一共展示了ClassLoaderUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: lookupFinderValue

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
/**
   * This method looks up a value in a finder class.
   * @param fieldControl the type of web control that is associated with this field.
   * @param prop the property to look up - either a property name as a String, or a referenced object
   * @param finder finder to look the value up in
   * @return the value that was returned from the lookup
   */
  private static String lookupFinderValue(ControlDefinition fieldControl, Object prop, KeyValuesFinder finder) {
      String propValue = null;

      // KULRICE-1808 : PersistableBusinessObjectValuesFinder is not working for inquiries that have child objects with ValuesFinder populated select lists
      if (finder instanceof PersistableBusinessObjectValuesFinder) {
          ((PersistableBusinessObjectValuesFinder) finder).setBusinessObjectClass(ClassLoaderUtils.getClass(fieldControl.getBusinessObjectClass()));
          ((PersistableBusinessObjectValuesFinder) finder).setKeyAttributeName(fieldControl.getKeyAttribute());
          ((PersistableBusinessObjectValuesFinder) finder).setLabelAttributeName(fieldControl.getLabelAttribute());
          if (fieldControl.getIncludeBlankRow() != null) {
          	((PersistableBusinessObjectValuesFinder) finder).setIncludeBlankRow(fieldControl.getIncludeBlankRow());
          }
          ((PersistableBusinessObjectValuesFinder) finder).setIncludeKeyInDescription(fieldControl.getIncludeKeyInLabel());
      }
      List<KeyValue> keyValues = finder.getKeyValues();
      propValue = getPropertyValueFromList(prop, keyValues);
      if(propValue==null) {
	propValue = lookupInactiveFinderValue(prop, finder);
}
      return propValue;
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:FieldBridge.java


示例2: establishConnectionMetaData

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
protected void establishConnectionMetaData(MetadataManager mm) throws Exception {
    String connMetadata = getMetadataLocation();
    if (StringUtils.isBlank(connMetadata)) {
        LOG.info("No OJB connection metadata loaded.");
        return;
    }
    if (!isConnectionAlreadyConfigured(mm)) {
        LOG.info("Loading OJB Connection Metadata from " + connMetadata);
        DefaultResourceLoader resourceLoader = new DefaultResourceLoader(ClassLoaderUtils.getDefaultClassLoader());
        InputStream is = resourceLoader.getResource(connMetadata).getInputStream();
        is = preprocessConnectionMetadata(is);
        ConnectionRepository cr = mm.readConnectionRepository(is);
        mm.mergeConnectionRepository(cr);
        try {
            is.close();
        } catch (Exception e) {
            LOG.warn("Failed to close stream to file " + connMetadata, e);
        }
    } else {
        LOG.info("OJB Connections already configured for jcd aliases '" + StringUtils.join(getJcdAliases(), ", ") + "', skipping Metadata merge.");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:BaseOjbConfigurer.java


示例3: getProxyForService

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
protected Object getProxyForService() {
	checkService();
	checkServiceInterface();
	ProxyFactory proxyFactory = new ProxyFactory();
	for (Class<?> serviceInterface : getServiceInterfaces()) {
		proxyFactory.addInterface(serviceInterface);
	}
	if (registerTraceInterceptor == true) {
		proxyFactory.addAdvice(new RemoteInvocationTraceInterceptor(getExporterName()));
	}
	ClassLoader classLoader = serviceDefinition.getServiceClassLoader();
	if (classLoader == null) {
	    classLoader = ClassLoaderUtils.getDefaultClassLoader();
	}
	Object service = ContextClassLoaderProxy.wrap(getService(), classLoader);
	service = BAMServerProxy.wrap(service, getServiceDefinition());
	proxyFactory.setTarget(service);
	return proxyFactory.getProxy(classLoader);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:KSBHttpInvokerServiceExporter.java


示例4: getSearchableAttributeValueByDataTypeString

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
public static SearchableAttributeValue getSearchableAttributeValueByDataTypeString(String dataType) {
    SearchableAttributeValue returnableValue = null;
    if (StringUtils.isBlank(dataType)) {
        return returnableValue;
    }
    for (SearchableAttributeValue attValue : getSearchableAttributeValueObjectTypes())
    {
        if (dataType.equalsIgnoreCase(attValue.getAttributeDataType()))
        {
            if (returnableValue != null)
            {
                String errorMsg = "Found two SearchableAttributeValue objects with same data type string ('" + dataType + "' while ignoring case):  " + returnableValue.getClass().getName() + " and " + attValue.getClass().getName();
                LOG.error("getSearchableAttributeValueByDataTypeString() " + errorMsg);
                throw new RuntimeException(errorMsg);
            }
            LOG.debug("getSearchableAttributeValueByDataTypeString() SearchableAttributeValue class name is " + attValue.getClass().getName() + "... ojbConcreteClassName is " + attValue.getOjbConcreteClass());
            ObjectDefinition objDef = new ObjectDefinition(attValue.getClass());
            returnableValue = (SearchableAttributeValue) ObjectDefinitionResolver.createObject(objDef, ClassLoaderUtils.getDefaultClassLoader(), false);
        }
    }
    return returnableValue;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:DocumentSearchInternalUtils.java


示例5: testIsWorkflowAttribute

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Test
public void testIsWorkflowAttribute() throws Exception {
    RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
    List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
    int index = 0;
    for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
        boolean isWorkflowAttribute = ruleTemplateAttribute.isWorkflowAttribute();
        Object attribute = ruleTemplateAttribute.getAttribute();
        attribute = ClassLoaderUtils.unwrapFromProxy(attribute);
        if (index == 0) {
            // should be the TestRuleAttribute
            assertNotNull(attribute);
            assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
            assertTrue("TestRuleAttribute is a workflow attribute.", isWorkflowAttribute);
        } else if (index == 1) {
            // should be the TestRuleValidationAttribute so should be null
            assertEquals("Should be TestRuleValidationAttribute", TestRuleValidationAttribute.class,
                    attribute.getClass());
            assertFalse("TestRuleValidationAttribute is not a workflow attribute", isWorkflowAttribute);
        }
        index++;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:RuleTemplateAttributeTest.java


示例6: loadProperties

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
private static void loadProperties( Properties props, String propertyFileName) {
    InputStream propertyFileInputStream = null;
    try {
        try {
            propertyFileInputStream = new DefaultResourceLoader(ClassLoaderUtils.getDefaultClassLoader()).getResource(propertyFileName).getInputStream();
            props.load(propertyFileInputStream);
        }
        finally {
            if (propertyFileInputStream != null) {
                propertyFileInputStream.close();
            }
        }
    }
    catch (IOException e) {
        LOG.error(e);
       // throw new RuntimeException("PropertyLoadingFactoryBean unable to load property file: " + propertyFileName);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:19,代码来源:PropertyLoadingFactoryBean.java


示例7: setParameter

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
public static void setParameter(HttpParams params, String paramName, String paramValue) {
	Class<?> paramType = getParameterType(paramName);
	if (paramType.equals(Boolean.class)) {
		params.setBooleanParameter(paramName, Boolean.parseBoolean(paramValue));
	} else if (paramType.equals(Integer.class)) {
		params.setIntParameter(paramName, Integer.parseInt(paramValue));
	} else if (paramType.equals(Long.class)) {
		params.setLongParameter(paramName, Long.parseLong(paramValue));
	} else if (paramType.equals(Double.class)) {
		params.setDoubleParameter(paramName, Double.parseDouble(paramValue));
	} else if (paramType.equals(String.class)) {
		params.setParameter(paramName, paramValue);
	} else if (paramType.equals(Class.class)) {
		try {
			Class<?> configuredClass = Class.forName(paramValue, true, ClassLoaderUtils.getDefaultClassLoader());
			params.setParameter(paramName, configuredClass);
		} catch (ClassNotFoundException e) {
			throw new RuntimeException("Could not locate the class needed to configure the HttpClient.", e);
		}
	} else {
		throw new RuntimeException("Attempted to configure an HttpClient parameter '" + paramName + "' " +
				"of a type not supported through Workflow configuration: " + paramType.getName());
	}
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:25,代码来源:HttpClientHelper.java


示例8: testIsWorkflowAttribute

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Test
public void testIsWorkflowAttribute() throws Exception {
    RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
    List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
    int index = 0;
    for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
        boolean isWorkflowAttribute = ruleTemplateAttribute.isWorkflowAttribute();
        Object attribute = ruleTemplateAttribute.getAttribute();
        attribute = ClassLoaderUtils.unwrapFromProxy(attribute);
        if (index == 0) {
            // should be the TestRuleAttribute
            assertNotNull(attribute);
            assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
            assertTrue("TestRuleAttribute is a workflow attribute.", isWorkflowAttribute);
        } else if (index == 1) {
            // should be the TestRuleValidationAttribute so should be null
            assertEquals("Should be TestRuleValidationAttribute", TestRuleValidationAttribute.class, attribute.getClass());
            assertFalse("TestRuleValidationAttribute is not a workflow attribute", isWorkflowAttribute);
        }
        index++;
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:23,代码来源:RuleTemplateAttributeTest.java


示例9: buildChain

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
private FilterChain buildChain(HttpServletRequest request, FilterChain targetChain) {
	BootstrapFilterChain chain = new BootstrapFilterChain(targetChain, ClassLoaderUtils.getDefaultClassLoader());
	String requestPath = request.getServletPath();
	for (FilterMapping mapping : filterMappings) {
		Filter filter = filters.get(mapping.getFilterName());
		if (!chain.containsFilter(filter) && matchFiltersURL(mapping.getUrlPattern(), requestPath) 
                   && !excludeFilter(mapping.getFilterName(), request.getRequestURL().toString())) {
               chain.addFilter(filter);
		}
	}
	return chain;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:BootstrapFilter.java


示例10: getAttributeFormatter

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DataDictionaryService#getAttributeFormatter(java.lang.String)
 */
@Override
public Class<? extends Formatter> getAttributeFormatter(String entryName, String attributeName) {
    Class formatterClass = null;

    AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
    if (attributeDefinition != null) {
        if (attributeDefinition.hasFormatterClass()) {
            formatterClass = ClassLoaderUtils.getClass(attributeDefinition.getFormatterClass());
        }
    }

    return formatterClass;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestDataDictionaryService.java


示例11: getAttributeValuesFinderClass

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DataDictionaryService#getAttributeValuesScopeId(java.lang.Class,
 *      java.lang.String)
 */
@Override
public Class<? extends KeyValuesFinder> getAttributeValuesFinderClass(String entryName, String attributeName) {
    Class valuesFinderClass = null;

    AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
    if (attributeDefinition != null) {
        String valuesFinderClassName = attributeDefinition.getControl().getValuesFinderClass();
        valuesFinderClass = ClassLoaderUtils.getClass(valuesFinderClassName);
    }

    return valuesFinderClass;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:TestDataDictionaryService.java


示例12: getAttributeFormatter

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Override
public Class<? extends Formatter> getAttributeFormatter(String entryName, String attributeName) {
       Class formatterClass = null;

       AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
       if (attributeDefinition != null) {
           if (attributeDefinition.hasFormatterClass()) {
               formatterClass = ClassLoaderUtils.getClass(attributeDefinition.getFormatterClass());
           }
       }

       return formatterClass;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:DataDictionaryServiceImpl.java


示例13: getAttributeValuesFinderClass

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
/**
    * @see org.kuali.rice.krad.service.DataDictionaryService#getAttributeValuesScopeId(java.lang.Class,
    *      java.lang.String)
    */
   @Override
public Class<? extends KeyValuesFinder> getAttributeValuesFinderClass(String entryName, String attributeName) {
       Class valuesFinderClass = null;

       AttributeDefinition attributeDefinition = getAttributeDefinition(entryName, attributeName);
       if (attributeDefinition != null) {
           String valuesFinderClassName = attributeDefinition.getControl().getValuesFinderClass();
           valuesFinderClass = ClassLoaderUtils.getClass(valuesFinderClassName);
       }

       return valuesFinderClass;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:DataDictionaryServiceImpl.java


示例14: completeValidation

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Override
public void completeValidation(Class rootObjectClass, Class otherObjectClass, ValidationTrace tracer) {
	super.completeValidation(rootObjectClass, otherObjectClass,tracer);
	if ( StringUtils.isNotBlank(lookupBoClass) ) {
       	try {
       		ClassUtils.getClass(ClassLoaderUtils.getDefaultClassLoader(), getLookupBoClass());
       	} catch (ClassNotFoundException e) {
               String currentValues[] = {"property = " + getName(), "class = " + rootObjectClass.getName(), "lookupBoClass = " + getLookupBoClass()};
               tracer.createError("lookupBoClass could not be found", currentValues);
       	}
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:KimAttributeDefinition.java


示例15: validate

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Override
public void validate() {
	super.validate();
	if (this.serviceInterfaces == null || this.serviceInterfaces.isEmpty()) {
		Class<?>[] interfaces = ClassLoaderUtils.getInterfacesToProxy(getService(), null, null);
		for (Class<?> serviceInterfaceClass : interfaces) {
		    this.serviceInterfaces.add(serviceInterfaceClass.getName());
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:11,代码来源:JavaServiceDefinition.java


示例16: loadSignatureCrypto

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Override
public Crypto loadSignatureCrypto(RequestData reqData) {
	try {
		return new Merlin(getMerlinProperties(), ClassLoaderUtils.getDefaultClassLoader());
	} catch (Exception e) {
		throw new RiceRuntimeException(e);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:CXFWSS4JInInterceptor.java


示例17: createInstance

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
public static Object createInstance(List<Endpoint> endpoints, Serializable context, String value1,
    String value2, long delayMilliseconds) {
if (endpoints == null || endpoints.isEmpty()) {
    throw new RuntimeException("Cannot create service proxy, no service(s) passed in.");
}
try {
    return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(), ContextClassLoaderProxy
	    .getInterfacesToProxy(endpoints.get(0).getService()),
	    new DelayedAsynchronousServiceCallProxy(endpoints, context, value1, value2, delayMilliseconds));
} catch (Exception e) {
    throw new RiceRuntimeException(e);
}
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:DelayedAsynchronousServiceCallProxy.java


示例18: createInstance

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
public static Object createInstance(List<Endpoint> endpoints, AsynchronousCallback callback,
    Serializable context, String value1, String value2) {
if (endpoints == null || endpoints.isEmpty()) {
    throw new RuntimeException("Cannot create service proxy, no service(s) passed in.");
}
try {
return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(), ContextClassLoaderProxy
	.getInterfacesToProxy(endpoints.get(0).getService()), new SynchronousServiceCallProxy(
			endpoints, callback, context, value1, value2));
} catch (Exception e) {
    throw new RiceRuntimeException(e);
   }
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:SynchronousServiceCallProxy.java


示例19: createInstance

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
public static Object createInstance(List<Endpoint> endpoints, AsynchronousCallback callback, Serializable context,
        String value1, String value2) {
    if (endpoints == null || endpoints.isEmpty()) {
        throw new RuntimeException("Cannot create service proxy, no service(s) passed in.");
    }
    try {
        return Proxy.newProxyInstance(ClassLoaderUtils.getDefaultClassLoader(),
                ContextClassLoaderProxy.getInterfacesToProxy(endpoints.get(0).getService()),
                new AsynchronousServiceCallProxy(endpoints, callback, context, value1, value2));
    } catch (Exception e) {
        throw new RiceRuntimeException(e);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:AsynchronousServiceCallProxy.java


示例20: getHandlerAdapter

import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入依赖的package包/类
@Override
protected HandlerAdapter getHandlerAdapter(Object handler) throws ServletException {
	if (handler instanceof HttpRequestHandler) {
		return new HttpRequestHandlerAdapter();
	} else if (handler instanceof Controller) {
		Object unwrappedHandler = ClassLoaderUtils.unwrapFromProxy(handler);
		if (unwrappedHandler instanceof CXFServletControllerAdapter) {
			// TODO this just seems weird as this controller is initially null when it's created, does there need to be some synchronization here?
			((CXFServletControllerAdapter)unwrappedHandler).setController(cxfServletController);
		}			
		return new SimpleControllerHandlerAdapter();
	}
	throw new RiceRuntimeException("handler of type " + handler.getClass().getName() + " is not known and can't be used by " + KSBDispatcherServlet.class.getName());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:KSBDispatcherServlet.java



注:本文中的org.kuali.rice.core.api.util.ClassLoaderUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ClientSnapshotDescriptionUtils类代码示例发布时间:2022-05-22
下一篇:
Java DefaultTaskFormHandler类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap