SecurityActions.setContextClassLoader(ejbDeploymentInformation.getDeploymentClassLoader());
// now switch the CL to the EJB deployment's CL so that the unmarshaller can use the
// correct CL for the rest of the unmarshalling of the stream
classLoaderProvider.switchClassLoader(ejbDeploymentInformation.getDeploymentClassLoader());
// read the Locator
final EJBLocator locator;
try {
locator = (EJBLocator) unMarshaller.readObject();
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
final String viewClassName = locator.getViewType().getName();
if (!ejbDeploymentInformation.getViewNames().contains(viewClassName)) {
this.writeNoSuchEJBFailureMessage(channel, invocationId, appName, moduleName, distinctName, beanName, viewClassName);
return;
}
// TODO: Add a check for remote view