rmi

Send code to be executed on server in C# - like Java RMI

微笑、不失礼 提交于 2019-12-23 19:13:04
问题 This is example code in java. Shared interfaces: import java.rmi.Remote; import java.rmi.RemoteException; public interface Compute extends Remote { public Object executeTask(Task t) throws RemoteException; } Task (this will be passed as parameter): import java.io.Serializable; public interface Task extends Serializable { public Object execute(); } Server: import java.rmi.Naming; import java.rmi.RMISecurityManager; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject;

JMX : rmiPort and registryPort the same?

我是研究僧i 提交于 2019-12-23 17:13:54
问题 I'm trying to learn JMX as deep as possible. I've read many blog posts about how to explicitly set the port numbers used by the JMX server. As you may be aware there are actually two ports required: One for the Registry and one for RMI protocol traffic. Recently I discovered this blog post which suggests that the two ports can be set to the same so that you only have to punch one hole in the firewall. I must admit I thought it would never work. I was certain that it would create a "socket

Is it possible to manually check LocateRegistry existing?

自作多情 提交于 2019-12-23 16:32:37
问题 I have found a safe way to get LocateRegistry (even if the registry does not already exist). Registry registry = null; try { registry = LocateRegistry.getRegistry(52365); registry.list(); // This call will throw an exception if the registry does not already exist } catch (RemoteException e) { registry = LocateRegistry.createRegistry(52365); } Is it possible to firstly check registry existence and use getRegistry or createRegistry in accordance with the result of the check? 回答1: Is it possible

Is it possible to import java.rmi.* in Android?

喜欢而已 提交于 2019-12-23 15:35:23
问题 I have a project on my distributed system course and we have to use the java.rmi.* on our project and I knew that android doesn't provide this library because of the dalvik VM problems. So I'm just asking is there away to use these libraries on Android ? Thanks. 回答1: RMI is not supported on Android. you could implement it yourself, but that's going to be a non-trivial amount of work. 回答2: RMI library is not included in Android API. That's really bad. I did a project where I need to use this

knowing the port number during RMI

不羁岁月 提交于 2019-12-23 15:26:49
问题 Is there a method to know the port number of both the client and server during RMI? When a result is returned during RMI to the client, next time the client requests the result, will the conversation between client and server be at the same port as the previous, when the server has been running since the first result was returned or a new port is created? for example : // call to a remote method add addServerIntf.add(d1,d2) // after this call i get the added result // again call the add

Asynchronous Java RMI

China☆狼群 提交于 2019-12-23 13:29:12
问题 Recently I have needed to use RMI, and I know enough for what I need to do, but one thing is intriguing me as I revisit this topic. Is it possible to make asynchronous RMI calls to the same service on the server? Let's say I have n threads on the client and a single server-side object--call it S. S has a single method that I want to call from my client-side threads, but I don't want it to block as it has no shared resource to worry about. Any ideas? Or is this something that is just better

Asynchronous Java RMI

核能气质少年 提交于 2019-12-23 13:29:09
问题 Recently I have needed to use RMI, and I know enough for what I need to do, but one thing is intriguing me as I revisit this topic. Is it possible to make asynchronous RMI calls to the same service on the server? Let's say I have n threads on the client and a single server-side object--call it S. S has a single method that I want to call from my client-side threads, but I don't want it to block as it has no shared resource to worry about. Any ideas? Or is this something that is just better

Which serialization format does Java use?

假装没事ソ 提交于 2019-12-23 08:05:27
问题 In an RMI program, I want to implement the Serializable interface to serialize objects received from a server. Does Java 6 use a built-in serialization format? I wanted to know if there is a specific name for the serialization format. 回答1: Yes, Java has its own binary serialization format. And I don't think it has a name other than Java serialization [format | protocol] . 来源: https://stackoverflow.com/questions/6638051/which-serialization-format-does-java-use

Java file transfer over RMI [duplicate]

一曲冷凌霜 提交于 2019-12-23 06:10:17
问题 This question already has an answer here : Java socket EOFException (1 answer) Closed last year . What is the easiest way to transfer files over RMI ? 回答1: RMI is a poor choice for this application. There is too much implicit data copying, and too much latency if you use multiple method calls. Use a socket or an HTTP connection. See my answer in this question for a general-purpose solution. I don't know why you are so fixated on using RMI for this. You've posted half a dozen questions on it,

How to properly identify and hold client references in RMI callback?

让人想犯罪 __ 提交于 2019-12-23 04:47:29
问题 I have a server and several "clients" (servers actually because of callbacks). A client can send a message to another only through the server. For this, the server must: Identify the calling client. Hold the clients' information and exported object reference so it is able to lookup the recipient. I have read on the Remote Session pattern (1, 2, 3) and here and here, but I couldn't find the answer I was looking for. For (1), I see the following options: The client sends its exported object