Java Pojo 类 ->用于 RPC 的 ASN.1
我想使用直接从 Java 接口定义的消息格式进行一些 RPC,然后我想使用一些工具来生成 ASN.1 文件。
你知道我可以使用哪些工具吗? (如果可能的话,不会强迫我在描述格式的接口中使用 ASN 库中的任何类型。
你知道是否有库可以在 JavaSE 程序中使用 ASN.1 进行 RPC?
I would like to do some RPC with the format of the messages being directly defined from Java interfaces, then I want to use some tools to generate the ASN.1 files.
Do you know what tools I can use? (if possible, something that doesn't force me to use any type from an ASN library in the interfaces which describe the format.
Do you know if there are libraries to do RPC with ASN.1 in a JavaSE program?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我想注释类并编写生成 ASN 的注释处理器可能是一种方法,但我无法猜测它需要做多少工作。
I guess that annotating the classes and writing annotation processor producing ASN could be a way but I can't guess amount of work it will take.
我想你已经检查过
except
你想要像 spring 远程导出器这样的东西,但不存在这样的设施。如果您使用 netty、mina、pure NIO、OIO、bouncycastle、spring、AOP 启动一个项目,那么这将是一个热门项目,称为 ASNExporter 。
i think you already checked
except
you want something like spring remote exporters, but no such facility exists. it would be a hot project may be called ASNExporter , if you started one using netty, mina, pure NIO, OIO, bouncycastle, spring, AOP.
您可能需要查看 Java Web Services Developer Pack 2.0 其中包括基于 ASN.1 标准构建的 Fast Infoset 1.0.1 FCS 发布加速技术。 Fast Infosets 是一项非常有趣的技术,由 SUN Microsystems 几年前启动,并且在已取代 JWSDP 的 Glassfish 中仍然可用。
一般来说,Fast Infoset 实现 SAX 和 StAX 接口。这允许任何 XML 技术与 Fast Infoset 一起使用,前提是它们支持 SAX 或 StAX。因此,将 Java 对象编组到 ASN.1 或从 ASN.1 中解编通常是很容易的。在一次会议上,Fast Infoset 也被称为二进制 XML。
因此,您可以使用 JAXB 注释对 POJO 进行注释,并使用 JAXB 将 marchall 转换为 ASN.1,或者您可以使用侵入性较小的库,例如 XStream 完成同样的任务。
几个链接:
You may want to have a look at Java Web Services Developer Pack 2.0 that includes Fast Infoset 1.0.1 FCS release acceleration technology built on ASN.1 standards. Fast Infosets is quite interesting piece of technology that was started by SUN Microsystems few years ago and still available in Glassfish that has superseded JWSDP.
In general Fast Infoset implementats SAX and StAX interfaces. This allows any XML technologies to be used with Fast Infoset provided that they support either SAX or StAX. So it's generally that easy to have Java objects marshalled to and unmarshalled from ASN.1. On one of the conferences Fast Infoset was also referred as binary XML.
So you can annotate your POJOs with JAXB annotations and marchall to ASN.1 with JAXB, or you can use less intrusive library like XStream to accomplish the same.
Few links:
查看Apache Harmony 项目。
该网站说:
Have a look at the Apache Harmony project.
The website says: