- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.cocoon.components.flow.WebContinuation
类的一些代码示例,展示了WebContinuation
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebContinuation
类的具体详情如下:
包路径:org.apache.cocoon.components.flow.WebContinuation
类名称:WebContinuation
[英]Representation of continuations in a Web environment.
Because a user may click on the back button of the browser and restart a saved computation in a continuation, each WebContinuation
becomes the parent of a subtree of continuations.
If there is no parent WebContinuation
, the created continuation becomes the root of a tree of WebContinuation
s.
[中]在Web环境中表示连续性。
由于用户可以单击浏览器的“上一步”按钮并在延续中重新启动已保存的计算,因此每个WebContinuation
都将成为延续子树的父级。
如果没有父级WebContinuation
,则创建的延续将成为WebContinuation
s树的根。
代码示例来源:origin: org.apache.cocoon/cocoon-core
/**
* Helper method to process a <jpath:continuation select=""/> element.
*
* @param a an <code>Attributes</code> value
* @exception SAXException if an error occurs
*/
private void doContinuation(final Attributes a)
throws SAXException {
final String level = a.getValue(JPATH_CONTINUATION_SELECT);
final String id = (level != null)
? m_kont.getContinuation(Integer.decode(level).intValue()).getId()
: m_kont.getContinuation(0).getId();
sendTextEvent(id);
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-api
/**
* Debugging method.
*
* <p>Assumes the receiving instance as the root of a tree and
* displays the tree of continuations.
*/
public void display() {
getLogger().debug("\nWK: Tree" + display(0));
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
/**
* Return this continuation if it is valid, or first valid parent
*/
private FOM_WebContinuation findValidParent(FOM_WebContinuation wk) {
if (wk != null) {
WebContinuation wc = wk.getWebContinuation();
while (wc != null && wc.disposed()) {
wc = wc.getParentContinuation();
}
if (wc != null) {
return new FOM_WebContinuation(wc);
}
}
return null;
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-api
public void detachFromParent() {
if (getParentContinuation() != null) {
getParentContinuation().getChildren().remove(this);
}
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
public String hasExpired() {
if ((wc.getLastAccessTime() + wc.getTimeToLive()) < System
.currentTimeMillis()) {
return HAS_EXPIRED_YES;
}
return HAS_EXPIRED_NO;
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
/**
* Return text representation of the WebContinuation.
*/
public String toString() {
return "WC" + wk.getId();
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* Removes an expired leaf <code>WebContinuation</code> node
* from its continuation tree, and recursively removes its
* parent(s) if it they have expired and have no (other) children.
* @param continuationsHolder
*
* @param wk <code>WebContinuation</code> node
*/
protected void removeContinuation(WebContinuationsHolder continuationsHolder,
WebContinuation wk) {
if (wk.getChildren().size() != 0) {
return;
}
// remove access to this contination
disposeContinuation(continuationsHolder, wk);
_detach(wk);
if (getLogger().isDebugEnabled()) {
getLogger().debug("WK: Deleted continuation: " + wk.getId());
}
// now check if parent needs to be removed.
WebContinuation parent = wk.getParentContinuation();
if (null != parent && parent.hasExpired()) {
//parent must have the same continuations holder, lookup not needed
removeContinuation(continuationsHolder, parent);
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-ajax-impl
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception {
String continuationId;
if (source == null) {
continuationId = ObjectModelHelper.getRequest(objectModel).getParameter("continuation-id");
} else {
continuationId = source;
}
// The interpreter id is the sitemap's URI
String interpreterId = SitemapParameters.getLocation(parameters).getURI();
WebContinuation wk = this.contManager.lookupWebContinuation(continuationId, interpreterId);
if (wk == null || wk.disposed()) {
return null;
} else {
// Getting the continuation updates the last access time
wk.getContinuation();
FlowHelper.setWebContinuation(objectModel, newObjectModel, wk);
return Collections.EMPTY_MAP;
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
public Continuation jsGet_continuation() {
return (Continuation)wk.getContinuation();
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* Dump to Log file the current contents of
* the expirations <code>SortedSet</code>
*/
protected void displayExpireSet() {
StringBuffer wkSet = new StringBuffer("\nWK; Expire set size: " + expirations.size());
Iterator i = expirations.iterator();
while (i.hasNext()) {
final WebContinuation wk = (WebContinuation) i.next();
final long lat = wk.getLastAccessTime() + wk.getTimeToLive();
wkSet.append("\nWK: ")
.append(wk.getId())
.append(" ExpireTime [");
if (lat < System.currentTimeMillis()) {
wkSet.append("Expired");
} else {
wkSet.append(lat);
}
wkSet.append("]");
}
getLogger().debug(wkSet.toString());
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
private void _invalidate(WebContinuationsHolder continuationsHolder, WebContinuation wk) {
if (getLogger().isDebugEnabled()) {
getLogger().debug("WK: Manual expire of continuation " + wk.getId());
}
disposeContinuation(continuationsHolder, wk);
expirations.remove(wk);
// Invalidate all the children continuations as well
List children = wk.getChildren();
int size = children.size();
for (int i = 0; i < size; i++) {
_invalidate(continuationsHolder, (WebContinuation) children.get(i));
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-api
/**
* Return the ancestor continuation situated <code>level</code>s
* above the current continuation. The current instance is
* considered to be at level 0. The parent continuation of the
* receiving instance at level 1, its parent is at level 2 relative
* to the receiving instance. If <code>level</code> is bigger than
* the depth of the tree, the root of the tree is returned.
*
* @param level an <code>int</code> value
* @return a <code>WebContinuation</code> value
*/
public WebContinuation getContinuation(int level) {
if (level <= 0) {
updateLastAccessTime();
return this;
} else if (parentContinuation == null) {
return this;
} else {
return parentContinuation.getContinuation(level - 1);
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
public WebContinuation lookupWebContinuation(String id, String interpreterId) {
// REVISIT: Is the following check needed to avoid threading issues:
// return wk only if !(wk.hasExpired) ?
WebContinuationsHolder continuationsHolder = lookupWebContinuationsHolder(false);
if (continuationsHolder == null)
return null;
WebContinuation kont = continuationsHolder.get(id);
if (kont == null)
return null;
if (!kont.interpreterMatches(interpreterId)) {
getLogger().error(
"WK: Continuation (" + kont.getId()
+ ") lookup for wrong interpreter. Bound to: "
+ kont.getInterpreterId() + ", looked up for: "
+ interpreterId);
return null;
}
return kont;
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* Detach this continuation from parent. This method removes
* continuation from {@link #forest} set, or, if it has parent,
* from parent's children collection.
*
* @param wk Continuation to detach from parent.
*/
protected void _detach(WebContinuation wk) {
WebContinuation parent = wk.getParentContinuation();
if (parent == null) {
forest.remove(wk);
} else
wk.detachFromParent();
}
代码示例来源:origin: org.apache.cocoon/cocoon-forms-impl
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException {
super.setup(resolver, objectModel, src, par);
Request req = ObjectModelHelper.getRequest(objectModel);
String continuationId = par.getParameter("continuation-id", req.getParameter("continuation-id"));
String widgetPath = par.getParameter("widget", req.getParameter("widget")).replace('.', '/');
this.filter = par.getParameter("filter", req.getParameter("filter"));
// The interpreter id is the sitemap's URI
String interpreterId = SitemapParameters.getLocation(parameters).getURI();
wk = this.contManager.lookupWebContinuation(continuationId, interpreterId);
if (wk == null || wk.disposed()) {
throw new InvalidContinuationException("Cannot get continuation for suggestion list");
}
Form form = (Form)wk.getAttribute("form");
if (form == null) {
throw new ProcessingException("No form is attached to the continuation");
}
this.locale = form.getLocale();
Field field = (Field)form.lookupWidget(widgetPath);
list = field.getSuggestionList();
if (list == null) {
throw new ProcessingException(field + " has no suggestion list");
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-sitemap-impl
/**
* When a new continuation is created in @link #createWebContinuation(Object, WebContinuation, int, String, ContinuationsDisposer),
* its parent continuation is removed from the expiration set. This way only leaf continuations are part of
* the expiration set.
*/
protected void handleParentContinuationExpiration(WebContinuation parent) {
if (parent.getChildren().size() < 2) {
expirations.remove(parent);
}
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
public void jsFunction_display() {
wk.display();
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
public FOM_WebContinuation jsGet_previousBookmark() {
WebContinuation c = wk.getParentContinuation();
if (c == null) {
return null;
}
// If this is a continuation of sendPageAndWait()
// and the immediate parent is a bookmark, then
// it is the bookmark for this page, so skip it.
if (!isBookmark(wk) && isBookmark(c)) {
c = c.getParentContinuation();
}
while (c != null && !isBookmark(c)) {
c = c.getParentContinuation();
}
if (c == null) {
return null;
}
FOM_WebContinuation pwk = new FOM_WebContinuation(c);
pwk.setParentScope(getParentScope());
pwk.setPrototype(getClassPrototype(getParentScope(), pwk.getClassName()));
return pwk;
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
public void jsFunction_setBookmark(boolean value) {
UserObject userObj = (UserObject)wk.getUserObject();
if (userObj == null) {
userObj = new UserObject();
wk.setUserObject(userObj);
}
userObj.isBookmark = value;
}
代码示例来源:origin: org.apache.cocoon/cocoon-flowscript-impl
PageLocalScopeImpl getPageLocal() {
UserObject userObj = (UserObject)wk.getUserObject();
if (userObj == null) return null;
return userObj.pageLocal;
}
我正在尝试实现 kotlin stateflow,但不知道它不起作用的原因。 当前输出: 验证34567 预期输出: 验证 34567 验证失败 package stateflowDuplicate
最近我发现了一个我无法理解的流行为。 问题描述 考虑这种情况:你有一个父 flow 并且在它的 collect 中,你将有一个“子”flow 并调用 .collect(),像这样: parentFlo
我想通过 UML2 事件图为以下事件建模: 执行操作 1。此操作产生两个输出参数: Object1和对象 2。 执行操作 2。此操作需要 Object2 作为输入参数。它不需要 Object1 作为输
在 Vaadin 8 中,您可以在 Tab(属于 TabSheet)上设置一个图标: tab#setIcon(...) 在 Vaadin Flow(目前使用 14.1)中,我不知道如何在 Tab(属于
有什么办法可以做到这一点吗?如果存储库仅在 .git/config 中包含 git-flow 指令(如 ),则该存储库是否被视为已初始化 .... [gitflow "branch"] mas
the 2nd collecting below does not collect until I remove the first one. also read from [Manuel Vi
在官方示例中,他们总是有 /* @flow */在页面顶部。现在这对现有项目来说很好,很有帮助,我想选择加入每个文件的流程。从头开始构建一个新项目我只想在任何地方进行流类型检查,而不必输入 /* @f
Vaadin 突然停止构建我的库并出现以下错误。我已经跳了 Vaadin 舞(还有很多其他的东西),但我现在没主意了。我尝试为生产构建库(但对于开发也失败了)。 我正在使用 Vaadin Flow。
我注意到很多人和例子都使用 Flows 作为 List<> 的包装器,例如像这样: @Query("SELECT * from some_model ORDER BY some_field") fun
Vaadin 突然停止构建我的库并出现以下错误。我已经跳了 Vaadin 舞(还有很多其他的东西),但我现在没主意了。我尝试为生产构建库(但对于开发也失败了)。 我正在使用 Vaadin Flow。
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 3 年前。 Improv
git flow init后,如何删除git flow模型? 如何从 .git/config 文件中删除所有相关配置? $ git flow init # force reset $ git flow
我运行了 git init 并在选择第一个分支时犯了一个错误。现在我想重新运行它来更改设置,但它再也不会问第一个问题。 Which branch should be used for bringing
我刚刚开始一份新工作,他们的代码管理一团乱。通常情况下这没什么问题,我可以应付,但在这个地方,情况就糟糕得离谱了。 他们使用 TFS...对此我无能为力。没有机会介绍 git,但我一直在阅读有关 gi
我的应用程序有更新问题。我不太明白 subview 之间的数据流是怎么回事。 这是我目前的结构 ViewModel:ObsebsrvableObject MainView 与 ObservedObje
为什么“flow check-contents”需要使用 < 将文件重定向到其中,而“flow suggest”则不需要?看起来 check-contents 应该假设命令行参数是要检查的文件路径。
最近我在 Git 中发现了工作流的三个概念: GitFlow GitHub 流程 GitLab 流程 我读过 the nice articles关于它,但我不太了解 GitLab Flow。 简单地说
我们刚刚改用 Hg Flow,但我们还没有弄清楚的一件事是如何最好地使用 Jenkins。理想情况下,我们将有一个构建和测试开发的作业,一个构建和测试默认作业和其他作业,这些作业在创建功能或发布分支时
将 Vaadin 12 与 FormLayout 一起使用和标签左侧的输入字段。 我想设置标签列的宽度。如何使用 Java API 实现这一点? 最佳答案 用于设置个人 FormItem标签宽度和/或
我正在使用 React-Flow 来可视化 React 中组件的树状层次结构。每当您在 React-Flow 中创建自定义节点时,您都可以像这样在树中使用它: ,我就可以做到这一点。 .有没有
我是一名优秀的程序员,十分优秀!