Codota Logo
FileSystemServantCatalog
Code IndexAdd Codota to your IDE (free)

How to use
FileSystemServantCatalog
in
com.logicbus.models.servant.impl

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: anylogic/alogic

@Override
public void configure(Properties p){
  super.configure(p);
  servant = PropertiesConstants.getString(p,"servant",servant);
}

origin: anylogic/alogic

public CatalogNode getChildByPath(CatalogNode parent, Path _path) {
  if (parent == null){
    parent = getRoot();
    if (parent == null) return null;
  }
  
  if (_path.isRoot()){
    return parent;
  }
  String __path = rootPath + parent.getPath() + _path;

  File rootFile = new File(__path);
  if (!rootFile.isDirectory() || !rootFile.exists()){
    return null;
  }
  
  Path childPath = parent.getPath().append(_path);
  
  return createCatalogNode(childPath);
}

origin: anylogic/alogic

public static void main(String [] args){				
  Settings settings = Settings.get();
  settings.SetValue("home", "D:\\ecloud\\logicbus\\servants");
  settings.addSettings(new CommandLine(args));
  
  ServantCatalog catalog = new FileSystemServantCatalog();
  catalog.configure(settings);
  ServantCatalogNode root = (ServantCatalogNode) catalog.getRoot();
  
  scanCatalog(catalog,root);				
  
  ServiceDescription sd = catalog.findService(new Path("/core/AclQuery"));
  if (sd != null){
    logger.info(sd.getPath());
  }
  
  sd = catalog.findService(new Path("/core/AclQuery2"));
  if (sd != null){
    logger.info(sd.getPath());
  }
}

origin: anylogic/alogic

public CatalogNode getRoot() {
  return createCatalogNode(new Path(""));
}

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

ServiceDescription sd = toServiceDescription(_path,doc);
if (sd == null){
  continue;
origin: anylogic/alogic

/**
 * 在当前目录下查找服务定义信息
 * @param id 服务的Id
 */
public ServiceDescription findService(Path id) {
  String pkg = id.getPackage();
  String serviceId = id.getId();
  ServantCatalogNodeImpl node = (ServantCatalogNodeImpl) getChildByPath(null,new Path(pkg));
  if (node == null){
    return null;
  }
  
  return node.findService(serviceId);
}

origin: anylogic/alogic

public CatalogNode[] getChildren(CatalogNode parent) {
  String __path = rootPath + parent.getPath();
  File rootFile = new File(__path);
  if (!rootFile.isDirectory() || !rootFile.exists()){
    return null;
  }
  
  Vector<CatalogNode> nodes = new Vector<CatalogNode>();
  File [] children = rootFile.listFiles();
  if (children != null){
    for (int i = 0 ; i < children.length ; i ++){
      File child = children[i];
      if (!child.isDirectory()){
        continue;
      }
      
      Path childPath = parent.getPath().append(child.getName());
      CatalogNode node = createCatalogNode(childPath);
      if (node != null){
        nodes.add(node);
      }
    }
  }        
  return nodes.toArray(new CatalogNode[0]);
}

origin: anylogic/alogic

@Override
public void configure(Properties p){
  super.configure(p);
  servant = PropertiesConstants.getString(p,"servant",servant);
  visible = PropertiesConstants.getString(p,"visible",visible);
  log = PropertiesConstants.getString(p,"log",log);
}

com.logicbus.models.servant.implFileSystemServantCatalog

Javadoc

基于文件系统的Servant目录实现
可在 com.logicbus.models.servant.ServantManager的配置文件中配置此种类型的服务目录。 例如:

本实现需要在catalog的XML节点中需要配置的属性包括:
- module:实现类,取值为本实现的类名,即com.logicbus.models.servant.impl.FileSystemServantCatalog
- home:服务目录在文件系统上的根目录,如果没有配置,则取全局的环境变量local.servant.home
- local.servant.home:当没有配置home时启用,可在web.xml或全局配置文件中配置,缺省值为${local.home}/servants,其中local.home同样是全局变量

Most used methods

  • <init>
  • configure
  • createCatalogNode
    根据路径和服务ID创建目录节点 本方法搜索本地文件目录_path下的以_name为名的.xml文件,将其服务描述装入内存.
  • getChildByPath
  • getRoot
  • scanCatalog
  • toServiceDescription
    从XML文档读入服务描述信息 一个典型的XML服务定义文档如下: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Iterator (java.util)
    An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Frame
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • ImageIO (javax.imageio)
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now