public Node writeDescriptor(Element root, WebComponentDescriptor descriptor) { if (descriptor != null && descriptor.getRunAsIdentity() != null) { Node servletNode = appendChild(root, RuntimeTagNames.SERVLET_DESCRIPTOR); appendTextChild(servletNode, RuntimeTagNames.SERVLET_NAME, descriptor.getCanonicalName()); appendTextChild(servletNode, RuntimeTagNames.RUN_AS_PRINCIPAL_NAME, descriptor.getRunAsIdentity().getPrincipal()); return servletNode; } return null; } }
private void computeRuntimeDefault(WebComponentDescriptor webComp) { if (!webComp.getUsesCallerIdentity()) { computeRunAsPrincipalDefault( webComp.getRunAsIdentity(), webComp.getApplication()); } }
/** * receives notification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { String name = element.getQName(); if (name.equals(RuntimeTagNames.SERVLET_NAME)) { Object parentDesc = ((WLWebBundleRuntimeNode)getParentNode()).getDescriptor(); if (parentDesc instanceof WebBundleDescriptor) { descriptor = ((WebBundleDescriptor)parentDesc).getWebComponentByCanonicalName(value); } } else if (name.equals(RuntimeTagNames.RUN_AS_PRINCIPAL_NAME)) { if (descriptor != null && descriptor.getRunAsIdentity() != null) { descriptor.getRunAsIdentity().setPrincipal(value); } } else { super.setElementValue(element, value); } }
/** * receives notiification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { if (RuntimeTagNames.SERVLET_NAME.equals(element.getQName())) { Object parentDesc = ((WebBundleRuntimeNode) getParentNode()).getWebBundleDescriptor(); if (parentDesc instanceof WebBundleDescriptor) { descriptor = ((WebBundleDescriptor) parentDesc).getWebComponentByCanonicalName(value); } } else if (RuntimeTagNames.PRINCIPAL_NAME.equals(element.getQName())) { if (descriptor!=null && descriptor.getRunAsIdentity()!=null) { descriptor.getRunAsIdentity().setPrincipal(value); } } else super.setElementValue(element, value); }
RunAsIdentityDescriptor runAsDescriptor = wcd.getRunAsIdentity();
if ( (descriptor.getRunAsIdentity() != null) || webServices.hasEndpointsImplementedBy(descriptor) ) { Node servletNode = appendChild(parent, nodeName); appendTextChild(servletNode, RuntimeTagNames.SERVLET_NAME, descriptor.getCanonicalName()); if( descriptor.getRunAsIdentity() != null ) { appendTextChild(servletNode, RuntimeTagNames.PRINCIPAL_NAME, descriptor.getRunAsIdentity().getPrincipal());
(RunAsIdentityDescriptor)wcd.getRunAsIdentity(); if (runas!=null) { String role = runas.getRoleName();
(RunAsIdentityDescriptor)wcd.getRunAsIdentity(); if (runas!=null) { String role = runas.getRoleName();
if (wcd.getRunAsIdentity() == null) { String roleName = runAsRoleName; if (roleName == null && clazz.isAnnotationPresent(RunAs.class)) {
setAsyncSupported(other.isAsyncSupported()); if (getRunAsIdentity() == null) { setRunAsIdentity(other.getRunAsIdentity());
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { RunAs runAsAn = (RunAs)ainfo.getAnnotation(); for (WebComponentContext webCompContext : webCompContexts) { WebComponentDescriptor webDesc = webCompContext.getDescriptor(); // override by xml if (webDesc.getRunAsIdentity() != null) { continue; } String roleName = runAsAn.value(); Role role = new Role(roleName); // add Role if not exists webDesc.getWebBundleDescriptor().addRole(role); RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor(); runAsDesc.setRoleName(roleName); webDesc.setRunAsIdentity(runAsDesc); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { RunAs runAsAn = (RunAs)ainfo.getAnnotation(); for (WebComponentContext webCompContext : webCompContexts) { WebComponentDescriptor webDesc = webCompContext.getDescriptor(); // override by xml if (webDesc.getRunAsIdentity() != null) { continue; } String roleName = runAsAn.value(); Role role = new Role(roleName); // add Role if not exists webDesc.getWebBundleDescriptor().addRole(role); RunAsIdentityDescriptor runAsDesc = new RunAsIdentityDescriptor(); runAsDesc.setRoleName(roleName); webDesc.setRunAsIdentity(runAsDesc); } return getDefaultProcessedResult(); }
/** * The copy constructor. */ public WebComponentDescriptor(WebComponentDescriptor other) { setCanonicalName(other.getCanonicalName()); setServlet(other.isServlet()); setWebComponentImplementation( other.getWebComponentImplementation()); getInitializationParameterSet().addAll( other.getInitializationParameterSet()); getUrlPatternsSet().addAll(other.getUrlPatternsSet()); setLoadOnStartUp(other.getLoadOnStartUp()); getSecurityRoleReferenceSet().addAll( other.getSecurityRoleReferenceSet()); setRunAsIdentity(other.getRunAsIdentity()); setAsyncSupported(other.isAsyncSupported()); setMultipartConfig(other.getMultipartConfig()); setWebBundleDescriptor(other.getWebBundleDescriptor()); setConflict(other.isConflict()); }
RunAsIdentityDescriptor runAs = descriptor.getRunAsIdentity(); if (runAs!=null) { RunAsNode runAsNode = new RunAsNode();
if (servlet.getRunAsIdentity()!=null) { s1descriptor.setPrincipalName(servlet.getRunAsIdentity().getPrincipal());
if (webComponentDesc.getRunAsIdentity() != null) { wrapper.setRunAs(webComponentDesc.getRunAsIdentity().getRoleName());