本文整理汇总了Java中org.kuali.rice.core.api.util.ClassLoaderUtils.unwrapFromProxy方法的典型用法代码示例。如果您正苦于以下问题:Java ClassLoaderUtils.unwrapFromProxy方法的具体用法?Java ClassLoaderUtils.unwrapFromProxy怎么用?Java ClassLoaderUtils.unwrapFromProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.ClassLoaderUtils
的用法示例。
在下文中一共展示了ClassLoaderUtils.unwrapFromProxy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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++;
}
}
示例2: 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++;
}
}
示例3: 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());
}
示例4: testGetWorkflowAttribute
import org.kuali.rice.core.api.util.ClassLoaderUtils; //导入方法依赖的package包/类
@Test
public void testGetWorkflowAttribute() throws Exception {
RuleTemplateBo template = KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName("TemplateWithRuleValidationAttribute");
List<RuleTemplateAttributeBo> ruleTemplateAttributes = (List<RuleTemplateAttributeBo>) template.getRuleTemplateAttributes();
int index = 0;
for (RuleTemplateAttributeBo ruleTemplateAttribute : ruleTemplateAttributes) {
boolean runtimeThrown = false;
WorkflowRuleAttribute attribute = null;
try {
attribute = ruleTemplateAttribute.getWorkflowAttribute();
} catch (RuntimeException e) {
runtimeThrown = true;
}
if (index == 0) {
// should be the TestRuleAttribute
assertFalse("RuntimeException should not have been thrown.", runtimeThrown);
assertNotNull("Attribute should exist.", attribute);
attribute = (WorkflowRuleAttribute) ClassLoaderUtils.unwrapFromProxy(attribute);
assertEquals("Should be TestRuleAttribute", TestRuleAttribute.class, attribute.getClass());
} else if (index == 1) {
// should be the TestRuleDelegationAttribute so should be null
assertTrue("RuntimeException should have been thrown.", runtimeThrown);
assertNull("This should be the rule delegation attribute, not a WorkflowAttribute.", attribute);
}
index++;
}
}