1 7 8 package org.jboss.webservice; 10 11 13 import org.jboss.deployment.DeploymentException; 14 import org.jboss.deployment.DeploymentInfo; 15 import org.jboss.logging.Logger; 16 import org.jboss.naming.Util; 17 import org.jboss.system.ServiceMBeanSupport; 18 import org.jboss.webservice.client.ServiceReferenceable; 19 import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData; 20 21 import javax.naming.Context ; 22 import java.util.Iterator ; 23 24 34 public class ServiceClientDeployer extends ServiceMBeanSupport 35 implements ServiceClientDeployerMBean, WebServiceClientDeployment 36 { 37 private static final Logger log = Logger.getLogger(ServiceClientDeployer.class); 39 40 50 public void setupServiceRefEnvironment(Context envCtx, Iterator serviceRefs, DeploymentInfo di) 51 throws DeploymentException 52 { 53 try 54 { 55 while (serviceRefs.hasNext()) 56 { 57 ServiceRefMetaData serviceRef = (ServiceRefMetaData)serviceRefs.next(); 58 String serviceRefName = serviceRef.getServiceRefName(); 59 60 ServiceReferenceable ref = new ServiceReferenceable(serviceRef, di); 61 Util.bind(envCtx, serviceRefName, ref); 62 63 log.debug("Webservice binding: java:comp/env/" + serviceRefName); 64 } 65 } 66 catch (Exception e) 67 { 68 throw new DeploymentException("Cannot bind webservice to client environment", e); 69 } 70 } 71 } 72 | Popular Tags |