+
+ /**
+ * Return an object from the server.
+ *
+ * @param <T>
+ * the expected type of object
+ * @param command
+ * the command to send
+ *
+ * @return the object or NULL
+ */
+ @SuppressWarnings("unchecked")
+ private <T> T getRemoteObject(final Object[] command) {
+ final Object[] result = new Object[1];
+ try {
+ new ConnectActionClientObject(host, port, true) {
+ @Override
+ public void action(Version serverVersion) throws Exception {
+ try {
+ Object rep = send(command);
+ result[0] = rep;
+ } catch (Exception e) {
+ Instance.getTraceHandler().error(e);
+ }
+ }
+ }.connect();
+ } catch (IOException e) {
+ Instance.getTraceHandler().error(e);
+ }
+
+ try {
+ return (T) result[0];
+ } catch (Exception e) {
+ Instance.getTraceHandler().error(e);
+ return null;
+ }
+ }