dain 2004/04/09 15:04:01
Modified: modules/core/src/java/org/openejb/loader EmbeddedLoader.java
EmbeddingLoader.java
Log:
Added jndi naming bindings
Fixed many problems with ContainerIndex GBean
Converted EJB protocol stack to GBeans
Cleaned up code formating of several classes
Revision Changes Path
1.4 +2 -2
openejb/modules/core/src/java/org/openejb/loader/EmbeddedLoader.java
Index: EmbeddedLoader.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/loader/EmbeddedLoader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EmbeddedLoader.java 10 Mar 2004 22:05:29 -0000 1.3
+++ EmbeddedLoader.java 9 Apr 2004 19:04:01 -0000 1.4
@@ -66,7 +66,7 @@
org.openejb.OpenEJB.init( props );
} catch( Exception e){
- throw new Exception("Cannot initailize OpenEJB. " + e.getMessage());
+ throw new Exception("Cannot initailize OpenEJB", e);
}
}
}
1.2 +32 -32
openejb/modules/core/src/java/org/openejb/loader/EmbeddingLoader.java
Index: EmbeddingLoader.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/loader/EmbeddingLoader.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EmbeddingLoader.java 1 Mar 2004 07:14:43 -0000 1.1
+++ EmbeddingLoader.java 9 Apr 2004 19:04:01 -0000 1.2
@@ -49,63 +49,63 @@
import org.openejb.util.ClasspathUtils;
/**
- *
+ *
*/
public class EmbeddingLoader implements Loader {
-
+
static boolean loaded = false;
-
+
/**
- * Checks to see if OpenEJB is available through classpath.
+ * Checks to see if OpenEJB is available through classpath.
* If it isn't, then the required libraries are
* added and OpenEJB is pulled in and instantiated.
- *
+ *
* @param env
* @exception Exception
*/
- public void load( Hashtable env ) throws Exception{
+ public void load(Hashtable env) throws Exception {
if (loaded) return;
ClassLoader cl = ClasspathUtils.getContextClassLoader();
- try{
+ try {
cl.loadClass("org.openejb.OpenEJB");
- } catch (Exception e){
- importOpenEJBLibraries( env );
- }
- try{
+ } catch (Exception e) {
+ importOpenEJBLibraries(env);
+ }
+ try {
Loader embedded = null;
-
- Class loaderClass = cl.loadClass( "org.openejb.loader.EmbeddedLoader" );
-
- embedded = (Loader)loaderClass.newInstance();
- embedded.load( env );
-
- } catch (Exception e){
- throw new Exception( "Cannot embed OpenEJB. Exception: "+
- e.getClass().getName()+" "+ e.getMessage());
+
+ Class loaderClass = cl.loadClass("org.openejb.loader.EmbeddedLoader");
+
+ embedded = (Loader) loaderClass.newInstance();
+ embedded.load(env);
+
+ } catch (Exception e) {
+ throw new Exception("Cannot embed OpenEJB. Exception: " +
e.getClass().getName(), e);
}
loaded = true;
}
-
+
// Sets the openejb.home system variable
- private void importOpenEJBLibraries( Hashtable env ) throws Exception{
+ private void importOpenEJBLibraries(Hashtable env) throws Exception {
// Sets the openejb.home system variable
- try{
- if ( env.get("openejb.home") != null ) {
- System.setProperty("openejb.home", (String)env.get("openejb.home"));
+ try {
+ if (env.get("openejb.home") != null) {
+ System.setProperty("openejb.home", (String)
env.get("openejb.home"));
}
- } catch (Exception e){}
-
- try{
+ } catch (Exception e) {
+ }
+
+ try {
// Loads all the libraries in the openejb.home/lib directory
org.openejb.util.ClasspathUtils.addJarsToPath("lib");
// Loads all the libraries in the openejb.home/dist directory
org.openejb.util.ClasspathUtils.addJarsToPath("dist");
- } catch (Exception e){
- throw new Exception( "Could not load OpenEJB libraries. Exception: "+
- e.getClass().getName()+" "+ e.getMessage());
+ } catch (Exception e) {
+ throw new Exception("Could not load OpenEJB libraries. Exception: " +
+ e.getClass().getName() + " " + e.getMessage());
}
}
}