Application Program and Service Provider Interfaces
Client API
OBE's client API is
based on the WfMC Interface 1. The main
interface
is org.obe.client.api.WMClient,
which extends org.wfmc.wapi2.WAPI2,
which in turn extends org.wfmc.wapi.WAPI.
A client application obtains a reference to a suitable client API
implemention by calling one of the static factory methods on
the org.obe.client.api.WMClientFactory
class. One factory method returns the default implementation (as determined by
the system property obe.client.protocol
) and the
other takes as an argument the name of the client type to create, as
specified by the string constants in the WMClientFactory interface.
There are several implementations of the WMClient interface:
-
org.obe.client.api.local.LocalClient
- This is the simplest implementation and is suitable for local
calls to an embedded workflow engine. It is non-transactional and calls
are not not subject to authorization checks(at present). The name
of this protocol is given by
WMClientFactory.LOCAL
.
-
org.obe.client.api.local.J2EELocalClient
- This implementation uses a local interface to the stateless
session bean provided by the OBE J2EE server implementation. It is
fully transactional and all calls are subject to JAAS authorization
checks. It is suitable for use by a J2EE application with OBE embedded
within it. The name of this protocol is given by
WMClientFactory.J2EE_LOCAL
.
-
org.obe.client.api.rmi.J2EERemoteClient
- This implementation uses a remote RMI interface to the stateless
session
bean provided by the OBE J2EE server implementation. It is fully
transactional and all calls are subject to JAAS authorization checks. It
is suitable for use by a remote Java client application such as a
Worklist Handler. The name of this protocol is given by
WMClientFactory.RMI
.
-
org.obe.client.api.xmlrpc.WMXmlRpcClient
- This implementation uses the obsolete Apache XML-RPC protocol to
communicate remotely with OBE. The name of this protocol is given by
WMClientFactory.XML_RPC
. The implementation is vestigial
and incomplete
and there's probably no longer any good reason to use it.
Here's a code snippet that makes an RMI connection to a remote OBE server:
WMClient client = null;
...
try {
String userId = prompt("User ID");
String password = prompt("Password");
String hostUrl = prompt("Host URL");
System.out.println("\nConnecting user '" + userId + "' to host '" + hostUrl + '\'');
WMConnectInfo ci = new WMConnectInfo(userId, password, hostUrl, null);
client = WMClientFactory.createClient(WMClientFactory.RMI);
client.connect(ci);
} catch (WMConnectException e) {
// Handle the connect exception appropriately
} catch (WMWorkflowException e) {
// Something else went wrong
}
Service Provider Interface
OBE's server SPI comprises
the service interfaces called or implemented by the pluggable components of the server.