本文整理了Java中org.tinygroup.context.Context.put()
方法的一些代码示例,展示了Context.put()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.put()
方法的具体详情如下:
包路径:org.tinygroup.context.Context
类名称:Context
方法名:put
[英]添加到子环境
[中]添加到子环境
代码示例来源:origin: org.tinygroup/context
public Object put(String key, Object value) {
context.put(key, value);
return value;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.context
public void putAll(Map<? extends String, ?> map) {
Iterator<? extends Entry<? extends String, ?>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Entry<? extends String, ?> entry = iterator.next();
context.put(entry.getKey(), entry.getValue());
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcore
/**
* 将线程变量取出clone一份放入上下文,key为THREAD_CONTEXT_KEY
*
* @param mainContext
*/
public static void putCurrentThreadContextIntoContext(Context mainContext) {
Map<String, Object> currentContext = getCurrentThreadContext();
mainContext.put(THREAD_CONTEXT_KEY, new HashMap<String, Object>(currentContext));
}
代码示例来源:origin: org.tinygroup/org.tinygroup.context
public <T> T put(String contextName, String name, T object) {
Context subContext = subContextMap.get(contextName);
if (subContext == null) {
subContext = createSubContext(contextName);
}
subContext.put(name, object);
return object;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.ientity
protected Context buildParameter(EntityModel model,
ModelRequestInfo modelRequestInfo, Context context) {
Context newContext=super.buildParameter(model, modelRequestInfo, context);
newContext.put(PAGE_SIZE, context.get(PAGE_SIZE));
newContext.put(PAGE_NUMBER, context.get(PAGE_NUMBER));
newContext.put(ORDER_BY_FIELD, context.get(ORDER_BY_FIELD));
newContext.put(SORT_DIRECTION, context.get(SORT_DIRECTION));
newContext.put(GROUP_BY_FIELD, context.get(GROUP_BY_FIELD));
return newContext;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydbflowcomponent
public void tinyService(Bean bean, Context context, DBOperator operator) {
if (bean != null) {
try {
Bean[] beans = operator.getBeans(bean);
context.put(resultKey, beans);
} catch (TinyDbException e) {
throw new RuntimeException(e);
}
} else {
logger.logMessage(LogLevel.WARN, "查询服务时,从上下文中找不到bean对象,其beantype:[{}]", beanType);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydbflowcomponent
public void tinyService(Bean bean, Context context, DBOperator operator) {
if (bean != null) {
try {
Bean insertBean = operator.insert(bean);
context.put(resultKey, insertBean);
} catch (TinyDbException e) {
throw new RuntimeException(e);
}
} else {
logger.logMessage(LogLevel.WARN, "新增服务时,从上下文中找不到bean对象,其beantype:[{}]", beanType);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydbflowcomponent
public void tinyService(Bean bean, Context context, DBOperator operator) {
if (bean != null) {
try {
int record = operator.update(bean);
context.put(resultKey, record);
} catch (TinyDbException e) {
throw new RuntimeException(e);
}
} else {
logger.logMessage(LogLevel.WARN, "修改服务时,从上下文中找不到bean对象,其beantype:[{}]", beanType);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.tinydbflowcomponent
public void tinyService(Bean bean, Context context, DBOperator operator) {
if (bean != null) {
try {
Bean[] beans = operator.getBeans(bean, start, limit);
context.put(resultKey, beans);
} catch (TinyDbException e) {
throw new RuntimeException(e);
}
} else {
logger.logMessage(LogLevel.WARN, "查询服务时,从上下文中找不到bean对象,其beantype:[{}]", beanType);
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.imda
private Event getEvent(ModelRequestInfo modelRequestInfo, Context context) {
Event event = new Event(UUID.randomUUID().toString()
.replaceAll("-", ""));
Context eventContext = ContextFactory.getContext();
eventContext.put("modelRequestInfo", modelRequestInfo);
eventContext.put("modelRequestContext", context);
ServiceRequest serviceRequest = new ServiceRequest();
event.setServiceRequest(serviceRequest);
serviceRequest.setServiceId("processModelService");
serviceRequest.setContext(eventContext);
return event;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "删除xml树:{0}的节点:{1}下,子节点名称为:{2}的节点",
xml, nodePath, nodeName);
context.put(resultKey,
XMLOperatorUtil.deleteByNodeName(xml, nodePath, nodeName));
LOGGER.logMessage(LogLevel.INFO,
"成功删除xml树:{0}的节点:{1}下,子节点名称为:{2}的节点", xml, nodePath,
nodeName);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "删除xml树:{0}的节点:{1}", xml,
nodePath);
context.put(resultKey, XMLOperatorUtil.deleteNode(xml, nodePath));
LOGGER.logMessage(LogLevel.INFO, "成功删除xml树:{0}的节点:{1}下", xml,
nodePath);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "枚举转换组件开始执行");
context.put(resultKey, CommEnumConverUntil.codeConvert(value));
LOGGER.logMessage(LogLevel.INFO, "枚举转换组件执行结束");
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "枚举转换组件开始执行");
context.put(resultKey,
CommEnumConverUntil.getEnum(enumClassPath, value, type));
LOGGER.logMessage(LogLevel.INFO, "枚举转换组件执行结束");
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "查询xml树:{0}的节点:{1}下的子节点", xml,
nodePath);
context.put(resultKey, XMLOperatorUtil.querySubNode(xml, nodePath));
LOGGER.logMessage(LogLevel.INFO, "成功查询xml树:{0}的节点:{1}下的子节点",
xml, nodePath);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
/**
* 创建节点注册Event
*
* @return
*/
private Event getNodeUnregRequestEvent() {
Context c = new ContextImpl();
c.put(NODE_KEY, getNode());
Event e = Event.createEvent(NODE_UNREG_TO_SC_REQUEST, c);
return e;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.beancontext
public <T> T get(String name) {
if (context.exist(name)) {
return (T) context.get(name);
} else {
//必须保存到上下文,否则每次返回不一定是同一个对象(scope可能是属性)
T t = (T) beanContainer.getBean(name);
context.put(name, t);
return t;
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
if (StringUtil.isBlank(preStr)) {
LOGGER.logMessage(LogLevel.ERROR, "需要剪切的字符串为空");
throw new FlowComponentException(
FlowComponentExceptionErrorCode.FLOW_PARAMETER_NULL,
"preStr");
}
LOGGER.logMessage(LogLevel.INFO, "字符串剪切组件开始执行");
context.put(resultKey, preStr.substring(beginIndex, endIndex));
LOGGER.logMessage(LogLevel.INFO, "字符串剪切组件执行结束");
}
代码示例来源:origin: org.tinygroup/org.tinygroup.flowbasiccomponent
public void execute(Context context) {
LOGGER.logMessage(LogLevel.INFO, "文件存在判断组件开始执行");
int code = FlowComponentConstants.DEFAULT_CODE;
FileObject fileObject = VFS.resolveFile(filePath);
if (fileObject.isExist()) {
code = FlowComponentConstants.EXIST_CODE;
}
context.put(resultKey, code);
LOGGER.logMessage(LogLevel.INFO, "文件存在判断组件执行结束");
}
代码示例来源:origin: org.tinygroup/org.tinygroup.ientity
private void contextReplace(Bean bean) {
for (ConditionField conditionField : conditionFields) {
String propertyName = getPropertyName(conditionField.getFieldId());
if (bean.containsKey(propertyName)) {
Object value = bean.get(propertyName);
context.put(propertyName, value);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!