protected static Object toConfigDeclaration(final String name, String value) throws URISyntaxException, OpenEJBException { // value = value.replaceFirst("(.)#", "$1%23"); value = value.replaceFirst("(provider=[^#=&]+)#", "$1%23"); final URI uri = URLs.uri(value); return toConfigDeclaration(name, uri); }
protected static Object toConfigDeclaration(final String name, String value) throws URISyntaxException, OpenEJBException { // value = value.replaceFirst("(.)#", "$1%23"); value = value.replaceFirst("(provider=[^#=&]+)#", "$1%23"); final URI uri = URLs.uri(value); return toConfigDeclaration(name, uri); }
public static void fillOpenEjb(final Openejb openejb, final Properties sysProps) { for (final Map.Entry<Object, Object> entry : sysProps.entrySet()) { final Object o = entry.getValue(); if (!(o instanceof String)) { continue; } if (!((String) o).startsWith("new://")) { continue; } final String name = (String) entry.getKey(); final String value = (String) entry.getValue(); try { final Object service = toConfigDeclaration(name, value); openejb.add(service); } catch (final URISyntaxException e) { logger.error("Error declaring service '" + name + "'. Invalid Service URI '" + value + "'. java.net.URISyntaxException: " + e.getMessage()); } catch (final OpenEJBException e) { logger.error(e.getMessage()); } } }
private void loadPropertiesDeclaredConfiguration(Openejb openejb) { Properties sysProps = new Properties(System.getProperties()); sysProps.putAll(SystemInstance.get().getProperties()); for (Map.Entry<Object, Object> entry : sysProps.entrySet()) { Object o = entry.getValue(); if (!(o instanceof String)) continue; if (!((String) o).startsWith("new://")) continue; String name = (String) entry.getKey(); String value = (String) entry.getValue(); try { URI uri = new URI(value); openejb.add(toConfigDeclaration(name, uri)); } catch (URISyntaxException e) { logger.error("Error declaring service '" + name + "'. Invalid Service URI '" + value + "'. java.net.URISyntaxException: " + e.getMessage()); } catch (OpenEJBException e) { logger.error(e.getMessage()); } } }
public static void fillOpenEjb(final Openejb openejb, final Properties sysProps) { for (final Map.Entry<Object, Object> entry : sysProps.entrySet()) { final Object o = entry.getValue(); if (!(o instanceof String)) { continue; } if (!((String) o).startsWith("new://")) { continue; } final String name = (String) entry.getKey(); final String value = (String) entry.getValue(); try { final Object service = toConfigDeclaration(name, value); openejb.add(service); } catch (final URISyntaxException e) { logger.error("Error declaring service '" + name + "'. Invalid Service URI '" + value + "'. java.net.URISyntaxException: " + e.getMessage()); } catch (final OpenEJBException e) { logger.error(e.getMessage()); } } }