use of org.cristalise.kernel.lookup.RolePath in project kernel by cristal-ise.
the class StandardServer method resetAgentIORs.
public static void resetAgentIORs(RolePath root) throws ObjectNotFoundException, ObjectCannotBeUpdated, CannotManageException {
Logger.msg("StandardServer.resetAgentIORs() - root:" + root);
Iterator<Path> roles = Gateway.getLookup().getChildren(root);
while (roles.hasNext()) {
RolePath role = (RolePath) roles.next();
resetAgentIORs(role);
for (AgentPath agent : Gateway.getLookup().getAgents(role)) {
Logger.msg("StandardServer.resetAgentIORs() - setting IOR for role:" + role + " agent:" + agent.getAgentName() + " " + agent.getItemPath());
Gateway.getLookupManager().setIOR(agent.getItemPath(), Gateway.getORB().object_to_string(Gateway.getCorbaServer().getAgentIOR(agent)));
}
}
}
use of org.cristalise.kernel.lookup.RolePath in project kernel by cristal-ise.
the class StandardServer method standardInitialisation.
/**
* Initialise the server
*
* @param props initiliased Properties
* @param res the instantiated ResourceLoader
* @throws Exception throw whatever happens
*/
public static void standardInitialisation(Properties props, ResourceLoader res) throws Exception {
isServer = true;
// read args and init Gateway
Gateway.init(props, res);
// connect to LDAP as root
Gateway.connect();
// start console
Logger.initConsole("ItemServer");
// initialize the server objects
Gateway.startServer();
if (Gateway.getProperties().containsKey(AbstractMain.MAIN_ARG_RESETIOR)) {
Logger.msg(5, "StandardServer.standardInitialisation() - RESETTING IORs");
resetItemIORs(new DomainPath(""));
resetAgentIORs(new RolePath());
AbstractMain.shutdown(0);
} else {
// start checking bootstrap & module items
Bootstrap.run();
}
Logger.msg(5, "StandardServer.standardInitialisation() - complete.");
}
use of org.cristalise.kernel.lookup.RolePath in project kernel by cristal-ise.
the class CastorXMLTest method testCastorRolePath.
@Test
public void testCastorRolePath() throws Exception {
CastorXMLUtility marshaller = Gateway.getMarshaller();
RolePath role = new RolePath("Minion", false);
RolePath rolePrime = (RolePath) marshaller.unmarshall(marshaller.marshall(role));
assertEquals(role.getStringPath(), rolePrime.getStringPath());
assertEquals(role.hasJobList(), rolePrime.hasJobList());
Logger.msg(marshaller.marshall(rolePrime));
}
Aggregations