Java Pojo 类 ->用于 RPC 的 ASN.1

发布于 2024-11-09 04:16:24 字数 197 浏览 2 评论 0原文

我想使用直接从 Java 接口定义的消息格式进行一些 RPC,然后我想使用一些工具来生成 ASN.1 文件。

  1. 你知道我可以使用哪些工具吗? (如果可能的话,不会强迫我在描述格式的接口中使用 ASN 库中的任何类型。

  2. 你知道是否有库可以在 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.

  1. 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.

  2. Do you know if there are libraries to do RPC with ASN.1 in a JavaSE program?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

有木有妳兜一样 2024-11-16 04:16:24

我想注释类并编写生成 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.

哥,最终变帅啦 2024-11-16 04:16:24

我想你已经检查过

  • BinaryNotes
  • Bouncy Castle
  • except

  • PowerASN

你想要像 spring 远程导出器这样的东西,但不存在这样的设施。如果您使用 netty、mina、pure NIO、OIO、bouncycastle、spring、AOP 启动一个项目,那么这将是一个热门项目,称为 ASNExporter 。

i think you already checked

  • BinaryNotes
  • Bouncy Castle
  • except

  • PowerASN

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.

独﹏钓一江月 2024-11-16 04:16:24

您可能需要查看 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:

寄离 2024-11-16 04:16:24

查看Apache Harmony 项目

该网站说:

ASN.1 框架提供了一种通用、简单且高效的方法来处理 ASN.1 基本类型、符号和编码规则。该框架可以描述为 Java* 对象与其 ASN.1 编码形式之间的一层,如图 1 所示。

图1

Have a look at the Apache Harmony project.

The website says:

The ASN.1 framework provides a common, easy and efficient approach for working with ASN.1 basic types, notations and encoding rules. This framework can be described as a layer between a Java* object and its ASN.1 encoded form, as shown in Figure 1.

Figure 1

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文