org.obe.client.api
Class WMClientFactory

java.lang.Object
  extended byorg.obe.client.api.WMClientFactory

public final class WMClientFactory
extends java.lang.Object

Factory class to support pluggable client implementations. As standard, local, j2ee-local, rmi and xml-rpc are supported.

Author:
Adrian Price

Field Summary
static java.lang.String J2EE_LOCAL
          Represents a standard, local J2EE interface.
static java.lang.String LOCAL
          Represents a standard, local Java interface.
static java.lang.String RMI
          Represents the standard RMI remote protocol.
static java.lang.String XML_RPC
          Represents the XML-RPC protocol.
 
Method Summary
static WMClient createClient()
          Creates a client instance using the default protocol.
static WMClient createClient(java.lang.String protocol)
          Creates a client instance for the specified protocol.
static void registerClientClass(java.lang.String protocol, java.lang.String clientClass)
          Registers a WMClient implementation for the specified protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL

public static final java.lang.String LOCAL
Represents a standard, local Java interface.

See Also:
Constant Field Values

J2EE_LOCAL

public static final java.lang.String J2EE_LOCAL
Represents a standard, local J2EE interface.

See Also:
Constant Field Values

RMI

public static final java.lang.String RMI
Represents the standard RMI remote protocol.

See Also:
Constant Field Values

XML_RPC

public static final java.lang.String XML_RPC
Represents the XML-RPC protocol. The default implementation uses the Apache XML-RPC libraries.

See Also:
Constant Field Values
Method Detail

createClient

public static WMClient createClient()
                             throws WMWorkflowException
Creates a client instance using the default protocol. The default protocol is "local", but can be overridden by setting the configuration property obe.client.protocol.

Returns:
A client instance.
Throws:
WMWorkflowException - if an exception occurred when instantiating the client.
java.lang.IllegalArgumentException - if the protocol name is invalid.

createClient

public static WMClient createClient(java.lang.String protocol)
                             throws WMWorkflowException
Creates a client instance for the specified protocol.

Parameters:
protocol - The protocol name, one of: LOCAL, J2EE_LOCAL, RMI, XML_RPC, or some implementation that was registered by a prior call to registerClientClass(java.lang.String, java.lang.String).
Returns:
A client instance.
Throws:
WMWorkflowException - if an exception occurred when instantiating the client.
java.lang.IllegalArgumentException - if the protocol name is invalid, or if the registered class is not a valid WMClient implementation.

registerClientClass

public static void registerClientClass(java.lang.String protocol,
                                       java.lang.String clientClass)
Registers a WMClient implementation for the specified protocol.

Parameters:
protocol - The protocol name.
clientClass - The fully qualified name of the implementing class, which must implement WMClient and have a public, no-args constructor.


SourceForge.net Logo OBE-1.0 Copyright (C) 2002-2006 Adrian Price. All Rights Reserved.