- 使用 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;
}
我有以下代码。我无法理解应如何实现 ProjectCardDescription 组件,以便能够在 ProjectCard 组件中传递其描述 我尝试过这个,但得到一个空组件: import React
我们正试图从 styled-components 项目中找出以下问题的原因:https://github.com/styled-components/styled-components/issues/
将所有文件从 jsx 更改为 tsx 后,出现此错误: ./src/components/index.js Module not found: Can't resolve './Header' in
我正在努力遵循以下 vuejs 应用场景动态组件 + 异步组件模式。一切正常,但仍然只有一个问题:我怎样才能访问通过传入的 Prop 数据 请看现场 fiddle : https://jsfiddl
我已经明白了Difference between React Component and React Element , 使用 JSX 基本上调用 React.createElement它返回一个元素
我最近开始使用 JSX 元素语法而不是调用函数,因为它使代码更漂亮。但看起来又不太一样。令人惊讶的是,因为在 App.js 中,函数调用会导致无限循环(并引发错误),但 JSX 元素可以工作。在 Da
通过少量渲染来构建嵌套组件系统的好方法是什么?请参阅下面带有主要问题(“如何...”)的所需代码: tab.vue(子组件) export default {
我正在编写一个轻量级游戏引擎,并且在为它做一些研究的同时,我遇到了许多令人信服的文章,它们提倡通过“组件集合”模型而不是“从具体类继承”模型来实现游戏对象。有很多优点: 可以使用数据组合对象 驱动设计
类型‘AbstractControl’上不存在属性‘Controls’。
考虑以下示例: function Travel(props) { return ( ) } function Welcom
我刚刚加入了一个 React Native 项目,在那里我经常看到扩展 React.Component 和 Component 本身的类。 示例: 类 SomeView 扩展了 React.Compo
我见过两种访问 Component 的方法: import React from 'react'; class Foo extends React.Component { ... } 和 im
我有一个库 jar,我想将其提供给许多应用程序。我想要的行为是在库中创建一个通用的 spring 组件类。如果在应用程序中,没有扩展相同的组件,则使用公共(public)组件;如果它在应用程序中扩展,
所以我正在制作一个游戏,我有 EnemyAI 以及 player,它们都扩展了 JPanel。世界有一个 null 布局,所以我正在使用 setBounds(); 来“移动”(我实际上只是移动世界图像
在 styled-component 中,您如何决定是应该使用插值函数来修改组件(通过传递 props )还是扩展现有组件。例如: const Button = styled.button`
我搜索并获取了以下信息。 请添加您的信息 h:commandbutton 与 a4j:commandButton 相同,唯一的区别是 a4j:commandButton 有额外的 ajax 请求。 a
我目前在一个项目中,我们有一个动态“表单”/内容模型,其中我们有一个包含字段和占位符的模块,占位符可以包含更多模块,为我们提供递归/灵活的数据模型. 现在为了渲染这个,我们创建了一个组件来渲染模块,动
我是 React 的新手,正在尝试设置一个 Bootstrap 模式来显示警报消息。 在我的父 App.js 文件中,我有一个错误处理程序,它向 Modal.js 组件发送一个触发模态显示的 Prop
通过 background-color:red 获得主页组件写入其 scss,然后使用 background-color:green 获取用户组件写入它的 scss。我启动我的应用程序,我在家,背景是
我有这个基本的应用程序,其中一些组件具有公共(public) load 方法。对于某些操作,我想在当前 svelte:component 上调用该方法,但我不知道如何获取对组件实例的引用。如何做到这一
我是一名优秀的程序员,十分优秀!