return result;
}
private static Grid connectToGrid(boolean delegate) {
boolean delegated = false;
GridClient grid = new GridClient();
if(delegate) {
try {
final GridNode delegatedNode = grid.delegate(true);
if(delegatedNode != null) {
delegated = true;
grid = new GridClient(delegatedNode);
}
} catch (RemoteException e) {
LOG.warn(e.getMessage(), e);
}
if(LOG.isInfoEnabled()) {
LOG.info("Connected to the Grid (" + (delegated ? "remote" : "local")
+ " master): " + grid.getEndpoint());
}
}
return grid;
}