geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r957816 [5/12] - in /geronimo/samples/branches/3.0-M1: ./ samples/ samples/all-samples/all-samples-jetty/ samples/all-samples/all-samples-tomcat/ samples/daytrader/ samples/daytrader/assemblies/ samples/daytrader/assemblies/javaee/ samples/...
Date Fri, 25 Jun 2010 06:33:49 GMT
Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/pom.xml?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/pom.xml (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/pom.xml Fri Jun 25 06:33:41 2010
@@ -1,82 +1,82 @@
-<?xml version="1.0" encoding="UTF-8"?>
-	<!--
-		Licensed to the Apache Software Foundation (ASF) under one or more
-		contributor license agreements. See the NOTICE file distributed with
-		this work for additional information regarding copyright ownership.
-		The ASF licenses this file to you 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.geronimo.samples</groupId>
-		<artifactId>DataCDInfo</artifactId>
-		<version>3.0-M1-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>DataCDInfo-JTA-ear</artifactId>
-	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EAR</name>
-	<packaging>ear</packaging>
-
-	<description>Geronimo Samples - DataCD Information Management Tool</description>
-
-	<dependencies>
-		
-	<dependency>
-            <groupId>org.apache.geronimo.samples</groupId>
-            <artifactId>DataCDInfo-JTA-war</artifactId>
-            <version>${version}</version>
-            <type>war</type>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.samples</groupId>
-            <artifactId>DataCDInfo-JTA-ejb</artifactId>
-            <version>${version}</version>
-            <type>ejb</type>
-        </dependency>
-	</dependencies>
-
-	<build>
-	<plugins>
-            <plugin>
-                <artifactId>maven-ear-plugin</artifactId>
-                <configuration>
-                    <displayName>Geronimo Sample EAR for DataCDInfo JTA+Struts1</displayName>
-                    <description>Geronimo Sample EAR for DataCDInfo JTA+Struts1</description>
-                    <version>5</version>
-                    <modules>
-                        <ejbModule>
-                            <groupId>org.apache.geronimo.samples</groupId>
-                            <artifactId>DataCDInfo-JTA-ejb</artifactId>
-                            <bundleFileName>DataCDInfo-JTA-ejb.jar</bundleFileName>
-                        </ejbModule>
-
-                        <webModule>
-                            <groupId>org.apache.geronimo.samples</groupId>
-                            <artifactId>DataCDInfo-JTA-war</artifactId>
-                            <contextRoot>/DataCDInfoJTAStruts1</contextRoot>
-                            <bundleFileName>DataCDInfo-JTA-war.war</bundleFileName>
-                        </webModule>
-                    </modules>
-                    <!--
-                    HACK: Include legal muck from maven-remote-resources-plugin
-                    -->
-                    <resourcesDir>${project.build.outputDirectory}</resourcesDir>
-                </configuration>
-            </plugin>
-
-        </plugins>
-	</build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to you 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.geronimo.samples</groupId>
+		<artifactId>DataCDInfo</artifactId>
+		<version>3.0-M1-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>DataCDInfo-JTA-ear</artifactId>
+	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EAR</name>
+	<packaging>ear</packaging>
+
+	<description>Geronimo Samples - DataCD Information Management Tool</description>
+
+	<dependencies>
+		
+	<dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-war</artifactId>
+            <version>${version}</version>
+            <type>war</type>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.samples</groupId>
+            <artifactId>DataCDInfo-JTA-ejb</artifactId>
+            <version>${version}</version>
+            <type>ejb</type>
+        </dependency>
+	</dependencies>
+
+	<build>
+	<plugins>
+            <plugin>
+                <artifactId>maven-ear-plugin</artifactId>
+                <configuration>
+                    <displayName>Geronimo Sample EAR for DataCDInfo JTA+Struts1</displayName>
+                    <description>Geronimo Sample EAR for DataCDInfo JTA+Struts1</description>
+                    <version>5</version>
+                    <modules>
+                        <ejbModule>
+                            <groupId>org.apache.geronimo.samples</groupId>
+                            <artifactId>DataCDInfo-JTA-ejb</artifactId>
+                            <bundleFileName>DataCDInfo-JTA-ejb.jar</bundleFileName>
+                        </ejbModule>
+
+                        <webModule>
+                            <groupId>org.apache.geronimo.samples</groupId>
+                            <artifactId>DataCDInfo-JTA-war</artifactId>
+                            <contextRoot>/DataCDInfoJTAStruts1</contextRoot>
+                            <bundleFileName>DataCDInfo-JTA-war.war</bundleFileName>
+                        </webModule>
+                    </modules>
+                    <!--
+                    HACK: Include legal muck from maven-remote-resources-plugin
+                    -->
+                    <resourcesDir>${project.build.outputDirectory}</resourcesDir>
+                </configuration>
+            </plugin>
+
+        </plugins>
+	</build>
+</project>

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/application.xml Fri Jun 25 06:33:41 2010
@@ -1,30 +1,30 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You 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.
--->
-<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
-  <display-name> 
-${pom.name}</display-name>
-  <module>
-    <web>
-      <web-uri>DataCDInfo-JTA-war.war</web-uri>
-      <context-root>DataCDInfoJTAStruts1</context-root>
-    </web>
-  </module>
-  <module>
-    <ejb>DataCDInfo-JTA-ejb.jar</ejb>
-  </module>
-</application>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
+  <display-name> 
+${pom.name}</display-name>
+  <module>
+    <web>
+      <web-uri>DataCDInfo-JTA-war.war</web-uri>
+      <context-root>DataCDInfoJTAStruts1</context-root>
+    </web>
+  </module>
+  <module>
+    <ejb>DataCDInfo-JTA-ejb.jar</ejb>
+  </module>
+</application>

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application-mysql.xml Fri Jun 25 06:33:41 2010
@@ -1,134 +1,134 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You 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.
--->
-<application application-name="DataCDInfo-JTA"
-	xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
-	<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
-		<dep:moduleId>
-			<dep:groupId>org.apache.geronimo.samples</dep:groupId>
-			<dep:artifactId>DataCDInfoJTA</dep:artifactId>
-			<dep:version>${version}</dep:version>
-			<dep:type>car</dep:type>
-		</dep:moduleId>
-		<dep:dependencies>
-			<dep:dependency>
-				<dep:groupId>mysql</dep:groupId>
-				<dep:artifactId>mysql-connector-java</dep:artifactId>
-				<dep:version>5.1.7</dep:version>
-				<dep:type>jar</dep:type>
-			</dep:dependency>
-		</dep:dependencies>
-	</dep:environment>
-
-	<module>
-		<ejb>DataCDInfo-JTA-ejb.jar</ejb>
-		<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
-			<persistence xmlns="http://java.sun.com/xml/ns/persistence"
-				version="1.0">
-				<persistence-unit name="DataCDInfoUnit">
-					<properties>
-						<property name="openjpa.jdbc.DBDictionary" value="mysql" />
-					</properties>
-				</persistence-unit>
-			</persistence>
-		</openejb-jar>
-	</module>
-
-	<ext-module>
-		<connector>DataCDInfoDataSource</connector>
-		<external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
-			<dep:groupId>org.tranql</dep:groupId>
-			<dep:artifactId>tranql-connector-mysql-xa</dep:artifactId>
-			<dep:type>rar</dep:type>
-		</external-path>
-		<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
-			<resourceadapter>
-				<outbound-resourceadapter>
-					<connection-definition>
-						<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-						<connectiondefinition-instance>
-							<name>jdbc/DataCDInfoDS</name>
-							<config-property-setting name="UserName">cdadmin</config-property-setting>
-							<config-property-setting name="Password">passme</config-property-setting>
-							<config-property-setting name="PortNumber">3306</config-property-setting>
-							<config-property-setting name="ServerName">localhost</config-property-setting>
-							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
-							<connectionmanager>
-								<xa-transaction>
-									<transaction-caching />
-								</xa-transaction>
-								<single-pool>
-									<max-size>100</max-size>
-									<min-size>0</min-size>
-									<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
-									<idle-timeout-minutes>30</idle-timeout-minutes>
-									<match-one />
-								</single-pool>
-							</connectionmanager>
-						</connectiondefinition-instance>
-						<!-- This non-transaction data source is for sequence generation use. Without it,
-						the geronimo will throw exception when persisting entities which require sequence
-						generation. -->
-						<connectiondefinition-instance>
-                            <name>jdbc/NoTxDataCDInfoDS</name>
-                            <config-property-setting name="UserName">cdadmin</config-property-setting>
-							<config-property-setting name="Password">passme</config-property-setting>
-							<config-property-setting name="PortNumber">3306</config-property-setting>
-							<config-property-setting name="ServerName">localhost</config-property-setting>
-							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
-                            <connectionmanager>
-                                <no-transaction/>
-                                <single-pool>
-                                    <max-size>10</max-size>
-                                    <min-size>0</min-size>
-                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
-                                    <idle-timeout-minutes>30</idle-timeout-minutes>
-                                    <match-one/>
-                                </single-pool>
-                            </connectionmanager>
-                        </connectiondefinition-instance>
-					</connection-definition>
-				</outbound-resourceadapter>
-			</resourceadapter>
-		</connector>
-	</ext-module>
-	
-	
-
-  <security xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0">
-    <sec:default-principal>
-      <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="anonymous"/>
-    </sec:default-principal>
-    <sec:role-mappings>
-      <sec:role role-name="admin">
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"/>
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>        
-      </sec:role>
-      <sec:role role-name="superadmin">
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="superadmin"/>
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="superman"/>        
-      </sec:role>
-    </sec:role-mappings>
-  </security>
-	
-	<gbean name="DBInitialization" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
-        <attribute name="path">DataCDInfo_tables_mysql.sql</attribute>
-        <reference name="DataSource">
-            <name>jdbc/NoTxDataCDInfoDS</name>
-        </reference>
-    </gbean>
-</application>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+<application application-name="DataCDInfo-JTA"
+	xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+	<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+		<dep:moduleId>
+			<dep:groupId>org.apache.geronimo.samples</dep:groupId>
+			<dep:artifactId>DataCDInfoJTA</dep:artifactId>
+			<dep:version>${version}</dep:version>
+			<dep:type>car</dep:type>
+		</dep:moduleId>
+		<dep:dependencies>
+			<dep:dependency>
+				<dep:groupId>mysql</dep:groupId>
+				<dep:artifactId>mysql-connector-java</dep:artifactId>
+				<dep:version>5.1.7</dep:version>
+				<dep:type>jar</dep:type>
+			</dep:dependency>
+		</dep:dependencies>
+	</dep:environment>
+
+	<module>
+		<ejb>DataCDInfo-JTA-ejb.jar</ejb>
+		<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
+			<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+				version="1.0">
+				<persistence-unit name="DataCDInfoUnit">
+					<properties>
+						<property name="openjpa.jdbc.DBDictionary" value="mysql" />
+					</properties>
+				</persistence-unit>
+			</persistence>
+		</openejb-jar>
+	</module>
+
+	<ext-module>
+		<connector>DataCDInfoDataSource</connector>
+		<external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+			<dep:groupId>org.tranql</dep:groupId>
+			<dep:artifactId>tranql-connector-mysql-xa</dep:artifactId>
+			<dep:type>rar</dep:type>
+		</external-path>
+		<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
+			<resourceadapter>
+				<outbound-resourceadapter>
+					<connection-definition>
+						<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+						<connectiondefinition-instance>
+							<name>jdbc/DataCDInfoDS</name>
+							<config-property-setting name="UserName">cdadmin</config-property-setting>
+							<config-property-setting name="Password">passme</config-property-setting>
+							<config-property-setting name="PortNumber">3306</config-property-setting>
+							<config-property-setting name="ServerName">localhost</config-property-setting>
+							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
+							<connectionmanager>
+								<xa-transaction>
+									<transaction-caching />
+								</xa-transaction>
+								<single-pool>
+									<max-size>100</max-size>
+									<min-size>0</min-size>
+									<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+									<idle-timeout-minutes>30</idle-timeout-minutes>
+									<match-one />
+								</single-pool>
+							</connectionmanager>
+						</connectiondefinition-instance>
+						<!-- This non-transaction data source is for sequence generation use. Without it,
+						the geronimo will throw exception when persisting entities which require sequence
+						generation. -->
+						<connectiondefinition-instance>
+                            <name>jdbc/NoTxDataCDInfoDS</name>
+                            <config-property-setting name="UserName">cdadmin</config-property-setting>
+							<config-property-setting name="Password">passme</config-property-setting>
+							<config-property-setting name="PortNumber">3306</config-property-setting>
+							<config-property-setting name="ServerName">localhost</config-property-setting>
+							<config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
+                            <connectionmanager>
+                                <no-transaction/>
+                                <single-pool>
+                                    <max-size>10</max-size>
+                                    <min-size>0</min-size>
+                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+                                    <idle-timeout-minutes>30</idle-timeout-minutes>
+                                    <match-one/>
+                                </single-pool>
+                            </connectionmanager>
+                        </connectiondefinition-instance>
+					</connection-definition>
+				</outbound-resourceadapter>
+			</resourceadapter>
+		</connector>
+	</ext-module>
+	
+	
+
+  <security xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0">
+    <sec:default-principal>
+      <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="anonymous"/>
+    </sec:default-principal>
+    <sec:role-mappings>
+      <sec:role role-name="admin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>        
+      </sec:role>
+      <sec:role role-name="superadmin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="superadmin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="superman"/>        
+      </sec:role>
+    </sec:role-mappings>
+  </security>
+	
+	<gbean name="DBInitialization" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
+        <attribute name="path">DataCDInfo_tables_mysql.sql</attribute>
+        <reference name="DataSource">
+            <name>jdbc/NoTxDataCDInfoDS</name>
+        </reference>
+    </gbean>
+</application>

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application.xml?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application.xml (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ear/src/main/resources/META-INF/geronimo-application.xml Fri Jun 25 06:33:41 2010
@@ -1,131 +1,72 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You 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.
--->
-<application application-name="DataCDInfo-JTA"
-	xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
-	<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
-		<dep:moduleId>
-			<dep:groupId>org.apache.geronimo.samples</dep:groupId>
-			<dep:artifactId>DataCDInfoJTA</dep:artifactId>
-			<dep:version>${version}</dep:version>
-			<dep:type>car</dep:type>
-		</dep:moduleId>
-		<dep:dependencies>
-			<dep:dependency>
-				<dep:groupId>org.apache.geronimo.configs</dep:groupId>
-                		<dep:artifactId>system-database</dep:artifactId>
-                		<dep:type>car</dep:type>
-			</dep:dependency>
-		</dep:dependencies>
-	</dep:environment>
-
-	<module>
-		<ejb>DataCDInfo-JTA-ejb.jar</ejb>
-		<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
-			<persistence xmlns="http://java.sun.com/xml/ns/persistence"
-				version="1.0">
-				<persistence-unit name="DataCDInfoUnit">
-					<properties>
-						<property name="openjpa.jdbc.DBDictionary" value="derby" />
-					</properties>
-				</persistence-unit>
-			</persistence>
-		</openejb-jar>
-	</module>
-
-	<ext-module>
-		<connector>DataCDInfoDataSource</connector>
-		<external-path xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
-			<dep:groupId>org.tranql</dep:groupId>
-			<dep:artifactId>tranql-connector-derby-embed-xa</dep:artifactId>
-			<dep:type>rar</dep:type>
-		</external-path>
-		<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">
-			<resourceadapter>
-				<outbound-resourceadapter>
-					<connection-definition>
-						<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-						<connectiondefinition-instance>
-							<name>jdbc/DataCDInfoDS</name>
-							<config-property-setting name="UserName"></config-property-setting>
-                            <config-property-setting name="Password"></config-property-setting>
-                            <config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
-                            <config-property-setting name="CreateDatabase">true</config-property-setting>
-							<connectionmanager>
-								<xa-transaction>
-									<transaction-caching />
-								</xa-transaction>
-								<single-pool>
-									<max-size>100</max-size>
-									<min-size>0</min-size>
-									<blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
-									<idle-timeout-minutes>30</idle-timeout-minutes>
-									<match-one />
-								</single-pool>
-							</connectionmanager>
-						</connectiondefinition-instance>
-						<!-- This non-transaction data source is for sequence generation use. Without it,
-						the geronimo will throw exception when persisting entities which require sequence
-						generation. -->
-						<connectiondefinition-instance>
-                            <name>jdbc/NoTxDataCDInfoDS</name>
-                            <config-property-setting name="UserName"></config-property-setting>
-                            <config-property-setting name="Password"></config-property-setting>
-                            <config-property-setting name="DatabaseName">cdinfodb</config-property-setting>
-                            <config-property-setting name="CreateDatabase">true</config-property-setting>
-                            <connectionmanager>
-                                <no-transaction/>
-                                <single-pool>
-                                    <max-size>10</max-size>
-                                    <min-size>0</min-size>
-                                    <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
-                                    <idle-timeout-minutes>30</idle-timeout-minutes>
-                                    <match-one/>
-                                </single-pool>
-                            </connectionmanager>
-                        </connectiondefinition-instance>
-					</connection-definition>
-				</outbound-resourceadapter>
-			</resourceadapter>
-		</connector>
-	</ext-module>
-	
-	
-
-  <security xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0">
-    <sec:default-principal>
-      <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="anonymous"/>
-    </sec:default-principal>
-    <sec:role-mappings>
-      <sec:role role-name="admin">
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"/>
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>        
-      </sec:role>
-      <sec:role role-name="superadmin">
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="superadmin"/>
-        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="superman"/>        
-      </sec:role>
-    </sec:role-mappings>
-  </security>
-	
-	<gbean name="DBInitialization" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
-        <attribute name="path">DataCDInfo_tables_derby.sql</attribute>
-        <reference name="DataSource">
-            <name>jdbc/NoTxDataCDInfoDS</name>
-        </reference>
-    </gbean>
-</application>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You 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.
+-->
+<application application-name="DataCDInfo-JTA"
+	xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-2.0">
+	<dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
+		<dep:moduleId>
+			<dep:groupId>${project.groupId}</dep:groupId>
+			<dep:artifactId>${project.artifactId}</dep:artifactId>
+			<dep:version>${project.version}</dep:version>
+			<dep:type>car</dep:type>
+		</dep:moduleId>
+		<dep:dependencies>
+			<dep:dependency>
+				<dep:groupId>org.apache.geronimo.samples</dep:groupId>
+                		<dep:artifactId>sample-datasource</dep:artifactId>
+                		<dep:type>car</dep:type>
+			</dep:dependency>
+		</dep:dependencies>
+	</dep:environment>
+
+	<module>
+		<ejb>DataCDInfo-JTA-ejb.jar</ejb>
+		<openejb-jar xmlns="http://openejb.apache.org/xml/ns/openejb-jar-2.2">
+			<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+				version="1.0">
+				<persistence-unit name="DataCDInfoUnit">
+					<properties>
+						<property name="openjpa.jdbc.DBDictionary" value="derby" />
+					</properties>
+				</persistence-unit>
+			</persistence>
+		</openejb-jar>
+	</module>
+
+  <security xmlns:sec="http://geronimo.apache.org/xml/ns/security-2.0">
+    <sec:default-principal>
+      <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="anonymous"/>
+    </sec:default-principal>
+    <sec:role-mappings>
+      <sec:role role-name="admin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>        
+      </sec:role>
+      <sec:role role-name="superadmin">
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="superadmin"/>
+        <sec:principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="superman"/>        
+      </sec:role>
+    </sec:role-mappings>
+  </security>
+	
+	<gbean name="DBInitialization" class="org.apache.geronimo.connector.wrapper.DatabaseInitializationGBean">
+        <attribute name="path">DataCDInfo_tables_derby.sql</attribute>
+        <reference name="DataSource">
+            <name>SampleNoTxDatasource</name>
+        </reference>
+    </gbean>
+</application>

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/pom.xml Fri Jun 25 06:33:41 2010
@@ -1,60 +1,60 @@
-<?xml version="1.0" encoding="UTF-8"?>
-	<!--
-		Licensed to the Apache Software Foundation (ASF) under one or more
-		contributor license agreements. See the NOTICE file distributed with
-		this work for additional information regarding copyright ownership.
-		The ASF licenses this file to you 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-	<modelVersion>4.0.0</modelVersion>
-
-	<parent>
-		<groupId>org.apache.geronimo.samples</groupId>
-		<artifactId>DataCDInfo</artifactId>
-		<version>3.0-M1-SNAPSHOT</version>
-	</parent>
-
-	<artifactId>DataCDInfo-JTA-ejb</artifactId>
-	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EJB</name>
-	<packaging>jar</packaging>
-
-	<description>Geronimo Samples - DataCD Information Management Tool</description>
-
-	<dependencies>	
-		
-		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-annotation_1.0_spec</artifactId>
-			<scope>provided</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-ejb_3.0_spec</artifactId>
-			<scope>provided</scope>
-		</dependency>
-
-		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-jpa_1.0_spec</artifactId>
-			<scope>provided</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.geronimo.specs</groupId>
-			<artifactId>geronimo-jta_1.1_spec</artifactId>
-			<scope>provided</scope>
-		</dependency>
-	</dependencies>
-	
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+	<!--
+		Licensed to the Apache Software Foundation (ASF) under one or more
+		contributor license agreements. See the NOTICE file distributed with
+		this work for additional information regarding copyright ownership.
+		The ASF licenses this file to you 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.geronimo.samples</groupId>
+		<artifactId>DataCDInfo</artifactId>
+		<version>3.0-M1-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>DataCDInfo-JTA-ejb</artifactId>
+	<name>Geronimo Samples :: DataCDInfo JTA + Struts1 :: EJB</name>
+	<packaging>jar</packaging>
+
+	<description>Geronimo Samples - DataCD Information Management Tool</description>
+
+	<dependencies>	
+		
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-annotation_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-ejb_3.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jpa_2.0_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.geronimo.specs</groupId>
+			<artifactId>geronimo-jta_1.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+	
+</project>

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/DataCDBean.java Fri Jun 25 06:33:41 2010
@@ -1,131 +1,131 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.beans;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.persistence.*;
-
-/**
- * Demo how to code JPA entity bean, including various JPA annotations:
- * NamedQueries, Id, JoinColumn
- * 
- *
- */
-
-@Entity(name="DataCD")
-@Table(name="DATACD_TABLE")
-@NamedQueries( {        
-   @NamedQuery(name = "DataCD.findByOwnerId", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername"),
-   @NamedQuery(name = "DataCD.findByOwnerIdandCDLabel", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername and cd.cdLabel = :cdlabel"),
-   @NamedQuery(name = "DataCD.deleteByOwnerId", query = "DELETE FROM DataCD cd WHERE cd.owner.username = :ownername"),
-   @NamedQuery(name = "DataCD.getAllCDs", query = "SELECT cd FROM DataCD cd")
-})
-public class DataCDBean implements Serializable{
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -7665259395127908808L;
-	@Id
-	@Column(name = "CDID")
-	@GeneratedValue(strategy=GenerationType.AUTO)
-	private Integer cdID;
-	
-	@JoinColumn(name = "OWNER_USERNAME")
-	@ManyToOne(fetch=FetchType.EAGER, optional=false)
-	private OwnerBean owner;
-	
-	@Column(name = "CDLABEL", nullable=false)
-	private String cdLabel;
-	
-	@Column(name = "CDDESC")
-	private String cdDescription;
-	
-	@Column(name = "CDARCHIVEDATE")
-	private Date cdArchiveDate;
-	
-	@Column(name = "CDSIZE")
-	private Integer cdSize;
-	
-	public DataCDBean(){
-		
-	}
-	
-	public DataCDBean(Integer cdID, String cdLabel,
-			String cdDescription, Date cdArchiveDate, Integer cdSize) {
-		super();
-		this.cdID = cdID;
-		this.cdLabel = cdLabel;
-		this.cdDescription = cdDescription;
-		this.cdArchiveDate = cdArchiveDate;
-		this.cdSize = cdSize;
-	}
-	
-	public String toString(){
-		return "[cdID:" + this.getCdID()
-				+ " cdLabel:" + this.getCdLabel()
-				+ " cdDescription:" + this.getCdDescription()
-				+ " cdArchiveDate:" + this.getCdArchiveDate().toString()
-				+ " cdSize:" + this.getCdSize()
-				+ " Owner:" + this.getOwner().getUsername()
-				+ "]";
-		
-	}
-	public Integer getCdID() {
-		return cdID;
-	}
-	public void setCdID(Integer cdID) {
-		this.cdID = cdID;
-	}
-	public OwnerBean getOwner() {
-		return owner;
-	}
-	public void setOwner(OwnerBean owner) {
-		this.owner = owner;
-	}
-	public String getCdLabel() {
-		return cdLabel;
-	}
-	public void setCdLabel(String cdLabel) {
-		this.cdLabel = cdLabel;
-	}
-	public String getCdDescription() {
-		return cdDescription;
-	}
-	public void setCdDescription(String cdDescription) {
-		this.cdDescription = cdDescription;
-	}
-	public Date getCdArchiveDate() {
-		return cdArchiveDate;
-	}
-	public void setCdArchiveDate(Date cdArchiveDate) {
-		this.cdArchiveDate = cdArchiveDate;
-	}
-	public Integer getCdSize() {
-		return cdSize;
-	}
-	public void setCdSize(Integer cdSize) {
-		this.cdSize = cdSize;
-	}
-	
-	
-	
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.beans;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import javax.persistence.*;
+
+/**
+ * Demo how to code JPA entity bean, including various JPA annotations:
+ * NamedQueries, Id, JoinColumn
+ * 
+ *
+ */
+
+@Entity(name="DataCD")
+@Table(name="DATACD_TABLE")
+@NamedQueries( {        
+   @NamedQuery(name = "DataCD.findByOwnerId", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername"),
+   @NamedQuery(name = "DataCD.findByOwnerIdandCDLabel", query = "SELECT cd FROM DataCD cd WHERE cd.owner.username = :ownername and cd.cdLabel = :cdlabel"),
+   @NamedQuery(name = "DataCD.deleteByOwnerId", query = "DELETE FROM DataCD cd WHERE cd.owner.username = :ownername"),
+   @NamedQuery(name = "DataCD.getAllCDs", query = "SELECT cd FROM DataCD cd")
+})
+public class DataCDBean implements Serializable{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7665259395127908808L;
+	@Id
+	@Column(name = "CDID")
+	@GeneratedValue(strategy=GenerationType.AUTO)
+	private Integer cdID;
+	
+	@JoinColumn(name = "OWNER_USERNAME")
+	@ManyToOne(fetch=FetchType.EAGER, optional=false)
+	private OwnerBean owner;
+	
+	@Column(name = "CDLABEL", nullable=false)
+	private String cdLabel;
+	
+	@Column(name = "CDDESC")
+	private String cdDescription;
+	
+	@Column(name = "CDARCHIVEDATE")
+	private Date cdArchiveDate;
+	
+	@Column(name = "CDSIZE")
+	private Integer cdSize;
+	
+	public DataCDBean(){
+		
+	}
+	
+	public DataCDBean(Integer cdID, String cdLabel,
+			String cdDescription, Date cdArchiveDate, Integer cdSize) {
+		super();
+		this.cdID = cdID;
+		this.cdLabel = cdLabel;
+		this.cdDescription = cdDescription;
+		this.cdArchiveDate = cdArchiveDate;
+		this.cdSize = cdSize;
+	}
+	
+	public String toString(){
+		return "[cdID:" + this.getCdID()
+				+ " cdLabel:" + this.getCdLabel()
+				+ " cdDescription:" + this.getCdDescription()
+				+ " cdArchiveDate:" + this.getCdArchiveDate().toString()
+				+ " cdSize:" + this.getCdSize()
+				+ " Owner:" + this.getOwner().getUsername()
+				+ "]";
+		
+	}
+	public Integer getCdID() {
+		return cdID;
+	}
+	public void setCdID(Integer cdID) {
+		this.cdID = cdID;
+	}
+	public OwnerBean getOwner() {
+		return owner;
+	}
+	public void setOwner(OwnerBean owner) {
+		this.owner = owner;
+	}
+	public String getCdLabel() {
+		return cdLabel;
+	}
+	public void setCdLabel(String cdLabel) {
+		this.cdLabel = cdLabel;
+	}
+	public String getCdDescription() {
+		return cdDescription;
+	}
+	public void setCdDescription(String cdDescription) {
+		this.cdDescription = cdDescription;
+	}
+	public Date getCdArchiveDate() {
+		return cdArchiveDate;
+	}
+	public void setCdArchiveDate(Date cdArchiveDate) {
+		this.cdArchiveDate = cdArchiveDate;
+	}
+	public Integer getCdSize() {
+		return cdSize;
+	}
+	public void setCdSize(Integer cdSize) {
+		this.cdSize = cdSize;
+	}
+	
+	
+	
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/OwnerBean.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/OwnerBean.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/OwnerBean.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/beans/OwnerBean.java Fri Jun 25 06:33:41 2010
@@ -1,90 +1,90 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.beans;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-import javax.persistence.*;
-
-/**
- * Demo how to code JPA entity bean, including various JPA annotations.
- * 
- *
- */
-
-@Entity(name="Owner")
-@Table(name = "OWNER_TABLE")
-public class OwnerBean implements Serializable {
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -7231801785238251943L;
-	
-	
-	@Id
-	@Column(name = "USERNAME", length=20)
-	private String username;
-	
-	@Column(name = "PASSWORD", nullable=false, length=20)
-	private String password;
-	
-	@OneToMany(mappedBy= "owner", 
-			fetch=FetchType.LAZY,
-			cascade=CascadeType.ALL)	
-	@OrderBy("cdArchiveDate DESC")
-	private Collection<DataCDBean> DataCDs;
-	
-	public OwnerBean(){
-		
-	}
-	
-	public OwnerBean(String userName, String password) {
-		super();
-		this.username = userName;
-		this.password = password;
-	}
-	
-	public String toString(){
-		return "username:" + getUsername()
-				+ "\n password:" + getPassword();
-	}
-	
-	public String getUsername() {
-		return username;
-	}
-	public void setUsername(String userName) {
-		this.username = userName;
-	}
-	public String getPassword() {
-		return password;
-	}
-	public void setPassword(String password) {
-		this.password = password;
-	}
-
-	public void setDataCDs(Collection<DataCDBean> dataCDs) {
-		this.DataCDs = dataCDs;
-	}
-
-	public Collection<DataCDBean> getDataCDs() {
-		return DataCDs;
-	}
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.beans;
+
+import java.io.Serializable;
+import java.util.Collection;
+
+import javax.persistence.*;
+
+/**
+ * Demo how to code JPA entity bean, including various JPA annotations.
+ * 
+ *
+ */
+
+@Entity(name="Owner")
+@Table(name = "OWNER_TABLE")
+public class OwnerBean implements Serializable {
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -7231801785238251943L;
+	
+	
+	@Id
+	@Column(name = "USERNAME", length=20)
+	private String username;
+	
+	@Column(name = "PASSWORD", nullable=false, length=20)
+	private String password;
+	
+	@OneToMany(mappedBy= "owner", 
+			fetch=FetchType.LAZY,
+			cascade=CascadeType.ALL)	
+	@OrderBy("cdArchiveDate DESC")
+	private Collection<DataCDBean> DataCDs;
+	
+	public OwnerBean(){
+		
+	}
+	
+	public OwnerBean(String userName, String password) {
+		super();
+		this.username = userName;
+		this.password = password;
+	}
+	
+	public String toString(){
+		return "username:" + getUsername()
+				+ "\n password:" + getPassword();
+	}
+	
+	public String getUsername() {
+		return username;
+	}
+	public void setUsername(String userName) {
+		this.username = userName;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public void setDataCDs(Collection<DataCDBean> dataCDs) {
+		this.DataCDs = dataCDs;
+	}
+
+	public Collection<DataCDBean> getDataCDs() {
+		return DataCDs;
+	}
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdmin.java Fri Jun 25 06:33:41 2010
@@ -1,89 +1,89 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.core;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateful;
-
-import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
-import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-
-/**
- * Session Bean implementation class DataCDInfoAdmin
- * 
- * Demo how to use security annotations and container-managed extended-scoped persistence context,
- * and using JTA transaction.
- */
-//@Stateful(name="ejb/DataCDInfoAdmin")
-@Stateful
-public class DataCDInfoAdmin implements DataCDInfoAdminLocal {
-	
-	@PersistenceContext(unitName="DataCDInfoUnit", type = PersistenceContextType.EXTENDED)	
-	private EntityManager em;
-
-    /**
-     * Default constructor. 
-     */
-    public DataCDInfoAdmin() {
-        // do nothing
-    }
-    
-    @RolesAllowed("superadmin")
-	public String findpasswd(String username) {
-		OwnerBean owner = em.find(OwnerBean.class, username);
-		String passwd = owner.getPassword();
-		return passwd;
-	}
-    
-	@RolesAllowed("superadmin")
-	public String[] listAllDataCDs() {
-		ArrayList<String> allcdstring = new ArrayList<String>();
-		Query query = em.createNamedQuery("DataCD.getAllCDs");
-		List<DataCDBean> allcds = query.getResultList();
-		for (DataCDBean cd : allcds){
-			allcdstring.add(cd.toString());
-		}
-		
-		String[] result = allcdstring.toArray(new String[0]);
-		return result;
-	}
-	
-	@RolesAllowed({"admin","superadmin"})
-	public String[] listOwners() {
-		ArrayList<String> allusers = new ArrayList<String>();
-		List<Object> owners = new ArrayList<Object>();
-		Query query = em.createNativeQuery("SELECT USERNAME FROM OWNER_TABLE");
-		owners = query.getResultList(); 
-		for (Object owner : owners ) {
-			String ownername = owner.toString();
-			allusers.add(ownername);
-		}
-		String[] result = allusers.toArray(new String[0]);
-		return result;
-	}
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.core;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateful;
+
+import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
+import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+/**
+ * Session Bean implementation class DataCDInfoAdmin
+ * 
+ * Demo how to use security annotations and container-managed extended-scoped persistence context,
+ * and using JTA transaction.
+ */
+//@Stateful(name="ejb/DataCDInfoAdmin")
+@Stateful
+public class DataCDInfoAdmin implements DataCDInfoAdminLocal {
+	
+	@PersistenceContext(unitName="DataCDInfoUnit", type = PersistenceContextType.EXTENDED)	
+	private EntityManager em;
+
+    /**
+     * Default constructor. 
+     */
+    public DataCDInfoAdmin() {
+        // do nothing
+    }
+    
+    @RolesAllowed("superadmin")
+	public String findpasswd(String username) {
+		OwnerBean owner = em.find(OwnerBean.class, username);
+		String passwd = owner.getPassword();
+		return passwd;
+	}
+    
+	@RolesAllowed("superadmin")
+	public String[] listAllDataCDs() {
+		ArrayList<String> allcdstring = new ArrayList<String>();
+		Query query = em.createNamedQuery("DataCD.getAllCDs");
+		List<DataCDBean> allcds = query.getResultList();
+		for (DataCDBean cd : allcds){
+			allcdstring.add(cd.toString());
+		}
+		
+		String[] result = allcdstring.toArray(new String[0]);
+		return result;
+	}
+	
+	@RolesAllowed({"admin","superadmin"})
+	public String[] listOwners() {
+		ArrayList<String> allusers = new ArrayList<String>();
+		List<Object> owners = new ArrayList<Object>();
+		Query query = em.createNativeQuery("SELECT USERNAME FROM OWNER_TABLE");
+		owners = query.getResultList(); 
+		for (Object owner : owners ) {
+			String ownername = owner.toString();
+			allusers.add(ownername);
+		}
+		String[] result = allusers.toArray(new String[0]);
+		return result;
+	}
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdminLocal.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdminLocal.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdminLocal.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoAdminLocal.java Fri Jun 25 06:33:41 2010
@@ -1,29 +1,29 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.core;
-
-import javax.ejb.Local;
-
-@Local
-public interface DataCDInfoAdminLocal {	
-	public String[] listOwners();	
-	public String findpasswd(String username);
-	public String[] listAllDataCDs();
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.core;
+
+import javax.ejb.Local;
+
+@Local
+public interface DataCDInfoAdminLocal {	
+	public String[] listOwners();	
+	public String findpasswd(String username);
+	public String[] listAllDataCDs();
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoJTAImpl.java Fri Jun 25 06:33:41 2010
@@ -1,227 +1,227 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.core;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Iterator;
-
-import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
-import javax.ejb.TransactionManagement;
-import javax.ejb.TransactionManagementType;
-import javax.ejb.Local;
-import javax.ejb.Remote;
-
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContextType;
-import javax.persistence.Query;
-import javax.persistence.PersistenceContext;
-
-import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
-import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
-import org.apache.geronimo.samples.datacdinfo.exceptions.DuplicatedDataCDException;
-import org.apache.geronimo.samples.datacdinfo.exceptions.IncorrectPasswordException;
-import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidOwnerException;
-import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidPasswordException;
-
-/**
- * 
- * Demo how to use container-managed transaction-scoped persistence context with JTA transaction.
- * 
- */
-@Stateless(name="ejb/DataCDInfoJTAImpl")
-@Remote(DataCDInfoRemote.class)
-@Local(DataCDInfoLocal.class)
-@TransactionAttribute(TransactionAttributeType.REQUIRED)
-@TransactionManagement(TransactionManagementType.CONTAINER)
-public class DataCDInfoJTAImpl implements DataCDInfoLocal, DataCDInfoRemote {
-
-	@PersistenceContext(unitName = "DataCDInfoUnit", type = PersistenceContextType.TRANSACTION)
-	private EntityManager em;
-
-	public DataCDInfoJTAImpl() {
-		// do nothing
-	}
-
-	public OwnerBean login(String username, String passwd)
-			throws InvalidOwnerException, IncorrectPasswordException {
-		// check if the owner is registered
-		OwnerBean owner = em.find(OwnerBean.class, username);
-		if (owner == null) {
-			String error = "No such user: " + username + "!";
-			throw new InvalidOwnerException(error);
-		}
-
-		if (!passwd.equals(owner.getPassword())) {
-			String error = "Incorrect password!";
-			throw new IncorrectPasswordException(error);
-		}
-
-		// Load CDs to cache
-		populateCDs(owner);
-
-		return owner;
-	}
-
-	public void logout(String username) {
-		// do nothing
-
-	}
-
-	public OwnerBean register(String username, String passwd)
-			throws InvalidOwnerException, InvalidPasswordException {
-
-		OwnerBean user = em.find(OwnerBean.class, username);
-		if (user != null) {
-			String error = "Can not register existing user:" + username;
-			throw new InvalidOwnerException(error);
-		}
-
-		if (passwd.length() < 6) {
-			String error = "Invalid password:" + passwd
-					+ ". Password must be at least 6 chars";
-			throw new InvalidPasswordException(error);
-		}
-
-		OwnerBean newuser = new OwnerBean(username, passwd);
-		try {
-			em.persist(newuser);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		return newuser;
-	}
-
-	public boolean unregister(String username) {
-
-		// Delete owner as well as cascadely deleting CDs owned by the owner.
-		OwnerBean deluser = em.find(OwnerBean.class, username.toLowerCase());
-		populateCDs(deluser);
-		try {
-			em.remove(deluser);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		return true;
-	}
-
-	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize,
-			String cddesc, Date cdarchivedate)
-			throws DuplicatedDataCDException, InvalidOwnerException {
-
-		DataCDBean newcd = new DataCDBean();
-
-		Query query = em.createNamedQuery("DataCD.findByOwnerIdandCDLabel");
-		query.setParameter("ownername", ownername.toLowerCase());
-		query.setParameter("cdlabel", cdlabel);
-		Collection<DataCDBean> cd = query.getResultList();
-
-		Iterator<DataCDBean> itr = cd.iterator();
-
-		if (!itr.hasNext()) {
-
-			newcd.setCdArchiveDate(cdarchivedate);
-			newcd.setCdDescription(cddesc);
-			newcd.setCdLabel(cdlabel);
-			newcd.setCdSize(cdsize);
-
-			OwnerBean theowner = em.find(OwnerBean.class, ownername
-					.toLowerCase());
-			newcd.setOwner(theowner);
-
-			try {
-				em.persist(newcd);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-
-		} else {
-			newcd = null;
-		}
-
-		return newcd;
-	}
-
-	public Collection<DataCDBean> listCDs(String ownername) {
-
-		OwnerBean owner = em.find(OwnerBean.class, ownername);
-		Query query = em.createNamedQuery("DataCD.findByOwnerId");
-		query.setParameter("ownername", owner.getUsername());
-		Collection<DataCDBean> cds = query.getResultList();
-		if (cds == null) {
-			cds = new ArrayList<DataCDBean>();
-		}
-		return cds;
-	}
-
-	public boolean removeCD(Integer cdid) {
-		boolean success = false;
-
-		DataCDBean datacd = em.find(DataCDBean.class, cdid);
-		if (datacd != null) {
-			try {
-				em.remove(datacd);
-				success = true;
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-
-		return success;
-	}
-
-	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc,
-			Date cdarchivedate) {
-
-		DataCDBean datacd = em.find(DataCDBean.class, cdid);
-		if (datacd != null) {
-			datacd.setCdArchiveDate(cdarchivedate);
-			datacd.setCdDescription(cddesc);
-			datacd.setCdSize(cdsize);
-			try {
-				em.persist(datacd);
-			} catch (Exception e) {
-				e.printStackTrace();
-			}
-		}
-		return datacd;
-	}
-
-	public OwnerBean refreshCDInfo(String ownername) {
-		OwnerBean owner = null;
-		owner = em.find(OwnerBean.class, ownername);
-		if (owner != null) {
-			populateCDs(owner);
-		}
-		return owner;
-	}
-
-	private void populateCDs(OwnerBean owner) {
-		Collection<DataCDBean> ownedcds = owner.getDataCDs();
-		Iterator<DataCDBean> itr = ownedcds.iterator();
-		while (itr.hasNext()) {
-			((DataCDBean) itr.next()).getCdLabel();
-		}
-	}
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.core;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.ejb.Stateless;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+import javax.ejb.Local;
+import javax.ejb.Remote;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContextType;
+import javax.persistence.Query;
+import javax.persistence.PersistenceContext;
+
+import org.apache.geronimo.samples.datacdinfo.beans.DataCDBean;
+import org.apache.geronimo.samples.datacdinfo.beans.OwnerBean;
+import org.apache.geronimo.samples.datacdinfo.exceptions.DuplicatedDataCDException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.IncorrectPasswordException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidOwnerException;
+import org.apache.geronimo.samples.datacdinfo.exceptions.InvalidPasswordException;
+
+/**
+ * 
+ * Demo how to use container-managed transaction-scoped persistence context with JTA transaction.
+ * 
+ */
+@Stateless(name="ejb/DataCDInfoJTAImpl")
+@Remote(DataCDInfoRemote.class)
+@Local(DataCDInfoLocal.class)
+@TransactionAttribute(TransactionAttributeType.REQUIRED)
+@TransactionManagement(TransactionManagementType.CONTAINER)
+public class DataCDInfoJTAImpl implements DataCDInfoLocal, DataCDInfoRemote {
+
+	@PersistenceContext(unitName = "DataCDInfoUnit", type = PersistenceContextType.TRANSACTION)
+	private EntityManager em;
+
+	public DataCDInfoJTAImpl() {
+		// do nothing
+	}
+
+	public OwnerBean login(String username, String passwd)
+			throws InvalidOwnerException, IncorrectPasswordException {
+		// check if the owner is registered
+		OwnerBean owner = em.find(OwnerBean.class, username);
+		if (owner == null) {
+			String error = "No such user: " + username + "!";
+			throw new InvalidOwnerException(error);
+		}
+
+		if (!passwd.equals(owner.getPassword())) {
+			String error = "Incorrect password!";
+			throw new IncorrectPasswordException(error);
+		}
+
+		// Load CDs to cache
+		populateCDs(owner);
+
+		return owner;
+	}
+
+	public void logout(String username) {
+		// do nothing
+
+	}
+
+	public OwnerBean register(String username, String passwd)
+			throws InvalidOwnerException, InvalidPasswordException {
+
+		OwnerBean user = em.find(OwnerBean.class, username);
+		if (user != null) {
+			String error = "Can not register existing user:" + username;
+			throw new InvalidOwnerException(error);
+		}
+
+		if (passwd.length() < 6) {
+			String error = "Invalid password:" + passwd
+					+ ". Password must be at least 6 chars";
+			throw new InvalidPasswordException(error);
+		}
+
+		OwnerBean newuser = new OwnerBean(username, passwd);
+		try {
+			em.persist(newuser);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+		return newuser;
+	}
+
+	public boolean unregister(String username) {
+
+		// Delete owner as well as cascadely deleting CDs owned by the owner.
+		OwnerBean deluser = em.find(OwnerBean.class, username.toLowerCase());
+		populateCDs(deluser);
+		try {
+			em.remove(deluser);
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return true;
+	}
+
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize,
+			String cddesc, Date cdarchivedate)
+			throws DuplicatedDataCDException, InvalidOwnerException {
+
+		DataCDBean newcd = new DataCDBean();
+
+		Query query = em.createNamedQuery("DataCD.findByOwnerIdandCDLabel");
+		query.setParameter("ownername", ownername.toLowerCase());
+		query.setParameter("cdlabel", cdlabel);
+		Collection<DataCDBean> cd = query.getResultList();
+
+		Iterator<DataCDBean> itr = cd.iterator();
+
+		if (!itr.hasNext()) {
+
+			newcd.setCdArchiveDate(cdarchivedate);
+			newcd.setCdDescription(cddesc);
+			newcd.setCdLabel(cdlabel);
+			newcd.setCdSize(cdsize);
+
+			OwnerBean theowner = em.find(OwnerBean.class, ownername
+					.toLowerCase());
+			newcd.setOwner(theowner);
+
+			try {
+				em.persist(newcd);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+
+		} else {
+			newcd = null;
+		}
+
+		return newcd;
+	}
+
+	public Collection<DataCDBean> listCDs(String ownername) {
+
+		OwnerBean owner = em.find(OwnerBean.class, ownername);
+		Query query = em.createNamedQuery("DataCD.findByOwnerId");
+		query.setParameter("ownername", owner.getUsername());
+		Collection<DataCDBean> cds = query.getResultList();
+		if (cds == null) {
+			cds = new ArrayList<DataCDBean>();
+		}
+		return cds;
+	}
+
+	public boolean removeCD(Integer cdid) {
+		boolean success = false;
+
+		DataCDBean datacd = em.find(DataCDBean.class, cdid);
+		if (datacd != null) {
+			try {
+				em.remove(datacd);
+				success = true;
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+
+		return success;
+	}
+
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc,
+			Date cdarchivedate) {
+
+		DataCDBean datacd = em.find(DataCDBean.class, cdid);
+		if (datacd != null) {
+			datacd.setCdArchiveDate(cdarchivedate);
+			datacd.setCdDescription(cddesc);
+			datacd.setCdSize(cdsize);
+			try {
+				em.persist(datacd);
+			} catch (Exception e) {
+				e.printStackTrace();
+			}
+		}
+		return datacd;
+	}
+
+	public OwnerBean refreshCDInfo(String ownername) {
+		OwnerBean owner = null;
+		owner = em.find(OwnerBean.class, ownername);
+		if (owner != null) {
+			populateCDs(owner);
+		}
+		return owner;
+	}
+
+	private void populateCDs(OwnerBean owner) {
+		Collection<DataCDBean> ownedcds = owner.getDataCDs();
+		Iterator<DataCDBean> itr = ownedcds.iterator();
+		while (itr.hasNext()) {
+			((DataCDBean) itr.next()).getCdLabel();
+		}
+	}
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoLocal.java Fri Jun 25 06:33:41 2010
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.core;
-
-import java.util.Collection;
-import java.util.Date;
-
-import javax.ejb.Local;
-
-import org.apache.geronimo.samples.datacdinfo.beans.*;
-import org.apache.geronimo.samples.datacdinfo.exceptions.*;
-
-@Local
-public interface DataCDInfoLocal {
-	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
-	public void logout(String username);
-	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
-	public boolean unregister(String username);
-	
-	public Collection<DataCDBean> listCDs(String ownername);
-	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
-	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
-	public boolean removeCD(Integer cdid);
-	public OwnerBean refreshCDInfo(String ownername);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.core;
+
+import java.util.Collection;
+import java.util.Date;
+
+import javax.ejb.Local;
+
+import org.apache.geronimo.samples.datacdinfo.beans.*;
+import org.apache.geronimo.samples.datacdinfo.exceptions.*;
+
+@Local
+public interface DataCDInfoLocal {
+	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
+	public void logout(String username);
+	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
+	public boolean unregister(String username);
+	
+	public Collection<DataCDBean> listCDs(String ownername);
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
+	public boolean removeCD(Integer cdid);
+	public OwnerBean refreshCDInfo(String ownername);
+
+}

Modified: geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java?rev=957816&r1=957815&r2=957816&view=diff
==============================================================================
--- geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java (original)
+++ geronimo/samples/branches/3.0-M1/samples/javaee5/DataCDInfo/DataCDInfo-JTA-ejb/src/main/java/org/apache/geronimo/samples/datacdinfo/core/DataCDInfoRemote.java Fri Jun 25 06:33:41 2010
@@ -1,42 +1,42 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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.geronimo.samples.datacdinfo.core;
-
-import java.util.Collection;
-import java.util.Date;
-
-import javax.ejb.Remote;
-
-import org.apache.geronimo.samples.datacdinfo.beans.*;
-import org.apache.geronimo.samples.datacdinfo.exceptions.*;
-
-@Remote
-public interface DataCDInfoRemote {
-	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
-	public void logout(String username);
-	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
-	public boolean unregister(String username);
-	
-	public Collection<DataCDBean> listCDs(String ownername);
-	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
-	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
-	public boolean removeCD(Integer cdid);
-	public OwnerBean refreshCDInfo(String ownername);
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.samples.datacdinfo.core;
+
+import java.util.Collection;
+import java.util.Date;
+
+import javax.ejb.Remote;
+
+import org.apache.geronimo.samples.datacdinfo.beans.*;
+import org.apache.geronimo.samples.datacdinfo.exceptions.*;
+
+@Remote
+public interface DataCDInfoRemote {
+	public OwnerBean login(String username, String passwd) throws InvalidOwnerException, IncorrectPasswordException;
+	public void logout(String username);
+	public OwnerBean register(String username, String passwd) throws InvalidOwnerException, InvalidPasswordException;
+	public boolean unregister(String username);
+	
+	public Collection<DataCDBean> listCDs(String ownername);
+	public DataCDBean addCD(String ownername, String cdlabel, Integer cdsize, String cddesc, Date cdarchivedate) throws DuplicatedDataCDException, InvalidOwnerException;
+	public DataCDBean updateCD(Integer cdid, Integer cdsize, String cddesc, Date cdarchivedate);
+	public boolean removeCD(Integer cdid);
+	public OwnerBean refreshCDInfo(String ownername);
+
+}



Mime
View raw message