verifyObjectName(myObjectName);
}
this.jettyContainer = jettyContainer;
this.originalSpecDD = originalSpecDD;
RunAsSource runAsSource1 = runAsSource == null ? RunAsSource.NULL : runAsSource;
SessionHandler sessionHandler;
if (null != handlerFactory) {
if (null == preHandlerFactory) {
throw new IllegalStateException("A preHandlerFactory must be set if an handler factory is set.");
}
PreHandler preHandler = preHandlerFactory.createHandler();
sessionHandler = handlerFactory.createHandler(preHandler);
} else {
sessionHandler = new SessionHandler();
}
SecurityHandler securityHandler = null;
// if (securityRealmName != null) {
// InternalJAASJettyRealm internalJAASJettyRealm = jettyContainer.addRealm(securityRealmName);
//wrap jetty realm with something that knows the dumb realmName
// JAASJettyRealm realm = new JAASJettyRealm(realmName, internalJAASJettyRealm);
if (securityHandlerFactory != null) {
Subject defaultSubject = runAsSource1.getDefaultSubject();
securityHandler = securityHandlerFactory.buildSecurityHandler(policyContextID, defaultSubject, runAsSource, true);
} else {
//TODO may need to turn off security with Context._options.
// securityHandler = new NoSecurityHandler();
}