我有一个Java Jersey项目,我正在运行一个应用程序。另一方面,我有一个项目是有一个RMI应用程序,我怎么能把这两个一起工作。换句话说,我如何将RMI/IIOP集成到Jersey应用程序中。与RMI集成泽西岛
我在想是这样的:
@Path("/items")
public class ItemsResource {
@Context
UriInfo uriInfo;
@Context
Request request;
Stuber s = new Stuber();
@GET
public Response get() throws RemoteException {
}
是我在新泽西州项目的外部类,将工作作为客户端与RMI/IIOP
public class Stuber {
Context ic;
iRemoteLogic logic;
public Stuber() {
super();
Object objref;
try {
ic = new InitialContext();
objref = ic.lookup("LogicService");
System.out.println("Client: Obtained a ref. to Hello server.");
logic = (iRemoteLogic) PortableRemoteObject.narrow(
objref, iRemoteLogic.class);
连接什么我应该添加到Stuber类以便能够作为RMI/IIOP客户端工作吗?
谢谢:)
注:我跟着this tutorial为RMI/IIOP
你想从泽西岛调用你的Stuber类吗? – UVM