public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
if (module.getType() != ConfigurationModuleType.EJB) {
return;
}
EjbModule ejbModule = (EjbModule) module;
Map<String, WebServiceBindingType> wsBindingMap =
createWebServiceBindingMap(ejbModule);
for (EnterpriseBeanInfo bean : ejbModule.getEjbJarInfo().enterpriseBeans) {
if (bean.type != EnterpriseBeanInfo.STATELESS) {
continue;
}
String ejbName = bean.ejbName;
AbstractName sessionName = earContext.getNaming().createChildName(module.getModuleName(), ejbName, NameFactory.STATELESS_SESSION_BEAN);
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.getModuleFile(),
ejbModule.getSharedContext(), cl)) {
try {
earContext.addGBean(ejbWebServiceGBean);
} catch (GBeanAlreadyExistsException e) {
throw new DeploymentException(