Here's a newer copy, with BeanInfo classes for the beans, an update to list all the beans in the manifest, and a new build script entry to produce a JSR-88 server provider JAR. I generated one big patch files this time, since it was getting to be a lot of individual files -- let me know if separate patch files are preferred.
Aaron On Sat, 16 Aug 2003, Aaron Mulder wrote: > Here's an updated patch with the DConfigBeans for JSR-88. It now > include DConfigBeans for most of the obvious EJB elements (EJB refs, > resource refs, etc.). There's also a schema for a Geronimo EJB DD, > patches to the build files to run Castor on the schema, and a patch to the > DeploymentManager to actually return DConfigBeans. Finally, there's a > very minimal test case; it can't go much further without some DDBeans to > work with. > > Aaron > > P.S. Note that the code won't compile unless you run the patched build > first to generate the Castor obejcts.
<<attachment: jsr88-dconfigbeans.zip>>
?
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/EjbJarDeploymentConfiguration.java
? modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/jar
Index: modules/core/maven.xml
===================================================================
RCS file: /home/cvspublic/incubator-geronimo/modules/core/maven.xml,v
retrieving revision 1.6
diff -c -r1.6 maven.xml
*** modules/core/maven.xml 16 Aug 2003 15:14:12 -0000 1.6
--- modules/core/maven.xml 18 Aug 2003 00:46:04 -0000
***************
*** 12,17 ****
--- 12,50 ----
</preGoal>
<preGoal name="java:compile">
+ <attainGoal name="castor:prepare-filesystem"/>
+
+ <j:set var="schema" value="${basedir}/src/xml/geronimo-ejb-jar.xsd"/>
+ <j:set var="gen"
value="${pom.getPluginContext('maven-castor-plugin').getVariable('maven.castor.dest')}"/>
+
+ <ant:java className="org.exolab.castor.builder.SourceGenerator"
+ failonerror="true">
+ <ant:arg value="-i"/>
+ <ant:arg value="${schema}"/>
+ <!--
+ <ant:arg value="-binding-file"/>
+ <ant:arg value="${basedir}/src/etc/twiddle-configuration-binding.xml"/>
+ -->
+ <ant:arg value="-package"/>
+ <ant:arg value="org.apache.geronimo.enterprise.deploy.common"/>
+ <ant:arg value="-types"/>
+ <ant:arg value="j2"/>
+ <ant:arg value="-nomarshall"/>
+ <ant:arg value="-f"/>
+ <ant:arg value="-dest"/>
+ <ant:arg value="${gen}"/>
+ </ant:java>
+ </preGoal>
+
+ <postGoal name="java:compile">
+ <ant:echo message="Generating a JSR-88 Product Provider JAR" />
+ <ant:jar destfile="${basedir}/target/jsr88-geronimo-plugin.jar"
+ basedir="${basedir}/target/classes"
+
includes="org/apache/geronimo/enterprise/deploy/provider/**/*.class"
+
manifest="${basedir}/src/conf/jsr88-product-provider-manifest.mf" />
+ </postGoal>
+
+ <preGoal name="java:compile">
<!--
<j:set var="maven.javacc.compile.src" value="target/gen-src"/>
<ant:path id="maven.javacc.compile.src.set"
location="${maven.javacc.compile.src}"/>
Index: modules/core/project.xml
===================================================================
RCS file: /home/cvspublic/incubator-geronimo/modules/core/project.xml,v
retrieving revision 1.10
diff -c -r1.10 project.xml
*** modules/core/project.xml 16 Aug 2003 19:31:46 -0000 1.10
--- modules/core/project.xml 18 Aug 2003 00:46:04 -0000
***************
*** 141,146 ****
--- 141,152 ----
</properties>
</dependency>
+ <dependency>
+ <id>castor</id>
+ <version>0.9.5</version>
+ <url>http://castor.exolab.org</url>
+ </dependency>
+
</dependencies>
Index: modules/core/src/conf/jsr88-product-provider-manifest.mf
===================================================================
RCS file:
/home/cvspublic/incubator-geronimo/modules/core/src/conf/jsr88-product-provider-manifest.mf,v
retrieving revision 1.1
diff -c -r1.1 jsr88-product-provider-manifest.mf
*** modules/core/src/conf/jsr88-product-provider-manifest.mf 14 Aug 2003
09:37:23 -0000 1.1
--- modules/core/src/conf/jsr88-product-provider-manifest.mf 18 Aug 2003
00:46:04 -0000
***************
*** 1,2 ****
--- 1,41 ----
Manifest-Version: 1.0
J2EE-DeploymentFactory-Implementation-Class:
org.apache.geronimo.enterprise.deploy.provider.GeronimoDeploymentFactory
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/ContextParam.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EjbJarBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EjbJarRoot.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EjbLocalRefBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EjbRefBean.class
+ Java-Bean: True
+
+ Name:
org/apache/geronimo/enterprise/deploy/provider/jar/EnterpriseBeansBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EntityBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/EnvEntryBean.class
+ Java-Bean: True
+
+ Name:
org/apache/geronimo/enterprise/deploy/provider/jar/MessageDrivenBean.class
+ Java-Bean: True
+
+ Name:
org/apache/geronimo/enterprise/deploy/provider/jar/ResourceEnvRefBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/ResourceRefBean.class
+ Java-Bean: True
+
+ Name:
org/apache/geronimo/enterprise/deploy/provider/jar/SecurityRoleRefBean.class
+ Java-Bean: True
+
+ Name: org/apache/geronimo/enterprise/deploy/provider/jar/SessionBean.class
+ Java-Bean: True
Index:
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/GeronimoDeploymentManager.java
===================================================================
RCS file:
/home/cvspublic/incubator-geronimo/modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/GeronimoDeploymentManager.java,v
retrieving revision 1.1
diff -c -r1.1 GeronimoDeploymentManager.java
***
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/GeronimoDeploymentManager.java
14 Aug 2003 09:37:23 -0000 1.1
---
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/GeronimoDeploymentManager.java
18 Aug 2003 00:46:04 -0000
***************
*** 69,81 ****
import javax.enterprise.deploy.shared.ModuleType;
import javax.enterprise.deploy.shared.DConfigBeanVersionType;
import javax.enterprise.deploy.model.DeployableObject;
/**
* The Geronimo implementation of the JSR-88 DeploymentManager interface.
* This same class is used for both connected mode and disconnected mode.
* It uses a plugin to manage that. Currently only J2EE 1.4 is supported.
*
! * @version $Revision: 1.1 $
*/
public class GeronimoDeploymentManager implements DeploymentManager {
private ServerConnection server; // a connection to an application server
--- 69,82 ----
import javax.enterprise.deploy.shared.ModuleType;
import javax.enterprise.deploy.shared.DConfigBeanVersionType;
import javax.enterprise.deploy.model.DeployableObject;
+ import org.apache.geronimo.enterprise.deploy.provider.jar.EjbJarRoot;
/**
* The Geronimo implementation of the JSR-88 DeploymentManager interface.
* This same class is used for both connected mode and disconnected mode.
* It uses a plugin to manage that. Currently only J2EE 1.4 is supported.
*
! * @version $Revision: 1.1 $ $Date: 2003/08/11 17:59:10 $
*/
public class GeronimoDeploymentManager implements DeploymentManager {
private ServerConnection server; // a connection to an application server
***************
*** 85,91 ****
}
public DeploymentConfiguration createConfiguration(DeployableObject dObj)
throws InvalidModuleException {
! return null; //todo
}
/**
--- 86,96 ----
}
public DeploymentConfiguration createConfiguration(DeployableObject dObj)
throws InvalidModuleException {
! if(dObj.getType().getValue() == ModuleType.EJB.getValue()) {
! return new EjbJarDeploymentConfiguration(dObj, new
EjbJarRoot(dObj.getDDBeanRoot()));
! } else {
! throw new InvalidModuleException("Can't handle modules of type
"+dObj.getType());
! }
}
/**
Index:
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/NoServerConnection.java
===================================================================
RCS file:
/home/cvspublic/incubator-geronimo/modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/NoServerConnection.java,v
retrieving revision 1.1
diff -c -r1.1 NoServerConnection.java
***
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/NoServerConnection.java
14 Aug 2003 09:37:23 -0000 1.1
---
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/NoServerConnection.java
18 Aug 2003 00:46:04 -0000
***************
*** 161,164 ****
--- 161,178 ----
public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream
moduleArchive, InputStream deploymentPlan) throws
UnsupportedOperationException, IllegalStateException {
return null;
}
+
+ /**
+ * @return null (there is no server available)
+ */
+ public String[] getSecurityRoleOptions(String securityRealm) {
+ return null;
+ }
+
+ /**
+ * @return null (there is no server available)
+ */
+ public String[] getResourceJndiNames(String resourceClassName) {
+ return null;
+ }
}
Index:
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/ServerConnection.java
===================================================================
RCS file:
/home/cvspublic/incubator-geronimo/modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/ServerConnection.java,v
retrieving revision 1.1
diff -c -r1.1 ServerConnection.java
***
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/ServerConnection.java
14 Aug 2003 09:37:23 -0000 1.1
---
modules/core/src/java/org/apache/geronimo/enterprise/deploy/provider/ServerConnection.java
18 Aug 2003 00:46:04 -0000
***************
*** 73,78 ****
--- 73,80 ----
* @version $Revision: 1.1 $
*/
public interface ServerConnection {
+ // ---------------------- Methods required by DeploymentManager
----------------------
+
/**
* Releases any server resources and closes the connection to the server.
*/
***************
*** 137,140 ****
--- 139,171 ----
* @see
javax.enterprise.deploy.spi.DeploymentManager#redeploy(javax.enterprise.deploy.spi.TargetModuleID[],
java.io.InputStream, java.io.InputStream)
*/
public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream
moduleArchive, InputStream deploymentPlan) throws
UnsupportedOperationException, IllegalStateException;
+
+ // ---------------------- Methods required to populate Property Editors
----------------------
+
+ /**
+ * Used to provide a list of security users/groups/roles that the deployer
+ * can map a J2EE security role to.
+ *
+ * @param securityRealm The security realm in use by the application
+ *
+ * @return A list of security mapping options, or null if the current user
+ * is not authorized to retrieve that information, or the
+ * information is not available.
+ */
+ public String[] getSecurityRoleOptions(String securityRealm);
+
+ /**
+ * Gets a list of the JNDI names of global resources of a particular type
+ * defined in the server. For example, a list of all javax.sql.DataSource
+ * resources. Note that any resources tied to a particular application
+ * will not be included.
+ *
+ * @param resourceClassName The name of the interface that the resource
+ * should implement (e.g. javax.sql.DataSource).
+ *
+ * @return A list of the JNDI names of the available resources. Returns
+ * null of no such resources are available, the current user is
+ * not authorized to retrieve the list, etc.
+ */
+ public String[] getResourceJndiNames(String resourceClassName);
}
