org.ogf.graap.wsag.client.api
Class ClientLocator<T>

java.lang.Object
  extended by org.ogf.graap.wsag.client.api.ClientLocator<T>
Type Parameters:
T - the type of the client

public class ClientLocator<T>
extends Object

The Locator returns a new wsag4j client instances. The lookup mechanism for a client implementation class is as follows:

  1. load the class specified in the system property client interface class name, for example AgreementFactoryRegistryClient
  2. load the class specified in the file
  3. load the class specified in the file
The key used in the configuration (system property) corresponds to the name of the client interface.

Author:
Oliver Waeldrich

Constructor Summary
protected ClientLocator(Class<T> clazz)
          Instantiates a new client locator.
 
Method Summary
 T newInstance(EndpointReferenceType epr)
          Returns a new client instance.
 T newInstance(EndpointReferenceType epr, LoginContext context)
          Returns a new client instance.
protected  T newInstance(EndpointReferenceType epr, LoginContext context, String altConfig)
          Returns a new client instance providing an alternative client configuration file.
protected  T newInstance(EndpointReferenceType epr, String altConfig)
          Returns a new client instance providing an alternative client configuration file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientLocator

protected ClientLocator(Class<T> clazz)
Instantiates a new client locator.

Parameters:
clazz - the client class
Method Detail

newInstance

public T newInstance(EndpointReferenceType epr)
              throws Exception
Returns a new client instance.

Parameters:
epr - the client epr
Returns:
the new client
Throws:
Exception - client instantiation error

newInstance

public T newInstance(EndpointReferenceType epr,
                     LoginContext context)
              throws Exception
Returns a new client instance.

Parameters:
epr - the client epr
context - client login context
Returns:
the new client
Throws:
Exception - client instantiation error

newInstance

protected T newInstance(EndpointReferenceType epr,
                        String altConfig)
                 throws Exception
Returns a new client instance providing an alternative client configuration file.

Parameters:
epr - the client epr
altConfig - alternative client factory implementation
Returns:
the new client
Throws:
Exception - client instantiation error

newInstance

protected T newInstance(EndpointReferenceType epr,
                        LoginContext context,
                        String altConfig)
                 throws Exception
Returns a new client instance providing an alternative client configuration file.

Parameters:
epr - the client epr
context - client login context
altConfig - alternative client factory implementation
Returns:
the new client
Throws:
Exception - client instantiation error


Copyright © 2008-2012. All Rights Reserved.