Author: hemapani Date: Wed Nov 24 05:29:53 2004 New Revision: 106412 URL: http://svn.apache.org/viewcvs?view=rev&rev=106412 Log: fix the geronimo module code for the creating folders at the tnunk target while testing .. there is a ews part that need to be fixed, add a configuration interface to add referances to the ejb configuration Added: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/Configuration.java Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java
Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java&r1=106411&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java (original) +++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/AxisGbean.java Wed Nov 24 05:29:53 2004 @@ -31,7 +31,6 @@ */ public class AxisGbean implements GBeanLifecycle { private static Log log = LogFactory.getLog(AxisGbean.class); - private final String name; private static final GBeanInfo GBEAN_INFO; private final ObjectName objectName; @@ -40,14 +39,16 @@ AxisGbean.class); // attributes - infoFactory.addAttribute("Name", String.class, true); infoFactory.addAttribute("objectName", String.class, false); // operations - infoFactory.setConstructor(new String[]{"Name", - "objectName"}); + infoFactory.setConstructor(new String[]{"objectName"}); GBEAN_INFO = infoFactory.getBeanInfo(); } + + public AxisGbean(){ + this.objectName = null; + } /** * Constructor AxisGbean @@ -55,8 +56,7 @@ * @param name @param objectName */ - public AxisGbean(String name, String objectName) { - this.name = name; + public AxisGbean(String objectName) { this.objectName = JMXUtil.getObjectName(objectName); } @@ -95,14 +95,5 @@ */ public static GBeanInfo getGBeanInfo() { return GBEAN_INFO; - } - - /** - * Method getName - * - * @return - */ - public String getName() { - return name; } } Added: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/Configuration.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/Configuration.java?view=auto&rev=106412 ============================================================================== --- (empty file) +++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/Configuration.java Wed Nov 24 05:29:53 2004 @@ -0,0 +1,24 @@ +/* + * Copyright 2003,2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.geronimo.axis; + +/** + * @version $Rev: $ $Date: $ + */ + +public interface Configuration { + public ClassLoader getClassLoader(); +} Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java&r1=106411&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java (original) +++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/EJBWSGBean.java Wed Nov 24 05:29:53 2004 @@ -23,11 +23,6 @@ import org.apache.geronimo.gbean.GBeanInfoBuilder; import org.apache.geronimo.gbean.GBeanLifecycle; import org.apache.geronimo.gbean.WaitingException; -import org.apache.geronimo.kernel.config.Configuration; -import org.apache.geronimo.kernel.jmx.JMXUtil; - -import javax.management.ObjectName; - import java.util.Collection; import java.util.Iterator; @@ -36,72 +31,54 @@ */ public class EJBWSGBean implements GBeanLifecycle { private static Log log = LogFactory.getLog(EJBWSGBean.class); - /** - * Field name - */ - private final String name; - - /** - * Field GBEAN_INFO - */ - private static final GBeanInfo GBEAN_INFO; - - /** - * Field objectName - */ - private final ObjectName objectName; - private Configuration ejbConfig; + + public static final GBeanInfo GBEAN_INFO; + private final String objectName; + private Collection classList; + private final Configuration ejbConfig; + static { GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("EJBWSGBean", EJBWSGBean.class); - // attributes - infoFactory.addAttribute("Name", String.class, true); infoFactory.addAttribute("objectName", String.class, false); - infoFactory.addReference("ejbConfig", Configuration.class); infoFactory.addAttribute("classList", Collection.class, true); + + infoFactory.addReference("EjbConfig", Configuration.class); + // operations - infoFactory.setConstructor(new String[]{"Name", - "objectName"}); + infoFactory.setConstructor(new String[]{"objectName"}); + infoFactory.setConstructor(new String[]{"objectName","EjbConfig"}); GBEAN_INFO = infoFactory.getBeanInfo(); } - /** - * Constructor AxisGbean - * - * @param name - * @param objectName - */ - public EJBWSGBean(String name, String objectName) { - this.name = name; - this.objectName = JMXUtil.getObjectName(objectName); + + public EJBWSGBean(String objectName) { + this.objectName = objectName; + this.ejbConfig = null; } - /** - * Method doFail - */ + public EJBWSGBean(String objectName,Configuration ejbConfig) { + this.objectName = objectName; + System.out.println(ejbConfig); + this.ejbConfig = (Configuration)ejbConfig; + } + + + public void doFail() { - log.info("Axis GBean has failed"); } - /** - * Method doStart - * - * @throws WaitingException - * @throws Exception - */ public void doStart() throws WaitingException, Exception { - System.out.println(name + "has started"); ClassLoader cl = ejbConfig.getClassLoader(); for (Iterator it = classList.iterator(); it.hasNext();) { String className = (String) it.next(); ClassUtils.setClassLoader(className, cl); } AxisGeronimoUtils.addEntryToAxisDD(cl.getResourceAsStream("deploy.wsdd")); - log.info(objectName); } /** @@ -114,49 +91,24 @@ log.info("WebServiceGBean has stoped"); } - /** - * Method getGBeanInfo - * - * @return - */ public static GBeanInfo getGBeanInfo() { return GBEAN_INFO; } - /** - * Method getName - * - * @return - */ - public String getName() { - return name; - } - /** - * @return - */ + public Collection getClassList() { return classList; } - /** - * @return - */ - public Configuration getEjbConfig() { - return ejbConfig; - } - - /** - * @param collection - */ public void setClassList(Collection collection) { classList = collection; } - /** - * @param configuration - */ - public void setEjbConfig(Configuration configuration) { - ejbConfig = configuration; - } +// public Configuration getEjbConfig() { +// return ejbConfig; +// } +// public void setEjbConfig(Configuration configuration) { +// ejbConfig = configuration; +// } } Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java&r1=106411&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java (original) +++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/POJOWSGBean.java Wed Nov 24 05:29:53 2004 @@ -33,7 +33,7 @@ */ public class POJOWSGBean implements GBeanLifecycle { private static Log log = LogFactory.getLog(POJOWSGBean.class); - private final String name; + private final String objectName; private static final GBeanInfo GBEAN_INFO; private URL moduleURL; private Collection classList; @@ -43,20 +43,20 @@ POJOWSGBean.class); // attributes - infoFactory.addAttribute("Name", String.class, true); infoFactory.addAttribute("objectName", String.class, false); infoFactory.addAttribute("moduleURL", URL.class, true); infoFactory.addAttribute("classList", Collection.class, true); // operations - infoFactory.setConstructor(new String[]{"Name", - "objectName"}); + infoFactory.setConstructor(new String[]{"objectName"}); GBEAN_INFO = infoFactory.getBeanInfo(); } - public POJOWSGBean(String name, String objectName) { - this.name = name; + + public POJOWSGBean(String objectName) { + this.objectName = objectName; } + public void doFail() { } @@ -95,12 +95,6 @@ return moduleURL; } - /** - * @return - */ - public String getName() { - return name; - } /** * @param url Modified: geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r1=106411&p2=geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java (original) +++ geronimo/trunk/modules/axis/src/java/org/apache/geronimo/axis/WSConfigBuilder.java Wed Nov 24 05:29:53 2004 @@ -27,6 +27,8 @@ import java.util.jar.JarFile; import java.util.zip.ZipFile; +import javax.management.ObjectName; + import org.apache.geronimo.deployment.ConfigurationBuilder; import org.apache.geronimo.deployment.DeploymentException; import org.apache.geronimo.gbean.GBeanInfo; @@ -34,35 +36,45 @@ import org.apache.geronimo.gbean.WaitingException; import org.apache.geronimo.gbean.jmx.GBeanMBean; import org.apache.geronimo.kernel.config.Configuration; +import org.apache.geronimo.kernel.jmx.JMXUtil; + /** * This Class should build Configurations out of deployment Module. * @version $Rev: $ $Date: $ */ public class WSConfigBuilder implements ConfigurationBuilder { - // private final AxisGbean axisGBean; - -// public WSConfigBuilder(AxisGbean axisGBean){ -// //this.axisGBean = axisGBean; -// } - public WSConfigBuilder(){ - //this.axisGBean = axisGBean; - } + private static final GBeanInfo GBEAN_INFO; - public static final GBeanInfo GBEAN_INFO; + private final ObjectName objectName; + private AxisGbean axisGbean; + static { - GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("WSConfigBuilder",WSConfigBuilder.class); - //referances - //infoFactory.addReference("AxisGBean", AxisGbean.class); - //interfaces + GBeanInfoBuilder infoFactory = new GBeanInfoBuilder("WSConfigBuilder", + WSConfigBuilder.class); + + // attributes + infoFactory.addAttribute("objectName", String.class, false); + infoFactory.addReference("AxisGbean",AxisGbean.class); infoFactory.addInterface(ConfigurationBuilder.class); - //constructers - //infoFactory.setConstructor(new String[]{"AxisGBean"}); - + + // operations + infoFactory.setConstructor(new String[]{"objectName","AxisGbean"}); + infoFactory.setConstructor(new String[]{"objectName"}); GBEAN_INFO = infoFactory.getBeanInfo(); } + public WSConfigBuilder(String objectName,AxisGbean axisGbean) { + this.objectName = JMXUtil.getObjectName(objectName); + this.axisGbean = axisGbean; + } + + public WSConfigBuilder(String objectName) { + this.objectName = JMXUtil.getObjectName(objectName); + this.axisGbean = null; + + } public void doStart() throws WaitingException, Exception { } @@ -120,6 +132,12 @@ return null; } + public void doFail() { + } + public void doStop() throws WaitingException, Exception { + } + + // /** // * the users suppose to use // * <code> @@ -243,6 +261,18 @@ public static GBeanInfo getGBeanInfo() { return GBEAN_INFO; + } + /** + * @return Returns the axisGbean. + */ + public AxisGbean getAxisGbean() { + return axisGbean; + } + /** + * @param axisGbean The axisGbean to set. + */ + public void setAxisGbean(AxisGbean axisGbean) { + this.axisGbean = axisGbean; } } Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java Wed Nov 24 05:29:53 2004 @@ -15,6 +15,8 @@ */ package org.apache.geronimo.axis; + + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -47,7 +49,7 @@ protected ObjectName wsConfgBuilderName; protected Kernel kernel; protected ConfigurationStore store; - protected File outFile = new File("target/temp"); + protected File outFile = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE); /** * @param testName @@ -74,7 +76,7 @@ kernel.startGBean(axisname); GBeanMBean wsConfgBuilderbean = new GBeanMBean(WSConfigBuilder.getGBeanInfo()); - //wsConfgBuilderbean.setReferencePattern("AxisGBean",axisname); + wsConfgBuilderbean.setReferencePattern("AxisGbean",axisname); kernel.loadGBean(wsConfgBuilderName, wsConfgBuilderbean); kernel.startGBean(wsConfgBuilderName); @@ -93,8 +95,41 @@ protected EARConfigBuilder getEARConfigBuilder() throws Exception { URI defaultParentId = new URI("org/apache/geronimo/Server"); +// GBeanMBean moduleBuilder = new GBeanMBean(OpenEJBModuleBuilder.GBEAN_INFO); +// moduleBuilder.setAttribute("defaultParentId",defaultParentId); +// kernel.loadGBean(AxisGeronimoConstants.OPENEJB_MODULE_BUILDER_NAME,moduleBuilder); +// +// +// //<gbean name="geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/J2EEDeployer" class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder"> +// // <attribute name="defaultParentId">org/apache/geronimo/Server</attribute> +// // <attribute name="j2eeServer" type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute> +// // <attribute name="transactionContextManagerObjectName" type="javax.management.ObjectName">geronimo.server:type=TransactionContextManager</attribute> +// // <attribute name="connectionTrackerObjectName" type="javax.management.ObjectName">geronimo.server:type=ConnectionTracker</attribute> +// // <attribute name="transactionalTimerObjectName" type="javax.management.ObjectName">geronimo.server:type=ThreadPooledTimer,name=TransactionalThreadPooledTimer</attribute> +// // <attribute name="nonTransactionalTimerObjectName" type="javax.management.ObjectName">geronimo.server:type=ThreadPooledTimer,name=NonTransactionalThreadPooledTimer</attribute> +// // <reference name="Repository">*:role=Repository,*</reference> +// // <reference name="EJBConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/J2EEDeployer</reference> +// // <reference name="EJBReferenceBuilder">geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/J2EEDeployer</reference> +// // <reference name="WebConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=Web,config=org/apache/geronimo/J2EEDeployer</reference> +// // <reference name="ConnectorConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/J2EEDeployer</reference> +// // <reference name="ResourceReferenceBuilder">geronimo.deployer:role=ModuleBuilder,type=Connector,config=org/apache/geronimo/J2EEDeployer</reference> +// // <reference name="AppClientConfigBuilder">geronimo.deployer:role=ModuleBuilder,type=AppClient,config=org/apache/geronimo/J2EEDeployer</reference> +// //</gbean> +// +// GBeanMBean earmoduleBuilder = new GBeanMBean(EARConfigBuilder.GBEAN_INFO); +// moduleBuilder.setAttribute("defaultParentId",defaultParentId); +// moduleBuilder.setAttribute("transactionContextManagerObjectName",AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME); +// moduleBuilder.setAttribute("connectionTrackerObjectName",AxisGeronimoConstants.CONNECTION_TRACKER_NAME); +// moduleBuilder.setReferencePattern("EJBConfigBuilder",AxisGeronimoConstants.OPENEJB_MODULE_BUILDER_NAME); +// moduleBuilder.setReferencePattern("EJBReferenceBuilder",AxisGeronimoConstants.OPENEJB_MODULE_BUILDER_NAME); +// moduleBuilder.setReferencePattern("ResourceReferenceBuilder",AxisGeronimoConstants.OPENEJB_MODULE_BUILDER_NAME); +// +// +// kernel.loadGBean(AxisGeronimoConstants.EAR_CONF_BUILDER_NAME,moduleBuilder); +// OpenEJBModuleBuilder moduleBuilder = new OpenEJBModuleBuilder(null, defaultParentId, null); - EARConfigBuilder earConfigBuilder = + + EARConfigBuilder earConfigBuilder = new EARConfigBuilder(defaultParentId, new ObjectName(j2eeDomainName + ":j2eeType=J2EEServer,name=" + j2eeServerName), transactionManagerObjectName, Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AxisGBeanTest.java Wed Nov 24 05:29:53 2004 @@ -21,6 +21,7 @@ import java.net.URL; import java.net.URLClassLoader; +import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import org.apache.geronimo.axis.testUtils.TestingUtils; @@ -47,7 +48,6 @@ ClassLoader cl = getClass().getClassLoader(); ClassLoader myCl = new URLClassLoader(new URL[0], cl); GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl); - gbean.setAttribute("Name", "Test"); kernel.loadGBean(name, gbean); kernel.startGBean(name); System.out.println(kernel.getMBeanServer().getAttribute(name, "state")); @@ -63,6 +63,18 @@ kernel.stopGBean(name); kernel.unloadGBean(name); } + + +// public void testEJBWebServiceGBean() throws Exception{ +// ObjectName ejbname = new ObjectName("test:name=ejbwsGBean"); +// GBeanMBean ejbBean = new GBeanMBean(EJBWSGBean.getGBeanInfo()); +// kernel.loadGBean(ejbname,ejbBean); +// kernel.startGBean(ejbname); +// +// kernel.stopGBean(ejbname); +// kernel.unloadGBean(ejbname); +// +// } protected void setUp() throws Exception { Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java Wed Nov 24 05:29:53 2004 @@ -23,6 +23,7 @@ import javax.management.ObjectName; import org.apache.geronimo.axis.AbstractTestCase; +import org.apache.geronimo.axis.EJBWSGBean; import org.apache.geronimo.axis.testUtils.AxisGeronimoConstants; import org.apache.geronimo.axis.testUtils.J2EEManager; import org.apache.geronimo.axis.testUtils.TestingUtils; @@ -95,41 +96,52 @@ null); - JarFile jarFileModules = null; - System.out.println("**"+jarFile +"**"); + ObjectName config = TestingUtils.installAndStartEJB(jarFile,AxisGeronimoConstants.STORE,earConfigBuilder,kernel); - File ejbdir = AxisGeronimoConstants.STORE.createNewConfigurationDir(); - - - try { - jarFileModules = new JarFile(jarFile); - Object plan = earConfigBuilder.getDeploymentPlan(null, jarFileModules); - earConfigBuilder.buildConfiguration(plan, jarFileModules, ejbdir); - } finally { - if (jarFileModules != null) { - jarFileModules.close(); - } - } - - -// ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName()); -// GBeanMBean gbean = AxisGeronimoUtils.loadConfig(ejbdir); -// kernel.loadGBean(name,gbean); -// gbean.setAttribute("baseURL",ejbdir.toURL()); -// kernel.startGBean(name); +// ObjectName ejbname = new ObjectName("test:name=ejbwsGBean"); +// GBeanMBean ejbBean = new GBeanMBean(EJBWSGBean.getGBeanInfo()); +// ejbBean.setReferencePattern("EjbConfig",config); +// kernel.loadGBean(ejbname,ejbBean); +// kernel.startGBean(ejbname); // - URI uri = AxisGeronimoConstants.STORE.install(ejbdir); - - - -// //ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName()); -// GBeanMBean gbean = AxisGeronimoUtils.loadConfig(unpackedDir); -// URI uri = AxisGeronimoUtils.saveConfiguration(gbean,AxisGeronimoConstants.STORE); - - GBeanMBean config = AxisGeronimoConstants.STORE.getConfiguration(uri); - ConfigurationManager configurationManager = kernel.getConfigurationManager(); - ObjectName configName = configurationManager.load(config, AxisGeronimoConstants.STORE.getBaseURL(uri)); - kernel.startRecursiveGBean(configName); +// kernel.stopGBean(ejbname); +// kernel.unloadGBean(ejbname); +// +// JarFile jarFileModules = null; +// System.out.println("**"+jarFile +"**"); +// +// File ejbdir = AxisGeronimoConstants.STORE.createNewConfigurationDir(); +// +// +// try { +// jarFileModules = new JarFile(jarFile); +// Object plan = earConfigBuilder.getDeploymentPlan(null, jarFileModules); +// earConfigBuilder.buildConfiguration(plan, jarFileModules, ejbdir); +// } finally { +// if (jarFileModules != null) { +// jarFileModules.close(); +// } +// } +// +// +//// ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName()); +//// GBeanMBean gbean = AxisGeronimoUtils.loadConfig(ejbdir); +//// kernel.loadGBean(name,gbean); +//// gbean.setAttribute("baseURL",ejbdir.toURL()); +//// kernel.startGBean(name); +//// +// URI uri = AxisGeronimoConstants.STORE.install(ejbdir); +// +// +// +//// //ObjectName name = new ObjectName("geronimo.test:name=" + jarFile.getName()); +//// GBeanMBean gbean = AxisGeronimoUtils.loadConfig(unpackedDir); +//// URI uri = AxisGeronimoUtils.saveConfiguration(gbean,AxisGeronimoConstants.STORE); +// +// GBeanMBean config = AxisGeronimoConstants.STORE.getConfiguration(uri); +// ConfigurationManager configurationManager = kernel.getConfigurationManager(); +// ObjectName configName = configurationManager.load(config, AxisGeronimoConstants.STORE.getBaseURL(uri)); +// kernel.startRecursiveGBean(configName); } protected void tearDown() throws Exception { Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/AxisGeronimoConstants.java Wed Nov 24 05:29:53 2004 @@ -23,6 +23,7 @@ import org.apache.geronimo.gbean.GBeanData; import org.apache.geronimo.kernel.jmx.JMXUtil; import org.apache.geronimo.system.configuration.LocalConfigStore; +import org.openejb.deployment.OpenEJBModuleBuilder; /** * @version $Rev: $ $Date: $ @@ -30,19 +31,19 @@ */ public class AxisGeronimoConstants { - public static final String J2EE_DOMAIN_NAME = "openejb.server"; - public static final String J2EE_SERVER_PREFIX = "TestOpenEJBServer"; + public static final String J2EE_DOMAIN_NAME = "geronimo.server"; + public static final String J2EE_SERVER_STRING = "geronimo"; + public static final ObjectName APPLICATION_NAME = JMXUtil.getObjectName("geronimo.jetty:app=test"); public static final String AXIS_CONFIG_STORE = "target/config-store"; public static final String TEMP_OUTPUT = "target/temp"; public static final ObjectName J2EE_SERVER_INFO = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ServerInfo"); - public static final ObjectName J2EE_SERVER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":j2eeType=J2EEServer,name=" + J2EE_SERVER_PREFIX); + public static final ObjectName J2EE_SERVER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":j2eeType=J2EEServer,name=" + J2EE_SERVER_STRING); + + public static final ObjectName CONNECTION_TRACKER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ConnectionTracker"); - //////////// - public static final ObjectName CONNTECTION_TRACKING_COORDINATOR = JMXUtil.getObjectName("geronimo.test:role=ConnectionTrackingCoordinator"); - //////////// public static final ObjectName WEB_CONTAINER_NAME = JMXUtil.getObjectName("geronimo.jetty:role=Container"); public static final ObjectName WEB_CONNECTOR_NAME = JMXUtil.getObjectName("geronimo.jetty:role=Connector"); @@ -50,18 +51,24 @@ public static final ObjectName EJB_CONTAINER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ContainerIndex"); public static final ObjectName TRANSACTION_MANAGER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=TransactionManager"); - public static final ObjectName TRANSACTION_CONTEXT_MANAGER_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=TransactionContextManager"); - public static final ObjectName TRACKED_CONNECTION_ASSOCIATOR_NAME = JMXUtil.getObjectName("geronimo.test:role=TrackedConnectionAssociator"); - public static final ObjectName WORKMANAGER_NAME = JMXUtil.getObjectName("geronimo.server:type=WorkManager,name=DefaultWorkManager"); + public static final ObjectName TRANSACTION_CONTEXT_MANAGER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=TransactionContextManager"); + public static final ObjectName TRACKED_CONNECTION_ASSOCIATOR_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":role=TrackedConnectionAssociator"); + public static final ObjectName WORKMANAGER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME+ ":type=WorkManager,name=DefaultWorkManager"); + + + public static final ObjectName RESOURCE_ADAPTER_NAME = JMXUtil.getObjectName("openejb.server:j2eeType=ResourceAdapter,J2EEServer=TestOpenEJBServer,name=MockRA"); - public static final ObjectName ACTIVATIONSPEC_NAME = JMXUtil.getObjectName("geronimo.server:j2eeType=ActivationSpec,name=MockMDB"); - public static final ObjectName THREADPOOL_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=ThreadPool,name=DefaultThreadPool"); - public static final ObjectName TRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer"); - public static final ObjectName NONTRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_SERVER_PREFIX + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer"); + public static final ObjectName ACTIVATIONSPEC_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":j2eeType=ActivationSpec,name=MockMDB"); + public static final ObjectName THREADPOOL_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ThreadPool,name=DefaultThreadPool"); + public static final ObjectName TRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer"); + public static final ObjectName NONTRANSACTIONAL_TIMER_NAME = JMXUtil.getObjectName(J2EE_DOMAIN_NAME + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer"); public static final GBeanData ACTIVATION_SPEC_INFO = new GBeanData(ActivationSpecWrapper.getGBeanInfo()); public static File OUTFILE = new File(AxisGeronimoConstants.AXIS_CONFIG_STORE); public static LocalConfigStore STORE = null; + + public static ObjectName OPENEJB_MODULE_BUILDER_NAME = JMXUtil.getObjectName("geronimo.deployer:role=ModuleBuilder,type=EJB,config=org/apache/geronimo/Server"); + public static ObjectName EAR_CONF_BUILDER_NAME = JMXUtil.getObjectName("geronimo.deployer:role=Builder,type=EAR,config=org/apache/geronimo/J2EEDeployer"); static{ try{ Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/JettyServiceWrapper.java Wed Nov 24 05:29:53 2004 @@ -52,7 +52,7 @@ containerPatterns = Collections.singleton(containerName); connectorName = AxisGeronimoConstants.WEB_CONNECTOR_NAME; tmName = AxisGeronimoConstants.TRANSACTION_MANAGER_NAME; - tcaName = AxisGeronimoConstants.CONNTECTION_TRACKING_COORDINATOR; + tcaName = AxisGeronimoConstants.CONNECTION_TRACKER_NAME; tcmName = AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME; } Modified: geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java?view=diff&rev=106412&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r1=106411&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java&r2=106412 ============================================================================== --- geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java (original) +++ geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/testUtils/TestingUtils.java Wed Nov 24 05:29:53 2004 @@ -114,8 +114,7 @@ Kernel kernel, ObjectName wsConfgBuilderName)throws Exception{ URI ejbURI = null; - ObjectName wsconf = new ObjectName("geronimo.test:name=" + jarfile.getName()); - ObjectName ejbconf = new ObjectName("geronimo.test:name=" + jarfile.getName() + "EJB"); + ObjectName wsconf = new ObjectName("geronimo.test:name=" + jarfile.getName()+",value=check"); URI wsURI = new URI("new"); WSPlan plan = null; @@ -125,20 +124,8 @@ ZipEntry zipe = (ZipEntry) entires.nextElement(); String name = zipe.getName(); if (name.endsWith("/ejb-jar.xml")) { - - JarFile module = new JarFile(jarfile); - File unpackedDir = store.createNewConfigurationDir(); - //Install the EJB - Object ejbplan = earConfigBuilder.getDeploymentPlan(null, module); - earConfigBuilder.buildConfiguration(ejbplan, module, unpackedDir); - ejbURI = store.install(unpackedDir); - - //load the EJB Configuration TODO, Do we need this? - GBeanMBean ejbGBean = AxisGeronimoUtils.loadConfig(unpackedDir); - - plan = WSPlan.createPlan(wsURI,wsconf,ejbGBean.getObjectNameObject(),jarfile); - System.out.println("entry found " + name + " the web service is based on a ejb."); - //log.info("the web service is based on a ejb."); + ObjectName ejbConfName = TestingUtils.installAndStartEJB(jarfile,store,earConfigBuilder,kernel); + plan = WSPlan.createPlan(wsURI,wsconf,ejbConfName,jarfile); break; } } @@ -155,19 +142,31 @@ File.class.getName()}); //wsconfBuilder.buildConfiguration(plan, null, wsinstallDir); - if(ejbURI != null){ - GBeanMBean config = store.getConfiguration(ejbURI); - ConfigurationManager configurationManager = kernel.getConfigurationManager(); - ObjectName configName = configurationManager.load(config, null); - kernel.loadGBean(configName,config); - kernel.startRecursiveGBean(configName); - } URI wsInstalledURI = store.install(wsinstallDir); GBeanMBean config = store.getConfiguration(wsInstalledURI); ConfigurationManager configurationManager = kernel.getConfigurationManager(); ObjectName configName = configurationManager.load(config, null); kernel.startRecursiveGBean(configName); + } + + public static ObjectName installAndStartEJB(File jarfile, + ConfigurationStore store, + EARConfigBuilder earConfigBuilder, + Kernel kernel)throws Exception{ + JarFile module = new JarFile(jarfile); + File unpackedDir = store.createNewConfigurationDir(); + //Install the EJB + Object ejbplan = earConfigBuilder.getDeploymentPlan(null, module); + earConfigBuilder.buildConfiguration(ejbplan, module, unpackedDir); + URI ejbURI = store.install(unpackedDir); + + + GBeanMBean config = store.getConfiguration(ejbURI); + ConfigurationManager configurationManager = kernel.getConfigurationManager(); + ObjectName configName = configurationManager.load(config, store.getBaseURL(ejbURI)); + kernel.startRecursiveGBean(configName); + return configName; } }