User: fleury
Date: 00/05/26 11:08:39
Modified: src/java/org/ejboss/container ContainerFactory.java
Container.java
Log:
We initialize with application parameters such as the owner and the name of the
application, this is stored in the container
Revision Changes Path
1.4 +52 -0 ejboss/src/java/org/ejboss/container/ContainerFactory.java
Index: ContainerFactory.java
===================================================================
RCS file:
/products/cvs/ejboss/ejboss/src/java/org/ejboss/container/ContainerFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ContainerFactory.java 2000/05/24 23:30:42 1.3
+++ ContainerFactory.java 2000/05/26 18:08:38 1.4
@@ -101,5 +101,57 @@
return beanNames;
}
+
+ /*
+ * initContainers(EjbJar, owner, application)
+ *
+ * We pass an Jar containing at least one bean to this factory.
+ * For each bean encountered in this EjbJar, we create and init a container
+ * taking into account the type of the Enterprise Bean
+ *
+ * @param EjbJar the EjbJar containing all the beans
+ *
+ */
+ public Collection initContainers(EjbJar ejbJar, String owner, String
application) {
+
+ // Get the enterprise beans
+
+ EnterpriseBeans beans = ejbJar.getEnterpriseBeans();
+
+ // We return the list of beans to the caller
+
+ Vector beanNames = new Vector();
+
+ // Iterate through the enterprise bean instances in the jar
+
+ Iterator iterator = beans.iterator();
+
+ while (iterator.hasNext()) {
+
+ // Get the Enterprise bean
+
+ EnterpriseBean ejb = (EnterpriseBean) iterator.next();
+
+ // set the name on the vector for a list of names
+
+ beanNames.add(ejb.getEjbName());
+
+ // For now we deploy a "Container" we should test the type of the
bean here
+
+ Container container = new Container();
+
+ container.owner = owner;
+
+ container.application = application;
+
+ // We need the bean instance and the full Jar for the assembly
descriptor
+
+ container.init(ejb, ejbJar);
+
+ }
+
+ return beanNames;
+
+ }
}
1.54 +17 -0 ejboss/src/java/org/ejboss/container/Container.java
Index: Container.java
===================================================================
RCS file: /products/cvs/ejboss/ejboss/src/java/org/ejboss/container/Container.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- Container.java 2000/05/22 02:45:16 1.53
+++ Container.java 2000/05/26 18:08:38 1.54
@@ -151,6 +151,15 @@
* @since EJBoss 0.9
*/
public PersistentStorage persistentStorage;
+
+ /*
+ * The User Owner of the container (system)
+ * The Application the bean is part of
+ *
+ */
+ public String owner;
+ public String application;
+ public String logIdentifier;
/******************************************************************************/
@@ -282,6 +291,10 @@
// First the classical construction
metaData = new ContainerMetaData(bean, ejbJar);
+
+ // Log identifier is initialized if owner and application are known
+
+ logIdentifier = bean.getEjbName()+"|"+owner+"|"+application;
// Then the EJBHome construction
@@ -682,6 +695,10 @@
ClassLoader cl = metaData.getHomeInterfaceClass().getClassLoader();
Thread.currentThread().setContextClassLoader( cl );
+
+ // Tracer identifier
+
+ Thread.currentThread().setName(logIdentifier);
ObjectInputStream ois = new ObjectInputStreamWithClassLoader(bais,cl);