User: olegnitz Date: 01/04/21 03:21:49 Modified: castorjdo README.txt Log: Updated build instructions Revision Changes Path 1.6 +3 -89 contrib/castorjdo/README.txt Index: README.txt =================================================================== RCS file: /cvsroot/jboss/contrib/castorjdo/README.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- README.txt 2001/01/04 09:56:18 1.5 +++ README.txt 2001/04/21 10:21:49 1.6 @@ -9,106 +9,20 @@ * Build jBoss: go to jboss\src\build and run build.bat or build.sh -* Put Castor jar file http://ftp.exolab.org/ftp/jars/castor-0.8.11.jar +* Put Castor jar file http://ftp.exolab.org/ftp/jars/castor-0.9.2.jar to contrib\castorjdo\lib * Build the CastorJDO MBean: go to contrib\castorjdo\src\build and run build.bat or build.sh -* The result is a jar file contrib\castorjdo\dist\jboss-castorjdo.jar +* The result is a jar file contrib\castorjdo\dist\jboss-castorjdo.jar o--------------------o HOW TO USE IT : -* Put the castor jar file and the CastorJDO MBean jar in lib/ext directory. -By now you also have to put there the xerces.jar, which can be extracted from -http://ftp.exolab.org/ftp/jars/castor-0.8.11.zip - -* Add the Mlet in jboss.conf - -<MLET CODE = "org.jboss.jdo.castor.CastorJDOImpl" ARCHIVE="jboss.jar,castor-0.8.11.jar" CODEBASE="../lib/ext/"> - <ARG TYPE="java.lang.String" VALUE="file:../conf/database.xml"> - <ARG TYPE="java.lang.String" VALUE="dataObjectsJndiName"> - <ARG TYPE="java.lang.Integer" VALUE="0"> - <ARG TYPE="java.lang.Boolean" VALUE="false"> - <ARG TYPE="java.lang.Boolean" VALUE="false"> -</MLET> - -where: - - the first argument is 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.: - - <database name="test" engine="oracle" > - <jndi name="dataSourceJndiName"/> - <mapping href="mapping.xml" /> - </database> - - - 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. - - the second argument is the JNDI name that is used for binding bean - resource references. See below. - - the third argument is a lock timeout in seconds, value "0" means - "use the Castor default value" (which now equals 10 seconds). - - the fourth argument is a flag of logging. When you set it to true, - the CastorJDO MBean sends information messages and warnings to - jBoss loggers. - - the fifth argument tells if your JDO classes are loaded via - ClassPathExtension MLET in jboss.conf - in this case set the argument - to "true", or via EJB jar classpath (i.e. either they are in the - same jar or they are accessible via Class-Path: attribute of - META-INF/MANIFEST.MF) - in this case set the argument to "false". - - is a flag of useflag of logging. When you set it to true, - the CastorJDO MBean sends information messages and warnings to - jBoss loggers. - -* Declare the resource managers in your jboss.xml besides your -ejb-jar.xml, e.g.: - <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> - - -* Declare the resource manager JNDI ENC for the beans in ejb-jar.xml, e.g.: - - <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> - -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"). - -* Get the JDO object in your Session bean as : - -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(); -} - +See http://www.jboss.org/business/jboss-castor.html o--------------------o _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-development
