Changed getRemoteObject(class...) to createRemoteObject(class...), so to
make it more clear, are we creating a NEW remote object, or getting an already existing one? Removed unnecessary IOException throws
This commit is contained in:
parent
add5b96263
commit
328825d60e
@ -417,8 +417,13 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
<Iface> void getRemoteObject(final Class<Iface> interfaceClass, final RemoteObjectCallback<Iface> callback) throws IOException {
|
<Iface> void createRemoteObject(final Class<Iface> interfaceClass, final RemoteObjectCallback<Iface> callback) {
|
||||||
connectionManager.getConnection0().getRemoteObject(interfaceClass, callback);
|
try {
|
||||||
|
C connection0 = connectionManager.getConnection0();
|
||||||
|
connection0.createRemoteObject(interfaceClass, callback);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("Error creating remote object!", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -445,8 +450,13 @@ class Client<C extends Connection> extends EndPointClient<C> implements Connecti
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public
|
public
|
||||||
<Iface> void getRemoteObject(final int objectId, final RemoteObjectCallback<Iface> callback) throws IOException {
|
<Iface> void getRemoteObject(final int objectId, final RemoteObjectCallback<Iface> callback) {
|
||||||
connectionManager.getConnection0().getRemoteObject(objectId, callback);
|
try {
|
||||||
|
C connection0 = connectionManager.getConnection0();
|
||||||
|
connection0.getRemoteObject(objectId, callback);
|
||||||
|
} catch (IOException e) {
|
||||||
|
logger.error("Error getting remote object!", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package dorkbox.network.connection;
|
package dorkbox.network.connection;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import dorkbox.network.connection.bridge.ConnectionBridge;
|
import dorkbox.network.connection.bridge.ConnectionBridge;
|
||||||
import dorkbox.network.connection.idle.IdleBridge;
|
import dorkbox.network.connection.idle.IdleBridge;
|
||||||
import dorkbox.network.connection.idle.IdleSender;
|
import dorkbox.network.connection.idle.IdleSender;
|
||||||
@ -117,10 +115,10 @@ interface Connection {
|
|||||||
*
|
*
|
||||||
* @see RemoteObject
|
* @see RemoteObject
|
||||||
*/
|
*/
|
||||||
<Iface> void getRemoteObject(final Class<Iface> interfaceClass, final RemoteObjectCallback<Iface> callback) throws IOException;
|
<Iface> void createRemoteObject(final Class<Iface> interfaceClass, final RemoteObjectCallback<Iface> callback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tells the remote connection to create a new proxy object that implements the specified interface. The methods on this object "map"
|
* Tells the remote connection to access an already created proxy object that implements the specified interface. The methods on this object "map"
|
||||||
* to an object that is created remotely.
|
* to an object that is created remotely.
|
||||||
* <p>
|
* <p>
|
||||||
* The callback will be notified when the remote object has been created.
|
* The callback will be notified when the remote object has been created.
|
||||||
@ -141,5 +139,5 @@ interface Connection {
|
|||||||
*
|
*
|
||||||
* @see RemoteObject
|
* @see RemoteObject
|
||||||
*/
|
*/
|
||||||
<Iface> void getRemoteObject(final int objectId, final RemoteObjectCallback<Iface> callback) throws IOException;
|
<Iface> void getRemoteObject(final int objectId, final RemoteObjectCallback<Iface> callback);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user