User: d_jencks Date: 02/02/06 06:32:59 Modified: src/main/org/jboss/resource ConnectionFactoryLoader.java Log: slight code cleanup Revision Changes Path 1.20 +9 -49 jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java Index: ConnectionFactoryLoader.java =================================================================== RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ConnectionFactoryLoader.java 2002/01/29 21:08:03 1.19 +++ ConnectionFactoryLoader.java 2002/02/06 14:32:59 1.20 @@ -66,7 +66,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a> * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a> * @see RARDeployer - * @version $Revision: 1.19 $ <p> + * @version $Revision: 1.20 $ <p> * * <b>Revisions:</b> <p> * @@ -104,7 +104,7 @@ private ObjectName resourceAdapterName; private String jndiName; - private String mcfProperties = ""; + private String mcfProps = ""; private String tmName = "java:/TransactionManager"; private ObjectName cmfLoaderName; private String cmProps; @@ -157,7 +157,7 @@ */ public void setManagedConnectionFactoryProperties(String p) { - this.mcfProperties = p; + this.mcfProps = p; } @@ -252,7 +252,7 @@ */ public String getManagedConnectionFactoryProperties() { - return mcfProperties; + return mcfProps; } /** @@ -556,15 +556,16 @@ // Set the properties on it - Properties mcfProps = new Properties(); + Properties mcfProperties = new Properties(); try { - parseProperties(mcfProps, mcfProperties); + mcfProperties.load( + new ByteArrayInputStream(mcfProps.getBytes("ISO-8859-1"))); } catch (IOException ioe) { // This shouldn't happen, so we try to carry on as if it didn't - log.error("Problem converting properties string '" + mcfProperties + + log.error("Problem converting properties string '" + mcfProps + "' to Properties", ioe); } @@ -574,7 +575,7 @@ for (Iterator i = ddProps.values().iterator(); i.hasNext(); ) { RARMetaData.Property ddProp = (RARMetaData.Property)i.next(); - String value = (String)mcfProps.get(ddProp.name); + String value = (String)mcfProperties.get(ddProp.name); if (value == null) { if (ddProp.value == null) @@ -712,9 +713,6 @@ cmConfig.rsf = new JBossResourceSubjectFactory(principalMapping); cmConfig.isReauthenticationSupported = metaData.getReauthenticationSupport(); - //JBossConnectionListenerImpl listener = - // new JBossConnectionListenerImpl(mcf, jndiName); - //cmConfig.listener = listener; Properties cmProperties = new Properties(); try @@ -739,8 +737,6 @@ throw new DeploymentException("Could not set up ConnectionManager! " + re); } - //listener.setConnectionManager(cm); - // Create us a connection factory Object cf; @@ -807,42 +803,6 @@ } } - /* - * The changes to -service.xml seem to have made the xml parsing - * ignore whitespace, so newlines are eliminated in these - * "property file" elements. This helps a bit. A better solution might - * be attribute-set elements containing attributes. - */ - private void parseProperties(Properties props, String s) throws IOException - { - String blanks = " \t\n\r"; - String blankseq = blanks + "="; - StringTokenizer st = new StringTokenizer(s, blankseq, true); - String key = null; - String value = null; - while (st.hasMoreTokens()) - { - key = st.nextToken(blankseq); - if (key.trim().equals("")) - { - continue; - } - - if (!st.nextToken(blankseq).equals("=")) - { - throw new IOException("Could not parse properties string" + s); - } - value = ""; - if (st.hasMoreTokens()) - { - value = st.nextToken(blanks); - } - props.setProperty(key, value); - } - } - - // Inner classes ------------------------------------------------- - }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development