geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecr...@apache.org
Subject svn commit: r636529 [8/15] - in /geronimo/samples/branches/1.0: ./ migration-ejb-bmp/ migration-ejb-bmp/dd/ migration-ejb-bmp/dd/META-INF/ migration-ejb-bmp/jndi/ migration-ejb-bmp/src/ migration-ejb-bmp/src/com/ migration-ejb-bmp/src/com/ibm/ migratio...
Date Wed, 12 Mar 2008 21:56:03 GMT
Added: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp (added)
+++ geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp Wed Mar 12 14:54:41 2008
@@ -0,0 +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.
+--%>
+<%@page language="java"%>
+<html>
+<head>
+<Title>Trader Login</Title>
+</head>
+<body>
+<form action="login" method="post">
+<table align="center" height="100%">
+<tr><td align="center"><font size="6">Online Brokerage</font></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td><font size="4" color="red"><%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%></font><td></tr>
+<tr><td valign="center">User Name</td><td><input type="text" name="user" value="<%=(request.getParameter("user")==null)?"":request.getParameter("user")%>"/></td></tr>
+<tr><td valign="center">Password</td><td><input type="password" name="password" value="<%=(request.getParameter("password")==null)?"":request.getParameter("password")%>"/></td></tr>
+<tr><td valign="center"><input type="submit" value="Login"/></td><td><input type="button" value="Register" onClick="window.location.href='register'"/></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+</table>
+</form>
+</body>
+</html>
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/login.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp (added)
+++ geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp Wed Mar 12 14:54:41 2008
@@ -0,0 +1,82 @@
+<%--
+   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.
+--%>
+<%@page language="java" import="com.dev.trade.bo.*" %>
+<html>
+<head>
+<Title>Trader Registration</Title>
+<script language="javascript">
+function verifyAndSubmit(){
+if(document.forms[0].user.value != "" && document.forms[0].name.value != "" && 
+   document.forms[0].password.value != "" && document.forms[0].address.value != "" && 
+      checkFloat(document.forms[0].cash.value))
+      {      
+     document.forms[0].submit();
+      }else{
+     alert("Invalid Input");  
+      }
+}
+function checkFloat(inp)
+{
+   var digits = "0123456789.";
+   var isNumber=true;
+   var digit;
+
+ 
+   for (i = 0; i < inp.length && isNumber == true; i++) 
+      { 
+      digit = inp.charAt(i); 
+      if (digits.indexOf(digit) == -1) 
+         {
+         isNumber = false;
+         }
+      }
+   return isNumber;
+   
+}
+</script>
+</head>
+<body>
+<form action="register" method="post">
+<table align="center" height="100%" >
+<% if(request.getParameter("action")==null){
+       session.removeAttribute("user");       
+   }
+%>
+<tr><td align="center"><font size="6">Online Brokerage - Registration</font></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td><font size="4" color="red"><%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%></font><td></tr>
+<%
+User user = (User)session.getAttribute("user");
+%>
+<tr><td>User Id</td><td><input type="text" name="user" value="<%=(user==null)?"":user.getUserId()%>" maxlength=15/></td></tr>
+<tr><td>User Name</td><td><input type="text" name="name" value="<%=(user==null)?"":user.getName()%>" maxlength=50/></td></tr>
+<tr><td>Password</td><td><input type="text" name="password" value="<%=(user==null)?"":user.getPassword()%>" maxlength=24/></td></tr>
+<tr><td>Address</td><td><input type="text" name="address" value="<%=(user==null)?"":user.getAddress()%>" maxlength=96/></td></tr>
+<tr><td>Cash</td><td><input type="text" name="cash" value="<%=(user==null)?0:user.getCash()%>" maxlength=9/></td></tr>
+
+<tr><td><input type="<%=(request.getParameter("action")==null)?"button":"hidden"%>" value="Register" onClick="verifyAndSubmit()"/></td><td></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+</table>
+</form>
+</body>
+</html>
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/register.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp (added)
+++ geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp Wed Mar 12 14:54:41 2008
@@ -0,0 +1,106 @@
+<%--
+   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.
+--%>
+<%@page language="java" import="java.util.List,com.dev.trade.bo.Stock" %>
+<html>
+<head>
+<Title>Available Stocks</Title>
+<script language="javascript">
+function setValues(index){
+if(typeof document.forms[0].buyQty[index] != "undefined"){
+document.forms[0].buyQuantity.value=document.forms[0].buyQty[index].value;
+document.forms[0].select.value=document.forms[0].sel[index].value;
+}else
+{
+document.forms[0].buyQuantity.value=document.forms[0].buyQty[index].value;
+document.forms[0].select.value=document.forms[0].sel[index].value;
+}
+
+//alert(document.forms[0].select.value);
+//alert(document.forms[0].buyQuantity.value);
+}
+function verify()
+{
+    if(document.forms[0].select.value == "" || document.forms[0].buyQuantity.value == "")
+    {
+            alert("Required field is empty");
+    }
+    else if(checkNumeric(document.forms[0].buyQuantity.value) == false)
+    {
+        alert("Quantity should be an integer");
+    }else if(document.forms[0].select.value != "" && document.forms[0].buyQuantity.value != ""){
+          document.forms[0].submit();
+    }
+    
+
+}
+function checkNumeric(inp)
+
+{
+   var digits = "0123456789";
+   var isNumber=true;
+   var digit;
+
+ 
+   for (i = 0; i < inp.length && isNumber == true; i++) 
+      { 
+      digit = inp.charAt(i); 
+      if (digits.indexOf(digit) == -1) 
+         {
+         isNumber = false;
+         }
+      }
+   return isNumber;
+   
+}
+function unselect(index)
+{
+if(typeof document.forms[0].buyQty[index] != "undefined"){
+document.forms[0].sel[index].checked = false;
+}else
+{
+document.forms[0].sel.checked = false;
+}
+}
+</script>
+</head>
+<body>
+<form action="buy" method="post" >
+<table align="center">
+<tr><td align="center"><font size="6">Online Brokerage - Available Stocks</font></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td><font size="4" color="red"><%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%></font><td></tr>
+<tr><td>Stock Name</td><td>Stock Price</td><td>Quantity</td><td>Buy</td></tr>
+<% List stocks = (List)session.getAttribute("stocks");
+   Stock stock = null;
+   for (int i=0;i<stocks.size();i++){
+      stock = (Stock)stocks.get(i);  
+%>
+
+<tr><td><%=stock.getName()%></td><td><%=stock.getPrice()%></td><td><input type="text" name="buyQty" value="" onClick="javascript:unselect(<%=i%>)" maxlength=5/></td><td><input type="radio" name="sel" value="<%=stock.getId()%>" onClick="javascript:setValues(<%=i%>)"/></td></tr>
+<% }
+       %>
+<tr><td><input type="button" value="Buy Stock" onClick="verify()"/></td><td><input type="button" value="User Info" onClick="window.location.href='register?action=1'"/></td></tr>
+<tr><td><a href="userstocks">View your Portfolio</a></td></tr>
+</table>
+
+<input type="hidden" name="buyQuantity">
+<input type="hidden" name="select">
+</form>
+</body>
+</html>
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/stocks.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp (added)
+++ geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp Wed Mar 12 14:54:41 2008
@@ -0,0 +1,109 @@
+<%--
+   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.
+--%>
+<%@page language="java" import="java.util.List,com.dev.trade.bo.*" %>
+<html>
+<head>
+<Title>Portfolio</Title>
+<script language="javascript">
+
+function setValues(index){
+
+if(typeof document.forms[0].sellQty[index] != "undefined"){
+document.forms[0].sellQuantity.value=document.forms[0].sellQty[index].value;
+document.forms[0].select.value=document.forms[0].sel[index].value;
+}else
+{
+document.forms[0].sellQuantity.value=document.forms[0].sellQty.value;
+document.forms[0].select.value=document.forms[0].sel.value;
+}
+//alert(document.forms[0].select.value);
+//alert(document.forms[0].sellQuantity.value);
+}
+function verify()
+{
+    if(document.forms[0].select.value == "" || document.forms[0].sellQuantity.value == "")
+    {
+            alert("Required field is empty");
+    }
+    else if(checkNumeric(document.forms[0].sellQuantity.value) == false)
+    {
+        alert("Quantity should be an integer");
+    }else if(document.forms[0].select.value != "" && document.forms[0].sellQuantity.value != ""){
+          document.forms[0].submit();
+    }
+    
+
+}
+function checkNumeric(inp)
+{
+   var digits = "0123456789";
+   var isNumber=true;
+   var digit;
+
+ 
+   for (i = 0; i < inp.length && isNumber == true; i++) 
+      { 
+      digit = inp.charAt(i); 
+      if (digits.indexOf(digit) == -1) 
+         {
+         isNumber = false;
+         }
+      }
+   return isNumber;
+   
+}
+function unselect(index)
+{
+if(typeof document.forms[0].sellQty[index] != "undefined"){
+document.forms[0].sel[index].checked = false;
+}else
+{
+document.forms[0].sel.checked = false;
+}
+}
+</script>
+</head>
+<body>
+<form action="sell" method="post">
+<table align="center">
+
+<tr><td align="center"><font size="6">Online Brokerage - Portfolio</font></td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td>&nbsp; </td></tr>
+<tr><td><font size="4" color="red"><%=(session.getAttribute("status")==null)?"":session.getAttribute("status")%></font><td></tr>
+<tr><td>User Cash:</td><td><% User user = (User)session.getAttribute("user");
+                              out.print(user.getCash() );%></td><tr>
+<tr><td>Stock Name</td><td>Stock Price</td><td>Quantity</td><td>Quantity to Sell</td><td>Select</td></tr>
+<% List stocks = (List)session.getAttribute("userStocks");
+   UserStock stock = null;
+   for (int i=0;i<stocks.size();i++){
+      stock = (UserStock)stocks.get(i);  
+%>
+
+<tr><td><%=stock.getName()%></td><td><%=stock.getPrice()%></td><td><input type="text" name="quantity" value="<%=stock.getQuantity()%>" /></td><td><input type="text" name="sellQty" value="" onClick="javascript:unselect(<%=i%>)" maxlength=5/></td><td><input type="radio" name="sel" value="<%=stock.getId()%>" onClick="javascript:setValues(<%=i%>)"/></td></tr>
+<% }
+       %>
+<tr><td><input type="button" value="Sell Stock" onClick="verify()"/></td><td><input type="button" value="User Info" onClick="window.location.href='register?action=1'"/></td></tr>
+<tr><td><a href="stocks">View Available Stocks</a></td></tr>
+</table>
+
+<input type="hidden" name="sellQuantity">
+<input type="hidden" name="select">
+</form>
+</body>
+</html>
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-hibernate/web/jsps/userstocks.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/LICENSE.txt
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/LICENSE.txt?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/LICENSE.txt (added)
+++ geronimo/samples/branches/1.0/migration-jca/LICENSE.txt Wed Mar 12 14:54:41 2008
@@ -0,0 +1,350 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] 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.
+
+=========================================================================
+J2G, Commons Logging, commons-el, jasper-runtime, jasper-compiler, 
+jasper-compiler-jdt, geronimo-jsp_spec, and geronimo-servlet-spec use the 
+above Apache License v2.0.
+=========================================================================
+   
+=========================================================================
+==  Dom4j License                                                      ==
+=========================================================================
+
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+Redistribution and use of this software and associated documentation
+("Software"), with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions of source code must retain copyright
+   statements and notices.  Redistributions must also contain a
+   copy of this document.
+ 
+2. Redistributions in binary form must reproduce the
+   above copyright notice, this list of conditions and the
+   following disclaimer in the documentation and/or other
+   materials provided with the distribution.
+ 
+3. The name "DOM4J" must not be used to endorse or promote
+   products derived from this Software without prior written
+   permission of MetaStuff, Ltd.  For written permission,
+   please contact dom4j-info@metastuff.com.
+ 
+4. Products derived from this Software may not be called "DOM4J"
+   nor may "DOM4J" appear in their names without prior written
+   permission of MetaStuff, Ltd. DOM4J is a registered
+   trademark of MetaStuff, Ltd.
+ 
+5. Due credit should be given to the DOM4J Project - 
+   http://www.dom4j.org
+ 
+THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+=========================================================================
+==  Jaxen License                                                      ==
+=========================================================================
+
+ Copyright 2003-2006 The Werken Company. All Rights Reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+  * Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+
+  * Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+  * Neither the name of the Jaxen Project nor the names of its
+    contributors may be used to endorse or promote products derived 
+    from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+=========================================================================
+==  PullParser License                                                 ==
+=========================================================================
+
+Copyright 2002 The Trustees of Indiana University.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+1) All redistributions of source code must retain the above
+   copyright notice, the list of authors in the original source
+   code, this list of conditions and the disclaimer listed in this
+   license;
+
+2) All redistributions in binary form must reproduce the above
+   copyright notice, this list of conditions and the disclaimer
+   listed in this license in the documentation and/or other
+   materials provided with the distribution;
+
+3) Any documentation included with all redistributions must include
+   the following acknowledgement:
+
+     "This product includes software developed by the Indiana 
+     University Extreme! Lab.  For further information please visit 
+     http://www.extreme.indiana.edu/"
+
+   Alternatively, this acknowledgment may appear in the software
+   itself, and wherever such third-party acknowledgments normally
+   appear.
+
+4) The name "Indiana Univeristy" and "Indiana Univeristy
+   Extreme! Lab" shall not be used to endorse or promote
+   products derived from this software without prior written
+   permission from Indiana University.  For written permission,
+   please contact http://www.extreme.indiana.edu/.
+
+5) Products derived from this software may not use "Indiana
+   Univeristy" name nor may "Indiana Univeristy" appear in their name,
+  without prior written permission of the Indiana University.
+ 
+Indiana University provides no reassurances that the source code
+provided does not infringe the patent or any other intellectual
+property rights of any other entity.  Indiana University disclaims any
+liability to any recipient for claims brought by any other entity
+based on infringement of intellectual property rights or otherwise.
+
+LICENSEE UNDERSTANDS THAT SOFTWARE IS PROVIDED "AS IS" FOR WHICH
+NO WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. INDIANA
+UNIVERSITY GIVES NO WARRANTIES AND MAKES NO REPRESENTATION THAT
+SOFTWARE IS FREE OF INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR
+OTHER PROPRIETARY RIGHTS.  INDIANA UNIVERSITY MAKES NO WARRANTIES THAT
+SOFTWARE IS FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP
+DOORS", "WORMS", OR OTHER HARMFUL CODE.  LICENSEE ASSUMES THE ENTIRE
+RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR ASSOCIATED MATERIALS,
+AND TO THE PERFORMANCE AND VALIDITY OF INFORMATION GENERATED USING
+SOFTWARE.
+
+
+
+
+

Propchange: geronimo/samples/branches/1.0/migration-jca/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/LICENSE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/LICENSE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/NOTICE.txt
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/NOTICE.txt?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/NOTICE.txt (added)
+++ geronimo/samples/branches/1.0/migration-jca/NOTICE.txt Wed Mar 12 14:54:41 2008
@@ -0,0 +1,46 @@
+=========================================================================
+==  NOTICE file corresponding to section 4(d) of the Apache License,   ==
+==  Version 2.0, in this case for the Apache Geronimo distribution.    ==
+=========================================================================
+
+Apache Geronimo
+Copyright 2003-2007 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of the J2G Conversion Tool were orginally developed by International
+Business Machines Corporation and are licensed to the Apache Software
+Foundation under the "Software Grant and Corporate Contribution License
+Agreement", informally known as the "IBM Console CLA".
+
+=========================================================================
+==  Commons-logging  Notice                                            ==
+=========================================================================
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+
+=========================================================================
+==  Dom4j Notice                                                       ==
+=========================================================================
+
+Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+=========================================================================
+==  Jaxen Notice                                                       ==
+=========================================================================
+
+Copyright 2003-2006 The Werken Company. All Rights Reserved.
+
+=========================================================================
+==  PullParser Notice                                                  ==
+=========================================================================
+
+Copyright 2002 The Trustees of Indiana University.
+All rights reserved.
+
+This product includes software developed by the Indiana
+University Extreme! Lab.  For further information please visit
+http://www.extreme.indiana.edu/
+

Propchange: geronimo/samples/branches/1.0/migration-jca/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/NOTICE.txt
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/NOTICE.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/build.properties
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/build.properties?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/build.properties (added)
+++ geronimo/samples/branches/1.0/migration-jca/build.properties Wed Mar 12 14:54:41 2008
@@ -0,0 +1,31 @@
+# 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.
+
+
+# Name of the server to build the application for:
+server.name = jboss
+
+# Home directory of JBoss 4.0.2 J2ee Application Server and name of the server 
+# instance on which the application should be deployed (this instance should be
+# either a copy of the default JBoss server or the default server itself because
+# its libs are also used for building the source code):
+jboss.home = C:/Programs/JBoss
+jboss.server = default
+
+# Home directory of Geronimo 1.0M5 J2ee Application Server and its administrator
+# credentials:
+geronimo.home = C:/Programs/Geronimo
+geronimo.user = system
+geronimo.password = manager

Propchange: geronimo/samples/branches/1.0/migration-jca/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/build.properties
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/build.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/build.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/build.xml?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/build.xml (added)
+++ geronimo/samples/branches/1.0/migration-jca/build.xml Wed Mar 12 14:54:41 2008
@@ -0,0 +1,128 @@
+<?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 name="JCA" default="build" basedir=".">
+
+    <property file="build.properties"/>
+
+    <path id="classpath">
+        <fileset dir="${jboss.home}/server/${jboss.server}/lib" includes="*.jar"/>
+    </path>
+
+
+    <!-- Builds JCA application -->
+    <target name="build">
+        <mkdir dir="bin"/>
+        <javac srcdir="src" destdir="bin" classpathref="classpath"/>
+
+        <antcall target="build.${server.name}"/>
+
+        <jar destfile="jca.war">
+            <zipfileset dir="bin" prefix="WEB-INF/classes" includes="**/web/*.class"/>
+            <zipfileset dir="web" excludes="WEB-INF/*-web.xml"/>
+            <zipfileset dir="web" includes="WEB-INF/${server.name}-web.xml"/>
+        </jar>
+    </target>
+
+    <!-- Packs JBoss version of the resource adapter module -->
+    <target name="build.jboss">
+        <jar destfile="jca.rar">
+            <zipfileset dir="bin" includes="**/connector/**/*.class"/>
+            <zipfileset dir="meta/jboss" prefix="META-INF" includes="ra.xml"/>
+        </jar>
+    </target>
+
+    <!-- Packs Geronimo version of the resource adapter module -->
+    <target name="build.geronimo">
+        <jar destfile="bin/jca.jar">
+            <zipfileset dir="bin" includes="**/connector/**/*.class"/>
+        </jar>
+        <jar destfile="jca.rar">
+            <zipfileset dir="bin" includes="jca.jar"/>
+            <zipfileset dir="meta/geronimo" prefix="META-INF" includes="ra.xml"/>
+        </jar>
+    </target>
+
+
+    <!--
+        Deploys (or redeploys) the application on the currently selected
+        server
+    -->
+    <target name="deploy">
+        <antcall target="deploy.${server.name}"/>
+    </target>
+
+    <!-- 
+        Deploys (or redeploys) the application on JBoss. If the server is
+        started the application will be installed and started on the fly.
+        The JBoss version of the application must be previously built 
+        and located in the current folder.
+    -->
+    <target name="deploy.jboss">
+        <copy todir="${jboss.home}/server/${jboss.server}/deploy"
+              file="meta/jboss/jca-ds.xml"/>
+        <copy todir="${jboss.home}/server/${jboss.server}/deploy" file="jca.rar"/>
+        <copy todir="${jboss.home}/server/${jboss.server}/deploy" file="jca.war"/>
+    </target>
+
+    <!-- 
+        Deploys (or redeploys) the application on Geronimo. The server 
+        should be started.
+        The Geronimo version of the application must be previously built
+        and located in the current folder.
+    -->
+    <target name="deploy.geronimo">
+        <java jar="${geronimo.home}/bin/deployer.jar" fork="true">
+            <arg value="--user"/>
+            <arg value="${geronimo.user}"/>
+            <arg value="--password"/>
+            <arg value="${geronimo.password}"/>
+            <arg value="undeploy"/>
+            <arg value="com/ibm/j2g/jca.war"/>
+        </java>
+
+        <java jar="${geronimo.home}/bin/deployer.jar" fork="true">
+            <arg value="--user"/>
+            <arg value="${geronimo.user}"/>
+            <arg value="--password"/>
+            <arg value="${geronimo.password}"/>
+            <arg value="undeploy"/>
+            <arg value="com/ibm/j2g/jca.rar"/>
+        </java>
+
+        <java jar="${geronimo.home}/bin/deployer.jar" fork="true">
+            <arg value="--user"/>
+            <arg value="${geronimo.user}"/>
+            <arg value="--password"/>
+            <arg value="${geronimo.password}"/>
+            <arg value="deploy"/>
+            <arg value="meta/geronimo/jca-plan.xml"/>
+            <arg value="jca.rar"/>
+        </java>
+
+        <java jar="${geronimo.home}/bin/deployer.jar" fork="true">
+            <arg value="--user"/>
+            <arg value="${geronimo.user}"/>
+            <arg value="--password"/>
+            <arg value="${geronimo.password}"/>
+            <arg value="deploy"/>
+            <arg value="jca.war"/>
+        </java>
+    </target>
+
+</project>

Propchange: geronimo/samples/branches/1.0/migration-jca/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/build.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml (added)
+++ geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml Wed Mar 12 14:54:41 2008
@@ -0,0 +1,41 @@
+<?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.
+-->
+
+<!-- This is Geronimo-specific descriptor -->
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector" version="1.5"
+        configId="com/ibm/j2g/jca.rar" 
+        parentId="org/apache/geronimo/Server">
+
+    <resourceadapter>
+        <outbound-resourceadapter>
+            <connection-definition>
+                <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
+                <connectiondefinition-instance>
+                    <name>FileRetriever</name>
+                    <config-property-setting name="RepositoryPath">..</config-property-setting>
+                    <connectionmanager>
+                        <no-transaction/>
+                        <no-pool/>
+                    </connectionmanager>
+                </connectiondefinition-instance>
+            </connection-definition>
+        </outbound-resourceadapter>
+    </resourceadapter>
+
+</connector>
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/jca-plan.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml (added)
+++ geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml Wed Mar 12 14:54:41 2008
@@ -0,0 +1,48 @@
+<?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.
+-->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+                            http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+        version="1.5">
+
+    <display-name>FileRetriever</display-name>
+    <vendor-name>IBM</vendor-name>
+    <eis-type>File system</eis-type>
+    <resourceadapter-version>1.0</resourceadapter-version>
+    <resourceadapter>
+        <outbound-resourceadapter>
+            <connection-definition>
+                <managedconnectionfactory-class>com.ibm.j2g.jca.connector.impl.FileRetrieverManagedConnectionFactory</managedconnectionfactory-class>
+                <config-property>
+                    <description>Path to the directory being the file repository</description>
+                    <config-property-name>RepositoryPath</config-property-name>
+                    <config-property-type>java.lang.String</config-property-type>
+                </config-property>
+                <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
+                <connectionfactory-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionFactoryImpl</connectionfactory-impl-class>
+                <connection-interface>com.ibm.j2g.jca.connector.FileRetrieverConnection</connection-interface>
+                <connection-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionImpl</connection-impl-class>
+            </connection-definition>
+            <transaction-support>NoTransaction</transaction-support>
+            <reauthentication-support>false</reauthentication-support>
+        </outbound-resourceadapter>
+    </resourceadapter>
+
+</connector>

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/geronimo/ra.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml (added)
+++ geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml Wed Mar 12 14:54:41 2008
@@ -0,0 +1,34 @@
+<?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.
+-->
+<!DOCTYPE connection-factories PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<!-- 
+   This is JBoss-specific descriptor.
+   It should be placed in the "deploy" directory of desired server configuration.
+-->
+
+<connection-factories>
+
+    <no-tx-connection-factory>
+        <jndi-name>FileRetriever</jndi-name>
+        <rar-name>jca.rar</rar-name>
+        <connection-definition>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connection-definition>
+        <config-property name="RepositoryPath" type="java.lang.String">..</config-property>
+    </no-tx-connection-factory>
+
+</connection-factories>

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/jca-ds.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml (added)
+++ geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml Wed Mar 12 14:54:41 2008
@@ -0,0 +1,49 @@
+<?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.
+-->
+
+<connector xmlns="http://java.sun.com/xml/ns/j2ee"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+                            http://java.sun.com/xml/ns/j2ee/connector_1_5.xsd"
+        version="1.5">
+
+    <display-name>FileRetriever</display-name>
+    <vendor-name>IBM</vendor-name>
+    <eis-type>File system</eis-type>
+    <resourceadapter-version>1.0</resourceadapter-version>
+    <resourceadapter>
+        <resourceadapter-class>org.jboss.resource.deployment.DummyResourceAdapter</resourceadapter-class>
+        <outbound-resourceadapter>
+            <connection-definition>
+                <managedconnectionfactory-class>com.ibm.j2g.jca.connector.impl.FileRetrieverManagedConnectionFactory</managedconnectionfactory-class>
+                <config-property>
+                    <description>Path to the directory being the file repository</description>
+                    <config-property-name>RepositoryPath</config-property-name>
+                    <config-property-type>java.lang.String</config-property-type>
+                </config-property>
+                <connectionfactory-interface>com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory</connectionfactory-interface>
+                <connectionfactory-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionFactoryImpl</connectionfactory-impl-class>
+                <connection-interface>com.ibm.j2g.jca.connector.FileRetrieverConnection</connection-interface>
+                <connection-impl-class>com.ibm.j2g.jca.connector.impl.FileRetrieverConnectionImpl</connection-impl-class>
+            </connection-definition>
+            <transaction-support>NoTransaction</transaction-support>
+            <reauthentication-support>false</reauthentication-support>
+        </outbound-resourceadapter>
+    </resourceadapter>
+
+</connector>

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/meta/jboss/ra.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java (added)
+++ geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java Wed Mar 12 14:54:41 2008
@@ -0,0 +1,56 @@
+/*
+* 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 com.ibm.j2g.jca.connector;
+
+import java.io.FileNotFoundException;
+import java.io.OutputStream;
+
+import javax.resource.ResourceException;
+
+public interface FileRetrieverConnection {
+
+    /**
+     * Retrieves file and writes its content to the output stream.
+     * @param name name of the file to retrieve
+     * @param stream output stream for writing the file content
+     *     (opening and closing the stream is performed by client)
+     * @throws ResourceException in case of any problem
+     * @throws FileNotFoundException if the file is not found
+     */
+    public void retrieve(String name, OutputStream stream) 
+        throws ResourceException, FileNotFoundException;
+    
+    /**
+     * Retrieves names of files available in the repository
+     * @return array of file names 
+     * @throws ResourceException in case of any problem
+     */
+    public String[] listFiles() throws ResourceException;
+    
+    /**
+     * Retrieves names of directories available in the repository
+     * @return array of directory names 
+     * @throws ResourceException in case of any problem
+     */
+    public String[] listDirectories() throws ResourceException;
+    
+    /**
+     * Closes the connection and all opened file streams
+     * @throws ResourceException in case of any problem
+     */
+    public void close() throws ResourceException;
+}
\ No newline at end of file

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java (added)
+++ geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java Wed Mar 12 14:54:41 2008
@@ -0,0 +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 com.ibm.j2g.jca.connector;
+
+import javax.resource.ResourceException;
+
+public interface FileRetrieverConnectionFactory {
+
+    /**
+     * Retrieves instance of the File Retriever connection
+     * @return File Retriever connection instance
+     * @throws ResourceException in case of any problem
+     */
+    public FileRetrieverConnection getConnection() throws ResourceException;
+}

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/FileRetrieverConnectionFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java (added)
+++ geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java Wed Mar 12 14:54:41 2008
@@ -0,0 +1,74 @@
+/*
+* 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 com.ibm.j2g.jca.connector.impl;
+
+import java.io.Serializable;
+
+import javax.naming.NamingException;
+import javax.naming.Reference;
+import javax.resource.Referenceable;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionManager;
+import javax.resource.spi.ManagedConnectionFactory;
+
+import com.ibm.j2g.jca.connector.FileRetrieverConnection;
+import com.ibm.j2g.jca.connector.FileRetrieverConnectionFactory;
+
+public class FileRetrieverConnectionFactoryImpl implements
+        FileRetrieverConnectionFactory, Serializable, Referenceable {
+
+    /** Managed connection factory */
+    private ManagedConnectionFactory mcf;
+
+    /** Connection manager */
+    private ConnectionManager cm;
+
+    /** JNDI reference */
+    private Reference reference;
+
+    /**
+     * The constructor
+     * @param factory managed connection factory
+     * @param cm connection manager
+     */
+    public FileRetrieverConnectionFactoryImpl(ManagedConnectionFactory factory,
+            ConnectionManager cm) {
+        this.mcf = factory;
+        this.cm = cm;
+    }
+
+    /*
+     * @see com.ibm.testjca.TestConnectionFactory#getConnection()
+     */
+    public FileRetrieverConnection getConnection() throws ResourceException {
+        return (FileRetrieverConnection) cm.allocateConnection(mcf, null);
+    }
+
+    /*
+     * @see javax.resource.Referenceable#setReference(javax.naming.Reference)
+     */
+    public void setReference(Reference reference) {
+        this.reference = reference;
+    }
+
+    /*
+     * @see javax.naming.Referenceable#getReference()
+     */
+    public Reference getReference() throws NamingException {
+        return reference;
+    }
+}

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionFactoryImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java (added)
+++ geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java Wed Mar 12 14:54:41 2008
@@ -0,0 +1,85 @@
+/*
+* 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 com.ibm.j2g.jca.connector.impl;
+
+import java.io.FileNotFoundException;
+import java.io.OutputStream;
+
+import javax.resource.ResourceException;
+
+import com.ibm.j2g.jca.connector.FileRetrieverConnection;
+
+public class FileRetrieverConnectionImpl implements FileRetrieverConnection {
+    
+    /** Underlying physical connection instance */
+    private FileRetrieverManagedConnection mc;
+    
+    /**
+     * The constructor
+     * @param mc underlying physical connection instance
+     */
+    public FileRetrieverConnectionImpl(FileRetrieverManagedConnection mc) {
+        this.mc = mc;
+    }
+    
+    /**
+     * Associates this handle with given underlying physical
+     * connection instance
+     * @param newMc underlying physical connection instance
+     */
+    public void associateConnection(FileRetrieverManagedConnection newMc) {
+        this.mc.removeConnection(this);
+        newMc.addConnection(this);
+        this.mc = newMc;
+    }
+
+    /**
+     * Invalidates the connection
+     */
+    public void invalidate() {
+        mc = null;
+    }
+
+    /*
+     * @see com.ibm.j2g.jca.FileRetrieverConnection#retrieve(java.lang.String, java.io.OutputStream)
+     */
+    public void retrieve(String name, OutputStream stream)
+            throws ResourceException, FileNotFoundException {
+        mc.retrieve(name, stream);
+    }
+
+    /*
+     * @see com.ibm.j2g.jca.FileRetrieverConnection#listFiles()
+     */
+    public String[] listFiles() throws ResourceException {
+        return mc.listFiles();
+    }
+
+    /*
+     * @see com.ibm.j2g.jca.FileRetrieverConnection#listDirectories()
+     */
+    public String[] listDirectories() throws ResourceException {
+        return mc.listDirectories();
+    }
+    
+    /*
+     * @see com.ibm.j2g.jca.FileRetrieverConnection#close()
+     */
+    public void close() throws ResourceException {
+        mc.close(this);
+    }
+}

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverConnectionImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java (added)
+++ geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java Wed Mar 12 14:54:41 2008
@@ -0,0 +1,302 @@
+/*
+* 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 com.ibm.j2g.jca.connector.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.resource.NotSupportedException;
+import javax.resource.ResourceException;
+import javax.resource.spi.ConnectionEvent;
+import javax.resource.spi.ConnectionEventListener;
+import javax.resource.spi.ConnectionRequestInfo;
+import javax.resource.spi.LocalTransaction;
+import javax.resource.spi.ManagedConnection;
+import javax.resource.spi.ManagedConnectionMetaData;
+import javax.security.auth.Subject;
+import javax.transaction.xa.XAResource;
+
+public class FileRetrieverManagedConnection implements ManagedConnection {
+
+    /** Log writer */
+    private PrintWriter writer;
+
+    /** List of listeners */
+    private List listeners;
+
+    /** Path to the repository containing files to retireve */
+    private String path;
+
+    /** Set of application-level handlers */
+    private Set connectionSet;
+
+    /**
+     * The constructor
+     * @param conReqInfo {@link ConnectionRequestInfo}
+     * @param writer log writer of the factory that calls this constructor
+     * @param repositoryPath path to the repository containing files to retireve
+     */
+    public FileRetrieverManagedConnection(ConnectionRequestInfo conReqInfo,
+            PrintWriter writer, String repositoryPath) {
+        this.writer = writer;
+        this.listeners = new ArrayList();
+        this.connectionSet = new HashSet();
+        this.path = repositoryPath;
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#getConnection(javax.security.auth.Subject,
+     *      javax.resource.spi.ConnectionRequestInfo)
+     */
+    public Object getConnection(Subject subj, ConnectionRequestInfo conReqInfo)
+            throws ResourceException {
+        if (this.path == null) {
+            throw new ResourceException("Path to a repository is null");
+        }
+        
+        File repository = new File(this.path);
+        if (!repository.exists() || !repository.isDirectory()) {
+            throw new ResourceException("Path [" + repository.getAbsolutePath()
+                    + "] does not lead to a repository");
+        }
+        FileRetrieverConnectionImpl conn = new FileRetrieverConnectionImpl(this);
+        addConnection(conn);
+        return conn;
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#destroy()
+     */
+    public void destroy() throws ResourceException {
+        invalidateAllConnections();
+        synchronized (this.listeners) {
+            listeners = null;
+        }
+        path = null;
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#cleanup()
+     */
+    public void cleanup() throws ResourceException {
+        invalidateAllConnections();
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#associateConnection(java.lang.Object)
+     */
+    public void associateConnection(Object conn) throws ResourceException {
+        if (!(conn instanceof FileRetrieverConnectionImpl)) {
+            throw new ResourceException("Connection has an incorrect type");
+        }
+        ((FileRetrieverConnectionImpl)conn).associateConnection(this);
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#addConnectionEventListener(javax.resource.spi.ConnectionEventListener)
+     */
+    public void addConnectionEventListener(ConnectionEventListener listener) {
+        synchronized (this.listeners) {
+            listeners.add(listener);
+        }
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#removeConnectionEventListener(javax.resource.spi.ConnectionEventListener)
+     */
+    public void removeConnectionEventListener(ConnectionEventListener listener) {
+        synchronized (this.listeners) {
+            listeners.remove(listener);
+        }
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#getXAResource()
+     */
+    public XAResource getXAResource() throws ResourceException {
+        throw new NotSupportedException("XA transactions are not supported");
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#getLocalTransaction()
+     */
+    public LocalTransaction getLocalTransaction() throws ResourceException {
+        throw new NotSupportedException("Transactions are not supported");
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#getMetaData()
+     */
+    public ManagedConnectionMetaData getMetaData() throws ResourceException {
+        return new FileRetrieverManagedConnectionMetaData();
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#setLogWriter(java.io.PrintWriter)
+     */
+    public void setLogWriter(PrintWriter out) throws ResourceException {
+        this.writer = out;
+    }
+
+    /*
+     * @see javax.resource.spi.ManagedConnection#getLogWriter()
+     */
+    public PrintWriter getLogWriter() throws ResourceException {
+        return writer;
+    }
+
+    /**
+     * Removes application-level handler from handlers set
+     * @param con handler to remove
+     * @see FileRetrieverConnectionImpl#associateConnection(FileRetrieverManagedConnection)
+     */
+    void removeConnection(FileRetrieverConnectionImpl con) {
+        synchronized (this.connectionSet) {
+            connectionSet.remove(con);
+        }
+    }
+
+    /**
+     * Adds application-level handler to handlers set
+     * @param con handler to add
+     * @see FileRetrieverConnectionImpl#associateConnection(FileRetrieverManagedConnection)
+     */
+    void addConnection(FileRetrieverConnectionImpl con) {
+        synchronized (this.connectionSet) {
+            connectionSet.add(con);
+        }
+    }
+
+    /**
+     * Invalidate all application-level handlers and clears handlers set
+     */
+    void invalidateAllConnections() {
+        synchronized (this.connectionSet) {
+            Iterator itr = connectionSet.iterator();
+            while (itr.hasNext()) {
+                FileRetrieverConnectionImpl con = (FileRetrieverConnectionImpl) itr
+                        .next();
+                con.invalidate();
+            }
+            connectionSet.clear();
+        }
+    }
+
+    /**
+     * Retrieves file and writes its content to the output stream.
+     * @param name name of the file to retrieve
+     * @param stream output stream for writing the file content
+     *     (opening and closing the stream is performed by client)
+     * @throws ResourceException in case of any problem
+     * @throws FileNotFoundException if the file is not found
+     */
+    public void retrieve(String name, OutputStream stream) 
+            throws ResourceException, FileNotFoundException {
+        if (stream == null) {
+            throw new ResourceException("File output stream is null");
+        }
+
+        FileInputStream fin = new FileInputStream(this.path + File.separatorChar + name);
+
+        // Writing the file to the output stream
+        try {
+            byte buffer[] = new byte[1024];
+            int count = 0;
+            while ((count = fin.read(buffer)) > 0) {
+                stream.write(buffer, 0, count);
+            }
+        
+        } catch (IOException e) {
+            new ResourceException(e.getMessage());
+
+        } finally {
+            try {
+                fin.close();
+            } catch (IOException e) {
+                new ResourceException(e.getMessage());
+            }
+        }
+    }
+
+    /**
+     * Closes connection
+     * @param con connection to close
+     */
+    public void close(FileRetrieverConnectionImpl con) {
+        ConnectionEvent event = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+        synchronized (this.listeners) {
+            Iterator itr = listeners.iterator();
+            while (itr.hasNext()) {
+                try {
+                    ((ConnectionEventListener)itr.next()).connectionClosed(event);
+                } catch (Throwable e) {
+                }
+            }
+        }
+        con.invalidate();
+        removeConnection(con);
+    }
+
+    /**
+     * Retrieves names of files available in the repository
+     * @return array of file names 
+     * @throws ResourceException in case of any problem
+     */
+    public String[] listFiles() throws ResourceException {
+        SortedSet names = new TreeSet(String.CASE_INSENSITIVE_ORDER);
+        
+        File repository = new File(this.path);
+        File[] files = repository.listFiles();
+        for (int i = 0; i < files.length; i++) {
+            if (files[i].isFile()) {
+                names.add(files[i].getName());
+            }
+        }
+
+        return (String[])names.toArray(new String[names.size()]);
+    }
+    
+    /**
+     * Retrieves names of directories available in the repository
+     * @return array of directory names 
+     * @throws ResourceException in case of any problem
+     */
+    public String[] listDirectories() throws ResourceException {
+        SortedSet names = new TreeSet(String.CASE_INSENSITIVE_ORDER);
+        
+        File repository = new File(this.path);
+        File[] files = repository.listFiles();
+        for (int i = 0; i < files.length; i++) {
+            if (files[i].isDirectory()) {
+                names.add(files[i].getName());
+            }
+        }
+
+        return (String[])names.toArray(new String[names.size()]);
+    }
+}

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-jca/src/com/ibm/j2g/jca/connector/impl/FileRetrieverManagedConnection.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message