开发者

Java Pojo Classes -> ASN.1 for 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开发者_JS百科 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?


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.


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.


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:

  • http://fi.java.net/how-to-use.html
  • http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_fastinfos.html


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.

Java Pojo Classes -> ASN.1 for RPC

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜