本文整理汇总了Java中org.springframework.webflow.core.collection.AttributeMap类的典型用法代码示例。如果您正苦于以下问题:Java AttributeMap类的具体用法?Java AttributeMap怎么用?Java AttributeMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AttributeMap类属于org.springframework.webflow.core.collection包,在下文中一共展示了AttributeMap类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sessionEnded
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
@Override
public void sessionEnded(final RequestContext context, final FlowSession session, final String outcome,
final AttributeMap output) {
if ( session.isRoot() ) {
final HttpServletRequest request = WebUtils.getHttpServletRequest(context);
// get session but don't create it if it doesn't already exist
final HttpSession webSession = request.getSession(false);
if (webSession != null) {
LOGGER.debug("Terminate web session {} in {} seconds", webSession.getId(), this.timeToDieInSeconds);
// set the web session to die in timeToDieInSeconds
webSession.setMaxInactiveInterval(this.timeToDieInSeconds);
}
}
}
示例2: validateEventIdForMatchingTransitionInContext
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
/**
* Validate event for transition.
*
* @param eventId the event id
* @param context the context
* @param attributes the attributes
* @return the event
*/
protected Event validateEventIdForMatchingTransitionInContext(final String eventId, final RequestContext context, final Map<String, Object> attributes) {
try {
final AttributeMap<Object> attributesMap = new LocalAttributeMap<>(attributes);
final Event event = new Event(this, eventId, attributesMap);
LOGGER.debug("Resulting event id is [{}]. Locating transitions in the context for that event id...", event.getId());
final TransitionDefinition def = context.getMatchingTransition(event.getId());
if (def == null) {
LOGGER.warn("Transition definition cannot be found for event [{}]", event.getId());
throw new AuthenticationException();
}
LOGGER.debug("Found matching transition [{}] with target [{}] for event [{}] with attributes [{}].",
def.getId(), def.getTargetStateId(), event.getId(), event.getAttributes());
return event;
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
示例3: testBookHotel
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
public void testBookHotel() {
setCurrentState("reviewHotel");
Hotel hotel = new Hotel();
hotel.setId(1L);
hotel.setName("Jameson Inn");
getFlowScope().put("hotel", hotel);
Flow mockBookingFlow = new Flow("booking");
mockBookingFlow.setInputMapper(new Mapper() {
public MappingResults map(Object source, Object target) {
assertEquals(new Long(1), ((AttributeMap) source).get("hotelId"));
return null;
}
});
new EndState(mockBookingFlow, "bookingConfirmed");
getFlowDefinitionRegistry().registerFlowDefinition(mockBookingFlow);
MockExternalContext context = new MockExternalContext();
context.setEventId("book");
resumeFlow(context);
assertFlowExecutionEnded();
assertFlowExecutionOutcomeEquals("finish");
}
示例4: createMockAddRoleSubflow
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
public Flow createMockAddRoleSubflow() {
Flow mockAddRoleFlow = new Flow("add-role");
mockAddRoleFlow.setInputMapper(new Mapper() {
public MappingResults map(Object source, Object target) {
assertNotNull(((AttributeMap) source).get("sorPerson"));
return null;
}
});
new EndState(mockAddRoleFlow, "roleWasAdded");
return mockAddRoleFlow;
}
示例5: doExecute
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
@Override
protected Event doExecute(final RequestContext context) {
final FlowSession session = context.getFlowExecutionContext().getActiveSession();
LOGGER.debug("Authentication has entered the flow [{}] executing state [{}",
context.getActiveFlow().getId(), session.getState().getId());
final Credential creds = WebUtils.getCredential(context);
final String id = creds != null ? creds.getId() : null;
final Credential mfaCreds = createCredentials(context, creds, id);
final AttributeMap map = new LocalAttributeMap(ATTRIBUTE_ID_MFA_CREDENTIALS, mfaCreds);
return new Event(this, EVENT_ID_SUCCESS, map);
}
示例6: sessionEnded
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
public void sessionEnded(RequestContext context, FlowSession session, String outcome, AttributeMap output) {
if (isParentPersistenceContext(session)) {
if (!isPersistenceContext(session.getDefinition())) {
bind(getHibernateSession(session.getParent()));
}
}
}
示例7: createFlowDefinitionUrl
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
@Override
public String createFlowDefinitionUrl(final String flowId, final AttributeMap input, final HttpServletRequest request) {
return request.getRequestURI()
+ (request.getQueryString() != null ? '?'
+ request.getQueryString() : "");
}
示例8: createFlowDefinitionUrl
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
@Override
public String createFlowDefinitionUrl(final String flowId, final AttributeMap input, final HttpServletRequest request) {
return request.getRequestURI()
+ (request.getQueryString() != null ? '?'
+ request.getQueryString() : StringUtils.EMPTY);
}
示例9: createFlowDefinitionUrl
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
@Override
public String createFlowDefinitionUrl(final String flowId, final AttributeMap input, final HttpServletRequest request) {
return request.getRequestURI()
+ (request.getQueryString() != null ? "?"
+ request.getQueryString() : "");
}
示例10: getAttributes
import org.springframework.webflow.core.collection.AttributeMap; //导入依赖的package包/类
public AttributeMap getAttributes() {
return attributes;
}