When all the entities have been created,
they need to be connected by a network. The following code demonstrates
how to connect the resources, the user and the replica catalogue to
different routers on the network.
try {
//connect resources
GridResource resObj = null; for (i = 0; i < resList.size(); i++)
{
FIFOScheduler resSched = new FIFOScheduler();
resObj = (GridResource) resList.get(i);
r2.attachHost(resObj, resSched);//attach the resource to router r2
}
//connect user
FIFOScheduler userSched = new FIFOScheduler();
r1.attachHost(user, userSched); //atach the user to router r1
//connect rc
FIFOScheduler gisSched = new FIFOScheduler();
r2.attachHost(rc, gisSched); // attach RC
} catch (ParameterException e4) {
e4.printStackTrace();
}