本文整理了Java中org.springframework.webflow.execution.Event.getSource()
方法的一些代码示例,展示了Event.getSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getSource()
方法的具体详情如下:
包路径:org.springframework.webflow.execution.Event
类名称:Event
方法名:getSource
暂无
代码示例来源:origin: org.springframework.webflow/spring-webflow
/**
* Get the event id to be used as grounds for a transition in the containing state, based on given result returned
* from action execution.
* <p>
* If the wrapped action is named, the name will be used as a qualifier for the event (e.g. "myAction.success").
* @param resultEvent the action result event
*/
protected Event postProcessResult(Event resultEvent) {
if (resultEvent == null) {
return null;
}
if (isNamed()) {
// qualify result event id with action name for a named action
String qualifiedId = getName() + "." + resultEvent.getId();
if (logger.isDebugEnabled()) {
logger.debug("Qualifying action result '" + resultEvent.getId() + "'; qualified result = '"
+ qualifiedId + "'");
}
resultEvent = new Event(resultEvent.getSource(), qualifiedId, resultEvent.getAttributes());
}
return resultEvent;
}
代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-api
@Override
public Event resolveSingle(final RequestContext context) {
val events = resolve(context);
if (events == null || events.isEmpty()) {
return null;
}
val event = events.iterator().next();
LOGGER.debug("Resolved single event [{}] via [{}] for this context", event.getId(), event.getSource().getClass().getName());
return event;
}
代码示例来源:origin: org.apereo.cas/cas-server-core-webflow-mfa-api
/**
* Resolve events internal set. Implementation may filter events from the collection
* to only return the one that is appropriate for this request. The default
* implementation returns the entire collection.
*
* @param resolveEvents the resolve events
* @param authentication the authentication
* @param registeredService the registered service
* @param request the request
* @param context the request context
* @return the set of resolved events
*/
protected Set<Event> resolveEventsInternal(final Set<Event> resolveEvents, final Authentication authentication, final RegisteredService registeredService,
final HttpServletRequest request, final RequestContext context) {
if (!resolveEvents.isEmpty()) {
LOGGER.trace("Collection of resolved events for this authentication sequence are:");
resolveEvents.forEach(e -> LOGGER.trace("Event id [{}] resolved from [{}]", e.getId(), e.getSource().getClass().getName()));
} else {
LOGGER.trace("No events could be resolved for this authentication transaction [{}] and service [{}]", authentication, registeredService);
}
val pair = filterEventsByMultifactorAuthenticationProvider(resolveEvents, authentication, registeredService, request);
WebUtils.putResolvedMultifactorAuthenticationProviders(context, pair.getValue());
return pair.getKey();
}
代码示例来源:origin: org.springframework.webflow/org.springframework.webflow
/**
* Get the event id to be used as grounds for a transition in the containing state, based on given result returned
* from action execution.
* <p>
* If the wrapped action is named, the name will be used as a qualifier for the event (e.g. "myAction.success").
* @param resultEvent the action result event
*/
protected Event postProcessResult(Event resultEvent) {
if (resultEvent == null) {
return null;
}
if (isNamed()) {
// qualify result event id with action name for a named action
String qualifiedId = getName() + "." + resultEvent.getId();
if (logger.isDebugEnabled()) {
logger.debug("Qualifying action result '" + resultEvent.getId() + "'; qualified result = '"
+ qualifiedId + "'");
}
resultEvent = new Event(resultEvent.getSource(), qualifiedId, resultEvent.getAttributes());
}
return resultEvent;
}
代码示例来源:origin: spring-projects/spring-webflow
/**
* Get the event id to be used as grounds for a transition in the containing state, based on given result returned
* from action execution.
* <p>
* If the wrapped action is named, the name will be used as a qualifier for the event (e.g. "myAction.success").
* @param resultEvent the action result event
*/
protected Event postProcessResult(Event resultEvent) {
if (resultEvent == null) {
return null;
}
if (isNamed()) {
// qualify result event id with action name for a named action
String qualifiedId = getName() + "." + resultEvent.getId();
if (logger.isDebugEnabled()) {
logger.debug("Qualifying action result '" + resultEvent.getId() + "'; qualified result = '"
+ qualifiedId + "'");
}
resultEvent = new Event(resultEvent.getSource(), qualifiedId, resultEvent.getAttributes());
}
return resultEvent;
}
代码示例来源:origin: org.springframework/spring-webflow
/**
* Get the event id to be used as grounds for a transition in the containing state, based on given result returned
* from action execution.
* <p>
* If the wrapped action is named, the name will be used as a qualifier for the event (e.g. "myAction.success").
* @param resultEvent the action result event
*/
protected Event postProcessResult(Event resultEvent) {
if (resultEvent == null) {
return null;
}
if (isNamed()) {
// qualify result event id with action name for a named action
String qualifiedId = getName() + "." + resultEvent.getId();
resultEvent = new Event(resultEvent.getSource(), qualifiedId, resultEvent.getAttributes());
}
return resultEvent;
}
代码示例来源:origin: spring-projects/spring-webflow
public void testSuccess() {
Event e = support.success(source);
assertEquals("success", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testBooleanTrueEvent() {
Event e = support.event(source, true);
assertEquals("yes", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testBooleanFalseEvent() {
Event e = support.event(source, false);
assertEquals("no", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testEvent() {
Event e = support.event(source, "no");
assertEquals("no", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testError() {
Event e = support.error(source);
assertEquals("error", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testYes() {
Event e = support.yes(source);
assertEquals("yes", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testNo() {
Event e = support.no(source);
assertEquals("no", e.getId());
assertSame(source, e.getSource());
}
代码示例来源:origin: spring-projects/spring-webflow
public void testSuccessWithResult() {
Object result = new Object();
Event e = support.success(source, result);
assertEquals("success", e.getId());
assertSame(source, e.getSource());
assertSame(result, e.getAttributes().get("result"));
}
代码示例来源:origin: spring-projects/spring-webflow
public void testErrorWithException() {
Exception ex = new Exception();
Event e = support.error(source, ex);
assertEquals("error", e.getId());
assertSame(source, e.getSource());
assertSame(ex, e.getAttributes().get("exception"));
}
代码示例来源:origin: spring-projects/spring-webflow
public void testEventWithAttrs() {
Event e = support.event(source, "no", "foo", "bar");
assertEquals("no", e.getId());
assertEquals("bar", e.getAttributes().get("foo"));
assertSame(source, e.getSource());
}
代码示例来源:origin: org.wicketstuff/spring-webflow
Event event1 = new Event(event.getSource(), PageFlowConstants.PAGE_FLOW_DEFAULT_TRANSITION);
context.handleEvent(event1);
return;
内容来源于网络,如有侵权,请联系作者删除!