StringTokenizer tokenizer = new StringTokenizer(pathPlusName, "/", false);
int numberOfPathTokens = tokenizer.countTokens() - 1;
Path path = null;
if (0 != numberOfPathTokens) {
String[] pathComponents = new String[numberOfPathTokens];
for (int counter = 0; counter < numberOfPathTokens; counter++) {
pathComponents[counter] = tokenizer.nextToken();
}
path = Path.buildPath(pathComponents);
}
String name = tokenizer.nextToken();
try {
ContextImpl newContext = new ContextImpl();
Context startingContext = BaseContextImpl.getStubFromServer(baseContextMachine);
startingContext.bindSubContext(path, name, newContext);
} catch (NamingException e) {
System.out.println("Failed to launched context " + pathPlusName);
System.out.println(e.getDescription());
e.printStackTrace();
} catch (Exception ee) {
ee.printStackTrace();
}