ApplicationRegistry applicationRegistry =
ApplicationRegistry.getSingleton();
// Get the factory method to enable the application context
// to be initialised.
ApplicationRegistryContainer applicationRegistryContainer =
applicationRegistry.getApplicationRegistryContainer(
applicationName);
// We did not match our appication so we are either mariner
// or an unknown application, either way we will use the
// default application behaviour.
if (applicationRegistryContainer == null) {
applicationRegistryContainer =
applicationRegistry.getApplicationRegistryContainer(
ApplicationRegistry.DEFAULT_APPLICATION_NAME);
// Still cannot find anything, give in.
if (applicationRegistryContainer == null) {
throw new IllegalStateException(
"No application registered");
}
}
MarinerURL requestURL = createRequestURL(request);
requestURL = volantisBean.getClientAccessibleURL(requestURL);
ApplicationContext appContext;
ApplicationContextFactory acf =
applicationRegistryContainer.getServletApplicationContextFactory();
// Save away a reference to the enclosing MarinerRequestContext
// if any.
enclosingRequestContext = getCurrent(request);