zoukankan      html  css  js  c++  java
  • Tapestry IoC Configuration

    Tapestry用来对服务进行配置的方式

    对服务进行配置需要用到contribute,然后+serviceId。

    看一下代码:

    public static void arbitraryMethodName(MappedConfiguration<String,FileServicer> configuration)
    {
        configuration.add("doc", new WordFileServicer());
        configuration.add("ppt", new PowerPointFileServicer());
    }

    其中可能最令人不解的就是MappedConfiguration了。

    There are three different styles of configurations (with matching contributions):

    有三种不同形式的configuration

    • Unordered Collection – Contributions are simply added in and order is not important.
      •   不排序的集合, 配置简单的追加进去,顺序一点也不重要。
        •   Configuration<Runnable> configuration
    • Ordered List – Contributions are provided as an ordered list. Contributions must establish the order by giving each contributed object a unique id, by establishing forward and backward dependencies between the values.
      •   排序的集合
        •   OrderedConfiguration<Runnable> configuration
    • Map – Contributions provide unique keys and corresponding values.
      •   映射表
        •   MappedConfiguration<String,FileServicer> configuration
  • 相关阅读:
    JS在火狐浏览器下如何关闭标签?
    .NET3.5项目转.NET2.0项目技巧
    GCHandler的使用
    多类选择器
    线程的Abort方法有感
    多线程死锁
    mysql 查看数据库、表的基本命令
    PHP往mysql数据库中写入中文失败
    TLS / SSL密码强化的建议
    MongoDB在Linux下常用优化设置
  • 原文地址:https://www.cnblogs.com/voctrals/p/3779496.html
Copyright © 2011-2022 走看看