Tabnine Logo
com.logicbus.models.servant
Code IndexAdd Tabnine to your IDE (free)

How to use com.logicbus.models.servant

Best Java code snippets using com.logicbus.models.servant (Showing top 20 results out of 315)

origin: anylogic/alogic

/**
 * 设置日志类型
 * @param type
 * 
 * @since 1.2.4.4
 */
public void setLogType(String type){logType = parseLogType(type);}

origin: anylogic/alogic

@Override
public void addWatcher(ServiceDescriptionWatcher watcher){
  for (ServantCatalog catalog:catalogs){
    if (catalog != null){
      catalog.addWatcher(watcher);
    }
  }
}
origin: anylogic/alogic

  @Override
  public void removeWatcher(ServiceDescriptionWatcher watcher) {
    for (ServantCatalog catalog:catalogs){
      if (catalog != null){
        catalog.removeWatcher(watcher);
      }
    }
  }
}
origin: anylogic/alogic

@Override
protected void onCreate(ServiceDescription sd){
  Properties props = sd.getProperties();
  
  dftAvg = PropertiesConstants.getInt(props, "avg", dftAvg);
}
origin: anylogic/alogic

  private static void scanCatalog(ServantCatalog sc,CatalogNode root) {		
    CatalogNode[] children = sc.getChildren(root);

    logger.info("Package found:" + root.getPath());
    
    ServantCatalogNode servantCatalogNode = (ServantCatalogNode) root;
    ServiceDescription[] services = servantCatalogNode.getServices();
    
    logger.info("Service Cnt:" + services.length);
      
    for (ServiceDescription sd:services){
      logger.info(sd.getPath() + "/" + sd.getServiceID());
    }
    
    for (CatalogNode child : children) {
      scanCatalog(sc, child);
    }
  }
}
origin: anylogic/alogic

  private static void scanCatalog(ServantCatalog sc,CatalogNode root) {		
    CatalogNode[] children = sc.getChildren(root);

    logger.info("Package found:" + root.getPath());
    
    ServantCatalogNode servantCatalogNode = (ServantCatalogNode) root;
    ServiceDescription[] services = servantCatalogNode.getServices();
    
    logger.info("Service Cnt:" + services.length);
      
    for (ServiceDescription sd:services){
      logger.info(sd.getPath());
    }
    
    for (CatalogNode child : children) {
      scanCatalog(sc, child);
    }
  }
}
origin: anylogic/alogic

@Override
public void configure(Properties p) {
  id = PropertiesConstants.getString(p,"id","",true);
  name = PropertiesConstants.getString(p, "name", getName(),true);
  note = PropertiesConstants.getString(p,"note",getNote(),true);
  visible = PropertiesConstants.getString(p, "visible", getVisible(),true);
  acGroupId = PropertiesConstants.getString(p, "acGroupId", getAcGroup(),true);
  privilege = PropertiesConstants.getString(p,"privilege", getPrivilege(),true);
  backendApp = PropertiesConstants.getString(p, "backendApp", getBackendApp(),true);
  backendPath = PropertiesConstants.getString(p, "backendPath",getBackendPath(),true);
  logType = parseLogType(PropertiesConstants.getString(p, "logType", getLogType().toString(),true));			
}
origin: anylogic/alogic

private void report(ServantCatalogNode root,Element xml){
  root.report(xml);
  Document doc = xml.getOwnerDocument();
  CatalogNode [] children = getChildren(root);
  if (children == null || children.length <= 0)
    return ;
  for (int i = 0 ; i < children.length ; i ++){
    Element catalog = doc.createElement("catalog");
    report((ServantCatalogNode) children[i],catalog);
    xml.appendChild(catalog);
  }            
}

origin: anylogic/alogic

private void report(ServantCatalogNode root,Map<String,Object> json){
  root.toJson(json);
  CatalogNode [] children = getChildren(root);
  if (children == null || children.length <= 0)
    return ;
  
  List<Object> catalogs = new ArrayList<Object>();
  
  for (int i = 0 ; i < children.length ; i ++){
    Map<String,Object> catalog = new HashMap<String,Object>();
    report((ServantCatalogNode)children[i],catalog);
    catalogs.add(catalog);
  }
  
  json.put("catalog", catalogs);			
}
origin: anylogic/alogic

/**
 * 输出目录
 * @param catalog 目录
 * @param root 节点
 * @param e 输出的Element
 */
protected void outputCatalog(ServantCatalog catalog,ServantCatalogNode root,Element e){
  root.toXML(e);
  Document doc = e.getOwnerDocument();
  CatalogNode [] children = catalog.getChildren(root);
  if (children == null || children.length <= 0)
    return ;
  for (int i = 0 ; i < children.length ; i ++){
    Element _e = doc.createElement("catalog");
    outputCatalog(catalog,(ServantCatalogNode)children[i],_e);
    e.appendChild(_e);
  }
}

origin: anylogic/alogic

protected String getGroupId(Path serviceId, ServiceDescription servant,Context ctx){
  return servant.getAcGroup();
}
origin: anylogic/alogic

public void report(Map<String, Object> json) {
  toJson(json);
}
origin: anylogic/alogic

public void report(Element xml) {
  toXML(xml);
}
origin: anylogic/alogic

/**
 * 查询指定服务的服务规格
 * @param id 服务ID
 * @return 服务规格
 */
public ServiceDescription get(Path id){
  for (int i = 0 ; i < catalogs.size() ; i ++){
    ServantCatalog __catalog = catalogs.elementAt(i);
    if (__catalog == null){
      continue;
    }
    ServiceDescription sd = __catalog.findService(id);
    if (sd != null){
      return sd;
    }
  }
  return null;
}
  
origin: anylogic/alogic

@Override
public void configure(Element e, Properties p) {
  Properties props = new XmlElementProperties(e,p);
  configure(props);
}

origin: anylogic/alogic

/**
 * 初始化服务者
 * 
 * <br>
 * 根据服务描述初始化服务者.
 * 
 * @param sd service description
 */
public void create(ServiceDescription sd){
  desc = sd;
  timeOut = PropertiesConstants.getLong(sd.getProperties(), "time_out", 3000);
}
origin: anylogic/alogic

@Override
public void toXML(Element root) {
  if (root != null){
    XmlTools.setString(root,"id",getServiceID());
    XmlTools.setString(root,"name",getName());
    XmlTools.setString(root,"note",getNote());
    XmlTools.setString(root,"visible",getVisible());
    XmlTools.setString(root,"log", logType.toString());
    XmlTools.setString(root,"acGroupId",getAcGroup());
    XmlTools.setString(root,"privilege",getPrivilege());
    XmlTools.setString(root,"backendApp", getBackendApp());
    XmlTools.setString(root,"backendPath",getBackendPath());
  }
}
origin: anylogic/alogic

public void create(ServiceDescription sd) throws ServantException{
  super.create(sd);		
  m_welcome = sd.getProperties().GetValue("welcome", "Welcome to Logic Bus Server!");
}

origin: anylogic/alogic

@Override
public void toJson(Map<String, Object> json) {
  if (json != null){
    JsonTools.setString(json,"id",getServiceID());
    JsonTools.setString(json,"name",getName());
    JsonTools.setString(json,"note",getNote());
    JsonTools.setString(json,"visible",getVisible());
    JsonTools.setString(json,"log", logType.toString());
    JsonTools.setString(json,"acGroupId",getAcGroup());
    JsonTools.setString(json,"privilege",getPrivilege());
    JsonTools.setString(json,"backendApp", getBackendApp());
    JsonTools.setString(json,"backendPath",getBackendPath());
  }
}
origin: anylogic/alogic

@Override
protected void onCreate(ServiceDescription sd) {
  Properties p = sd.getProperties();
  dftApp = PropertiesConstants.getString(p, "dftApp", dftApp);
  arguToken = PropertiesConstants.getString(p, "auth.para.token", arguToken);
  arguFromIp = PropertiesConstants.getString(p, "auth.para.fromIp", arguFromIp);
  arguCallback = PropertiesConstants.getString(p, "auth.para.callback", arguCallback);
  arguApp = PropertiesConstants.getString(p, "auth.para.app", arguApp);
  ipBinded = PropertiesConstants.getBoolean(p, "auth.ip.binded", ipBinded);
}
com.logicbus.models.servant

Most used classes

  • ServiceDescription
    服务描述
  • DefaultServiceDescription
    ServiceDescription的缺省实现
  • ServiceDescription$LogType
    业务日志的类型 分为三种类型: - none - brief - detail
  • DefaultServiceDescription$PropertySpec
    参数规格
  • FileSystemServantCatalog
    基于文件系统的Servant目录实现 可在 com.logicbus.models.servant.ServantManager的配置文件中配置此种类型的服务目录。 例如: 本实现需要在catalo
  • ServantCatalog$Abstract,
  • ServantCatalog,
  • ServantCatalogNode,
  • ServantManager,
  • MetadataServantCatalog,
  • XMLDocumentServantCatalog,
  • XMLResourceServantCatalog
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now