Author: mszefler
Date: Tue Nov 28 18:29:04 2006
New Revision: 480338
URL: http://svn.apache.org/viewvc?view=rev&rev=480338
Log:
* Simplification of process-store DAO mechanism
* Remove in-memory store, replace with in Hibernate for testing.
* Event scheme to support distributed deployment.
* Re-factor of ProcesStore / BpelServer relationship.
* Thread safety.
* Some tests for processStore
* Consolidate all schema generation in bpel-schemas
* Maven fixes
Modified:
incubator/ode/trunk/axis2/pom.xml
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/deploy/DeploymentPoller.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/GeronimoFactory.java
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/SOAPUtils.java
Modified: incubator/ode/trunk/axis2/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/pom.xml?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
--- incubator/ode/trunk/axis2/pom.xml (original)
+++ incubator/ode/trunk/axis2/pom.xml Tue Nov 28 18:29:04 2006
@@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>org.apache.ode</groupId>
- <artifactId>ode-bpel-dd</artifactId>
+ <artifactId>ode-bpel-schemas</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ode</groupId>
@@ -52,10 +52,6 @@
</dependency>
<dependency>
<groupId>org.apache.ode</groupId>
- <artifactId>ode-naming</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.ode</groupId>
<artifactId>ode-bpel-api</artifactId>
</dependency>
<dependency>
@@ -66,7 +62,6 @@
<groupId>org.apache.ode</groupId>
<artifactId>ode-bpel-store</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.ode</groupId>
<artifactId>ode-bpel-connector</artifactId>
@@ -105,21 +100,25 @@
<groupId>jotm</groupId>
<artifactId>jotm</artifactId>
</dependency>
+
+ <!-- The following are needed by JOTM -->
<dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- </dependency>
- <dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-kernel</artifactId>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+ <scope>runtime</scope>
</dependency>
+
<dependency>
- <groupId>geronimo</groupId>
- <artifactId>geronimo-transaction</artifactId>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jta_1.0.1B_spec</artifactId>
+ <scope>compile</scope>
</dependency>
+ <!-- ################################ -->
+
+
<dependency>
- <groupId>org.jencks</groupId>
- <artifactId>jencks</artifactId>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
</dependency>
<dependency>
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/BindingContextImpl.java
Tue Nov 28 18:29:04 2006
@@ -17,6 +17,7 @@
* under the License.
*/
+
package org.apache.ode.axis2;
import org.apache.axis2.AxisFault;
@@ -41,11 +42,11 @@
_store = store;
}
- public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint
myRoleEndpoint, PortType portType) {
+ public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint
myRoleEndpoint,
+ PortType portType) {
try {
- ODEService svc = _server.createService(
- _store.getDefinitionForService(processId,
myRoleEndpoint.serviceName),
- myRoleEndpoint.serviceName, myRoleEndpoint.portName);
+ ODEService svc =
_server.createService(_store.getProcessConfiguration(processId).getDefinitionForService(myRoleEndpoint.serviceName)
+ , myRoleEndpoint.serviceName, myRoleEndpoint.portName);
return svc.getMyServiceRef();
} catch (AxisFault axisFault) {
throw new ContextException("Could not activate endpoint for
service " + myRoleEndpoint.serviceName
@@ -62,7 +63,7 @@
// NOTE: This implementation assumes that the initial value of the
// partner role determines the binding.
return _server.createExternalService(_store
- .getDefinitionForService(processId,
initialPartnerEndpoint.serviceName),
+
.getProcessConfiguration(processId).getDefinitionForService(initialPartnerEndpoint.serviceName),
initialPartnerEndpoint.serviceName,
initialPartnerEndpoint.portName);
}
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
--- incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
(original)
+++ incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
Tue Nov 28 18:29:04 2006
@@ -36,6 +36,8 @@
import org.apache.ode.bpel.engine.BpelServerImpl;
import org.apache.ode.bpel.iapi.BpelEventListener;
import org.apache.ode.bpel.iapi.ProcessStore;
+import org.apache.ode.bpel.iapi.ProcessStoreEvent;
+import org.apache.ode.bpel.iapi.ProcessStoreListener;
import org.apache.ode.bpel.scheduler.quartz.QuartzSchedulerImpl;
import org.apache.ode.daohib.DataSourceConnectionProvider;
import org.apache.ode.daohib.HibernateTransactionManagerLookup;
@@ -75,27 +77,40 @@
public class ODEServer {
private static final Log __log = LogFactory.getLog(ODEServer.class);
+
private static final Messages __msgs =
Messages.getMessages(Messages.class);
private File _appRoot;
+
private File _workRoot;
private BpelServerImpl _server;
+
private ProcessStoreImpl _store;
+
private ODEConfigProperties _odeConfig;
+
private AxisConfiguration _axisConfig;
+
private DataSource _datasource;
+
private TransactionManager _txMgr;
+
private BpelDAOConnectionFactory _daoCF;
+
private ExecutorService _executorService;
+
private QuartzSchedulerImpl _scheduler;
+
private DeploymentPoller _poller;
private MultiKeyMap _services = new MultiKeyMap();
+
private MultiKeyMap _externalServices = new MultiKeyMap();
+
private BpelServerConnector _connector;
- public void init(ServletConfig config, AxisConfiguration axisConf) throws
ServletException {
+ public void init(ServletConfig config, AxisConfiguration axisConf) throws
ServletException {
_axisConfig = axisConf;
_appRoot = new
File(config.getServletContext().getRealPath("/WEB-INF"));
TempFileManager.setWorkingDirectory(_appRoot);
@@ -126,23 +141,26 @@
__log.debug("Initializing BPEL server.");
initBpelServer();
+
try {
_server.start();
} catch (Exception ex) {
String errmsg = __msgs.msgOdeBpelServerStartFailure();
- __log.error(errmsg,ex);
+ __log.error(errmsg, ex);
throw new ServletException(errmsg, ex);
}
+ _store.loadAll();
+
__log.debug("Initializing JCA adapter.");
initConnector();
File deploymentDir = new File(_workRoot, "processes");
_poller = new DeploymentPoller(deploymentDir, this);
- new ManagementService().enableService(_axisConfig, _server,
_appRoot.getAbsolutePath());
- new DeploymentWebService().enableService(_axisConfig, _server, _store,
_poller,
- _appRoot.getAbsolutePath(), _workRoot.getAbsolutePath());
+ new ManagementService().enableService(_axisConfig, _server, _store,
_appRoot.getAbsolutePath());
+ new DeploymentWebService().enableService(_axisConfig, _server, _store,
_poller, _appRoot.getAbsolutePath(), _workRoot
+ .getAbsolutePath());
_poller.start();
__log.info(__msgs.msgPollingStarted(deploymentDir.getAbsolutePath()));
@@ -154,7 +172,7 @@
* Shutdown the service engine. This performs cleanup before the BPE is
* terminated. Once this method has been called, init() must be called
before
* the transformation engine can be started again with a call to start().
- *
+ *
* @throws AxisFault if the engine is unable to shut down.
*/
public void shutDown() throws AxisFault {
@@ -162,8 +180,8 @@
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
if (_poller != null) {
- _poller.stop();
- _poller = null;
+ _poller.stop();
+ _poller = null;
}
try {
@@ -194,8 +212,8 @@
}
public ODEService createService(Definition def, QName serviceName, String
portName) throws AxisFault {
- if (_services.get(serviceName, portName) != null){
- AxisService service = ((ODEService)_services.get(serviceName,
portName)).getAxisService();
+ if (_services.get(serviceName, portName) != null) {
+ AxisService service = ((ODEService) _services.get(serviceName,
portName)).getAxisService();
_axisConfig.removeService(service.getName());
}
AxisService axisService = ODEAxisService.createService(_axisConfig,
def, serviceName, portName);
@@ -209,9 +227,9 @@
// Setting our new service on the receiver, the same receiver handles
all
// operations so the first one should fit them all
- AxisOperation firstOp =
(AxisOperation)axisService.getOperations().next();
-
((ODEMessageReceiver)firstOp.getMessageReceiver()).setService(odeService);
-
((ODEMessageReceiver)firstOp.getMessageReceiver()).setExecutorService(_executorService);
+ AxisOperation firstOp = (AxisOperation)
axisService.getOperations().next();
+ ((ODEMessageReceiver)
firstOp.getMessageReceiver()).setService(odeService);
+ ((ODEMessageReceiver)
firstOp.getMessageReceiver()).setExecutorService(_executorService);
// We're public!
_axisConfig.addService(axisService);
@@ -276,17 +294,17 @@
private void initDataSource() throws ServletException {
switch (_odeConfig.getDbMode()) {
- case EXTERNAL:
- initExternalDb();
- break;
- case EMBEDDED:
- initEmbeddedDb();
- break;
- case INTERNAL:
- initInternalDb();
- break;
- default:
- break;
+ case EXTERNAL:
+ initExternalDb();
+ break;
+ case EMBEDDED:
+ initEmbeddedDb();
+ break;
+ case INTERNAL:
+ initInternalDb();
+ break;
+ default:
+ break;
}
}
@@ -297,6 +315,7 @@
} else {
_connector = new BpelServerConnector();
_connector.setBpelServer(_server);
+ _connector.setProcessStore(_store);
_connector.setPort(_odeConfig.getConnectorPort());
_connector.setId("jcaServer");
try {
@@ -313,8 +332,8 @@
__log.info(__msgs.msgOdeUsingExternalDb(_odeConfig.getDbDataSource()));
} catch (Exception ex) {
String msg =
__msgs.msgOdeInitExternalDbFailed(_odeConfig.getDbDataSource());
- __log.error(msg,ex);
- throw new ServletException(msg,ex);
+ __log.error(msg, ex);
+ throw new ServletException(msg, ex);
}
}
@@ -348,17 +367,16 @@
minervaPool.start();
} catch (Exception ex) {
String errmsg = __msgs.msgOdeDbPoolStartupFailed(url);
- __log.error(errmsg,ex);
- throw new ServletException(errmsg,ex);
+ __log.error(errmsg, ex);
+ throw new ServletException(errmsg, ex);
}
_datasource = minervaPool.createDataSource();
}
-
/**
* Initialize the Hibernate data store.
- *
+ *
* @throws ServletException
*/
private void initHibernate() throws ServletException {
@@ -367,7 +385,7 @@
DataSourceConnectionProvider.class.getName());
properties.put(Environment.TRANSACTION_MANAGER_STRATEGY,
HibernateTransactionManagerLookup.class.getName());
-// properties.put(Environment.SESSION_FACTORY_NAME, "jta");
+ // properties.put(Environment.SESSION_FACTORY_NAME, "jta");
File hibernatePropFile;
String confDir = System.getProperty("org.apache.ode.configDir");
@@ -404,7 +422,8 @@
}
private void initProcessStore() {
- _store = new ProcessStoreImpl(_workRoot, _datasource, _txMgr);
+ _store = new ProcessStoreImpl(_datasource);
+ _store.registerListener(new ProcessStoreListenerImpl());
}
private void initBpelServer() {
@@ -428,8 +447,6 @@
new P2PMexContextImpl(this, new
MessageExchangeContextImpl(this), _executorService, _txMgr));
_server.setBindingContext(new BindingContextImpl(this, _store));
_server.setScheduler(_scheduler);
- _server.setProcessStore(_store);
- registerEventListeners();
_server.init();
}
@@ -498,8 +515,8 @@
public BpelServerImpl getBpelServer() {
return _server;
}
-
- private void registerEventListeners() {
+
+ private void registerEventListeners() {
String listenersStr = _odeConfig.getEventListeners();
if (listenersStr != null) {
for (StringTokenizer tokenizer = new StringTokenizer(listenersStr,
",;"); tokenizer.hasMoreTokens();) {
@@ -514,8 +531,26 @@
}
}
+ private void handleEvent(ProcessStoreEvent pse) {
+ __log.debug("Process store event: " + pse);
+ switch (pse.type) {
+ case ACTVIATED:
+ case RETIRED:
+ // bounce the process
+ _server.unregister(pse.pid);
+ _server.register(_store.getProcessConfiguration(pse.pid));
+ break;
+ case DISABLED:
+ case UNDEPLOYED:
+ _server.unregister(pse.pid);
+ break;
+ default:
+ __log.debug("Ignoring store event: " + pse);
+ }
+ }
private static final String DEFAULT_HIBERNATE_DIALECT =
"org.hibernate.dialect.DerbyDialect";
+
private static final HashMap<String,
DialectFactory.VersionInsensitiveMapper> HIBERNATE_DIALECTS = new
HashMap<String, DialectFactory.VersionInsensitiveMapper>();
static {
@@ -538,4 +573,11 @@
"org.hibernate.dialect.DerbyDialect"));
}
+ private class ProcessStoreListenerImpl implements ProcessStoreListener {
+
+ public void onProcessStoreEvent(ProcessStoreEvent event) {
+ handleEvent(event);
+ }
+
+ }
}
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/deploy/DeploymentPoller.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/deploy/DeploymentPoller.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/deploy/DeploymentPoller.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/deploy/DeploymentPoller.java
Tue Nov 28 18:29:04 2006
@@ -123,11 +123,15 @@
__log.error("Error creating deployed marker file, " + file + "
will not be deployed");
continue;
}
+
+ try {
+ _odeServer.getProcessStore().undeploy(file);
+ } catch (Exception ex) {
+ __log.error("Error undeploying " + file.getName());
+ }
+
try {
Collection<QName> deployed =
_odeServer.getProcessStore().deploy(file);
- for (QName pqname : deployed) {
- _odeServer.getBpelServer().load(pqname, true);
- }
__log.info("Deployment of artifact " + file.getName() + "
successful.");
} catch (Exception e) {
__log.error("Deployment of " + file.getName() + " failed,
aborting for now.", e);
@@ -135,15 +139,12 @@
}
// Removing deployments that disappeared
- String[] deployed =
_odeServer.getProcessStore().listDeployedPackages();
+ Collection<String> deployed =
_odeServer.getProcessStore().getPackages();
for (String s : deployed) {
if (s != null) {
File deployDir = new File(_deployDir, s);
if (!deployDir.exists()) {
Collection<QName> undeployed =
_odeServer.getProcessStore().undeploy(deployDir);
- for (QName pqname : undeployed) {
- _odeServer.getBpelServer().unload(pqname, true);
- }
File marker = new File(_deployDir, s + ".deployed");
marker.delete();
if (undeployed.size() > 0) __log.info("Successfully
undeployed " + s);
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/DeploymentWebService.java
Tue Nov 28 18:29:04 2006
@@ -19,6 +19,24 @@
package org.apache.ode.axis2.service;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collection;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+import javax.activation.DataHandler;
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMText;
@@ -40,17 +58,6 @@
import org.apache.ode.bpel.iapi.ProcessStore;
import org.apache.ode.utils.fs.FileUtils;
-import javax.activation.DataHandler;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-import java.io.*;
-import java.util.Collection;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
/**
* Axis wrapper for process deployment.
*/
@@ -116,7 +123,7 @@
File dest = new File(_deployPath, namePart.getText());
Collection<QName> undeployed = _store.undeploy(dest);
for (QName pqname : undeployed) {
- _server.unload(pqname, true);
+ _server.unregister(pqname);
}
// If the previous deployment failed, there will still
be something but
@@ -133,9 +140,6 @@
"descriptor in its root directory named
deploy.xml, aborting.");
Collection<QName> deployed = _store.deploy(dest);
- for (QName pqname : deployed) {
- _server.load(pqname, true);
- }
File deployedMarker = new File(_deployPath,
namePart.getText() + ".deployed");
deployedMarker.createNewFile();
@@ -165,9 +169,6 @@
_poller.hold();
Collection<QName> undeployed =
_store.undeploy(deploymentDir);
- for (QName pqname : undeployed) {
- _server.unload(pqname, true);
- }
File deployedMarker = new File(_deployPath, elmtStr +
".deployed");
deployedMarker.delete();
@@ -180,7 +181,7 @@
_poller.release();
}
} else if (operation.equals("listDeployedPackages")) {
- String[] packageNames = _store.listDeployedPackages();
+ Collection<String> packageNames = _store.getPackages();
OMElement response =
factory.createOMElement("deployedPackages", depns);
for (String name : packageNames) {
OMElement nameElmt = factory.createOMElement("name",
depns);
@@ -190,7 +191,7 @@
sendResponse(factory, messageContext,
"listDeployedPackagesResponse", response);
} else if (operation.equals("listProcesses")) {
OMElement namePart =
messageContext.getEnvelope().getBody().getFirstElement().getFirstElement();
- QName[] processIds =
_store.listProcesses(namePart.getText());
+ List<QName> processIds =
_store.listProcesses(namePart.getText());
OMElement response = factory.createOMElement("processIds",
depns);
for (QName qname : processIds) {
OMElement nameElmt = factory.createOMElement("id",
depns);
@@ -200,7 +201,7 @@
sendResponse(factory, messageContext,
"listProcessResponse", response);
} else if (operation.equals("getProcessPackage")) {
OMElement qnamePart =
messageContext.getEnvelope().getBody().getFirstElement().getFirstElement();
- String packageName =
_store.getProcessConfiguration(OMUtils.getTextAsQName(qnamePart)).getProcessPackage();
+ String packageName =
_store.getProcessConfiguration(OMUtils.getTextAsQName(qnamePart)).getPackage();
OMElement response =
factory.createOMElement("packageName", depns);
response.setText(packageName);
sendResponse(factory, messageContext,
"getProcessPackageResponse", response);
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
Tue Nov 28 18:29:04 2006
@@ -19,6 +19,22 @@
package org.apache.ode.axis2.service;
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.Definition;
+import javax.wsdl.WSDLException;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.soap.SOAPEnvelope;
@@ -35,28 +51,15 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.axis2.hooks.ODEAxisService;
import org.apache.ode.axis2.util.OMUtils;
+import org.apache.ode.bpel.engine.ProcessAndInstanceManagementImpl;
import org.apache.ode.bpel.iapi.BpelServer;
+import org.apache.ode.bpel.iapi.ProcessStore;
import org.apache.ode.bpel.pmapi.InstanceManagement;
import org.apache.ode.bpel.pmapi.ProcessInfoCustomizer;
import org.apache.ode.bpel.pmapi.ProcessManagement;
import org.apache.xmlbeans.XmlObject;
import org.w3c.dom.Node;
-import javax.wsdl.Definition;
-import javax.wsdl.WSDLException;
-import javax.wsdl.factory.WSDLFactory;
-import javax.wsdl.xml.WSDLReader;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.IOException;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
/**
* Axis2 wrapper for process and instance management interfaces.
*/
@@ -67,9 +70,10 @@
private ProcessManagement _processMgmt;
private InstanceManagement _instanceMgmt;
- public void enableService(AxisConfiguration axisConfig, BpelServer server,
String rootpath) {
- _processMgmt = server.getBpelManagementFacade();
- _instanceMgmt = server.getBpelManagementFacade();
+ public void enableService(AxisConfiguration axisConfig, BpelServer server,
ProcessStore _store, String rootpath) {
+ ProcessAndInstanceManagementImpl pm = new
ProcessAndInstanceManagementImpl(server,_store);
+ _processMgmt = pm;
+ _instanceMgmt = pm;
Definition def;
try {
@@ -163,7 +167,7 @@
} else if (clazz.equals(Integer.TYPE) || clazz.equals(Integer.class)) {
return Integer.parseInt(elmt.getText());
} else if (clazz.isArray()) {
- ArrayList alist = new ArrayList();
+ ArrayList<Object> alist = new ArrayList<Object>();
Iterator children = elmt.getChildElements();
Class targetClazz = clazz.getComponentType();
while (children.hasNext())
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/GeronimoFactory.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/GeronimoFactory.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/GeronimoFactory.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/GeronimoFactory.java
Tue Nov 28 18:29:04 2006
@@ -1,80 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.ode.axis2.util;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.transaction.TransactionManager;
-
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.config.MultiParentClassLoader;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.transaction.context.GeronimoTransactionManager;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
-
-public class GeronimoFactory {
-
- /* Public no-arg contructor is required */
- public GeronimoFactory() {
- }
-
- public TransactionManager getTransactionManager() {
- Kernel kernel = KernelRegistry.getSingleKernel();
- TransactionContextManager ctxManager = null;
-
- try {
- ctxManager = (TransactionContextManager)
kernel.getGBean(TransactionContextManager.class);
- } catch (GBeanNotFoundException except) {
- throw new RuntimeException( "Can't lookup GBean: " +
TransactionContextManager.class, except);
- }
-
- MultiParentClassLoader loader = (MultiParentClassLoader)
ctxManager.getClass().getClassLoader();
-
- // Add Jencks to Geronimo's root classloader to avoid
InvalidAccessError
- AbstractNameQuery abstractNameQuery = new AbstractNameQuery(null,
Collections.EMPTY_MAP, Repository.class.getName());
- Set set = kernel.listGBeans(abstractNameQuery);
- for (Iterator iterator = set.iterator(); iterator.hasNext();) {
- AbstractName abstractName = (AbstractName) iterator.next();
- File f = null;
- try {
- Repository repo = (Repository) kernel.getGBean(abstractName);
- f = repo.getLocation(new Artifact("org.jencks", "jencks",
"1.3", "jar"));
- loader.addURL(f.toURL());
- } catch (GBeanNotFoundException except) {
- throw new RuntimeException("Can't lookup GBean: " +
abstractName, except);
- } catch (MalformedURLException except) {
- throw new RuntimeException("Invalid URL for jencks: " + f,
except);
- }
- }
-
- // Use Jenck to wrap TransactionContextManager back to
TransactionManager
- return new GeronimoTransactionManager(ctxManager);
- }
-
-}
+///*
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements. See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership. The ASF licenses this file
+// * to you 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.ode.axis2.util;
+//
+//import java.io.File;
+//import java.net.MalformedURLException;
+//import java.util.Collections;
+//import java.util.Iterator;
+//import java.util.Set;
+//
+//import javax.transaction.TransactionManager;
+//
+//import org.apache.geronimo.gbean.AbstractName;
+//import org.apache.geronimo.gbean.AbstractNameQuery;
+//import org.apache.geronimo.kernel.GBeanNotFoundException;
+//import org.apache.geronimo.kernel.Kernel;
+//import org.apache.geronimo.kernel.KernelRegistry;
+//import org.apache.geronimo.kernel.config.MultiParentClassLoader;
+//import org.apache.geronimo.kernel.repository.Artifact;
+//import org.apache.geronimo.kernel.repository.Repository;
+//import org.apache.geronimo.transaction.context.GeronimoTransactionManager;
+//import org.apache.geronimo.transaction.context.TransactionContextManager;
+//
+//public class GeronimoFactory {
+//
+// /* Public no-arg contructor is required */
+// public GeronimoFactory() {
+// }
+//
+// public TransactionManager getTransactionManager() {
+// Kernel kernel = KernelRegistry.getSingleKernel();
+// TransactionContextManager ctxManager = null;
+//
+// try {
+// ctxManager = (TransactionContextManager)
kernel.getGBean(TransactionContextManager.class);
+// } catch (GBeanNotFoundException except) {
+// throw new RuntimeException( "Can't lookup GBean: " +
TransactionContextManager.class, except);
+// }
+//
+// MultiParentClassLoader loader = (MultiParentClassLoader)
ctxManager.getClass().getClassLoader();
+//
+// // Add Jencks to Geronimo's root classloader to avoid
InvalidAccessError
+// AbstractNameQuery abstractNameQuery = new AbstractNameQuery(null,
Collections.EMPTY_MAP, Repository.class.getName());
+// Set set = kernel.listGBeans(abstractNameQuery);
+// for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+// AbstractName abstractName = (AbstractName) iterator.next();
+// File f = null;
+// try {
+// Repository repo = (Repository) kernel.getGBean(abstractName);
+// f = repo.getLocation(new Artifact("org.jencks", "jencks",
"1.3", "jar"));
+// loader.addURL(f.toURL());
+// } catch (GBeanNotFoundException except) {
+// throw new RuntimeException("Can't lookup GBean: " +
abstractName, except);
+// } catch (MalformedURLException except) {
+// throw new RuntimeException("Invalid URL for jencks: " + f,
except);
+// }
+// }
+//
+// // Use Jenck to wrap TransactionContextManager back to
TransactionManager
+// return new GeronimoTransactionManager(ctxManager);
+// }
+//
+//}
Modified:
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/SOAPUtils.java
URL:
http://svn.apache.org/viewvc/incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/SOAPUtils.java?view=diff&rev=480338&r1=480337&r2=480338
==============================================================================
---
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/SOAPUtils.java
(original)
+++
incubator/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/util/SOAPUtils.java
Tue Nov 28 18:29:04 2006
@@ -125,7 +125,8 @@
return "";
}
- private static void copyParts(Element source, Element target,
javax.wsdl.Message msgdef) {
+ @SuppressWarnings("unchecked")
+private static void copyParts(Element source, Element target,
javax.wsdl.Message msgdef) {
List<Part> expectedParts = msgdef.getOrderedParts(null);
Element srcpart = DOMUtils.getFirstChildElement(source);