本文整理汇总了Java中com.alibaba.citrus.turbine.Context类的典型用法代码示例。如果您正苦于以下问题:Java Context类的具体用法?Java Context怎么用?Java Context使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Context类属于com.alibaba.citrus.turbine包,在下文中一共展示了Context类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(HttpSession session, Context context, CookieParser parser) {
User user = (User) session.getAttribute(WebConstants.CURRENT_USER_KEY);
if (user != null) context.put("operator", user.getUsername());
RootContextPath rootContextPath = new RootContextPath(request.getContextPath());
context.put("rootContextPath", rootContextPath);
if (! context.containsKey("bucLogoutAddress")) {
context.put("bucLogoutAddress", rootContextPath.getURI("logout"));
}
if (! context.containsKey("helpUrl")) {
context.put("helpUrl", "http://code.alibabatech.com/wiki/display/dubbo");
}
context.put(WebConstants.CURRENT_USER_KEY, user);
context.put("language", parser.getString("locale"));
context.put("registryServerSync", registryServerSync);
}
示例2: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(HttpSession session, Context context, CookieParser parser) {
User user = (User) session.getAttribute(WebConstants.CURRENT_USER_KEY);
if (user != null) context.put("operator", user.getUsername());
RootContextPath rootContextPath = new RootContextPath(request.getContextPath());
context.put("rootContextPath", rootContextPath);
if (! context.containsKey("bucLogoutAddress")) {
context.put("bucLogoutAddress", rootContextPath.getURI("logout"));
}
if (! context.containsKey("helpUrl")) {
context.put("helpUrl", "https://github.com/dangdangdotcom/dubbox/wiki");
}
context.put(WebConstants.CURRENT_USER_KEY, user);
context.put("language", parser.getString("locale"));
context.put("registryServerSync", registryServerSync);
}
示例3: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("pipelineId") Long pipelineId, @Param("pageIndex") int pageIndex, Context context)
throws Exception {
Map<String, Object> condition = new HashMap<String, Object>();
int count = alarmRuleService.getCount();
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<AlarmRule> alarmRules = alarmRuleService.listAllAlarmRules(condition);
StringBuffer buffer = new StringBuffer();
for (AlarmRule alarmRule : alarmRules) {
buffer.append(alarmRule.getId());
buffer.append(",");
}
context.put("alarmRules", alarmRules);
context.put("alarmRuleIds", buffer.toString());
context.put("paginator", paginator);
}
示例4: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Context context)
throws Exception {
@SuppressWarnings("unchecked")
Map<String, Object> condition = new HashMap<String, Object>();
if ("请输入关键字(目前支持Zookeeper的地址搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = autoKeeperClusterService.getCount();
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<AutoKeeperCluster> autoKeeperClusters = autoKeeperClusterService.listAutoKeeperClusters();
context.put("paginator", paginator);
context.put("autoKeeperClusters", autoKeeperClusters);
}
示例5: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Context context)
throws Exception {
@SuppressWarnings("unchecked")
Map<String, Object> condition = new HashMap<String, Object>();
if ("支持ID、用户名、真实姓名、部门搜索".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = userService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<User> users = userService.listByCondition(condition);
context.put("users", users);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
}
示例6: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("canalId") Long canalId, Context context) throws Exception {
Canal canal = canalService.findById(canalId);
AutoKeeperCluster zkCluster = autoKeeperClusterService.findAutoKeeperClusterById(canal.getCanalParameter()
.getZkClusterId());
List<Pipeline> pipelines = pipelineService.listByDestinationWithoutOther(canal.getName());
List<Long> channelIds = new ArrayList<Long>();
for (Pipeline pipeline : pipelines) {
channelIds.add(pipeline.getChannelId());
}
List<Channel> channels = channelService.listOnlyChannels(channelIds.toArray(new Long[channelIds.size()]));
Map<Long, Channel> channelMap = new HashMap<Long, Channel>();
for (Channel channel : channels) {
channelMap.put(channel.getId(), channel);
}
context.put("canal", canal);
context.put("pipelines", pipelines);
context.put("channelMap", channelMap);
context.put("zkCluster", zkCluster);
}
示例7: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("clusterId") String clusterId, @Param("address") String address, Context context)
throws Exception {
AutoKeeperCluster autoKeeperCluster = autoKeeperClusterService.findAutoKeeperClusterById(Long.valueOf(clusterId));
Set<AutoKeeperConnectionStat> autoKeeperConnectionStats = new HashSet<AutoKeeperConnectionStat>();
for (String ipAddress : autoKeeperCluster.getServerList()) {
if (ipAddress.equalsIgnoreCase(address)) {
AutoKeeperServerStat autoKeeperServerStat = autoKeeperStatService.findServerStat(ipAddress);
if (autoKeeperServerStat != null) {
autoKeeperConnectionStats = autoKeeperServerStat.getConnectionStats();
} else {
autoKeeperConnectionStats = new HashSet<AutoKeeperConnectionStat>();
}
}
}
context.put("autoKeeperConnectionStats", autoKeeperConnectionStats);
}
示例8: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("dataMediaPairId") Long dataMediaPairId, Context context) throws Exception {
DataMediaPair dataMediaPair = dataMediaPairService.findById(dataMediaPairId);
Channel channel = channelService.findByPipelineId(dataMediaPair.getPipelineId());
List<ColumnPair> columnPairs = dataMediaPair.getColumnPairs();
List<ColumnGroup> columnGroups = dataMediaPair.getColumnGroups();
// 暂时策略,只拿出list的第一个Group
ColumnGroup columnGroup = new ColumnGroup();
if (!CollectionUtils.isEmpty(columnGroups)) {
columnGroup = columnGroups.get(0);
}
context.put("dataMediaPair", dataMediaPair);
context.put("columnGroup", columnGroup);
context.put("columnPairs", columnPairs);
context.put("channelId", channel.getId());
}
示例9: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("nodeId") Long nodeId, Context context) throws Exception {
Node node = nodeService.findById(nodeId);
List<Channel> channels = channelService.listByNodeId(nodeId);
if (node.getStatus().isStart()) {
context.put("heapMemoryUsage", nodeRemoteService.getHeapMemoryUsage(nodeId));
context.put("versionInfo", nodeRemoteService.getNodeVersionInfo(nodeId));
context.put("systemInfo", nodeRemoteService.getNodeSystemInfo(nodeId));
context.put("threadActiveSize", nodeRemoteService.getThreadActiveSize(nodeId));
context.put("threadPoolSize", nodeRemoteService.getThreadPoolSize(nodeId));
context.put("runningPipelines", nodeRemoteService.getRunningPipelines(nodeId));
} else {
context.put("heapMemoryUsage", 0);
context.put("threadActiveSize", 0);
context.put("threadPoolSize", 0);
context.put("runningPipelines", 0);
context.put("versionInfo", "");
context.put("systemInfo", "");
}
context.put("node", node);
context.put("channels", channels);
}
示例10: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("dataMediaId") Long dataMediaId, Context context) throws Exception {
DataMedia dataMedia = dataMediaService.findById(dataMediaId);
List<DataMediaPair> dataMediaPairs = dataMediaPairService.listByDataMediaId(dataMediaId);
List<SeniorDataMediaPair> seniorDataMediapairs = new ArrayList<SeniorDataMediaPair>();
for (DataMediaPair dataMediaPair : dataMediaPairs) {
SeniorDataMediaPair seniorDataMediaPair = new SeniorDataMediaPair();
seniorDataMediaPair.setChannel(channelService.findByPipelineId(dataMediaPair.getPipelineId()));
seniorDataMediaPair.setDataMediaPair(dataMediaPair);
seniorDataMediapairs.add(seniorDataMediaPair);
}
context.put("dataMedia", dataMedia);
context.put("seniorDataMediapairs", seniorDataMediapairs);
}
示例11: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param(name = "token") String token, Context context) throws Exception {
if (StringUtils.isEmpty(token)) {
context.put("result", "empty token");
return;
}
if (!verify(token)) {
context.put("result", "invalided token");
return;
}
try {
globalMonitor.explore();
} catch (Throwable e) {
log.error("monitor trigger happens error", e);
context.put("result", e);
return;
}
context.put("result", true);
}
示例12: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(HttpSession session, Context context, CookieParser parser) {
User user = (User) session.getAttribute(WebConstants.CURRENT_USER_KEY);
if (user != null) context.put("operator", user.getUsername());
RootContextPath rootContextPath = new RootContextPath(request.getContextPath());
context.put("rootContextPath", rootContextPath);
if (!context.containsKey("bucLogoutAddress")) {
context.put("bucLogoutAddress", rootContextPath.getURI("logout"));
}
if (!context.containsKey("helpUrl")) {
context.put("helpUrl", "http://code.alibabatech.com/wiki/display/dubbo");
}
context.put(WebConstants.CURRENT_USER_KEY, user);
context.put("language", parser.getString("locale"));
context.put("registryServerSync", registryServerSync);
}
示例13: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey,
@Param("local") String local, Context context) throws Exception {
@SuppressWarnings("unchecked")
Map<String, Object> condition = new HashMap<String, Object>();
if ("请输入关键字(目前支持DataMedia的ID、名字搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = dataMediaService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<DataMedia> dataMedias = dataMediaService.listByCondition(condition);
context.put("dataMedias", dataMedias);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
context.put("local", local);
}
示例14: execute
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
public void execute(@Param("pageIndex") int pageIndex, @Param("searchKey") String searchKey, Context context)
throws Exception {
@SuppressWarnings("unchecked")
Map<String, Object> condition = new HashMap<String, Object>();
if ("请输入关键字(目前支持DataSource的ID、名字搜索)".equals(searchKey)) {
searchKey = "";
}
condition.put("searchKey", searchKey);
int count = dataMediaSourceService.getCount(condition);
Paginator paginator = new Paginator();
paginator.setItems(count);
paginator.setPage(pageIndex);
condition.put("offset", paginator.getOffset());
condition.put("length", paginator.getLength());
List<DataMediaSource> dataMediaSources = dataMediaSourceService.listByCondition(condition);
context.put("sources", dataMediaSources);
context.put("paginator", paginator);
context.put("searchKey", searchKey);
}
示例15: ParameterMap
import com.alibaba.citrus.turbine.Context; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public ParameterMap(HttpServletRequest request, Context context, TurbineRunDataInternal navigator){
super();
this.request = request;
this.context = context;
this.rundata = navigator;
Enumeration<String> keys = request.getParameterNames();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
Object value = getParameterValue(key);
context.put(key, value);
}
}