RouterDefinition rd = dd.getRouterDefinition();
Class delegateRouter = rd.getRouterClass();
ResourceRouter delegate = null;
//initialize persistence for router
PersistenceDefinition persistenceDef = rd.getPersistenceDefinition();
if(delegateRouter != null){
delegate = rd.newInstance();
if(persistenceDef != null){
RouterPersistence persistence = (RouterPersistence)persistenceDef.newInstance();
delegate.setPersistence(persistence);
}
delegate.initialize();
}