public void setDescriptor(WebComponentDescriptor webComp) { this.webComp = webComp; descriptor = webComp.getWebBundleDescriptor(); }
public void setDescriptor(WebComponentDescriptor webComp) { this.webComp = webComp; descriptor = webComp.getWebBundleDescriptor(); }
public Application getApplication() { if (getWebBundleDescriptor() != null) { return getWebBundleDescriptor().getApplication(); } return null; }
private Map<String, String> getUrlPatternToServletNameMap() { return ((getWebBundleDescriptor() != null) ? getWebBundleDescriptor().getUrlPatternToServletNameMap() : null); } };
@Override public boolean remove(Object o) { boolean result = super.remove(o); if (getWebBundleDescriptor() != null) { getWebBundleDescriptor().resetUrlPatternToServletNameMap(); } return result; }
@Override protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { return processAnnotation(ainfo, webCompContexts[0].getDescriptor().getWebBundleDescriptor()); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { WebBundleDescriptor webBundleDesc = webCompContexts[0].getDescriptor().getWebBundleDescriptor(); return processAnnotation(ainfo, webBundleDesc); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { WebBundleDescriptor webBundleDesc = webCompContexts[0].getDescriptor().getWebBundleDescriptor(); return processAnnotation(ainfo, webBundleDesc); }
@Override protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, WebComponentContext[] webCompContexts) throws AnnotationProcessorException { return processAnnotation(ainfo, webCompContexts[0].getDescriptor().getWebBundleDescriptor()); }
/** * writes all the runtime information for web service endpoints for * a given web component * * @param parent node to add the runtime xml info * @param the web component */ public void writeWebServiceEndpointInfo (Node parent, WebComponentDescriptor webComp) { WebBundleDescriptor bundle = webComp.getWebBundleDescriptor(); WebServicesDescriptor webServices = bundle.getWebServices(); Collection endpoints = webServices.getEndpointsImplementedBy(webComp); for(Iterator iter = endpoints.iterator(); iter.hasNext();) { WebServiceEndpoint next = (WebServiceEndpoint) iter.next(); writeDescriptor(parent, WebServicesTagNames.WEB_SERVICE_ENDPOINT, next); } }
public Node writeDescriptor(Node parent, WebServiceEndpoint descriptor) { String ctxtPath; String serviceUri; String endpointAddressUri = descriptor.getEndpointAddressUri(); if (descriptor.implementedByEjbComponent()) { ctxtPath = endpointAddressUri.substring(0, endpointAddressUri.lastIndexOf("/") - 1); serviceUri = endpointAddressUri.substring(endpointAddressUri.lastIndexOf("/")); } else { //for servlet endpoint, use web application context root ctxtPath = descriptor.getWebComponentImpl().getWebBundleDescriptor().getContextRoot(); serviceUri = endpointAddressUri; } Document doc = getOwnerDocument(parent); Element serviceEndpointAddress = doc.createElement(WLWebServicesTagNames.SERVICE_ENDPOINT_ADDRESS); Element ctxtPathEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_CONTEXTPATH); ctxtPathEl.appendChild(doc.createTextNode(ctxtPath)); serviceEndpointAddress.appendChild(ctxtPathEl); Element serviceuriEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_SERVICEURI); serviceuriEl.appendChild(doc.createTextNode(serviceUri)); serviceEndpointAddress.appendChild(serviceuriEl); parent.appendChild(serviceEndpointAddress); return serviceEndpointAddress; }
/** * writes all the runtime information for web service endpoints for * a given web component * * @param parent node to add the runtime xml info * @param the web component */ public void writeWebServiceEndpointInfo (Node parent, WebComponentDescriptor webComp) { WebBundleDescriptor bundle = webComp.getWebBundleDescriptor(); WebServicesDescriptor webServices = bundle.getWebServices(); Collection endpoints = webServices.getEndpointsImplementedBy(webComp); for(Iterator iter = endpoints.iterator(); iter.hasNext();) { WebServiceEndpoint next = (WebServiceEndpoint) iter.next(); writeDescriptor(parent, WebServicesTagNames.WEB_SERVICE_ENDPOINT, next); } }
webComponentImpl.getWebBundleDescriptor(); String contextRoot = webBundle.getContextRoot(); if( contextRoot.startsWith("/") ) {
public Node writeDescriptor(Node parent, WebServiceEndpoint descriptor) { String ctxtPath; String serviceUri; String endpointAddressUri = descriptor.getEndpointAddressUri(); if (descriptor.implementedByEjbComponent()) { ctxtPath = endpointAddressUri.substring(0, endpointAddressUri.lastIndexOf("/") - 1); serviceUri = endpointAddressUri.substring(endpointAddressUri.lastIndexOf("/")); } else { //for servlet endpoint, use web application context root ctxtPath = descriptor.getWebComponentImpl().getWebBundleDescriptor().getContextRoot(); serviceUri = endpointAddressUri; } Document doc = getOwnerDocument(parent); Element serviceEndpointAddress = doc.createElement(WLWebServicesTagNames.SERVICE_ENDPOINT_ADDRESS); Element ctxtPathEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_CONTEXTPATH); ctxtPathEl.appendChild(doc.createTextNode(ctxtPath)); serviceEndpointAddress.appendChild(ctxtPathEl); Element serviceuriEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_SERVICEURI); serviceuriEl.appendChild(doc.createTextNode(serviceUri)); serviceEndpointAddress.appendChild(serviceuriEl); parent.appendChild(serviceEndpointAddress); return serviceEndpointAddress; }
/** * Given a WebComponentDescriptor, find the set of urlPattern which does not have * any existing url pattern in SecurityConstraint * @param webCompDesc * @return a list of url String */ public static Set<String> getUrlPatternsWithoutSecurityConstraint(WebComponentDescriptor webCompDesc) { Set<String> urlPatternsWithoutSC = new HashSet<String>(webCompDesc.getUrlPatternsSet()); WebBundleDescriptor webBundleDesc = webCompDesc.getWebBundleDescriptor(); Set<String> urlPatterns = webCompDesc.getUrlPatternsSet(); Enumeration<SecurityConstraint> eSecConstr = webBundleDesc.getSecurityConstraints(); while (eSecConstr.hasMoreElements()) { SecurityConstraint sc = eSecConstr.nextElement(); for (WebResourceCollection wrc : sc.getWebResourceCollections()) { urlPatternsWithoutSC.removeAll(wrc.getUrlPatterns()); } } return urlPatternsWithoutSC; }
/** * 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 (WebServicesTagNames.PORT_COMPONENT_NAME.equals (element.getQName())) { Object parentDesc = getParentNode().getDescriptor(); if (parentDesc instanceof EjbDescriptor) { EjbBundleDescriptor bundle = ((EjbDescriptor) parentDesc).getEjbBundleDescriptor(); WebServicesDescriptor webServices = bundle.getWebServices(); descriptor = webServices.getEndpointByName(value); } else if( parentDesc instanceof WebComponentDescriptor) { WebBundleDescriptor bundle = ((WebComponentDescriptor) parentDesc).getWebBundleDescriptor(); WebServicesDescriptor webServices = bundle.getWebServices(); descriptor = webServices.getEndpointByName(value); } if (descriptor==null) { DOLUtils.getDefaultLogger().log(Level.SEVERE, "enterprise.port_component_name_unknown", new Object[] { value }); } } else super.setElementValue(element, value); }
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()); }
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(); }
descriptor.getWebBundleDescriptor().getWebServices();