FileDocCategorySizeDatePackage
WebServiceRefInjector.javaAPI DocJBoss 4.2.12891Fri Jul 13 20:53:46 BST 2007org.jboss.injection

WebServiceRefInjector

public class WebServiceRefInjector extends Object implements EncInjector
Inject a jaxws web service ref.
author
Thomas.Diesler@jboss.com
version
$Revision: 61864 $

Fields Summary
private static final Logger
log
private String
name
private org.jboss.ws.integration.ServiceRefMetaData
sref
Constructors Summary
public WebServiceRefInjector(String name, AnnotatedElement anElement, org.jboss.ws.integration.ServiceRefMetaData sref)


         
   
      this.name = name;
      this.sref = sref;
      this.sref.setAnnotatedElement(anElement);
   
Methods Summary
public voidinject(InjectionContainer container)

      try
      {
         Context encCtx = container.getEnc();
         EJBContainer ejbContainer = (EJBContainer)container;
         DeploymentUnit unit = ejbContainer.getDeploymentUnit();
         URL rootURL = unit.getUrl();

         ClassLoader loader = unit.getClassLoader();
         URLLoaderAdapter vfsRoot = new URLLoaderAdapter(rootURL);
         new ServiceRefDelegate().bindServiceRef(encCtx, name, vfsRoot, loader, sref);
         
         log.debug("@WebServiceRef bound [env=" + name + "]");
      }
      catch (Exception e)
      {
         throw new WebServiceException("Unable to bind @WebServiceRef [enc=" + name + "]", e);
      }
   
public java.lang.StringtoString()

      return super.toString() + "{enc=" + name + "}";