在 JBoss 中实现 CORBA 接口

发布于 2024-10-18 13:24:25 字数 767 浏览 7 评论 0原文

我正在寻找有关如何使 EJB(或底层 MBean)可通过 CORBA 访问的教程或任何其他信息。

这就是我发现的全部内容: http://www.jboss.org/jbossiiop

我有一个现有的CORBA 服务器(基于 java,但非标准),我想允许它调用我的 JBoss MBean。该 MBean 已使用 EJB (v2.1) 通过 RMI 公开。

当前的AppServer目标版本是jboss-eap-4.3。


编辑:我希望我的问题太模糊而无法得到解答,所以这里有一个更新:

我希望在 JBoss 中运行的 EJB 注册到在远程单独服务器上运行的 Corba ORB。至少我认为我是这样的。现有的 CORBA 客户端通过定义的 IDL/接口连接到服务,我试图通过 JBoss EJB 实现该 IDL/接口。此时,所述客户端连接到同一接口的多个实例,以通过该接口拉取信息并管理本地(同一进程)服务。我希望将 JBoss EJB 作为此 CORBA IDL 的另一个实现加入。

我对 CORBA 的理解一开始就生疏且薄弱,所以我没有走得太远。我可以在 JBoss 中轻松运行 ORB,但我不清楚如何设置绑定以便“传统”CORBA ORB 可以找到它。我可以更改 JBoss 实现的任何部分来使其工作,但更改其他服务器很困难。

有没有办法让 EJB 向远程服务器(ala jndi)注册自己? 现有客户端是否能够在不添加 jboss 特定类的情况下连接到 Jacorb?

I'm looking for a tutorial or any additional information on how to make an EJB (or underlying MBean) accessible via CORBA.

This is all I've found: http://www.jboss.org/jbossiiop

I have an existing CORBA server (java-based, but non-standard) and I want to allow it to call into my JBoss MBean. This MBean is already exposed via RMI using an EJB (v2.1).

The current AppServer target version is jboss-eap-4.3.


Edit: I'm hoping my question is just too vague to get answered so here's an update:

I want my EJB running in JBoss to register with the Corba ORB running on a remote separate server. At least I think I do. The existing CORBA client connects to services via a defined IDL/interface that I'm trying to implement via a JBoss EJB. At this point, said client connects to several instances of the same interface to pull information and manage local (same process) services via this interface. I want the JBoss EJB to be dropped in as just another implementation of this CORBA IDL.

My understanding of CORBA is rusty and weak to begin with so I'm not getting very far. I can run an ORB in JBoss easily enough, but it's not clear to me how to set up the binding so the "legacy" CORBA ORB can find it. I can change any part of the JBoss implementation to make this work, but changing the other server is difficult.

Is there a way for the EJB to register itself with a remote server (ala jndi)?
Will the existing client be able to connect to Jacorb without adding jboss specific classes?

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

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

发布评论

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

评论(2

一绘本一梦想 2024-10-25 13:24:25

简而言之,您必须实现一个适配器,将其部署在 Jboss 中,并向远程 NamingService 注册它。在您的适配器实现中,您调用 MBean。

现在更详细
您有一个 CORBA idl,您可以生成存根和骨架。

interface Stock {
    int getQuote( in string company);
};

您提供必要的实现

public class StockImpl extends StockPOA {
  public int getQuote(String company) {
     //forward a call to MBean here
  }
}

您执行通常的 CORBA 注册工作。类似于:

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(...);
org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));

poa.the_POAManager().activate();

NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));

NameComponent [] name = new NameComponent[1];

org.omg.CORBA.Object o = poa.servant_to_reference( new StockImpl(orb,poa));
name[0] = new NameComponent( "Stock", "server");
nc.bind(name, o);

orb.run();

现在您的对象已在远程 NamingService 中注册,并且可以通过 CORBA 访问。

您必须将 CORBA jar 包含在 JBOSS 类路径中。

In short you have to implement an adapter, deploy it in Jboss, register it with the remote NamingService. In your adapter implementation you call your MBeans.

Now more in details
You have a CORBA idl, you generate stubs and skeletons.

interface Stock {
    int getQuote( in string company);
};

You provide necessary implementation

public class StockImpl extends StockPOA {
  public int getQuote(String company) {
     //forward a call to MBean here
  }
}

You do the usual CORBA registration stuff. something like:

org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(...);
org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper.narrow(orb.resolve_initial_references("RootPOA"));

poa.the_POAManager().activate();

NamingContextExt nc = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"));

NameComponent [] name = new NameComponent[1];

org.omg.CORBA.Object o = poa.servant_to_reference( new StockImpl(orb,poa));
name[0] = new NameComponent( "Stock", "server");
nc.bind(name, o);

orb.run();

Now your object is registered in the remote NamingService and is accessible via CORBA.

You have to include CORBA jars in the JBOSS classpath.

心清如水 2024-10-25 13:24:25
  1. Corba orb 是一个套接字侦听器,因此最好使用 JBoss 控制下的,即标准 orb:

    ObjectName ORB_NAME = ObjectNameFactory.create("jboss:service=CorbaORB");
    ORB orb = (ORB)server.getAttribute(ORB_NAME, "ORB");

  2. 要自动启动 Corba 服务,请在 JBoss Service mbean 中执行此操作:
    http://community.jboss.org/wiki/examplehelloworldservice

  3. 避免编译IDL 您可以使用动态调用接口。
    看看 Axis2 CORBA 模块是如何做到的:http://wso2.org/library/2807< /p>

  4. < p>如果您使用 JBoss“all”配置,则不需要在类路径上有 Orb,这包括 Corba。

  1. A Corba orb is a socket listener, so best to use the one under JBoss's control, i.e. the standard orb:

    ObjectName ORB_NAME = ObjectNameFactory.create("jboss:service=CorbaORB");
    ORB orb = (ORB)server.getAttribute(ORB_NAME, "ORB");

  2. to automatically start your Corba service do it in a JBoss Service mbean:
    http://community.jboss.org/wiki/examplehelloworldservice

  3. To avoid having to compile IDL you could use the Dynamic Invocation Interface.
    Have a look at how Axis2 CORBA Module does it: http://wso2.org/library/2807

  4. You do not need an Orb on the classpath if you use the JBoss "all" configuration, this includes Corba.

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