You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2004/02/06 09:55:05 UTC
cvs commit: incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee ENCHelper.java URIRefConfigBean.java
djencks 2004/02/06 00:55:04
Modified: modules/deployment project.xml
modules/deployment/src/java/org/apache/geronimo/deployment/plugin
DConfigBeanRootSupport.java DConfigBeanSupport.java
DeploymentConfigurationSupport.java
DeploymentManagerImpl.java
modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application
EARConfigBean.java EARConfiguration.java
EARConfigurationFactory.java
modules/deployment/src/java/org/apache/geronimo/deployment/plugin/client
ClientConfigBean.java
ClientConfigurationFactory.java
modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories
DeploymentConfigurationFactory.java
modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee
ENCHelper.java URIRefConfigBean.java
Log:
mostly xmlbeans support in 88 supporting classes
Revision Changes Path
1.8 +10 -1 incubator-geronimo/modules/deployment/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/project.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- project.xml 3 Feb 2004 16:41:59 -0000 1.7
+++ project.xml 6 Feb 2004 08:55:04 -0000 1.8
@@ -26,6 +26,15 @@
<dependencies>
+ <!-- needed for xmlbeans runtime-->
+ <dependency>
+ <groupId>xmlbeans</groupId>
+ <artifactId>xbean-apache</artifactId>
+ <version>1.0-DEV</version>
+ <properties>
+ </properties>
+ </dependency>
+
<dependency>
<groupId>geronimo</groupId>
<artifactId>geronimo-kernel</artifactId>
1.2 +8 -5 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DConfigBeanRootSupport.java
Index: DConfigBeanRootSupport.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DConfigBeanRootSupport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DConfigBeanRootSupport.java 22 Jan 2004 04:44:43 -0000 1.1
+++ DConfigBeanRootSupport.java 6 Feb 2004 08:55:04 -0000 1.2
@@ -59,14 +59,17 @@
import javax.enterprise.deploy.spi.DConfigBeanRoot;
import javax.enterprise.deploy.spi.DConfigBean;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlObject;
+
/**
- *
- *
+ *
+ *
* @version $Revision$ $Date$
*/
public abstract class DConfigBeanRootSupport extends DConfigBeanSupport implements DConfigBeanRoot {
- public DConfigBeanRootSupport(DDBeanRoot ddBean) {
- super(ddBean);
+ public DConfigBeanRootSupport(DDBeanRoot ddBean, XmlObject xmlObject, SchemaTypeLoader schemaTypeLoader) {
+ super(ddBean, xmlObject, schemaTypeLoader);
}
public DConfigBean getDConfigBean(DDBeanRoot ddBeanRoot) {
1.5 +16 -6 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DConfigBeanSupport.java
Index: DConfigBeanSupport.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DConfigBeanSupport.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DConfigBeanSupport.java 23 Jan 2004 19:58:16 -0000 1.4
+++ DConfigBeanSupport.java 6 Feb 2004 08:55:04 -0000 1.5
@@ -58,14 +58,18 @@
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.IOException;
-import java.io.PrintWriter;
+import java.io.InputStream;
+import java.io.OutputStream;
+
import javax.enterprise.deploy.model.DDBean;
import javax.enterprise.deploy.model.XpathEvent;
import javax.enterprise.deploy.spi.DConfigBean;
import javax.enterprise.deploy.spi.exceptions.BeanNotFoundException;
import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
-import org.w3c.dom.Element;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
/**
*
@@ -75,9 +79,13 @@
public abstract class DConfigBeanSupport implements DConfigBean {
protected final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private final DDBean ddBean;
+ protected XmlObject xmlObject;
+ private final SchemaTypeLoader schemaTypeLoader;
- public DConfigBeanSupport(DDBean ddBean) {
+ public DConfigBeanSupport(DDBean ddBean, XmlObject xmlObject, SchemaTypeLoader schemaTypeLoader) {
this.ddBean = ddBean;
+ this.xmlObject = xmlObject;
+ this.schemaTypeLoader = schemaTypeLoader;
}
public DDBean getDDBean() {
@@ -107,9 +115,11 @@
pcs.removePropertyChangeListener(pcl);
}
- public void toXML(PrintWriter writer) throws IOException {
+ public void toXML(OutputStream outputStream) throws IOException {
+ xmlObject.save(outputStream);
}
- public void fromXML(Element element) {
+ public void fromXML(InputStream inputStream) throws XmlException, IOException {
+ xmlObject = schemaTypeLoader.parse(inputStream, null, null);
}
}
1.2 +32 -2 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DeploymentConfigurationSupport.java
Index: DeploymentConfigurationSupport.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DeploymentConfigurationSupport.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DeploymentConfigurationSupport.java 22 Jan 2004 00:51:09 -0000 1.1
+++ DeploymentConfigurationSupport.java 6 Feb 2004 08:55:04 -0000 1.2
@@ -57,6 +57,8 @@
import java.io.OutputStream;
import java.io.InputStream;
+import java.io.IOException;
+
import javax.enterprise.deploy.spi.DeploymentConfiguration;
import javax.enterprise.deploy.spi.DConfigBeanRoot;
import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
@@ -64,6 +66,8 @@
import javax.enterprise.deploy.model.DeployableObject;
import javax.enterprise.deploy.model.DDBeanRoot;
+import org.apache.xmlbeans.XmlException;
+
/**
*
*
@@ -72,8 +76,11 @@
public abstract class DeploymentConfigurationSupport implements DeploymentConfiguration {
private final DeployableObject deployable;
- public DeploymentConfigurationSupport(DeployableObject deployable) {
+ protected DConfigBeanRootSupport dConfigRoot;
+
+ public DeploymentConfigurationSupport(DeployableObject deployable, DConfigBeanRootSupport dConfigRoot) {
this.deployable = deployable;
+ this.dConfigRoot = dConfigRoot;
}
public DeployableObject getDeployableObject() {
@@ -81,6 +88,9 @@
}
public DConfigBeanRoot getDConfigBeanRoot(DDBeanRoot bean) throws ConfigurationException {
+ if (getDeployableObject().getDDBeanRoot().equals(bean)) {
+ return dConfigRoot;
+ }
return null;
}
@@ -88,14 +98,34 @@
}
public void save(OutputStream outputArchive) throws ConfigurationException {
+ try {
+ dConfigRoot.toXML(outputArchive);
+ outputArchive.flush();
+ } catch (IOException e) {
+ throw (ConfigurationException) new ConfigurationException("Unable to save configuration").initCause(e);
+ }
}
public void restore(InputStream inputArchive) throws ConfigurationException {
+ try {
+ dConfigRoot.fromXML(inputArchive);
+ } catch (IOException e) {
+ throw (ConfigurationException) new ConfigurationException("Error reading configuration input").initCause(e);
+ } catch (XmlException e) {
+ throw (ConfigurationException) new ConfigurationException("Error parsing configuration input").initCause(e);
+ }
}
public void saveDConfigBean(OutputStream outputArchive, DConfigBeanRoot bean) throws ConfigurationException {
+ try {
+ ((DConfigBeanRootSupport)bean).toXML(outputArchive);
+ outputArchive.flush();
+ } catch (IOException e) {
+ throw (ConfigurationException) new ConfigurationException("Unable to save configuration").initCause(e);
+ }
}
+ //todo figure out how to implement this.
public DConfigBeanRoot restoreDConfigBean(InputStream inputArchive, DDBeanRoot bean) throws ConfigurationException {
return null;
}
1.8 +94 -24 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DeploymentManagerImpl.java
Index: DeploymentManagerImpl.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/DeploymentManagerImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DeploymentManagerImpl.java 26 Jan 2004 05:55:26 -0000 1.7
+++ DeploymentManagerImpl.java 6 Feb 2004 08:55:04 -0000 1.8
@@ -64,8 +64,10 @@
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
+
import javax.enterprise.deploy.model.DeployableObject;
import javax.enterprise.deploy.shared.CommandType;
import javax.enterprise.deploy.shared.DConfigBeanVersionType;
@@ -78,17 +80,22 @@
import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
import javax.enterprise.deploy.spi.exceptions.TargetException;
import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.geronimo.deployment.DeploymentException;
import org.apache.geronimo.deployment.DeploymentModule;
import org.apache.geronimo.deployment.plugin.factories.DeploymentConfigurationFactory;
-import org.apache.geronimo.deployment.util.XMLUtil;
+import org.apache.geronimo.gbean.GBean;
+import org.apache.geronimo.gbean.GBeanContext;
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
import org.apache.geronimo.gbean.GConstructorInfo;
+import org.apache.geronimo.gbean.GOperationInfo;
import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.WaitingException;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
+import org.apache.xmlbeans.XmlObject;
import org.w3c.dom.Document;
/**
@@ -96,8 +103,12 @@
*
* @version $Revision$ $Date$
*/
-public class DeploymentManagerImpl implements DeploymentManager {
+public class DeploymentManagerImpl implements DeploymentManager, GBean {
private final DeploymentServer server;
+ private final Map schemaTypeToFactoryMap = new HashMap();
+ private final Map schemaTypeToLoaderMap = new LinkedHashMap();
+ private final SchemaTypeLoader thisTypeLoader = XmlBeans.getContextTypeLoader();
+ private SchemaTypeLoader schemaTypeLoader = thisTypeLoader;
private final Map configurationFactories;
public DeploymentManagerImpl(
@@ -109,6 +120,9 @@
DeploymentConfigurationFactory carFactory
) {
this.server = server;
+ //make sure context loader is always present
+ //todo think if null is a plausible key here.
+ schemaTypeToLoaderMap.put(null, thisTypeLoader);
configurationFactories = new HashMap(5);
addFactory(ModuleType.EAR, earFactory);
addFactory(ModuleType.WAR, warFactory);
@@ -117,6 +131,23 @@
addFactory(ModuleType.CAR, carFactory);
}
+ public synchronized void addDeploymentConfigurationFactory(SchemaType schemaType, SchemaTypeLoader schemaTypeLoader, DeploymentConfigurationFactory factory) {
+ schemaTypeToFactoryMap.put(schemaType, factory);
+ schemaTypeToLoaderMap.put(schemaType, schemaTypeLoader);
+ rebuildSchemaTypeLoader();
+ }
+
+ public synchronized void removeDeploymentConfigurationFactory(SchemaType schemaType) {
+ schemaTypeToFactoryMap.remove(schemaType);
+ schemaTypeToLoaderMap.remove(schemaType);
+ rebuildSchemaTypeLoader();
+ }
+
+ private void rebuildSchemaTypeLoader() {
+ SchemaTypeLoader[] loaders = (SchemaTypeLoader[]) schemaTypeToLoaderMap.values().toArray(new SchemaTypeLoader[schemaTypeToLoaderMap.size()]);
+ schemaTypeLoader = XmlBeans.typeLoaderUnion(loaders);
+ }
+
private void addFactory(ModuleType type, DeploymentConfigurationFactory factory) {
if (factory != null) {
configurationFactories.put(type, factory);
@@ -183,35 +214,50 @@
}
public ProgressObject distribute(Target[] targetList, File moduleArchive, File deploymentPlan) throws IllegalStateException {
- Document doc;
+ InputStream moduleArchiveStream = null;
try {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- doc = parser.parse(deploymentPlan);
- } catch (Exception e) {
- return new FailedProgressObject(CommandType.DISTRIBUTE, e.getMessage());
+ moduleArchiveStream = new FileInputStream(moduleArchive);
+ } catch (FileNotFoundException e) {
+ return new FailedProgressObject(CommandType.DISTRIBUTE, "Could not find module archive: " + moduleArchive);
}
- URI configID;
+ InputStream deploymentPlanStream = null;
try {
- configID = getConfigID(doc);
+ deploymentPlanStream = new FileInputStream(deploymentPlan);
+ } catch (FileNotFoundException e) {
+ return new FailedProgressObject(CommandType.DISTRIBUTE, "Could not find deployment plan: " + deploymentPlan);
+ }
+ return distribute(targetList, moduleArchiveStream, deploymentPlanStream);
+ }
+
+ public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException {
+ XmlObject plan;
+ URI configId;
+ try {
+ plan = schemaTypeLoader.parse(deploymentPlan, null, null);
+ configId = getConfigID(null);
+ } catch (org.apache.xmlbeans.XmlException e) {
+ return new FailedProgressObject(CommandType.DISTRIBUTE, "Could not parse deployment plan");
+ } catch (java.io.IOException e) {
+ return new FailedProgressObject(CommandType.DISTRIBUTE, "Could not read deployment plan");
} catch (URISyntaxException e) {
- return new FailedProgressObject(CommandType.DISTRIBUTE, e.getMessage());
+ return new FailedProgressObject(CommandType.DISTRIBUTE, "Could not read construct configId URI");
}
+ SchemaType planType = plan.schemaType();
+ DeploymentConfigurationFactory factory = (DeploymentConfigurationFactory) schemaTypeToFactoryMap.get(planType);
DeploymentModule module = null;
- for (Iterator i = configurationFactories.values().iterator(); i.hasNext();) {
- DeploymentConfigurationFactory factory = (DeploymentConfigurationFactory) i.next();
- try {
- module = factory.createModule(moduleArchive, doc, configID, server.isLocal());
- } catch (DeploymentException e) {
- return new FailedProgressObject(CommandType.DISTRIBUTE, e.getMessage());
- }
+ try {
+ module = factory.createModule(moduleArchive, plan, configId, server.isLocal());
+ } catch (DeploymentException e) {
+ return new FailedProgressObject(CommandType.DISTRIBUTE, e.getMessage());
}
if (module == null) {
return new FailedProgressObject(CommandType.DISTRIBUTE, "No deployer found for supplied plan");
}
- return server.distribute(targetList, module, configID);
- }
+ return server.distribute(targetList, module, configId);
- public ProgressObject distribute(Target[] targetList, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException {
+
+ //this won't get called.
+ /*
Document doc;
try {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
@@ -238,6 +284,7 @@
return new FailedProgressObject(CommandType.DISTRIBUTE, "No deployer found for supplied plan");
}
return server.distribute(targetList, module, configID);
+ */
}
public ProgressObject start(TargetModuleID[] moduleIDList) throws IllegalStateException {
@@ -274,16 +321,39 @@
// @todo shut down the deployment kernel
}
+ //should we be using this or reading configID from deploymentplan?
private URI getConfigID(Document doc) throws URISyntaxException {
String id = Long.toString(System.currentTimeMillis()); // unique enough one hopes
- id = XMLUtil.getChildContent(doc.getDocumentElement(), "config-id", id, id);
+ //id = XMLUtil.getChildContent(doc.getDocumentElement(), "config-id", id, id);
return new URI(id);
}
public static final GBeanInfo GBEAN_INFO;
+ public void setGBeanContext(GBeanContext context) {
+ }
+
+ public void doStart() throws WaitingException, Exception {
+ for (Iterator iterator = configurationFactories.values().iterator(); iterator.hasNext();) {
+ DeploymentConfigurationFactory factory = (DeploymentConfigurationFactory) iterator.next();
+ addDeploymentConfigurationFactory(factory.getSchemaType(), factory.getSchemaTypeLoader(), factory);
+ }
+ }
+
+ public void doStop() throws WaitingException, Exception {
+ for (Iterator iterator = configurationFactories.values().iterator(); iterator.hasNext();) {
+ DeploymentConfigurationFactory factory = (DeploymentConfigurationFactory) iterator.next();
+ removeDeploymentConfigurationFactory(factory.getSchemaType());
+ }
+ }
+
+ public void doFail() {
+ }
+
static {
GBeanInfoFactory infoFactory = new GBeanInfoFactory("JSR88 Deployment Manager", DeploymentManagerImpl.class.getName());
+ infoFactory.addOperation(new GOperationInfo("addDeploymentConfigurationFactory", new String[]{SchemaType.class.getName(), SchemaTypeLoader.class.getName(), DeploymentConfigurationFactory.class.getName()}));
+ infoFactory.addOperation(new GOperationInfo("removeDeploymentConfigurationFactory", new String[]{SchemaType.class.getName()}));
infoFactory.addReference(new GReferenceInfo("Server", DeploymentServer.class.getName()));
infoFactory.addReference(new GReferenceInfo("EARFactory", DeploymentConfigurationFactory.class.getName()));
infoFactory.addReference(new GReferenceInfo("WARFactory", DeploymentConfigurationFactory.class.getName()));
1.3 +2 -2 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfigBean.java
Index: EARConfigBean.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfigBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EARConfigBean.java 22 Jan 2004 04:44:43 -0000 1.2
+++ EARConfigBean.java 6 Feb 2004 08:55:04 -0000 1.3
@@ -66,6 +66,6 @@
*/
public class EARConfigBean extends DConfigBeanSupport {
public EARConfigBean(DDBean ddBean) {
- super(ddBean);
+ super(ddBean, null, null);
}
}
1.2 +4 -4 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfiguration.java
Index: EARConfiguration.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfiguration.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- EARConfiguration.java 22 Jan 2004 00:51:09 -0000 1.1
+++ EARConfiguration.java 6 Feb 2004 08:55:04 -0000 1.2
@@ -60,12 +60,12 @@
import org.apache.geronimo.deployment.plugin.DeploymentConfigurationSupport;
/**
- *
- *
+ *
+ *
* @version $Revision$ $Date$
*/
public class EARConfiguration extends DeploymentConfigurationSupport{
public EARConfiguration(DeployableObject deployable) {
- super(deployable);
+ super(deployable, null);
}
}
1.5 +18 -6 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfigurationFactory.java
Index: EARConfigurationFactory.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/application/EARConfigurationFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EARConfigurationFactory.java 26 Jan 2004 05:55:26 -0000 1.4
+++ EARConfigurationFactory.java 6 Feb 2004 08:55:04 -0000 1.5
@@ -69,6 +69,10 @@
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.GBeanInfoFactory;
import org.apache.geronimo.gbean.GOperationInfo;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
import org.w3c.dom.Document;
/**
@@ -77,6 +81,8 @@
* @version $Revision$ $Date$
*/
public class EARConfigurationFactory implements DeploymentConfigurationFactory {
+
+ private static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
public DeploymentConfiguration createConfiguration(DeployableObject deployable) throws InvalidModuleException {
if (!ModuleType.EAR.equals(deployable.getType())) {
throw new InvalidModuleException("DeployableObject must be an EAR");
@@ -84,19 +90,25 @@
return new EARConfiguration(deployable);
}
- public DeploymentModule createModule(InputStream moduleArchive, Document deploymentPlan, URI configID) throws DeploymentException {
- throw new UnsupportedOperationException();
+ public DeploymentModule createModule(InputStream moduleArchive, XmlObject deploymentPlan, URI configID, boolean isLocal) throws DeploymentException {
+ return null;
+ }
+
+ //these might be temporary
+ public SchemaType getSchemaType() {
+ return null;
}
- public DeploymentModule createModule(File moduleArchive, Document deploymentPlan, URI configID, boolean isLocal) throws DeploymentException {
- throw new UnsupportedOperationException();
+ public SchemaTypeLoader getSchemaTypeLoader() {
+ return SCHEMA_TYPE_LOADER;
}
+
public static final GBeanInfo GBEAN_INFO;
static {
GBeanInfoFactory infoFactory = new GBeanInfoFactory("Geronimo EAR Configuration Factory", EARConfigurationFactory.class.getName());
- infoFactory.addOperation(new GOperationInfo("createConfiguration", new String[]{DeployableObject.class.getName()}));
+ infoFactory.addInterface(DeploymentConfigurationFactory.class);
GBEAN_INFO = infoFactory.getBeanInfo();
}
1.3 +2 -2 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/client/ClientConfigBean.java
Index: ClientConfigBean.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/client/ClientConfigBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ClientConfigBean.java 22 Jan 2004 04:44:43 -0000 1.2
+++ ClientConfigBean.java 6 Feb 2004 08:55:04 -0000 1.3
@@ -71,7 +71,7 @@
};
public ClientConfigBean(DDBean ddBean) {
- super(ddBean);
+ super(ddBean, null, null);
}
public String[] getXpaths() {
1.5 +18 -7 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/client/ClientConfigurationFactory.java
Index: ClientConfigurationFactory.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/client/ClientConfigurationFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ClientConfigurationFactory.java 26 Jan 2004 05:55:26 -0000 1.4
+++ ClientConfigurationFactory.java 6 Feb 2004 08:55:04 -0000 1.5
@@ -65,24 +65,35 @@
import org.apache.geronimo.deployment.plugin.factories.DeploymentConfigurationFactory;
import org.apache.geronimo.deployment.DeploymentModule;
import org.apache.geronimo.deployment.DeploymentException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.XmlBeans;
import org.w3c.dom.Document;
/**
- *
- *
+ *
+ *
* @version $Revision$ $Date$
*/
public class ClientConfigurationFactory implements DeploymentConfigurationFactory {
+ private static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.getContextTypeLoader();
public DeploymentConfiguration createConfiguration(DeployableObject deployable) throws InvalidModuleException {
return null;
}
- public DeploymentModule createModule(InputStream moduleArchive, Document deploymentPlan, URI configID) throws DeploymentException {
- throw new UnsupportedOperationException();
+ public DeploymentModule createModule(InputStream moduleArchive, XmlObject deploymentPlan, URI configID, boolean isLocal) throws DeploymentException {
+ return null;
}
- public DeploymentModule createModule(File moduleArchive, Document deploymentPlan, URI configID, boolean isLocal) throws DeploymentException {
- throw new UnsupportedOperationException();
+ //these might be temporary
+ public SchemaType getSchemaType() {
+ return null;
}
+
+ public SchemaTypeLoader getSchemaTypeLoader() {
+ return SCHEMA_TYPE_LOADER;
+ }
+
}
1.5 +11 -7 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories/DeploymentConfigurationFactory.java
Index: DeploymentConfigurationFactory.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/factories/DeploymentConfigurationFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DeploymentConfigurationFactory.java 26 Jan 2004 05:55:26 -0000 1.4
+++ DeploymentConfigurationFactory.java 6 Feb 2004 08:55:04 -0000 1.5
@@ -56,16 +56,17 @@
package org.apache.geronimo.deployment.plugin.factories;
import java.io.InputStream;
-import java.io.File;
import java.net.URI;
+
import javax.enterprise.deploy.model.DeployableObject;
import javax.enterprise.deploy.spi.DeploymentConfiguration;
-import javax.enterprise.deploy.spi.Target;
import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
-import org.apache.geronimo.deployment.DeploymentModule;
import org.apache.geronimo.deployment.DeploymentException;
-import org.w3c.dom.Document;
+import org.apache.geronimo.deployment.DeploymentModule;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeLoader;
/**
*
@@ -75,7 +76,10 @@
public interface DeploymentConfigurationFactory {
public DeploymentConfiguration createConfiguration(DeployableObject deployable) throws InvalidModuleException;
- public DeploymentModule createModule(InputStream moduleArchive, Document deploymentPlan, URI configID) throws DeploymentException;
+ public DeploymentModule createModule(InputStream moduleArchive, XmlObject deploymentPlan, URI configID, boolean isLocal) throws DeploymentException;
+
+ //these might be temporary
+ public SchemaType getSchemaType();
+ public SchemaTypeLoader getSchemaTypeLoader();
- public DeploymentModule createModule(File moduleArchive, Document deploymentPlan, URI configID, boolean isLocal) throws DeploymentException;
}
1.5 +26 -4 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/ENCHelper.java
Index: ENCHelper.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/ENCHelper.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ENCHelper.java 25 Jan 2004 01:53:17 -0000 1.4
+++ ENCHelper.java 6 Feb 2004 08:55:04 -0000 1.5
@@ -80,6 +80,9 @@
* @version $Revision$ $Date$
*/
public class ENCHelper {
+
+ private static final Log log = LogFactory.getLog(ENCHelper.class);
+
public static final String[] ENC_XPATHS = {
"ejb-ref/ejb-ref-name",
"ejb-local-ref/ejb-ref-name",
@@ -96,11 +99,11 @@
public ENCHelper(DDBean ddBean) {
this.ddBean = ddBean;
}
- private static final Log log = LogFactory.getLog(ENCHelper.class);
+
public DConfigBean getDConfigBean(DDBean ddBean) throws ConfigurationException {
String xpath = ddBean.getXpath();
String name = ddBean.getText();
- log.info("Gettig config bean for " + name + " at " + xpath);
+ log.info("Getting config bean for " + name + " at " + xpath);
if (xpath.endsWith("ejb-ref/ejb-ref-name")) {
DConfigBean dcBean = (DConfigBean) ejbRefs.get(name);
if (dcBean == null) {
@@ -161,6 +164,7 @@
}
public void toXML(PrintWriter writer) throws IOException {
+ /*
for (Iterator i = ejbRefs.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
writer.println("<ejb-ref>");
@@ -197,10 +201,11 @@
((DConfigBeanSupport) entry.getValue()).toXML(writer);
writer.println("</resource-ref>");
}
+ */
}
public void fromXML(Element parent) {
- Map ejbRefDDBeans = mapDDBeans("ejb-ref/ejb-ref-name");
+ /* Map ejbRefDDBeans = mapDDBeans("ejb-ref/ejb-ref-name");
Map ejbLocalRefDDBeans = mapDDBeans("ejb-local-ref/ejb-ref-name");
Map serviceRefDDBeans = mapDDBeans("service-ref/service-ref-name");
Map resourceRefDDBeans = mapDDBeans("resource-ref/res-ref-name");
@@ -239,6 +244,23 @@
}
}
}
+ */
+ }
+
+ public Map getEjbRefs() {
+ return ejbRefs;
+ }
+
+ public Map getEjbLocalRefs() {
+ return ejbLocalRefs;
+ }
+
+ public Map getServiceRefs() {
+ return serviceRefs;
+ }
+
+ public Map getResourceRefs() {
+ return resourceRefs;
}
private Map mapDDBeans(String xpath) {
1.2 +4 -4 incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/URIRefConfigBean.java
Index: URIRefConfigBean.java
===================================================================
RCS file: /home/cvs/incubator-geronimo/modules/deployment/src/java/org/apache/geronimo/deployment/plugin/j2ee/URIRefConfigBean.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- URIRefConfigBean.java 23 Jan 2004 22:39:08 -0000 1.1
+++ URIRefConfigBean.java 6 Feb 2004 08:55:04 -0000 1.2
@@ -60,15 +60,15 @@
import org.apache.geronimo.deployment.plugin.DConfigBeanSupport;
/**
- *
- *
+ *
+ *
* @version $Revision$ $Date$
*/
public class URIRefConfigBean extends DConfigBeanSupport {
private String targetURI;
public URIRefConfigBean(DDBean ddBean) {
- super(ddBean);
+ super(ddBean, null, null);
}
public String getTargetURI() {