我有一個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