gpt4 book ai didi

com.logicbus.backend.message.XMLMessage.getDocument()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 20:55:05 27 4
gpt4 key购买 nike

本文整理了Java中com.logicbus.backend.message.XMLMessage.getDocument()方法的一些代码示例,展示了XMLMessage.getDocument()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLMessage.getDocument()方法的具体详情如下:
包路径:com.logicbus.backend.message.XMLMessage
类名称:XMLMessage
方法名:getDocument

XMLMessage.getDocument介绍

暂无

代码示例

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  
  int avg = getArgument("avg",dftAvg,ctx);
  Random r = new Random();
  
  int duration = (int)((r.nextGaussian()/4 + 1) * avg);
  
  try {
    TimeUnit.MILLISECONDS.sleep(duration);
  } catch (InterruptedException e) {
    throw new ServantException("core.e1006",e.getMessage());
  }
  
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  root.appendChild(doc.createTextNode("I have sleep " + duration + " ms."));
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Element eleSource = doc.createElement("source");
  
  CacheStoreFactory src = CacheStoreFactory.get();
  src.report(eleSource);
  
  root.appendChild(eleSource);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Element eleSource = doc.createElement("source");
  
  FileSystemSource src = FileSystemSource.get();
  src.report(eleSource);
  
  root.appendChild(eleSource);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Element eleSource = doc.createElement("source");
  
  DbcpSource src = DbcpSource.get();
  src.report(eleSource);
  
  root.appendChild(eleSource);
  
  return 0;
}
protected int onJson(Context ctx){

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Element eleSource = doc.createElement("source");
  
  KValueSource src = KValueSource.get();
  src.report(eleSource);
  
  root.appendChild(eleSource);
  
  return 0;
}
protected int onJson(Context ctx) {

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Element eleSource = doc.createElement("source");
  
  BlobManagerFactory f = BlobManagerFactory.get();            
  f.report(eleSource);
  
  root.appendChild(eleSource);
  
  return 0;
}
@Override

代码示例来源:origin: anylogic/alogic

@Override
  protected int onXml(Context ctx){
    XMLMessage msg = (XMLMessage)ctx.asMessage(XMLMessage.class);
    
    Document doc = msg.getDocument();
    Element data = doc.createElement("data");
    
    PrincipalManager sm = (PrincipalManager)SessionManagerFactory.getDefault();
    Principal principal = sm.login(ctx);        
    principal.report(data);

    msg.getRoot().appendChild(data);
    return 0;
  }
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  TaskCenter tc = TaskCenter.TheFactory.get();
  if (tc == null){
    throw new ServantException("core.e1003","Can not find a valid task center");
  }
  
  Document doc = msg.getDocument();
  
  Element elem = doc.createElement("tc");
  tc.report(elem);
  msg.getRoot().appendChild(elem);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Scheduler scheduler = SchedulerFactory.get();
  if (scheduler == null){
    throw new ServantException("core.e1003","Can not find a valid scheduler");
  }
  
  Document doc = msg.getDocument();
  
  Element _scheduler = doc.createElement("scheduler");
  scheduler.report(_scheduler);
  msg.getRoot().appendChild(_scheduler);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  KValueSource src = KValueSource.get();
  
  Collection<Schema> current = src.current();
  for (Schema c:current){
    Element elem = doc.createElement("schema");
    c.report(elem);
    root.appendChild(elem);
  }
  
  return 0;
}
protected int onJson(Context ctx){

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  FileSystemSource src = FileSystemSource.get();
  
  Collection<VirtualFileSystem> vfss = src.current();
  for (VirtualFileSystem vfs:vfss){
    Element ele = doc.createElement("vfs");
    vfs.report(ele);
    root.appendChild(ele);
  }
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  CacheStoreFactory src = CacheStoreFactory.get();
  
  Collection<Store<CacheObject>> caches = src.current();
  for (Store<CacheObject> cache:caches){
    Element eleCache = doc.createElement("cache");
    cache.report(eleCache);
    root.appendChild(eleCache);
  }
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  DbcpSource src = DbcpSource.get();
  
  Collection<ConnectionPool> pools = src.current();
  for (ConnectionPool pool:pools){
    Element elem = doc.createElement("pool");
    pool.report(elem);
    root.appendChild(elem);
  }
  
  return 0;
}
protected int onJson(Context ctx) {

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Scheduler scheduler = SchedulerFactory.get();
  if (scheduler == null){
    throw new ServantException("core.e1003","Can not find a valid scheduler");
  }
  scheduler.reload();
  
  Document doc = msg.getDocument();
  
  Element _scheduler = doc.createElement("scheduler");
  scheduler.report(_scheduler);
  msg.getRoot().appendChild(_scheduler);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Scheduler scheduler = SchedulerFactory.get();
  if (scheduler == null){
    throw new ServantException("core.e1003","Can not find a valid scheduler");
  }
  scheduler.resume();
  
  Document doc = msg.getDocument();
  
  Element _scheduler = doc.createElement("scheduler");
  scheduler.report(_scheduler);
  msg.getRoot().appendChild(_scheduler);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  Scheduler scheduler = SchedulerFactory.get();
  if (scheduler == null){
    throw new ServantException("core.e1003","Can not find a valid scheduler");
  }
  scheduler.pause();
  
  Document doc = msg.getDocument();
  
  Element _scheduler = doc.createElement("scheduler");
  scheduler.report(_scheduler);
  msg.getRoot().appendChild(_scheduler);
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  String id = getArgument("cacheId",ctx);
  
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Store<CacheObject> found = CacheStoreFactory.get(id);
  if (found == null){
    throw new ServantException("clnt.e2007","Can not find a cache :" + id);
  }
  
  Element eleCache = doc.createElement("cache");
  found.report(eleCache);
  root.appendChild(eleCache);
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx) {
  XMLMessage msg = (XMLMessage)ctx.asMessage(XMLMessage.class);
  
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Settings settings = Settings.get();
  AccessController ac = (AccessController) settings.get("accessController");
  if (ac != null){
    String [] groups = ac.getGroupList();
    
    for (String g:groups){
      Element acls = doc.createElement("acls");				
      XmlTools.setString(acls,"id",g);			
      root.appendChild(acls);
    }
  }
  
  return 0;
}

代码示例来源:origin: anylogic/alogic

protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  String id = getArgument("id",ctx);
  
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  KValueSource src = KValueSource.get();
  Schema found = src.get(id);
  if (found == null){
    throw new ServantException("user.data_not_found","Can not find the kavalue schema :" + id);
  }
  
  Element elem = doc.createElement("schema");
  found.report(elem);
  root.appendChild(elem);
  return 0;
}

代码示例来源:origin: anylogic/alogic

@Override
protected int onXml(Context ctx){
  XMLMessage msg = (XMLMessage) ctx.asMessage(XMLMessage.class);
  String id = getArgument("cacheId",ctx);
  
  Document doc = msg.getDocument();
  Element root = msg.getRoot();
  
  Store<CacheObject> found = CacheStoreFactory.get(id);
  if (found == null){
    throw new ServantException("clnt.e2007","Can not find a cache :" + id);
  }
  
  String objectId = getArgument("objectId",ctx);
  found.del(objectId);
  
  Element eleCache = doc.createElement("cache");
  found.report(eleCache);
  root.appendChild(eleCache);
  return 0;
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com