public void init(Properties props) throws Exception { if (props == null) return; String format = props.getProperty(WS_ADDRESS_FORMAT); if (format != null) { this.wsAddressTemplate = new StringTemplate(format); } realmName = props.getProperty("realmName"); transportGuarantee = props.getProperty("transportGuarantee"); authMethod = props.getProperty("authMethod"); virtualHost = props.getProperty("virtualHost"); }
private String formatDeploymentId(EnterpriseBean bean, Map<String, String> contextData, StringTemplate template) { contextData.put("ejbType", bean.getClass().getSimpleName()); contextData.put("ejbClass", bean.getEjbClass()); // we don't have the ejb class object (only the string name) so we have // to extract the simple name from the FQN of the class int simpleNameIdx = bean.getEjbClass().lastIndexOf("."); contextData.put("ejbClass.simpleName", bean.getEjbClass().substring(simpleNameIdx + 1)); contextData.put("ejbName", bean.getEjbName()); return template.apply(contextData); } }
@Override public void init(final Properties props) throws Exception { if (props == null) return; final String format = props.getProperty(WS_ADDRESS_FORMAT); if (format != null) { this.wsAddressTemplate = new StringTemplate(format); } realmName = props.getProperty("realmName"); transportGuarantee = props.getProperty("transportGuarantee"); authMethod = props.getProperty("authMethod"); virtualHost = props.getProperty("virtualHost", "localhost"); }
private String autoAssignWsLocation(EnterpriseBeanInfo bean, PortData port, Map<String, String> contextData, StringTemplate template) { contextData.put("ejbDeploymentId", bean.ejbDeploymentId); contextData.put("ejbType", getEjbType(bean.type)); contextData.put("ejbClass", bean.ejbClass); contextData.put("ejbClass.simpleName", bean.ejbClass.substring(bean.ejbClass.lastIndexOf('.') + 1)); contextData.put("ejbName", bean.ejbName); contextData.put("portComponentName", port.getPortName().getLocalPart()); contextData.put("wsdlPort", port.getWsdlPort().getLocalPart()); contextData.put("wsdlService", port.getWsdlService().getLocalPart()); return template.apply(contextData); }
@Override public void init(final Properties props) throws Exception { if (props == null) return; final String format = props.getProperty(WS_ADDRESS_FORMAT); if (format != null) { this.wsAddressTemplate = new StringTemplate(format); } realmName = props.getProperty("realmName"); transportGuarantee = props.getProperty("transportGuarantee"); authMethod = props.getProperty("authMethod"); virtualHost = props.getProperty("virtualHost", "localhost"); }
private String autoAssignWsLocation(final EnterpriseBeanInfo bean, final PortData port, final Map<String, String> contextData, final StringTemplate template) { if (bean.properties.containsKey(WS_FORCE_ADDRESS)) { return bean.properties.getProperty(WS_FORCE_ADDRESS); } contextData.put("ejbDeploymentId", bean.ejbDeploymentId); contextData.put("ejbType", getEjbType(bean.type)); contextData.put("ejbClass", bean.ejbClass); contextData.put("ejbClass.simpleName", bean.ejbClass.substring(bean.ejbClass.lastIndexOf('.') + 1)); contextData.put("ejbName", bean.ejbName); contextData.put("portComponentName", port.getPortName().getLocalPart()); contextData.put("wsdlPort", port.getWsdlPort().getLocalPart()); contextData.put("wsdlService", port.getWsdlService().getLocalPart()); return template.apply(contextData); }
public WsService() { String format = SystemInstance.get().getProperty(WS_ADDRESS_FORMAT, "/{ejbDeploymentId}"); this.wsAddressTemplate = new StringTemplate(format); }
private String autoAssignWsLocation(final EnterpriseBeanInfo bean, final PortData port, final Map<String, String> contextData, final StringTemplate template) { if (bean.properties.containsKey(WS_FORCE_ADDRESS)) { return bean.properties.getProperty(WS_FORCE_ADDRESS); } contextData.put("ejbDeploymentId", bean.ejbDeploymentId); contextData.put("ejbType", getEjbType(bean.type)); contextData.put("ejbClass", bean.ejbClass); contextData.put("ejbClass.simpleName", bean.ejbClass.substring(bean.ejbClass.lastIndexOf('.') + 1)); contextData.put("ejbName", bean.ejbName); contextData.put("portComponentName", port.getPortName().getLocalPart()); contextData.put("wsdlPort", port.getWsdlPort().getLocalPart()); contextData.put("wsdlService", port.getWsdlService().getLocalPart()); return template.apply(contextData); }
public InitEjbDeployments() { String format = SystemInstance.get().getOptions().get(DEPLOYMENT_ID_FORMAT, "{ejbName}"); this.deploymentIdTemplate = new StringTemplate(format); }
private String formatDeploymentId(final EnterpriseBean bean, final Map<String, String> contextData, final StringTemplate template) { contextData.put("ejbType", bean.getClass().getSimpleName()); contextData.put("ejbClass", bean.getEjbClass()); // we don't have the ejb class object (only the string name) so we have // to extract the simple name from the FQN of the class final int simpleNameIdx = bean.getEjbClass().lastIndexOf("."); contextData.put("ejbClass.simpleName", bean.getEjbClass().substring(simpleNameIdx + 1)); contextData.put("ejbName", bean.getEjbName()); final String name = template.apply(contextData); if (bean instanceof CompManagedBean) { // avoid conflict in ear between an ejbmodule and a war using the same name return name + System.identityHashCode(bean); } return name; } }
public InitEjbDeployments() { final String format = SystemInstance.get().getOptions().get(DEPLOYMENT_ID_FORMAT, "{ejbName}"); this.deploymentIdTemplate = new StringTemplate(format); }
private String formatDeploymentId(final EnterpriseBean bean, final Map<String, String> contextData, final StringTemplate template) { contextData.put("ejbType", bean.getClass().getSimpleName()); contextData.put("ejbClass", bean.getEjbClass()); // we don't have the ejb class object (only the string name) so we have // to extract the simple name from the FQN of the class final int simpleNameIdx = bean.getEjbClass().lastIndexOf("."); contextData.put("ejbClass.simpleName", bean.getEjbClass().substring(simpleNameIdx + 1)); contextData.put("ejbName", bean.getEjbName()); final String name = template.apply(contextData); if (bean instanceof CompManagedBean) { // avoid conflict in ear between an ejbmodule and a war using the same name return name + System.identityHashCode(bean); } return name; } }
public InitEjbDeployments() { final String format = SystemInstance.get().getOptions().get(DEPLOYMENT_ID_FORMAT, "{ejbName}"); this.deploymentIdTemplate = new StringTemplate(format); }
public String getName(Class interfce, Interface type) { StringTemplate template = templates.get(interfce.getName()); if (template == null) template = templates.get(type.getAnnotationName()); if (template == null) template = templates.get(""); Map<String,String> contextData = new HashMap<String,String>(beanContext); contextData.put("interfaceType", type.getAnnotationName()); contextData.put("interfaceType.annotationName", type.getAnnotationName()); contextData.put("interfaceType.annotationNameLC",type.getAnnotationName().toLowerCase()); contextData.put("interfaceType.xmlName", type.getXmlName()); contextData.put("interfaceType.xmlNameCc", type.getXmlNameCc()); contextData.put("interfaceType.openejbLegacyName", type.getOpenejbLegacy()); contextData.put("interfaceClass", interfce.getName()); contextData.put("interfaceClass.simpleName", interfce.getSimpleName()); contextData.put("interfaceClass.packageName", packageName(interfce)); return template.apply(contextData); } }
public WsService() { final String format = SystemInstance.get().getOptions().get(WS_ADDRESS_FORMAT, "/{ejbDeploymentId}"); this.wsAddressTemplate = new StringTemplate(format); }
public String getName(final Class interfce, final String key, final Interface type) { Map<String, StringTemplate> template = templates.get(interfce.getName()); if (template == null) { template = templates.get(type.getAnnotationName()); } if (template == null) { template = templates.get(""); } final Map<String, String> contextData = new HashMap<String, String>(beanContext); contextData.put("interfaceType", type.getAnnotationName()); contextData.put("interfaceType.annotationName", type.getAnnotationName()); contextData.put("interfaceType.annotationNameLC", type.getAnnotationName().toLowerCase()); contextData.put("interfaceType.xmlName", type.getXmlName()); contextData.put("interfaceType.xmlNameCc", type.getXmlNameCc()); contextData.put("interfaceType.openejbLegacyName", type.getOpenejbLegacy()); contextData.put("interfaceClass", interfce.getName()); contextData.put("interfaceClass.simpleName", interfce.getSimpleName()); contextData.put("interfaceClass.packageName", packageName(interfce)); StringTemplate stringTemplate = null; if (template.containsKey(key)) { stringTemplate = template.get(key); } else { stringTemplate = template.get(DEFAULT_NAME_KEY); } if (stringTemplate == null) { stringTemplate = template.values().iterator().next(); } return stringTemplate.apply(contextData); }
public void begin(DeploymentInfo deploymentInfo) { this.deploymentInfo = deploymentInfo; EnterpriseBeanInfo beanInfo = beanInfos.get(deploymentInfo.getDeploymentID()); templates = new HashMap<String, StringTemplate>(); templates.put("", template); for (JndiNameInfo nameInfo : beanInfo.jndiNamess) { String intrface = nameInfo.intrface; if (intrface == null) intrface = ""; templates.put(intrface, new StringTemplate(nameInfo.name)); } beanInfo.jndiNames.clear(); beanInfo.jndiNamess.clear(); beanContext = new HashMap<String, String>(appContext); putAll(beanContext, deploymentInfo.getProperties()); beanContext.put("moduleId", deploymentInfo.getModuleID()); beanContext.put("ejbType", deploymentInfo.getComponentType().name()); beanContext.put("ejbClass", deploymentInfo.getBeanClass().getName()); beanContext.put("ejbClass.simpleName", deploymentInfo.getBeanClass().getSimpleName()); beanContext.put("ejbClass.packageName", packageName(deploymentInfo.getBeanClass())); beanContext.put("ejbName", deploymentInfo.getEjbName()); beanContext.put("deploymentId", deploymentInfo.getDeploymentID().toString()); }
public String getName(final Class interfce, final String key, final Interface type) { Map<String, StringTemplate> template = templates.get(interfce.getName()); if (template == null) { template = templates.get(type.getAnnotationName()); } if (template == null) { template = templates.get(""); } final Map<String, String> contextData = new HashMap<String, String>(beanContext); contextData.put("interfaceType", type.getAnnotationName()); contextData.put("interfaceType.annotationName", type.getAnnotationName()); contextData.put("interfaceType.annotationNameLC", type.getAnnotationName().toLowerCase()); contextData.put("interfaceType.xmlName", type.getXmlName()); contextData.put("interfaceType.xmlNameCc", type.getXmlNameCc()); contextData.put("interfaceType.openejbLegacyName", type.getOpenejbLegacy()); contextData.put("interfaceClass", interfce.getName()); contextData.put("interfaceClass.simpleName", interfce.getSimpleName()); contextData.put("interfaceClass.packageName", packageName(interfce)); StringTemplate stringTemplate = null; if (template.containsKey(key)) { stringTemplate = template.get(key); } else { stringTemplate = template.get(DEFAULT_NAME_KEY); } if (stringTemplate == null) { stringTemplate = template.values().iterator().next(); } return stringTemplate.apply(contextData); }
public WsService() { final String format = SystemInstance.get().getOptions().get(WS_ADDRESS_FORMAT, "/{ejbDeploymentId}"); this.wsAddressTemplate = new StringTemplate(format); }
map.put("host", ip); map.put("bind", ip); String uriString = discoveryUriFormat.apply(map); try { uri = new URI(uriString);