Theres some mixing up between ComAdapter and EvAComAdapter using the IslandModelEA. It now works, yet Im not sure what really goes on.
This commit is contained in:
parent
475e488b27
commit
50511b0ed5
@ -571,6 +571,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
URL baseDir = this.getClass().getClassLoader().getResource("");
|
URL baseDir = this.getClass().getClassLoader().getResource("");
|
||||||
String cp = System.getProperty("java.class.path",".");
|
String cp = System.getProperty("java.class.path",".");
|
||||||
if (!cp.contains(baseDir.getPath())) {
|
if (!cp.contains(baseDir.getPath())) {
|
||||||
|
// this was added due to matlab not adding base dir to base path...
|
||||||
System.err.println("classpath does not contain base directory!");
|
System.err.println("classpath does not contain base directory!");
|
||||||
System.err.println("adding base dir and trying again...");
|
System.err.println("adding base dir and trying again...");
|
||||||
System.setProperty("java.class.path", cp + System.getProperty("path.separator") + baseDir.getPath());
|
System.setProperty("java.class.path", cp + System.getProperty("path.separator") + baseDir.getPath());
|
||||||
|
@ -112,7 +112,12 @@ public class EvAComAdapter extends ComAdapter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected MainAdapter getMainAdapter(RMIInvocationHandler invocHandler) throws RemoteException {
|
protected MainAdapter getMainAdapter(RMIInvocationHandler invocHandler) throws RemoteException {
|
||||||
return (EvAMainAdapter) invocHandler.getWrapper();
|
try {
|
||||||
|
return (EvAMainAdapter) invocHandler.getWrapper();
|
||||||
|
} catch (ClassCastException e) {
|
||||||
|
System.err.println("Warning: cannot cast to EvAMainAdapter in EvAComAdapter.. trying MainAdapter...");
|
||||||
|
}
|
||||||
|
return (MainAdapter) invocHandler.getWrapper();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void logInfo(String msg) {
|
protected void logInfo(String msg) {
|
||||||
|
@ -23,8 +23,6 @@ import java.lang.reflect.Method;
|
|||||||
public class RMIProxyRemoteThread implements InvocationHandler,
|
public class RMIProxyRemoteThread implements InvocationHandler,
|
||||||
Serializable {
|
Serializable {
|
||||||
private static ComAdapter m_Adapter;
|
private static ComAdapter m_Adapter;
|
||||||
private Object m_Object;
|
|
||||||
private String m_ObjectName;
|
|
||||||
private RMIThreadInvocationHandler m_RMIThreadHandler;
|
private RMIThreadInvocationHandler m_RMIThreadHandler;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -44,19 +42,25 @@ public class RMIProxyRemoteThread implements InvocationHandler,
|
|||||||
c.getClass().getInterfaces(),
|
c.getClass().getInterfaces(),
|
||||||
new RMIProxyRemoteThread(c,host));
|
new RMIProxyRemoteThread(c,host));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void maybeLoadAdapter() {
|
||||||
|
if (m_Adapter==null)
|
||||||
|
m_Adapter = ComAdapter.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param c
|
* @param c
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String[] getServerList() {
|
public static String[] getServerList() {
|
||||||
if (m_Adapter==null) m_Adapter = ComAdapter.getInstance();
|
maybeLoadAdapter();
|
||||||
m_Adapter.evalAvailableHostNameList();
|
m_Adapter.evalAvailableHostNameList();
|
||||||
return m_Adapter.getAvailableHostNameList();
|
return m_Adapter.getAvailableHostNameList();
|
||||||
|
|
||||||
}
|
}
|
||||||
public static void setServerList(String[] servers ) {
|
public static void setServerList(String[] servers ) {
|
||||||
if (m_Adapter==null) m_Adapter = ComAdapter.getInstance();
|
maybeLoadAdapter();
|
||||||
|
|
||||||
m_Adapter.setServerList(servers);
|
m_Adapter.setServerList(servers);
|
||||||
m_Adapter.evalAvailableHostNameList();
|
m_Adapter.evalAvailableHostNameList();
|
||||||
@ -82,15 +86,15 @@ public class RMIProxyRemoteThread implements InvocationHandler,
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private RMIProxyRemoteThread (Object c, String host) {
|
private RMIProxyRemoteThread (Object c, String host) {
|
||||||
m_ObjectName = c.getClass().getName();
|
// m_ObjectName = c.getClass().getName();
|
||||||
if (m_Adapter==null) m_Adapter = ComAdapter.getInstance();
|
maybeLoadAdapter();
|
||||||
m_RMIThreadHandler = m_Adapter.getRMIThreadHandler(c,host);
|
m_RMIThreadHandler = m_Adapter.getRMIThreadHandler(c,host);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private RMIProxyRemoteThread (Object c, MainAdapterClient Client) {
|
private RMIProxyRemoteThread (Object c, MainAdapterClient Client) {
|
||||||
m_ObjectName = c.getClass().getName();
|
// m_ObjectName = c.getClass().getName();
|
||||||
try {
|
try {
|
||||||
m_RMIThreadHandler = Client.getRMIThreadHandler(c);
|
m_RMIThreadHandler = Client.getRMIThreadHandler(c);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -102,8 +106,8 @@ public class RMIProxyRemoteThread implements InvocationHandler,
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private RMIProxyRemoteThread (Object c) {
|
private RMIProxyRemoteThread (Object c) {
|
||||||
m_ObjectName = c.getClass().getName();
|
// m_ObjectName = c.getClass().getName();
|
||||||
if (m_Adapter==null) m_Adapter = ComAdapter.getInstance();
|
maybeLoadAdapter();
|
||||||
m_RMIThreadHandler = m_Adapter.getRMIThreadHandler(c);
|
m_RMIThreadHandler = m_Adapter.getRMIThreadHandler(c);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user