简体   繁体   English

使用Excel中的EJB的最佳解决方案

[英]Best solution for using EJBs from Excel

We would like to give access to some of our EJBs from Excel. 我们希望从Excel中访问某些EJB。 The goal is to give an API usable from VBA. 目的是提供可从VBA使用的API。

Our EJBs are mostly Stateless Session Beans that do simple CRUD operations with POJOs. 我们的EJB主要是无状态会话Bean,它们使用POJO进行简单的CRUD操作。

Some possible solutions: 一些可能的解决方案:

  • Exposing the EJBs as WebServices and create a VB/C# dll wrapping them, 将EJB公开为Web服务,并创建一个将它们包装的VB / C#dll,
  • Using Corba to access the EJBs from C#, 使用Corba从C#访问EJB,
  • Creating a COM Library that uses Java to access the EJBs, 创建一个使用Java访问EJB的COM库,

Pointers to frameworks for these solution or other ideas are welcome. 欢迎提供指向这些解决方案或其他想法的框架的指针。

I work on an open source project called XLLoop - this framework allows you to expose POJO functions as Excel functions. 我正在一个名为XLLoop的开源项目上工作-这个框架允许您将POJO函数公开为Excel函数。

It consists of: 它包括:

  1. An Excel add-in (XLL), which communicates over TCP to: Excel加载项(XLL),可通过TCP与以下对象进行通信:
  2. A Java server/library, which invokes java methods. Java服务器/库,它调用java方法。

You could embed this java function server in an EJB and have it deployed as part of your app server. 您可以将此Java函数服务器嵌入EJB中,并将其部署为应用程序服务器的一部分。

您可以看一下IIOP.NET ,它可以解决此问题。

If you have a fairly recent ejb container, the cheapest and easiest should be to expose your beans as web services and call it from VB/C#. 如果您的ejb容器是最近的容器,那么最便宜和最简单的方法就是将bean作为Web服务公开,并从VB / C#调用它。 This doesn't require any extra tool or library. 这不需要任何额外的工具或库。

You could try Obba (I work on this project): 您可以尝试Obba (我正在从事此项目):

Obba is a Java object handler for spreadsheet applications. Obba是用于电子表格应用程序的Java对象处理程序。

It provides a bridge between spreadsheets and Java classes, such that spreadsheets can be used as graphical user interface for Java libraries. 它提供了电子表格和Java类之间的桥梁,因此电子表格可用作Java库的图形用户界面。 Accessing your Java library form the spreadsheet requires no glue code (no VBA needed, no special Java code needed). 从电子表格访问Java库不需要胶粘代码(不需要VBA,不需要特殊的Java代码)。 Objects are instantiated by their original constructor. 对象由其原始构造函数实例化。 Constructors and methods are invoked using a "by name" reflection. 构造函数和方法使用“按名称”反射调用。 A spreadsheet-specific factory method is not necessary. 电子表格专用的工厂方法不是必需的。 Obba provides the functions to handle objects in spreadsheets. Obba提供了处理电子表格中对象的功能。

The Java virtual machine providing the add-in may run on the same computer or a remote computer - without any change to the spreadsheet, ie, object referenced in the spreadsheet can reside on remote Java virtual machine. 提供加载项的Java虚拟机可以在同一台计算机或远程计算机上运行-无需对电子表格进行任何更改,即,电子表格中引用的对象可以驻留在远程Java虚拟机上。

I highly recommend IKVM . 我强烈推荐IKVM It is a java byte code to .NET assembly compiler (ie JAR --> DLL) and I have used it to create live JMX links and listeners in an Excel automation server. 它是.NET程序集编译器(即JAR-> DLL)的Java字节代码,我已使用它在Excel自动化服务器中创建实时JMX链接和侦听器。 It should not be difficult for you to create a .NET assembly of your EJB client stubs and supporting libraries. 创建EJB客户端存根和支持库的.NET程序集应该并不困难。

//Nicholas //尼古拉斯

Back in the VB6/COM/DCOM times we used the suite J-Integra to accomblish this task. 回到VB6 / COM / DCOM时代,我们使用套件J-Integra来完成此任务。 I have no experience with the .NET version though. 我没有.NET版本的经验。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM