private void addWSContextInfo(WebServiceContextImpl wsCtxt) { WebServiceContextImpl wsc = null; EjbDescriptor bundle = endpoint.getEjbComponentImpl(); Iterator<ResourceReferenceDescriptor> it = bundle.getResourceReferenceDescriptors().iterator(); while(it.hasNext()) { ResourceReferenceDescriptor r = it.next(); if(r.isWebServiceContext()) { try { javax.naming.InitialContext ic = new javax.naming.InitialContext(); wsc = (WebServiceContextImpl) ic.lookup("java:comp/env/" + r.getName()); } catch (Throwable t) { logger.severe(rb.getString("exception.thrown") + t); } if(wsc != null) { wsc.setContextDelegate(wsCtxt.getContextDelegate()); } } } }
/** * Store resources in ResourceRefDescriptor. */ private void parseResources(ResourceReferenceDescriptor resRef, JndiNameEnvironment env, AppResources appResources) { resRef.checkType(); String name = getLogicalJNDIName(resRef.getName(), env); String type = resRef.getType(); String jndiName = resRef.getJndiName(); AppResource resRefResource = new AppResource(name, jndiName, type, env, true); if (resRef.isURLResource()) { if (jndiName != null && !(jndiName.startsWith(ResourceConstants.JAVA_SCOPE_PREFIX))) { try { // for jndi-name like "http://localhost:8080/index.html" new java.net.URL(jndiName); resRefResource.noValidation(); } catch (MalformedURLException e) { // If jndi-name is not an actual url, we might want to lookup the name } } } if (resRef.isWebServiceContext()) resRefResource.noValidation(); appResources.store(resRefResource); }
} else if (resourceRef.isWebServiceContext()) { WebServiceReferenceManager wsRefMgr = habitat.getByContract(WebServiceReferenceManager.class); if (wsRefMgr != null ) {
while(it.hasNext()) { ResourceReferenceDescriptor r = it.next(); if(r.isWebServiceContext()) { Iterator<InjectionTarget> iter = r.getInjectionTargets().iterator(); boolean matchingClassFound = false;
} else if (resourceRef.isWebServiceContext()) { WebServiceReferenceManager wsRefMgr = locator.getService(WebServiceReferenceManager.class); if (wsRefMgr != null ) {
while(it.hasNext()) { ResourceReferenceDescriptor r = it.next(); if(r.isWebServiceContext()) { Iterator<InjectionTarget> iter = r.getInjectionTargets().iterator(); boolean matchingClassFound = false;