org.restlet.ext.oauth
Class ClientStoreFactory

java.lang.Object
  extended by org.restlet.ext.oauth.ClientStoreFactory

public abstract class ClientStoreFactory
extends Object

Factory for ClientStore. The Default is to create a memory based client store This class uses reflection and even an non empty constructor is possible. By default it will instantiate a memory backed client store with empty constructor. Example :

 {
     @code
     Object[] params = { "http://www.restlet.org" };
     ClientStoreFactory.setClientStoreImpl(MyClientStore.class, params);
     ClientStore clientStore = ClientStoreFactory.getInstance();
 }
 
In the example the class MyClientStore would have a public constructor that accepts a String parameter.

Author:
Kristoffer Gronowski

Method Summary
static ClientStore<?> getInstance()
          Creates an instance of ClientStore.
static void setClientStoreImpl(Class<? extends ClientStore<?>> impl)
          This method sets up if the implementing class uses a no-arg public constructor
static void setClientStoreImpl(Class<? extends ClientStore<?>> impl, Object... constructorParams)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ClientStore<?> getInstance()
Creates an instance of ClientStore. It is a singelton so multiple calls would just retrieve an earlier created instance.

Returns:
an implementation of a ClientStore

setClientStoreImpl

public static void setClientStoreImpl(Class<? extends ClientStore<?>> impl)
This method sets up if the implementing class uses a no-arg public constructor

Parameters:
impl - class reference of a class implementing ClientStore

setClientStoreImpl

public static void setClientStoreImpl(Class<? extends ClientStore<?>> impl,
                                      Object... constructorParams)
Parameters:
impl - class reference of a class implementing ClientStore
constructorParams - array of constructor arguments.


Copyright © 2005-2013 Restlet.