User: oleg
Date: 00/09/19 02:28:17
Added: castorjdo castorjdo.html jboss-castorjdo.jar
Log:
CastorJDO section added
Revision Changes Path
1.1 jbossweb/castorjdo/castorjdo.html
Index: castorjdo.html
===================================================================
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 4">
<title>JBoss - Coding the Future</title>
</head>
<body bgcolor="white" leftmargin="0" topmargin="0" marginwidth="0"
marginheight="0">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="581">
<tbody>
<tr height="1958">
<td bgcolor="white" valign="top" height="718">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="51">
<tbody>
<tr height="2">
<td height="2"><img src="../picture/corner-nw-small.gif" width="11"
height="11"></td>
</tr>
<tr height="37">
<td height="37"><img alt="o" height="1" src="binary.htm" width="1"><font
color="#ffcc00" face="Arial,Helvetica,sans-serif" size="6"><b>Using
Castor JDO with JBoss</b></font></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr height="2">
<td bgcolor="white" valign="bottom" width="11"><img
src="../picture/corner-sw-small.gif" width="11" height="11"></td>
<td bgcolor="white" width="100%"></td>
<td bgcolor="white" width="21"></td>
<td width="4"></td>
</tr>
<tr>
<td bgcolor="#99cc66" width="11"><img alt="o" height="1" src="binary.htm"
width="1"></td>
<td bgcolor="#99cc66" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr bgcolor="#99cc66">
<td width="100%"><font color="white" face="Myriad Web,Arial"
size="3"><b>Why-to</b></font></td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#FFFFFF" width="21"><img src="../picture/corner-e.gif" width="22"
height="22"></td>
<td width="4"></td>
</tr>
<tr height="99">
<td bgcolor="white" valign="top" width="11"><img
src="../picture/corner-nw-small.gif" width="11" height="11"></td>
<td align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="89">
<tbody>
<tr>
<td valign="top" width="648">
<p> </p>
<a href="http://access1.sun.com/jdo/">"Java Data Objects specification"</a> runs:
<i>
<p>Java Data Objects is a suitable component for integration with EJB in these
scenarios:
<ul>
<li>Session Beans with JDO classes as dependent objects;</li>
<li>Entity Beans with JDO classes as delegates for both Bean Managed
Persistence
</ul>
</i>
This also applies to Castor JDO, which was inspired by the same source
as the quoted specification:
<a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_012_dataobj.html">JSR-12
"Java Data Objects Specification"</a>.
Castor JDO being used with Session and BMP Entity Beans serves as an
alternative to CMP Entity Beans, and is in many cases more fast and efficient.
However, Castor doesn't complies to the the Sun JDO specification yet.
Castor JDO is RDBMS-oriented and serves as O/R mapping tool, while the current draft
of Sun JDO specification seems to be OODBMS-oriented.
</p>
<p>CastorJDO module is a part of 3rd party Integration section of
<a href="../project_game_over.htm">Project Game Over</a>.
It makes possible to use Castor JDO DataObjects factories as bean resources
bound to the bean JNDI namespace.
</p>
<p> </p>
</td>
<td valign="top" width="10"></td>
<td align="right" valign="top" width="10"> </td>
</tr>
</tbody>
</table>
</td>
<td width="21"><img alt="o" height="1" src="binary.htm" width="1"></td>
<td width="4"></td>
</tr>
</tbody>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td bgcolor="white" valign="bottom" width="11"><img
src="../picture/corner-sw-small.gif" width="11" height="11"></td>
<td bgcolor="white" width="100%"></td>
<td bgcolor="white" width="21"></td>
<td width="4"></td>
</tr>
<tr>
<td bgcolor="#99cc66" width="11"><img alt="o" height="1" src="binary.htm"
width="1"></td>
<td bgcolor="#99cc66" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr bgcolor="#99cc66">
<td width="100%"><font color="white" face="Myriad Web,Arial"
size="3"><b>Where-from</b></font></td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#FFFFFF" width="21"><img src="../picture/corner-e.gif" width="22"
height="22"></td>
<td width="4"></td>
</tr>
<tr height="56">
<td bgcolor="white" valign="top" width="11"><img
src="../picture/corner-nw-small.gif" width="11" height="11"></td>
<td align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="89">
<tbody>
<tr>
<td valign="top" width="672"><br>
The latest version of <a href="http://castor.exolab.org">Castor</a>
from CVS
is needed for now,
since some methods used by the integration module were added
after the official release of Castor 0.8.8.
You should also take xerces.jar file there.
Alternatively, you can take all needed jar files from jBoss CVS:
<p><a
href="http://cvs.working-dogs.com/ejboss/cvsweb/index.cgi/~checkout~/contrib/castorjdo/lib/castor-0.8.8.jar?rev=1.1&content-type=text/plain">castor-0.8.8.jar</a>
Copyright 2000 © Intalio Inc. All Rights Reserved.</p>
<p><a
href="http://cvs.working-dogs.com/ejboss/cvsweb/index.cgi/~checkout~/contrib/castorjdo/lib/xerces.jar?rev=1.1&content-type=text/plain">xerces.jar</a>
Copyright 1999-2000 © The Apache Software Foundation. All rights
reserved.</p>
The CastorJDO integration module is here:
<p><a href="jboss-castorjdo.jar">jboss-castorjdo.jar</a>
Copyright 2000 © The jBoss organization. All Rights Reserved.</p>
The sources are in <a href="../cvs.htm">CVS</a>, module "contrib".
</td>
<td valign="top" width="10"></td>
<td align="right" valign="top" width="11"> </td>
</tr>
</tbody>
</table>
</td>
<td width="21"><img alt="o" height="1" src="binary.htm" width="1"></td>
<td width="4"></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td bgcolor="white" valign="bottom" width="11"><img
src="../picture/corner-sw-small.gif" width="11" height="11"></td>
<td bgcolor="white" width="100%"></td>
<td bgcolor="white" width="21"></td>
<td width="4"></td>
</tr>
<tr>
<td bgcolor="#99cc66" width="11"><img alt="o" height="1" src="binary.htm"
width="1"></td>
<td bgcolor="#99cc66" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr bgcolor="#99cc66">
<td width="100%"><font color="white" face="Myriad Web,Arial"
size="3"><b>How-to</b></font></td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#FFFFFF" width="21"><img src="../picture/corner-e.gif" width="22"
height="22"></td>
<td width="4"></td>
</tr>
<tr height="56">
<td bgcolor="white" valign="top" width="11"><img
src="../picture/corner-nw-small.gif" width="11" height="11"></td>
<td align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="89">
<tbody>
<tr>
<td valign="top" width="672">
<p><br>
<ul>
<li>Put the three jars files mentioned above in lib/ext directory.</li>
<li>Add the Mlet in jboss.conf<br>
<pre>
<MLET CODE = "org.jboss.jdo.castor.CastorJDOImpl"
ARCHIVE="jboss.jar,castor-0.8.8.jar,xerces.jar"
CODEBASE="../lib/ext/">
<ARG TYPE="java.lang.String" VALUE="../conf/database.xml">
<ARG TYPE="java.lang.String" VALUE="dataObjectsJndiName">
<ARG TYPE="java.lang.Integer" VALUE="0">
<ARG TYPE="java.lang.Boolean" VALUE="false">
</MLET>
</pre>
where the parameters are:
<ol>
<li>the database configuration file needed by
the Castor JDO, it contains JNDI name of JDBC DataSource and
reference(s) to mapping configuration file(s), e.g.:
<pre>
<database name="test" engine="oracle" >
<jndi name="dataSourceJndiName"/>
<mapping href="../conf/mapping.xml" />
</database>
</pre>
It is recommended to place it in "conf" directory or in one of its
subdirectories as well as mapping configuration file(s).
At least, don't place them to your EJB jar files.
See Castor documentation for further info on the content of the
Castor configuration files.</li>
<li>the JNDI name that is used for binding bean
resource references. See below.</li>
<li>the lock timeout in seconds, value "0" means
"use the Castor default value" (which now equals 10 seconds).</li>
<li>the flag of logging. When you set it to true,
the CastorJDO MBean sends information messages and warnings to
jBoss loggers.</li>
</ol>
<li>Declare the resource managers in your jboss.xml besides your
ejb-jar.xml, e.g.:<br>
<pre>
<resource-managers>
<resource-manager
res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>dataSourceNameForBean</res-name>
<res-jndi-name>dataSourceJndiName</res-jndi-name>
</resource-manager>
<resource-manager
res-class="org.jboss.ejb.deployment.CastorJDOResource">
<res-name>dataObjectsNameForBean</res-name>
<res-jndi-name>dataObjectsJndiName</res-jndi-name>
</resource-manager>
</resource-managers>
</pre>
</li>
<li>Declare the resource manager JNDI ENC for the beans in ejb-jar.xml, e.g.:
<pre>
<resource-ref>
<description>DataObjects factory</description>
<res-ref-name>dataObjectsNameForBean</res-ref-name>
<res-type>org.exolab.castor.jdo.DataObjects</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</pre>
It is recommended to start JNDI names for JDO resources with "jdo/"
(e.g, the bean JNDI name might be "java:comp/env/jdo/myjdo").
</li>
<li>Get the JDO object in your bean as :
<pre>
public MyObject a_method() {
InitialContext ic = new InitialContext();
DataObjects jdo = (DataObjects) ic.lookup("java:comp/env/jdo/myjdo");
Database db = jdo.getDatabase();
db.create(obj1);
[...]
db.remove(obj2);
[...]
whatever action on db
db.close();
return obj1;
}
</pre>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</td>
<td bgcolor="white" valign="top" width="170" height="718">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td><img alt="o" height="1" src="binary.htm" width="1"><font color="#424264"
face="Myriad Web,Arial" size="1"> </font></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr height="20">
<td bgcolor="#FFFFFF">
<div align="right"> <img src="../picture/corner-w.gif" width="10"
height="22"></div>
</td>
<td bgcolor="#336600" width="100%" myriad web, arial"><font color="white"
face="Myriad Web,Arial"><b><img alt="o" border="0" height="1" src="binary.htm"
width="1"></b></font><font face="Arial,Helvetica,sans-serif" color="white"><b>Info
</b></font></td>
<td bgcolor="#396c06"><img alt="o" height="1" src="../picture/blank.gif"
width="1"></td>
</tr>
<tr height="278">
<td height="145"></td>
<td bgcolor="#99cc66" width="100%" height="145">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<table border="0"
cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr height="249">
<td>
<p><a href="http://castor.exolab.org">Castor JDO</a> is
the variant of implementation of
<a
href="http://java.sun.com/aboutJava/communityprocess/jsr/jsr_012_dataobj.html">JSR-12
Java Data Objects Specification</a>.
It is a part of
<a href="http://www.exolab.org">ExoLab</a> project.</p>
<p> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#99cc66" height="145"></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr height="18">
<td> </td>
</tr>
<tr height="308">
<td><img alt="o" height="1" src="binary.htm" width="1"><font
color="#424264" face="Myriad Web,Arial" size="1">
</font>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr height="20">
<td bgcolor="#FFFFFF">
<div align="right"> <img src="../picture/corner-w.gif" width="10"
height="22"></div>
</td>
<td bgcolor="#336600" width="100%"><font color="white" face="Myriad
Web,Arial"><b><img alt="o" border="0" height="1" src="binary.htm"
width="1"></b></font><font face="Arial,Helvetica,sans-serif" color="white"><b>The
tasks </b></font></td>
<td bgcolor="#396c06"><img alt="o" height="1"
src="../picture/blank.gif" width="1"></td>
</tr>
<tr height="296">
<td height="195"></td>
<td bgcolor="#99cc66" width="100%" height="195">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<table
border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr
height="249">
<td height="209">No foreseeable tasks by now.
Sitting and waiting for a feedback.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#99cc66" height="195"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> </td>
</tr>
<tr>
<td><img alt="o" height="1" src="binary.htm" width="1"><font
color="#424264" face="Myriad Web,Arial" size="1">
</font></td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td bgcolor="#FFFFFF">
<div align="right"> <img src="../picture/corner-w.gif" width="10"
height="22"></div>
</td>
<td bgcolor="#336600" width="100%" nowrap><font
face="Arial,Helvetica,sans-serif" color="white" size="3"><b>Have
a look at... </b></font></td>
<td bgcolor="#396c06"><img alt="o" height="1" src="../picture/blank.gif"
width="1"></td>
</tr>
<tr height="253">
<td></td>
<td bgcolor="#ffcc00" width="100%">
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<table border="0" cellpadding="2" cellspacing="0" width="100%">
<tr height="21">
<td width="67" height="21"><a href="../mailing.htm"
target="mainFrame"><font face="Myriad Web,Arial" size="3" color="black">Mailing
lists </font></a></td>
</tr>
<tr>
<td width="67"><a href="../cvs.htm" target="mainFrame"><font
face="Myriad Web,Arial" size="3" color="black">CVS</font></a></td>
</tr>
<tr>
<td width="67"><a href="../binary.htm"
target="mainFrame"><font face="Myriad Web,Arial" size="3"
color="black">Binary</font></a></td>
</tr>
<tbody> </tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#99cc66"></td>
</tr>
</tbody>
</table>
</td>
<td bgcolor="#bfbffe" height="718"></td>
</tr>
</table>
</body>
</html>
1.1 jbossweb/castorjdo/jboss-castorjdo.jar
<<Binary file>>