portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sg...@apache.org
Subject svn commit: r234454 - in /portals/jetspeed-2/trunk/app-servers/security/jboss: ./ src/java/META-INF/ src/java/META-INF/jboss-secsvc/ src/java/org/apache/jetspeed/appservers/security/jboss/
Date Mon, 22 Aug 2005 08:45:08 GMT
Author: sgala
Date: Mon Aug 22 01:44:52 2005
New Revision: 234454

URL: http://svn.apache.org/viewcvs?rev=234454&view=rev
Log:
svn:eol-style=native

Modified:
    portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml   (contents, props changed)
    portals/jetspeed-2/trunk/app-servers/security/jboss/project.properties   (props changed)
    portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml   (contents, props changed)
    portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml   (contents, props changed)
    portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml   (props changed)
    portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java
    portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java

Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml?rev=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml Mon Aug 22 01:44:52 2005
@@ -1,165 +1,165 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 2004 The Apache Software Foundation
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<project default="sar:sar" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:license="license" xmlns:define="jelly:define" xmlns:util="jelly:util" xmlns:maven="jelly:maven">
-
-    <goal name="sar:sar" description="Create the deliverable jar file." prereqs="test:test">
-
-        <copy todir="${maven.build.dest}/classes/META-INF/jboss-secsvc" overwrite="true">
-        	<fileset dir="../../../src/webapp/WEB-INF/assembly">
-            	<include name="security-providers.xml" />
-            	<include name="security-spi.xml" />            	
-            	<include name="transaction.xml" />             	
-        	</fileset>
-        </copy>
-        
-        <j:choose>
-            <j:when test="${pom.currentVersion == null}">
-                <ant:fail>You must define currentVersion in your POM.</ant:fail>
-            </j:when>
-        </j:choose>
-
-        <ant:available property="maven.jar.manifest.available" file="${maven.jar.manifest}" />
-
-        <j:set var="specificationTitle" value="${pom.shortDescription.trim()}" />
-        <j:if test="${specificationTitle.length() gt 49}">
-            <ant:echo>Warning: shortDescription is greater than 49 characters - trimming for specification title.</ant:echo>
-            <j:set var="specificationTitle" value="${specificationTitle.substring(0,46)}..." />
-        </j:if>
-
-        <j:forEach var="lib" items="${pom.artifacts}">
-            <j:set var="dep" value="${lib.dependency}" />
-            <j:choose>
-                <j:when test="${dep.getProperty('sar.bundle')=='true'}">
-                    <ant:copy todir="${maven.build.dest}" file="${lib.path}" />
-                </j:when>
-            </j:choose>
-        </j:forEach>
-
-        <!-- See http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html -->
-        <!-- See http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html -->
-        <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.sar" basedir="${maven.build.dest}" index="${maven.jar.index}" compress="${maven.jar.compress}" excludes="${maven.jar.excludes}">
-            <j:if test="${maven.jar.manifest.available}">
-                <ant:setProperty name="manifest" value="${maven.jar.manifest}" />
-            </j:if>
-
-            <j:if test="${context.getVariable('maven.jar.includes') != null}">
-                <ant:setProperty name="includes" value="${maven.jar.includes}" />
-            </j:if>
-
-            <j:set var="licenseFileName">
-                <license:fileName />
-            </j:set>
-            <util:file name="${licenseFileName}" var="licenseFile" />
-            <ant:metainf dir="${licenseFile.canonicalFile.parent}">
-                <ant:include name="${licenseFile.canonicalFile.name}" />
-            </ant:metainf>
-            <ant:manifest>
-                <ant:attribute name="Built-By" value="${user.name}" />
-                <ant:attribute name="Created-By" value="Apache Jakarta Maven" />
-                <ant:attribute name="Package" value="${pom.package}" />
-                <ant:attribute name="Build-Jdk" value="${java.version}" />
-
-                <j:set var="jarClasspath" value="${maven.jar.manifest.classpath.add}" />
-                <j:if test="${jarClasspath}">
-                    <j:forEach var="dep" items="${pom.dependencies}">
-                        <j:if test="${dep.getProperty('jar.manifest.classpath')=='true'}">
-                            <j:set var="maven.jar.classpath" value="${maven.jar.classpath} ${dep.artifact}" />
-                        </j:if>
-                    </j:forEach>
-                    <j:if test="${maven.jar.classpath.length() != 0}">
-                        <ant:attribute name="Class-Path" value="${maven.jar.classpath}" />
-                    </j:if>
-                </j:if>
-                <!-- added supplementary entries -->
-                <ant:attribute name="Extension-Name" value="${pom.artifactId}" />
-                <ant:attribute name="Specification-Title" value="${specificationTitle}" />
-                <ant:attribute name="Specification-Vendor" value="${pom.organization.name}" />
-                <!--
-        		<ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
-		        -->
-                <ant:attribute name="Implementation-Title" value="${pom.package}" />
-                <ant:attribute name="Implementation-Vendor" value="${pom.organization.name}" />
-                <ant:attribute name="Implementation-Version" value="${pom.currentVersion}" />
-                <j:set var="mainclass" value="${maven.jar.mainclass}" />
-                <j:if test="${!empty(mainclass)}">
-                    <ant:attribute name="Main-Class" value="${mainclass}" />
-                </j:if>
-
-                <j:set var="jarExtensions" value="${maven.jar.manifest.extensions.add}" />
-                <j:if test="${jarExtensions == 'true'}">
-                    <j:set var="extensionList" value="" />
-                    <j:forEach var="artifact" items="${pom.artifacts}">
-                        <j:set var="dep" value="${artifact.dependency}" />
-                        <j:if test="${dep.type == 'jar' || empty(dep.type)}">
-                            <j:set var="extensionList" value="${extensionList} ${dep.artifactId}" />
-                        </j:if>
-                    </j:forEach>
-
-                    <j:if test="${extensionList.length() != 0}">
-                        <j:set var="extensionList" value="${extensionList.substring(1)}" />
-                        <ant:attribute name="Extension-List" value="${extensionList}" />
-                    </j:if>
-
-                    <j:forEach var="artifact" items="${pom.artifacts}">
-                        <j:set var="dep" value="${artifact.dependency}" />
-                        <j:if test="${dep.type == 'jar' || empty(dep.type)}">
-                            <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}" />
-                            <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}" />
-
-                            <j:choose>
-                                <j:when test="${empty(dep.url) || dep.url.toString().trim().length() == 0}">
-                                    <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}" />
-                                </j:when>
-                                <j:otherwise>
-                                    <ant:attribute name="${dep.artifactId}-Implementation-URL" value="${dep.url}" />
-                                </j:otherwise>
-                            </j:choose>
-                        </j:if>
-                    </j:forEach>
-                </j:if>
-
-                <j:if test="${context.getVariable('maven.jar.manifest.attributes.list') != null}">
-                    <util:tokenize var="attributeList" delim="," trim="true">${maven.jar.manifest.attributes.list}</util:tokenize>
-                    <j:forEach var="attribute" items="${attributeList}">
-                        <j:set var="name" value="maven.jar.manifest.attribute.${attribute}" />
-                        <j:set var="value" value="${context.findVariable(name)}" />
-                        <ant:attribute name="${attribute}" value="${value}" />
-                    </j:forEach>
-                </j:if>
-
-                <j:if test="${context.getVariable('maven.jar.manifest.groups.list') != null}">
-                    <util:tokenize var="groupList" delim="," trim="true">${maven.jar.manifest.groups.list}</util:tokenize>
-                    <j:forEach var="group" items="${groupList}">
-                        <j:set var="nameVar" value="maven.jar.manifest.${group}.name" />
-                        <j:set var="groupName" value="${context.findVariable(nameVar)}" />
-                        <j:set var="attributeListVar" value="maven.jar.manifest.${group}.attributes.list" />
-                        <j:set var="groupAttributes" value="${context.findVariable(attributeListVar)}" />
-                        <util:tokenize var="attributeList" delim="," trim="true">${groupAttributes}</util:tokenize>
-                        <ant:section name="${groupName}">
-                            <j:forEach var="attribute" items="${attributeList}">
-                                <j:set var="name" value="maven.jar.manifest.${group}.attribute.${attribute}" />
-                                <j:set var="value" value="${context.findVariable(name)}" />
-                                <ant:attribute name="${attribute}" value="${value}" />
-                            </j:forEach>
-                        </ant:section>
-                    </j:forEach>
-                </j:if>
-            </ant:manifest>
-        </ant:jar>
-    </goal>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<project default="sar:sar" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:license="license" xmlns:define="jelly:define" xmlns:util="jelly:util" xmlns:maven="jelly:maven">
+
+    <goal name="sar:sar" description="Create the deliverable jar file." prereqs="test:test">
+
+        <copy todir="${maven.build.dest}/classes/META-INF/jboss-secsvc" overwrite="true">
+        	<fileset dir="../../../src/webapp/WEB-INF/assembly">
+            	<include name="security-providers.xml" />
+            	<include name="security-spi.xml" />            	
+            	<include name="transaction.xml" />             	
+        	</fileset>
+        </copy>
+        
+        <j:choose>
+            <j:when test="${pom.currentVersion == null}">
+                <ant:fail>You must define currentVersion in your POM.</ant:fail>
+            </j:when>
+        </j:choose>
+
+        <ant:available property="maven.jar.manifest.available" file="${maven.jar.manifest}" />
+
+        <j:set var="specificationTitle" value="${pom.shortDescription.trim()}" />
+        <j:if test="${specificationTitle.length() gt 49}">
+            <ant:echo>Warning: shortDescription is greater than 49 characters - trimming for specification title.</ant:echo>
+            <j:set var="specificationTitle" value="${specificationTitle.substring(0,46)}..." />
+        </j:if>
+
+        <j:forEach var="lib" items="${pom.artifacts}">
+            <j:set var="dep" value="${lib.dependency}" />
+            <j:choose>
+                <j:when test="${dep.getProperty('sar.bundle')=='true'}">
+                    <ant:copy todir="${maven.build.dest}" file="${lib.path}" />
+                </j:when>
+            </j:choose>
+        </j:forEach>
+
+        <!-- See http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html -->
+        <!-- See http://java.sun.com/j2se/1.4.1/docs/guide/jar/jar.html -->
+        <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.sar" basedir="${maven.build.dest}" index="${maven.jar.index}" compress="${maven.jar.compress}" excludes="${maven.jar.excludes}">
+            <j:if test="${maven.jar.manifest.available}">
+                <ant:setProperty name="manifest" value="${maven.jar.manifest}" />
+            </j:if>
+
+            <j:if test="${context.getVariable('maven.jar.includes') != null}">
+                <ant:setProperty name="includes" value="${maven.jar.includes}" />
+            </j:if>
+
+            <j:set var="licenseFileName">
+                <license:fileName />
+            </j:set>
+            <util:file name="${licenseFileName}" var="licenseFile" />
+            <ant:metainf dir="${licenseFile.canonicalFile.parent}">
+                <ant:include name="${licenseFile.canonicalFile.name}" />
+            </ant:metainf>
+            <ant:manifest>
+                <ant:attribute name="Built-By" value="${user.name}" />
+                <ant:attribute name="Created-By" value="Apache Jakarta Maven" />
+                <ant:attribute name="Package" value="${pom.package}" />
+                <ant:attribute name="Build-Jdk" value="${java.version}" />
+
+                <j:set var="jarClasspath" value="${maven.jar.manifest.classpath.add}" />
+                <j:if test="${jarClasspath}">
+                    <j:forEach var="dep" items="${pom.dependencies}">
+                        <j:if test="${dep.getProperty('jar.manifest.classpath')=='true'}">
+                            <j:set var="maven.jar.classpath" value="${maven.jar.classpath} ${dep.artifact}" />
+                        </j:if>
+                    </j:forEach>
+                    <j:if test="${maven.jar.classpath.length() != 0}">
+                        <ant:attribute name="Class-Path" value="${maven.jar.classpath}" />
+                    </j:if>
+                </j:if>
+                <!-- added supplementary entries -->
+                <ant:attribute name="Extension-Name" value="${pom.artifactId}" />
+                <ant:attribute name="Specification-Title" value="${specificationTitle}" />
+                <ant:attribute name="Specification-Vendor" value="${pom.organization.name}" />
+                <!--
+        		<ant:attribute name="Specification-Version" value="${pom.currentVersion}"/>
+		        -->
+                <ant:attribute name="Implementation-Title" value="${pom.package}" />
+                <ant:attribute name="Implementation-Vendor" value="${pom.organization.name}" />
+                <ant:attribute name="Implementation-Version" value="${pom.currentVersion}" />
+                <j:set var="mainclass" value="${maven.jar.mainclass}" />
+                <j:if test="${!empty(mainclass)}">
+                    <ant:attribute name="Main-Class" value="${mainclass}" />
+                </j:if>
+
+                <j:set var="jarExtensions" value="${maven.jar.manifest.extensions.add}" />
+                <j:if test="${jarExtensions == 'true'}">
+                    <j:set var="extensionList" value="" />
+                    <j:forEach var="artifact" items="${pom.artifacts}">
+                        <j:set var="dep" value="${artifact.dependency}" />
+                        <j:if test="${dep.type == 'jar' || empty(dep.type)}">
+                            <j:set var="extensionList" value="${extensionList} ${dep.artifactId}" />
+                        </j:if>
+                    </j:forEach>
+
+                    <j:if test="${extensionList.length() != 0}">
+                        <j:set var="extensionList" value="${extensionList.substring(1)}" />
+                        <ant:attribute name="Extension-List" value="${extensionList}" />
+                    </j:if>
+
+                    <j:forEach var="artifact" items="${pom.artifacts}">
+                        <j:set var="dep" value="${artifact.dependency}" />
+                        <j:if test="${dep.type == 'jar' || empty(dep.type)}">
+                            <ant:attribute name="${dep.artifactId}-Extension-Name" value="${dep.artifactId}" />
+                            <ant:attribute name="${dep.artifactId}-Implementation-Version" value="${dep.version}" />
+
+                            <j:choose>
+                                <j:when test="${empty(dep.url) || dep.url.toString().trim().length() == 0}">
+                                    <ant:attribute name="${dep.artifactId}-Implementation-URL" value="http://www.ibiblio.org/maven${artifact.urlPath}" />
+                                </j:when>
+                                <j:otherwise>
+                                    <ant:attribute name="${dep.artifactId}-Implementation-URL" value="${dep.url}" />
+                                </j:otherwise>
+                            </j:choose>
+                        </j:if>
+                    </j:forEach>
+                </j:if>
+
+                <j:if test="${context.getVariable('maven.jar.manifest.attributes.list') != null}">
+                    <util:tokenize var="attributeList" delim="," trim="true">${maven.jar.manifest.attributes.list}</util:tokenize>
+                    <j:forEach var="attribute" items="${attributeList}">
+                        <j:set var="name" value="maven.jar.manifest.attribute.${attribute}" />
+                        <j:set var="value" value="${context.findVariable(name)}" />
+                        <ant:attribute name="${attribute}" value="${value}" />
+                    </j:forEach>
+                </j:if>
+
+                <j:if test="${context.getVariable('maven.jar.manifest.groups.list') != null}">
+                    <util:tokenize var="groupList" delim="," trim="true">${maven.jar.manifest.groups.list}</util:tokenize>
+                    <j:forEach var="group" items="${groupList}">
+                        <j:set var="nameVar" value="maven.jar.manifest.${group}.name" />
+                        <j:set var="groupName" value="${context.findVariable(nameVar)}" />
+                        <j:set var="attributeListVar" value="maven.jar.manifest.${group}.attributes.list" />
+                        <j:set var="groupAttributes" value="${context.findVariable(attributeListVar)}" />
+                        <util:tokenize var="attributeList" delim="," trim="true">${groupAttributes}</util:tokenize>
+                        <ant:section name="${groupName}">
+                            <j:forEach var="attribute" items="${attributeList}">
+                                <j:set var="name" value="maven.jar.manifest.${group}.attribute.${attribute}" />
+                                <j:set var="value" value="${context.findVariable(name)}" />
+                                <ant:attribute name="${attribute}" value="${value}" />
+                            </j:forEach>
+                        </ant:section>
+                    </j:forEach>
+                </j:if>
+            </ant:manifest>
+        </ant:jar>
+    </goal>
+
+</project>

Propchange: portals/jetspeed-2/trunk/app-servers/security/jboss/maven.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/app-servers/security/jboss/project.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml?rev=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml Mon Aug 22 01:44:52 2005
@@ -1,157 +1,157 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Copyright 2004 The Apache Software Foundation
-    
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-    
-    $Id: project.xml,v 1.28 2005/03/31 14:07:14 ate Exp $
--->
-<project>
-    <extend>${basedir}/../../../core-build.xml</extend>
-    <pomVersion>3</pomVersion>
-    <id>jetspeed-jboss-security-service</id>
-    <name>Jetspeed-2 JBoss Security Service</name>
-
-    <package>org.apache.jetspeed</package>
-    <description>Security Service for JBoss</description>
-    <shortDescription>Security Service</shortDescription>
-
-    <repository>
-        <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-jetspeed-2/appservers/security/jboss</connection>
-        <url>http://cvs.apache.org/viewcvs/jakarta-jetspeed-2/appservers/security/jboss</url>
-    </repository>
-
-    <dependencies>
-
-        <!-- Dependencies copied from general (included)
-            dependencies. Must be copied (and preceeding the included
-            dependencies) for setting the sar.bundle property. May be removed
-            if sar.bundle property is maintained in included file. -->
-
-        <dependency>
-            <id>springframework:spring</id>
-            <version>${spring.version}</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>aopalliance</id>
-            <version>1.0</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>ojb:db-ojb</id>
-            <version>1.0.1</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-lang</id>
-            <version>2.0</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>jetspeed-commons</id>
-            <groupId>jetspeed2</groupId>
-            <version>${jetspeed.version}</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-configuration</id>
-            <version>1.0</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-
-        <!-- Components -->
-        <dependency>
-            <id>jetspeed-security</id>
-            <groupId>jetspeed2</groupId>
-            <version>${jetspeed.version}</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>jetspeed-cm</id>
-            <groupId>jetspeed2</groupId>
-            <version>${jetspeed.version}</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>jetspeed-api</id>
-            <groupId>jetspeed2</groupId>
-            <version>${jetspeed.version}</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-pool</id>
-            <version>1.2</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-dbcp</id>
-            <version>1.2.1</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-codec</id>
-            <version>1.3</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>commons-collections</id>
-            <version>3.0</version>
-            <properties>
-                <sar.bundle>true</sar.bundle>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <id>jmx:jmxri</id>
-            <version>1.2.1</version>
-        </dependency>
-    </dependencies>
-
-</project>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright 2004 The Apache Software Foundation
+    
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+    
+    $Id: project.xml,v 1.28 2005/03/31 14:07:14 ate Exp $
+-->
+<project>
+    <extend>${basedir}/../../../core-build.xml</extend>
+    <pomVersion>3</pomVersion>
+    <id>jetspeed-jboss-security-service</id>
+    <name>Jetspeed-2 JBoss Security Service</name>
+
+    <package>org.apache.jetspeed</package>
+    <description>Security Service for JBoss</description>
+    <shortDescription>Security Service</shortDescription>
+
+    <repository>
+        <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-jetspeed-2/appservers/security/jboss</connection>
+        <url>http://cvs.apache.org/viewcvs/jakarta-jetspeed-2/appservers/security/jboss</url>
+    </repository>
+
+    <dependencies>
+
+        <!-- Dependencies copied from general (included)
+            dependencies. Must be copied (and preceeding the included
+            dependencies) for setting the sar.bundle property. May be removed
+            if sar.bundle property is maintained in included file. -->
+
+        <dependency>
+            <id>springframework:spring</id>
+            <version>${spring.version}</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>aopalliance</id>
+            <version>1.0</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>ojb:db-ojb</id>
+            <version>1.0.1</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-lang</id>
+            <version>2.0</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>jetspeed-commons</id>
+            <groupId>jetspeed2</groupId>
+            <version>${jetspeed.version}</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-configuration</id>
+            <version>1.0</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+
+        <!-- Components -->
+        <dependency>
+            <id>jetspeed-security</id>
+            <groupId>jetspeed2</groupId>
+            <version>${jetspeed.version}</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>jetspeed-cm</id>
+            <groupId>jetspeed2</groupId>
+            <version>${jetspeed.version}</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>jetspeed-api</id>
+            <groupId>jetspeed2</groupId>
+            <version>${jetspeed.version}</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-pool</id>
+            <version>1.2</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-dbcp</id>
+            <version>1.2.1</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-codec</id>
+            <version>1.3</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>commons-collections</id>
+            <version>3.0</version>
+            <properties>
+                <sar.bundle>true</sar.bundle>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <id>jmx:jmxri</id>
+            <version>1.2.1</version>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: portals/jetspeed-2/trunk/app-servers/security/jboss/project.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml?rev=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml Mon Aug 22 01:44:52 2005
@@ -30,4 +30,4 @@
         </constructor-arg>
     </bean>
 
-</beans>
\ No newline at end of file
+</beans>

Propchange: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-secsvc/jboss-security-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/META-INF/jboss-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java?rev=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/JdbcMetadataUtils.java Mon Aug 22 01:44:52 2005
@@ -1,482 +1,482 @@
-/* Copyright 2002-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * TODO: Copied here because db-ojb 1.0.1 used by Jetspeed2 does not provide
- * this. May be replaved when Jetspeed2 updates OJB.
- */
-
-package org.apache.jetspeed.appservers.security.jboss;
-
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-import javax.sql.DataSource;
-import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
-import org.apache.ojb.broker.metadata.MetadataException;
-
-/**
- * This class provides some utility functions to OJB for working with JDBC metadata.
- * 
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- */
-public class JdbcMetadataUtils
-{
-    /**
-     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the protocol
-     */
-    public static final String PROPERTY_PROTOCOL = "protocol";
-
-    /**
-     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the sub
-     * protocol
-     */
-    public static final String PROPERTY_SUBPROTOCOL = "subprotocol";
-
-    /**
-     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the database
-     * alias (the actual database url)
-     */
-    public static final String PROPERTY_DBALIAS = "dbAlias";
-
-    /** Identifier for the DB2 platform */
-    public static final String PLATFORM_DB2 = "Db2";
-
-    /** Identifier for the Firebird platform */
-    public static final String PLATFORM_FIREBIRD = "Firebird";
-
-    /** Identifier for the Hsqldb platform */
-    public static final String PLATFORM_HSQLDB = "Hsqldb";
-
-    /** Identifier for the Informix platform */
-    public static final String PLATFORM_INFORMIX = "Informix";
-
-    /** Identifier for the MaxDB platform */
-    public static final String PLATFORM_MAXDB = "MaxDB";
-
-    /** Identifier for the McKoi platform */
-    public static final String PLATFORM_MCKOI = "McKoi";
-
-    /** Identifier for the MsAccess platform */
-    public static final String PLATFORM_MSACCESS = "MsAccess";
-
-    /** Identifier for the Microsoft SQL Server platform */
-    public static final String PLATFORM_MSSQLSERVER = "MsSQLServer";
-
-    /** Identifier for the MySQL platform */
-    public static final String PLATFORM_MYSQL = "MySQL";
-
-    /** Identifier for the generic Oracle platform */
-    public static final String PLATFORM_ORACLE = "Oracle";
-
-    /** Identifier for the Oracle9i platform */
-    public static final String PLATFORM_ORACLE9I = "Oracle9i";
-
-    /** Identifier for the PostgresSQL platform */
-    public static final String PLATFORM_POSTGRESQL = "PostgreSQL";
-
-    /** Identifier for the generic Sybase platform */
-    public static final String PLATFORM_SYBASE = "Sybase";
-
-    /** Identifier for the Sybase ASA platform */
-    public static final String PLATFORM_SYBASEASA = "SybaseASA";
-
-    /** Identifier for the Sybase ASE platform */
-    public static final String PLATFORM_SYBASEASE = "SybaseASE";
-
-    /** Identifier for the Oracle9i for WebLogic platform */
-    public static final String PLATFORM_WLORACLE9I = "WLOracle9i";
-
-    /** The standard DB2 jdbc driver */
-    public static final String DRIVER_DB2 = "COM.ibm.db2.jdbc.app.DB2Driver";
-
-    /** The i-net DB2 jdbc driver */
-    public static final String DRIVER_DB2_INET = "com.inet.drda.DRDADriver";
-
-    /** The standard Firebird jdbc driver */
-    public static final String DRIVER_FIREBIRD = "org.firebirdsql.jdbc.FBDriver";
-
-    /** The standard Hsqldb jdbc driver */
-    public static final String DRIVER_HSQLDB = "org.hsqldb.jdbcDriver";
-
-    /** The i-net pooled jdbc driver for SQLServer and Sybase */
-    public static final String DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
-
-    /** The standard Informix jdbc driver */
-    public static final String DRIVER_INFORMIX = "com.informix.jdbc.IfxDriver";
-
-    /** The jTDS jdbc driver for SQLServer and Sybase */
-    public static final String DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
-
-    /** The standard MaxDB jdbc driver */
-    public static final String DRIVER_MAXDB = "com.sap.dbtech.jdbc.DriverSapDB";
-
-    /** The standard McKoi jdbc driver */
-    public static final String DRIVER_MCKOI = "com.mckoi.JDBCDriver";
-
-    /** The standard SQLServer jdbc driver */
-    public static final String DRIVER_MSSQLSERVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
-
-    /** The i-net SQLServer jdbc driver */
-    public static final String DRIVER_MSSQLSERVER_INET = "com.inet.tds.TdsDriver";
-
-    /** The JNetDirect SQLServer jdbc driver */
-    public static final String DRIVER_MSSQLSERVER_JSQLCONNECT = "com.jnetdirect.jsql.JSQLDriver";
-
-    /** The standard MySQL jdbc driver */
-    public static final String DRIVER_MYSQL = "com.mysql.jdbc.Driver";
-
-    /** The old MySQL jdbc driver */
-    public static final String DRIVER_MYSQL_OLD = "org.gjt.mm.mysql.Driver";
-
-    /** The standard Oracle jdbc driver */
-    public static final String DRIVER_ORACLE = "oracle.jdbc.driver.OracleDriver";
-
-    /** The i-net Oracle jdbc driver */
-    public static final String DRIVER_ORACLE_INET = "com.inet.ora.OraDriver";
-
-    /** The standard PostgreSQL jdbc driver */
-    public static final String DRIVER_POSTGRESQL = "org.postgresql.Driver";
-
-    /** The standard Sapdb jdbc driver */
-    public static final String DRIVER_SAPDB = DRIVER_MAXDB;
-
-    /** The standard Sybase jdbc driver */
-    public static final String DRIVER_SYBASE = "com.sybase.jdbc2.jdbc.SybDriver";
-
-    /** The old Sybase jdbc driver */
-    public static final String DRIVER_SYBASE_OLD = "com.sybase.jdbc.SybDriver";
-
-    /** The i-net Sybase jdbc driver */
-    public static final String DRIVER_SYBASE_INET = "com.inet.syb.SybDriver";
-
-    /** The subprotocol used by the standard DB2 driver */
-    public static final String SUBPROTOCOL_DB2 = "db2";
-
-    /** The subprotocol used by the i-net DB2 driver */
-    public static final String SUBPROTOCOL_DB2_INET = "inetdb2";
-
-    /** The subprotocol used by the standard Firebird driver */
-    public static final String SUBPROTOCOL_FIREBIRD = "firebirdsql";
-
-    /** The subprotocol used by the standard Hsqldb driver */
-    public static final String SUBPROTOCOL_HSQLDB = "hsqldb";
-
-    /** The subprotocol used by the standard Informix driver */
-    public static final String SUBPROTOCOL_INFORMIX = "informix-sqli";
-
-    /** The subprotocol used by the standard MaxDB driver */
-    public static final String SUBPROTOCOL_MAXDB = "sapdb";
-
-    /** The subprotocol used by the standard McKoi driver */
-    public static final String SUBPROTOCOL_MCKOI = "mckoi";
-
-    /** The subprotocol used by the standard SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER = "microsoft:sqlserver";
-
-    /** A subprotocol used by the i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER_INET = "inetdae";
-
-    /** A subprotocol used by the i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER6_INET = "inetdae6";
-
-    /** A subprotocol used by the i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER7_INET = "inetdae7";
-
-    /** A subprotocol used by the i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER7A_INET = "inetdae7a";
-
-    /** A subprotocol used by the pooled i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED = "inetpool:inetdae";
-
-    /** A subprotocol used by the pooled i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED = "inetpool:inetdae6";
-
-    /** A subprotocol used by the pooled i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED = "inetpool:inetdae7";
-
-    /** A subprotocol used by the pooled i-net SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED = "inetpool:inetdae7a";
-
-    /** The subprotocol used by the JNetDirect SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT = "JSQLConnect";
-
-    /** The subprotocol used by the jTDS SQLServer driver */
-    public static final String SUBPROTOCOL_MSSQLSERVER_JTDS = "jtds:sqlserver";
-
-    /** The subprotocol used by the standard MySQL driver */
-    public static final String SUBPROTOCOL_MYSQL = "mysql";
-
-    /** The subprotocol used by the standard Oracle driver */
-    public static final String SUBPROTOCOL_ORACLE = "oracle";
-
-    /** The subprotocol used by the i-net Oracle driver */
-    public static final String SUBPROTOCOL_ORACLE_INET = "inetora";
-
-    /** The subprotocol used by the standard PostgreSQL driver */
-    public static final String SUBPROTOCOL_POSTGRESQL = "postgresql";
-
-    /** The subprotocol used by the standard Sapdb driver */
-    public static final String SUBPROTOCOL_SAPDB = SUBPROTOCOL_MAXDB;
-
-    /** The subprotocol used by the standard Sybase driver */
-    public static final String SUBPROTOCOL_SYBASE = "sybase:Tds";
-
-    /** The subprotocol used by the i-net Sybase driver */
-    public static final String SUBPROTOCOL_SYBASE_INET = "inetsyb";
-
-    /** The subprotocol used by the pooled i-net Sybase driver */
-    public static final String SUBPROTOCOL_SYBASE_INET_POOLED = "inetpool:inetsyb";
-
-    /** The subprotocol used by the jTDS Sybase driver */
-    public static final String SUBPROTOCOL_SYBASE_JTDS = "jtds:sybase";
-
-    /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
-    private HashMap jdbcSubProtocolToPlatform = new HashMap();
-
-    /** Maps the jdbc driver name to a OJB platform name */
-    private HashMap jdbcDriverToPlatform = new HashMap();
-
-    /**
-     * Creates a new <code>JdbcMetadataUtils</code> object.
-     */
-    public JdbcMetadataUtils()
-    {
-        // Note that currently Sapdb and MaxDB have equal subprotocols and
-        // drivers so we have no means to distinguish them
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2, PLATFORM_DB2);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2_INET, PLATFORM_DB2);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_FIREBIRD, PLATFORM_FIREBIRD);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_HSQLDB, PLATFORM_HSQLDB);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_INFORMIX, PLATFORM_INFORMIX);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MAXDB, PLATFORM_MAXDB);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET_POOLED, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET_POOLED, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET_POOLED, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_JTDS, PLATFORM_MSSQLSERVER);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MYSQL, PLATFORM_MYSQL);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE, PLATFORM_ORACLE);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE_INET, PLATFORM_ORACLE);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_POSTGRESQL, PLATFORM_POSTGRESQL);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE, PLATFORM_SYBASE);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET, PLATFORM_SYBASE);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET_POOLED, PLATFORM_SYBASE);
-        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_JTDS, PLATFORM_SYBASE);
-
-        jdbcDriverToPlatform.put(DRIVER_DB2, PLATFORM_DB2);
-        jdbcDriverToPlatform.put(DRIVER_DB2_INET, PLATFORM_DB2);
-        jdbcDriverToPlatform.put(DRIVER_FIREBIRD, PLATFORM_FIREBIRD);
-        jdbcDriverToPlatform.put(DRIVER_HSQLDB, PLATFORM_HSQLDB);
-        jdbcDriverToPlatform.put(DRIVER_INFORMIX, PLATFORM_INFORMIX);
-        jdbcDriverToPlatform.put(DRIVER_MAXDB, PLATFORM_MAXDB);
-        jdbcDriverToPlatform.put(DRIVER_MCKOI, PLATFORM_MCKOI);
-        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER, PLATFORM_MSSQLSERVER);
-        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
-        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_JSQLCONNECT, PLATFORM_MSSQLSERVER);
-        jdbcDriverToPlatform.put(DRIVER_MYSQL, PLATFORM_MYSQL);
-        jdbcDriverToPlatform.put(DRIVER_MYSQL_OLD, PLATFORM_MYSQL);
-        jdbcDriverToPlatform.put(DRIVER_ORACLE, PLATFORM_ORACLE);
-        jdbcDriverToPlatform.put(DRIVER_ORACLE_INET, PLATFORM_ORACLE);
-        jdbcDriverToPlatform.put(DRIVER_POSTGRESQL, PLATFORM_POSTGRESQL);
-        jdbcDriverToPlatform.put(DRIVER_SYBASE, PLATFORM_SYBASE);
-        jdbcDriverToPlatform.put(DRIVER_SYBASE_OLD, PLATFORM_SYBASE);
-        jdbcDriverToPlatform.put(DRIVER_SYBASE_INET, PLATFORM_SYBASE);
-    }
-
-    /**
-     * Fills parameters of the given {@link JdbcConnectionDescriptor} with metadata extracted from the given datasource.
-     * 
-     * @param jcd
-     *            The jdbc connection descriptor to fill
-     * @param dataSource
-     *            The data source
-     * @param username
-     *            The username required to establish a connection via the data source Can be empty if the data source
-     *            does not require it or if one is specified in the jdbc connection descriptor
-     * @param password
-     *            The username required to establish a connection via the data source Can be empty if the data source or
-     *            username does not require it or if one is specified in the jdbc connection descriptor
-     */
-    public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username,
-            String password) throws MetadataException
-    {
-        String realUsername = (jcd.getUserName() != null ? jcd.getUserName() : username);
-        String realPassword = (jcd.getPassWord() != null ? jcd.getPassWord() : password);
-        Connection connection = null;
-        DatabaseMetaData metadata = null;
-
-        try
-        {
-            // we have to open a connection to be able to retrieve metadata
-            if (realUsername != null)
-            {
-                connection = dataSource.getConnection(realUsername, realPassword);
-            }
-            else
-            {
-                connection = dataSource.getConnection();
-            }
-
-            metadata = connection.getMetaData();
-        }
-        catch (Throwable t)
-        {
-            if (connection != null)
-            {
-                try
-                {
-                    connection.close();
-                }
-                catch (SQLException ex)
-                {
-                }
-            }
-            throw new MetadataException("Could not get the metadata from the given datasource", t);
-        }
-
-        try
-        {
-            HashMap urlComponents = parseConnectionUrl(metadata.getURL());
-
-            if (urlComponents.containsKey(PROPERTY_DBALIAS))
-            {
-                jcd.setProtocol((String) urlComponents.get(PROPERTY_PROTOCOL));
-                jcd.setSubProtocol((String) urlComponents.get(PROPERTY_SUBPROTOCOL));
-                jcd.setDbAlias((String) urlComponents.get(PROPERTY_DBALIAS));
-                if (jdbcSubProtocolToPlatform.containsKey(jcd.getSubProtocol()))
-                {
-                    // TODO: We might be able to use this: metadata.getDatabaseProductName();
-                    jcd.setDbms((String) jdbcSubProtocolToPlatform.get(jcd.getSubProtocol()));
-                }
-            }
-        }
-        catch (Throwable t)
-        {
-            try
-            {
-                connection.close();
-            }
-            catch (SQLException ex)
-            {
-            }
-            throw new MetadataException("Could not get the metadata from the given datasource", t);
-        }
-        try
-        {
-            // this will only work with JDK >= 1.4 and only with some jdbc drivers
-            Integer majorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMajorVersion");
-            Integer minorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMinorVersion");
-
-            jcd.setJdbcLevel(Double.parseDouble(majorVersion.toString() + "." + minorVersion.toString()));
-        }
-        catch (Throwable t)
-        {
-            // otherwise we're assuming JDBC 2.0 compliance
-            jcd.setJdbcLevel(2.0);
-        }
-        try
-        {
-            connection.close();
-        }
-        catch (SQLException ex)
-        {
-        }
-    }
-
-    /**
-     * Splits the given jdbc connection url into its components and puts them into a hash map using the
-     * <code>PROPERTY_</code> constants.
-     * 
-     * @param jdbcConnectionUrl
-     *            The connection url
-     * @return The properties
-     */
-    public HashMap parseConnectionUrl(String jdbcConnectionUrl)
-    {
-        HashMap result = new HashMap();
-
-        if (jdbcConnectionUrl == null)
-        {
-            return result;
-        }
-
-        int pos = jdbcConnectionUrl.indexOf(':');
-        int lastPos;
-
-        result.put(PROPERTY_PROTOCOL, jdbcConnectionUrl.substring(0, pos));
-
-        lastPos = pos;
-        pos = jdbcConnectionUrl.indexOf(':', lastPos + 1);
-
-        String subProtocol = jdbcConnectionUrl.substring(lastPos + 1, pos);
-
-        // there are a few jdbc drivers that have a subprotocol containing one or more ':'
-        if ("inetpool".equals(subProtocol))
-        {
-            // Possible forms are:
-            // inetpool:<subprotocol>
-            // inetpool:jdbc:<subprotocol> (where we'll remove the 'jdbc' part)
-
-            int tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
-
-            if ("inetpool:jdbc".equals(jdbcConnectionUrl.substring(lastPos + 1, tmpPos)))
-            {
-                pos = tmpPos;
-                tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
-            }
-            subProtocol += ":" + jdbcConnectionUrl.substring(pos + 1, tmpPos);
-        }
-        else if ("jtds".equals(subProtocol) || "microsoft".equals(subProtocol) || "sybase".equals(subProtocol))
-        {
-            pos = jdbcConnectionUrl.indexOf(':', pos + 1);
-            subProtocol = ":" + jdbcConnectionUrl.substring(lastPos + 1, pos);
-        }
-
-        result.put(PROPERTY_SUBPROTOCOL, subProtocol);
-        result.put(PROPERTY_DBALIAS, jdbcConnectionUrl.substring(pos + 1));
-
-        return result;
-    }
-
-    /**
-     * Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and
-     * where the specified jdbc driver is used.
-     * 
-     * @param jdbcSubProtocol
-     *            The JDBC subprotocol used to connect to the database
-     * @param jdbcDriver
-     *            The JDBC driver used to connect to the database
-     * @return The platform identifier or <code>null</code> if no platform could be found
-     */
-    public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
-    {
-        String platform = (String) jdbcSubProtocolToPlatform.get(jdbcSubProtocol);
-
-        if (platform == null)
-        {
-            platform = (String) jdbcDriverToPlatform.get(jdbcDriver);
-        }
-        return platform;
-    }
-}
+/* Copyright 2002-2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * TODO: Copied here because db-ojb 1.0.1 used by Jetspeed2 does not provide
+ * this. May be replaved when Jetspeed2 updates OJB.
+ */
+
+package org.apache.jetspeed.appservers.security.jboss;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.SQLException;
+import java.util.HashMap;
+
+import javax.sql.DataSource;
+import org.apache.commons.beanutils.PropertyUtils;
+import org.apache.ojb.broker.metadata.JdbcConnectionDescriptor;
+import org.apache.ojb.broker.metadata.MetadataException;
+
+/**
+ * This class provides some utility functions to OJB for working with JDBC metadata.
+ * 
+ * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ */
+public class JdbcMetadataUtils
+{
+    /**
+     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the protocol
+     */
+    public static final String PROPERTY_PROTOCOL = "protocol";
+
+    /**
+     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the sub
+     * protocol
+     */
+    public static final String PROPERTY_SUBPROTOCOL = "subprotocol";
+
+    /**
+     * The name of the property returned by the {@link #splitConnectionUrl(String)} method that contains the database
+     * alias (the actual database url)
+     */
+    public static final String PROPERTY_DBALIAS = "dbAlias";
+
+    /** Identifier for the DB2 platform */
+    public static final String PLATFORM_DB2 = "Db2";
+
+    /** Identifier for the Firebird platform */
+    public static final String PLATFORM_FIREBIRD = "Firebird";
+
+    /** Identifier for the Hsqldb platform */
+    public static final String PLATFORM_HSQLDB = "Hsqldb";
+
+    /** Identifier for the Informix platform */
+    public static final String PLATFORM_INFORMIX = "Informix";
+
+    /** Identifier for the MaxDB platform */
+    public static final String PLATFORM_MAXDB = "MaxDB";
+
+    /** Identifier for the McKoi platform */
+    public static final String PLATFORM_MCKOI = "McKoi";
+
+    /** Identifier for the MsAccess platform */
+    public static final String PLATFORM_MSACCESS = "MsAccess";
+
+    /** Identifier for the Microsoft SQL Server platform */
+    public static final String PLATFORM_MSSQLSERVER = "MsSQLServer";
+
+    /** Identifier for the MySQL platform */
+    public static final String PLATFORM_MYSQL = "MySQL";
+
+    /** Identifier for the generic Oracle platform */
+    public static final String PLATFORM_ORACLE = "Oracle";
+
+    /** Identifier for the Oracle9i platform */
+    public static final String PLATFORM_ORACLE9I = "Oracle9i";
+
+    /** Identifier for the PostgresSQL platform */
+    public static final String PLATFORM_POSTGRESQL = "PostgreSQL";
+
+    /** Identifier for the generic Sybase platform */
+    public static final String PLATFORM_SYBASE = "Sybase";
+
+    /** Identifier for the Sybase ASA platform */
+    public static final String PLATFORM_SYBASEASA = "SybaseASA";
+
+    /** Identifier for the Sybase ASE platform */
+    public static final String PLATFORM_SYBASEASE = "SybaseASE";
+
+    /** Identifier for the Oracle9i for WebLogic platform */
+    public static final String PLATFORM_WLORACLE9I = "WLOracle9i";
+
+    /** The standard DB2 jdbc driver */
+    public static final String DRIVER_DB2 = "COM.ibm.db2.jdbc.app.DB2Driver";
+
+    /** The i-net DB2 jdbc driver */
+    public static final String DRIVER_DB2_INET = "com.inet.drda.DRDADriver";
+
+    /** The standard Firebird jdbc driver */
+    public static final String DRIVER_FIREBIRD = "org.firebirdsql.jdbc.FBDriver";
+
+    /** The standard Hsqldb jdbc driver */
+    public static final String DRIVER_HSQLDB = "org.hsqldb.jdbcDriver";
+
+    /** The i-net pooled jdbc driver for SQLServer and Sybase */
+    public static final String DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
+
+    /** The standard Informix jdbc driver */
+    public static final String DRIVER_INFORMIX = "com.informix.jdbc.IfxDriver";
+
+    /** The jTDS jdbc driver for SQLServer and Sybase */
+    public static final String DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
+
+    /** The standard MaxDB jdbc driver */
+    public static final String DRIVER_MAXDB = "com.sap.dbtech.jdbc.DriverSapDB";
+
+    /** The standard McKoi jdbc driver */
+    public static final String DRIVER_MCKOI = "com.mckoi.JDBCDriver";
+
+    /** The standard SQLServer jdbc driver */
+    public static final String DRIVER_MSSQLSERVER = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
+
+    /** The i-net SQLServer jdbc driver */
+    public static final String DRIVER_MSSQLSERVER_INET = "com.inet.tds.TdsDriver";
+
+    /** The JNetDirect SQLServer jdbc driver */
+    public static final String DRIVER_MSSQLSERVER_JSQLCONNECT = "com.jnetdirect.jsql.JSQLDriver";
+
+    /** The standard MySQL jdbc driver */
+    public static final String DRIVER_MYSQL = "com.mysql.jdbc.Driver";
+
+    /** The old MySQL jdbc driver */
+    public static final String DRIVER_MYSQL_OLD = "org.gjt.mm.mysql.Driver";
+
+    /** The standard Oracle jdbc driver */
+    public static final String DRIVER_ORACLE = "oracle.jdbc.driver.OracleDriver";
+
+    /** The i-net Oracle jdbc driver */
+    public static final String DRIVER_ORACLE_INET = "com.inet.ora.OraDriver";
+
+    /** The standard PostgreSQL jdbc driver */
+    public static final String DRIVER_POSTGRESQL = "org.postgresql.Driver";
+
+    /** The standard Sapdb jdbc driver */
+    public static final String DRIVER_SAPDB = DRIVER_MAXDB;
+
+    /** The standard Sybase jdbc driver */
+    public static final String DRIVER_SYBASE = "com.sybase.jdbc2.jdbc.SybDriver";
+
+    /** The old Sybase jdbc driver */
+    public static final String DRIVER_SYBASE_OLD = "com.sybase.jdbc.SybDriver";
+
+    /** The i-net Sybase jdbc driver */
+    public static final String DRIVER_SYBASE_INET = "com.inet.syb.SybDriver";
+
+    /** The subprotocol used by the standard DB2 driver */
+    public static final String SUBPROTOCOL_DB2 = "db2";
+
+    /** The subprotocol used by the i-net DB2 driver */
+    public static final String SUBPROTOCOL_DB2_INET = "inetdb2";
+
+    /** The subprotocol used by the standard Firebird driver */
+    public static final String SUBPROTOCOL_FIREBIRD = "firebirdsql";
+
+    /** The subprotocol used by the standard Hsqldb driver */
+    public static final String SUBPROTOCOL_HSQLDB = "hsqldb";
+
+    /** The subprotocol used by the standard Informix driver */
+    public static final String SUBPROTOCOL_INFORMIX = "informix-sqli";
+
+    /** The subprotocol used by the standard MaxDB driver */
+    public static final String SUBPROTOCOL_MAXDB = "sapdb";
+
+    /** The subprotocol used by the standard McKoi driver */
+    public static final String SUBPROTOCOL_MCKOI = "mckoi";
+
+    /** The subprotocol used by the standard SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER = "microsoft:sqlserver";
+
+    /** A subprotocol used by the i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER_INET = "inetdae";
+
+    /** A subprotocol used by the i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER6_INET = "inetdae6";
+
+    /** A subprotocol used by the i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER7_INET = "inetdae7";
+
+    /** A subprotocol used by the i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER7A_INET = "inetdae7a";
+
+    /** A subprotocol used by the pooled i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER_INET_POOLED = "inetpool:inetdae";
+
+    /** A subprotocol used by the pooled i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER6_INET_POOLED = "inetpool:inetdae6";
+
+    /** A subprotocol used by the pooled i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER7_INET_POOLED = "inetpool:inetdae7";
+
+    /** A subprotocol used by the pooled i-net SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED = "inetpool:inetdae7a";
+
+    /** The subprotocol used by the JNetDirect SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER_JSQLCONNECT = "JSQLConnect";
+
+    /** The subprotocol used by the jTDS SQLServer driver */
+    public static final String SUBPROTOCOL_MSSQLSERVER_JTDS = "jtds:sqlserver";
+
+    /** The subprotocol used by the standard MySQL driver */
+    public static final String SUBPROTOCOL_MYSQL = "mysql";
+
+    /** The subprotocol used by the standard Oracle driver */
+    public static final String SUBPROTOCOL_ORACLE = "oracle";
+
+    /** The subprotocol used by the i-net Oracle driver */
+    public static final String SUBPROTOCOL_ORACLE_INET = "inetora";
+
+    /** The subprotocol used by the standard PostgreSQL driver */
+    public static final String SUBPROTOCOL_POSTGRESQL = "postgresql";
+
+    /** The subprotocol used by the standard Sapdb driver */
+    public static final String SUBPROTOCOL_SAPDB = SUBPROTOCOL_MAXDB;
+
+    /** The subprotocol used by the standard Sybase driver */
+    public static final String SUBPROTOCOL_SYBASE = "sybase:Tds";
+
+    /** The subprotocol used by the i-net Sybase driver */
+    public static final String SUBPROTOCOL_SYBASE_INET = "inetsyb";
+
+    /** The subprotocol used by the pooled i-net Sybase driver */
+    public static final String SUBPROTOCOL_SYBASE_INET_POOLED = "inetpool:inetsyb";
+
+    /** The subprotocol used by the jTDS Sybase driver */
+    public static final String SUBPROTOCOL_SYBASE_JTDS = "jtds:sybase";
+
+    /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
+    private HashMap jdbcSubProtocolToPlatform = new HashMap();
+
+    /** Maps the jdbc driver name to a OJB platform name */
+    private HashMap jdbcDriverToPlatform = new HashMap();
+
+    /**
+     * Creates a new <code>JdbcMetadataUtils</code> object.
+     */
+    public JdbcMetadataUtils()
+    {
+        // Note that currently Sapdb and MaxDB have equal subprotocols and
+        // drivers so we have no means to distinguish them
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2, PLATFORM_DB2);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_DB2_INET, PLATFORM_DB2);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_FIREBIRD, PLATFORM_FIREBIRD);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_HSQLDB, PLATFORM_HSQLDB);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_INFORMIX, PLATFORM_INFORMIX);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MAXDB, PLATFORM_MAXDB);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_INET_POOLED, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER6_INET_POOLED, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7_INET_POOLED, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER7A_INET_POOLED, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MSSQLSERVER_JTDS, PLATFORM_MSSQLSERVER);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_MYSQL, PLATFORM_MYSQL);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE, PLATFORM_ORACLE);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_ORACLE_INET, PLATFORM_ORACLE);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_POSTGRESQL, PLATFORM_POSTGRESQL);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE, PLATFORM_SYBASE);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET, PLATFORM_SYBASE);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_INET_POOLED, PLATFORM_SYBASE);
+        jdbcSubProtocolToPlatform.put(SUBPROTOCOL_SYBASE_JTDS, PLATFORM_SYBASE);
+
+        jdbcDriverToPlatform.put(DRIVER_DB2, PLATFORM_DB2);
+        jdbcDriverToPlatform.put(DRIVER_DB2_INET, PLATFORM_DB2);
+        jdbcDriverToPlatform.put(DRIVER_FIREBIRD, PLATFORM_FIREBIRD);
+        jdbcDriverToPlatform.put(DRIVER_HSQLDB, PLATFORM_HSQLDB);
+        jdbcDriverToPlatform.put(DRIVER_INFORMIX, PLATFORM_INFORMIX);
+        jdbcDriverToPlatform.put(DRIVER_MAXDB, PLATFORM_MAXDB);
+        jdbcDriverToPlatform.put(DRIVER_MCKOI, PLATFORM_MCKOI);
+        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER, PLATFORM_MSSQLSERVER);
+        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_INET, PLATFORM_MSSQLSERVER);
+        jdbcDriverToPlatform.put(DRIVER_MSSQLSERVER_JSQLCONNECT, PLATFORM_MSSQLSERVER);
+        jdbcDriverToPlatform.put(DRIVER_MYSQL, PLATFORM_MYSQL);
+        jdbcDriverToPlatform.put(DRIVER_MYSQL_OLD, PLATFORM_MYSQL);
+        jdbcDriverToPlatform.put(DRIVER_ORACLE, PLATFORM_ORACLE);
+        jdbcDriverToPlatform.put(DRIVER_ORACLE_INET, PLATFORM_ORACLE);
+        jdbcDriverToPlatform.put(DRIVER_POSTGRESQL, PLATFORM_POSTGRESQL);
+        jdbcDriverToPlatform.put(DRIVER_SYBASE, PLATFORM_SYBASE);
+        jdbcDriverToPlatform.put(DRIVER_SYBASE_OLD, PLATFORM_SYBASE);
+        jdbcDriverToPlatform.put(DRIVER_SYBASE_INET, PLATFORM_SYBASE);
+    }
+
+    /**
+     * Fills parameters of the given {@link JdbcConnectionDescriptor} with metadata extracted from the given datasource.
+     * 
+     * @param jcd
+     *            The jdbc connection descriptor to fill
+     * @param dataSource
+     *            The data source
+     * @param username
+     *            The username required to establish a connection via the data source Can be empty if the data source
+     *            does not require it or if one is specified in the jdbc connection descriptor
+     * @param password
+     *            The username required to establish a connection via the data source Can be empty if the data source or
+     *            username does not require it or if one is specified in the jdbc connection descriptor
+     */
+    public void fillJCDFromDataSource(JdbcConnectionDescriptor jcd, DataSource dataSource, String username,
+            String password) throws MetadataException
+    {
+        String realUsername = (jcd.getUserName() != null ? jcd.getUserName() : username);
+        String realPassword = (jcd.getPassWord() != null ? jcd.getPassWord() : password);
+        Connection connection = null;
+        DatabaseMetaData metadata = null;
+
+        try
+        {
+            // we have to open a connection to be able to retrieve metadata
+            if (realUsername != null)
+            {
+                connection = dataSource.getConnection(realUsername, realPassword);
+            }
+            else
+            {
+                connection = dataSource.getConnection();
+            }
+
+            metadata = connection.getMetaData();
+        }
+        catch (Throwable t)
+        {
+            if (connection != null)
+            {
+                try
+                {
+                    connection.close();
+                }
+                catch (SQLException ex)
+                {
+                }
+            }
+            throw new MetadataException("Could not get the metadata from the given datasource", t);
+        }
+
+        try
+        {
+            HashMap urlComponents = parseConnectionUrl(metadata.getURL());
+
+            if (urlComponents.containsKey(PROPERTY_DBALIAS))
+            {
+                jcd.setProtocol((String) urlComponents.get(PROPERTY_PROTOCOL));
+                jcd.setSubProtocol((String) urlComponents.get(PROPERTY_SUBPROTOCOL));
+                jcd.setDbAlias((String) urlComponents.get(PROPERTY_DBALIAS));
+                if (jdbcSubProtocolToPlatform.containsKey(jcd.getSubProtocol()))
+                {
+                    // TODO: We might be able to use this: metadata.getDatabaseProductName();
+                    jcd.setDbms((String) jdbcSubProtocolToPlatform.get(jcd.getSubProtocol()));
+                }
+            }
+        }
+        catch (Throwable t)
+        {
+            try
+            {
+                connection.close();
+            }
+            catch (SQLException ex)
+            {
+            }
+            throw new MetadataException("Could not get the metadata from the given datasource", t);
+        }
+        try
+        {
+            // this will only work with JDK >= 1.4 and only with some jdbc drivers
+            Integer majorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMajorVersion");
+            Integer minorVersion = (Integer) PropertyUtils.getProperty(metadata, "JDBCMinorVersion");
+
+            jcd.setJdbcLevel(Double.parseDouble(majorVersion.toString() + "." + minorVersion.toString()));
+        }
+        catch (Throwable t)
+        {
+            // otherwise we're assuming JDBC 2.0 compliance
+            jcd.setJdbcLevel(2.0);
+        }
+        try
+        {
+            connection.close();
+        }
+        catch (SQLException ex)
+        {
+        }
+    }
+
+    /**
+     * Splits the given jdbc connection url into its components and puts them into a hash map using the
+     * <code>PROPERTY_</code> constants.
+     * 
+     * @param jdbcConnectionUrl
+     *            The connection url
+     * @return The properties
+     */
+    public HashMap parseConnectionUrl(String jdbcConnectionUrl)
+    {
+        HashMap result = new HashMap();
+
+        if (jdbcConnectionUrl == null)
+        {
+            return result;
+        }
+
+        int pos = jdbcConnectionUrl.indexOf(':');
+        int lastPos;
+
+        result.put(PROPERTY_PROTOCOL, jdbcConnectionUrl.substring(0, pos));
+
+        lastPos = pos;
+        pos = jdbcConnectionUrl.indexOf(':', lastPos + 1);
+
+        String subProtocol = jdbcConnectionUrl.substring(lastPos + 1, pos);
+
+        // there are a few jdbc drivers that have a subprotocol containing one or more ':'
+        if ("inetpool".equals(subProtocol))
+        {
+            // Possible forms are:
+            // inetpool:<subprotocol>
+            // inetpool:jdbc:<subprotocol> (where we'll remove the 'jdbc' part)
+
+            int tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+
+            if ("inetpool:jdbc".equals(jdbcConnectionUrl.substring(lastPos + 1, tmpPos)))
+            {
+                pos = tmpPos;
+                tmpPos = jdbcConnectionUrl.indexOf(':', pos + 1);
+            }
+            subProtocol += ":" + jdbcConnectionUrl.substring(pos + 1, tmpPos);
+        }
+        else if ("jtds".equals(subProtocol) || "microsoft".equals(subProtocol) || "sybase".equals(subProtocol))
+        {
+            pos = jdbcConnectionUrl.indexOf(':', pos + 1);
+            subProtocol = ":" + jdbcConnectionUrl.substring(lastPos + 1, pos);
+        }
+
+        result.put(PROPERTY_SUBPROTOCOL, subProtocol);
+        result.put(PROPERTY_DBALIAS, jdbcConnectionUrl.substring(pos + 1));
+
+        return result;
+    }
+
+    /**
+     * Derives the OJB platform to use for a database that is connected via a url using the specified subprotocol, and
+     * where the specified jdbc driver is used.
+     * 
+     * @param jdbcSubProtocol
+     *            The JDBC subprotocol used to connect to the database
+     * @param jdbcDriver
+     *            The JDBC driver used to connect to the database
+     * @return The platform identifier or <code>null</code> if no platform could be found
+     */
+    public String findPlatformFor(String jdbcSubProtocol, String jdbcDriver)
+    {
+        String platform = (String) jdbcSubProtocolToPlatform.get(jdbcSubProtocol);
+
+        if (platform == null)
+        {
+            platform = (String) jdbcDriverToPlatform.get(jdbcDriver);
+        }
+        return platform;
+    }
+}

Modified: portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java?rev=234454&r1=234453&r2=234454&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java (original)
+++ portals/jetspeed-2/trunk/app-servers/security/jboss/src/java/org/apache/jetspeed/appservers/security/jboss/LoginModule.java Mon Aug 22 01:44:52 2005
@@ -1,154 +1,154 @@
-/* Copyright 2004 Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.jetspeed.appservers.security.jboss;
-
-import java.util.Map;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginException;
-
-import org.apache.jetspeed.security.UserManager;
-import org.apache.jetspeed.security.impl.ext.JBossLoginModule;
-
-/**
- * A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.
- */
-public class LoginModule implements javax.security.auth.spi.LoginModule
-{
-
-    private String securityService = null;
-
-    private JBossLoginModule delegee = null;
-
-    /**
-     * Helper for delaying the creation of the JBossLoginModule. We cannot access the security service MBean before
-     * <code>initialize</code> has been called, but need the user manager in the constructor of JBossLoginModule. The
-     * constructor that takes the user manager as argument is protected (and right so), so we need this helper.
-     */
-    private class LoginModuleDelegee extends JBossLoginModule
-    {
-        public LoginModuleDelegee(UserManager userManager)
-        {
-            super(userManager);
-        }
-    }
-
-    /**
-     * Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform
-     * authentication and role lookup.
-     * <P>
-     * Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR)
-     * is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login
-     * module proxy in login-config.xml.
-     * 
-     * <pre>
-     *  &lt;application-policy name = &quot;sample&quot;&gt;
-     *    &lt;authentication&gt;
-     *      &lt;login-module code = &quot;org.jboss.security.auth.spi.ProxyLoginModule&quot;
-     *        flag = &quot;required&quot;&gt;
-     *        &lt;module-option name = &quot;moduleName&quot;&gt;
-     *          org.apache.jetspeed.appservers.security.jboss.LoginModule
-     *        &lt;/module-option&gt;
-     *        &lt;!-- The name of the security service MBean. Must match
-     *             the name in jboss-service.xml --&gt;
-     *        &lt;module-option name = &quot;securityService&quot;&gt;
-     *          org.apache.jetspeed:service=JetspeedSecurityService         
-     *        &lt;/module-option&gt;
-     *      &lt;/login-module&gt;
-     *    &lt;/authentication&gt;
-     *  &lt;/application-policy&gt;
-     * </pre>
-     */
-    public LoginModule()
-    {
-    }
-
-    private UserManager getUserManager()
-    {
-        try
-        {
-            MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
-            ObjectName serviceName = new ObjectName(securityService);
-            return (UserManager) server.invoke(serviceName, "getUserManager", null, null);
-        }
-        catch (MalformedObjectNameException e)
-        {
-            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
-        }
-        catch (InstanceNotFoundException e)
-        {
-            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
-        }
-        catch (ReflectionException e)
-        {
-            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
-        }
-        catch (MBeanException e)
-        {
-            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
-        }
-    }
-
-    /**
-     * @see javax.security.auth.spi.LoginModule#initialize()
-     */
-    public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
-    {
-        securityService = (String) options.get("securityService");
-        delegee = new LoginModuleDelegee(getUserManager());
-        delegee.initialize(subject, callbackHandler, sharedState, options);
-
-    }
-
-    /** 
-     * @see javax.security.auth.spi.LoginModule#abort()
-     */
-    public boolean abort() throws LoginException
-    {
-        return delegee.abort();
-    }
-
-    /** 
-     * @see javax.security.auth.spi.LoginModule#commit()
-     */
-    public boolean commit() throws LoginException
-    {
-        return delegee.commit();
-    }
-
-    /** 
-     * @see javax.security.auth.spi.LoginModule#login()
-     */
-    public boolean login() throws LoginException
-    {
-        return delegee.login();
-    }
-
-    /** 
-     * @see javax.security.auth.spi.LoginModule#logout()
-     */
-    public boolean logout() throws LoginException
-    {
-        return delegee.logout();
-    }
-}
+/* Copyright 2004 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.appservers.security.jboss;
+
+import java.util.Map;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.ReflectionException;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginException;
+
+import org.apache.jetspeed.security.UserManager;
+import org.apache.jetspeed.security.impl.ext.JBossLoginModule;
+
+/**
+ * A login module that uses the JetspeedSecurityService MBean for authentication and role assignment.
+ */
+public class LoginModule implements javax.security.auth.spi.LoginModule
+{
+
+    private String securityService = null;
+
+    private JBossLoginModule delegee = null;
+
+    /**
+     * Helper for delaying the creation of the JBossLoginModule. We cannot access the security service MBean before
+     * <code>initialize</code> has been called, but need the user manager in the constructor of JBossLoginModule. The
+     * constructor that takes the user manager as argument is protected (and right so), so we need this helper.
+     */
+    private class LoginModuleDelegee extends JBossLoginModule
+    {
+        public LoginModuleDelegee(UserManager userManager)
+        {
+            super(userManager);
+        }
+    }
+
+    /**
+     * Create a new login module. The module looks up the JetspeedSecurityService MBean and uses it to actually perform
+     * authentication and role lookup.
+     * <P>
+     * Note that the MBean must be available when this login module is instantiated. Therefore, if the MBean (the SAR)
+     * is deployed after JBoss has been started, this login module must be created lazily by using the JBoss login
+     * module proxy in login-config.xml.
+     * 
+     * <pre>
+     *  &lt;application-policy name = &quot;sample&quot;&gt;
+     *    &lt;authentication&gt;
+     *      &lt;login-module code = &quot;org.jboss.security.auth.spi.ProxyLoginModule&quot;
+     *        flag = &quot;required&quot;&gt;
+     *        &lt;module-option name = &quot;moduleName&quot;&gt;
+     *          org.apache.jetspeed.appservers.security.jboss.LoginModule
+     *        &lt;/module-option&gt;
+     *        &lt;!-- The name of the security service MBean. Must match
+     *             the name in jboss-service.xml --&gt;
+     *        &lt;module-option name = &quot;securityService&quot;&gt;
+     *          org.apache.jetspeed:service=JetspeedSecurityService         
+     *        &lt;/module-option&gt;
+     *      &lt;/login-module&gt;
+     *    &lt;/authentication&gt;
+     *  &lt;/application-policy&gt;
+     * </pre>
+     */
+    public LoginModule()
+    {
+    }
+
+    private UserManager getUserManager()
+    {
+        try
+        {
+            MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).get(0);
+            ObjectName serviceName = new ObjectName(securityService);
+            return (UserManager) server.invoke(serviceName, "getUserManager", null, null);
+        }
+        catch (MalformedObjectNameException e)
+        {
+            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+        }
+        catch (InstanceNotFoundException e)
+        {
+            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+        }
+        catch (ReflectionException e)
+        {
+            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+        }
+        catch (MBeanException e)
+        {
+            throw (IllegalStateException) ((new IllegalStateException(e.getMessage())).initCause(e));
+        }
+    }
+
+    /**
+     * @see javax.security.auth.spi.LoginModule#initialize()
+     */
+    public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
+    {
+        securityService = (String) options.get("securityService");
+        delegee = new LoginModuleDelegee(getUserManager());
+        delegee.initialize(subject, callbackHandler, sharedState, options);
+
+    }
+
+    /** 
+     * @see javax.security.auth.spi.LoginModule#abort()
+     */
+    public boolean abort() throws LoginException
+    {
+        return delegee.abort();
+    }
+
+    /** 
+     * @see javax.security.auth.spi.LoginModule#commit()
+     */
+    public boolean commit() throws LoginException
+    {
+        return delegee.commit();
+    }
+
+    /** 
+     * @see javax.security.auth.spi.LoginModule#login()
+     */
+    public boolean login() throws LoginException
+    {
+        return delegee.login();
+    }
+
+    /** 
+     * @see javax.security.auth.spi.LoginModule#logout()
+     */
+    public boolean logout() throws LoginException
+    {
+        return delegee.logout();
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message