assert sessionName != null: "StatelesSessionBean object name is null";
AbstractName ejbWebServiceName = earContext.getNaming().createChildName(sessionName, ejbName, NameFactory.WEB_SERVICE_LINK);
GBeanData ejbWebServiceGBean = new GBeanData(ejbWebServiceName, this.wsGBeanInfo);
ejbWebServiceGBean.setAttribute("ejbName", ejbName);
ejbWebServiceGBean.setAttribute("ejbClass", bean.ejbClass);
WebServiceBindingType wsBinding = wsBindingMap.get(ejbName);
if (wsBinding != null) {
List<String> ddVirtualHosts = wsBinding.getWebServiceVirtualHost();
if (ddVirtualHosts != null) {
String[] virtualHosts = new String[ddVirtualHosts.size()];
for (int i=0; i<ddVirtualHosts.size(); i++) {
virtualHosts[i] = ddVirtualHosts.get(i).trim();
}
ejbWebServiceGBean.setAttribute("virtualHosts", virtualHosts);
}
WebServiceSecurityType wsSecurity = wsBinding.getWebServiceSecurity();
if (wsSecurity != null) {
ejbWebServiceGBean.setAttribute("securityRealmName", wsSecurity.getSecurityRealmName().trim());
ejbWebServiceGBean.setAttribute("transportGuarantee", wsSecurity.getTransportGuarantee().toString());
ejbWebServiceGBean.setAttribute("authMethod", wsSecurity.getAuthMethod().value());
if (wsSecurity.getRealmName() != null) {
ejbWebServiceGBean.setAttribute("realmName", wsSecurity.getRealmName().trim());
}
}
}
if (jaxwsBuilder.configureEJB(ejbWebServiceGBean, bean.ejbName, ejbModule,
ejbModule.getSharedContext(), cl)) {
try {
earContext.addGBean(ejbWebServiceGBean);
} catch (GBeanAlreadyExistsException e) {
throw new DeploymentException(
"Could not add ejb web service gbean to context",
e);
}
if (this.listener != null) {
ejbWebServiceGBean.setReferencePattern("WebServiceContainer", this.listener);
}
ejbWebServiceGBean.setReferencePattern("EjbDeployment", sessionName);
}
ejbWebServiceGBean.clearAttribute("ejbName");
ejbWebServiceGBean.clearAttribute("ejbClass");
}
}