org.terracotta.express
Interface Client


public interface Client

A Java object representation of a client in the cluster.


Method Summary
<T> T
instantiate(String className, Class[] cstrArgTypes, Object[] cstrArgs)
          Instantiates a class using an internal instrumentation capable class loader.
 void shutdown()
          Shuts down this client reference.
<T> T
staticFactoryMethod(String className, String methodName, Class[] argTypes, Object[] args)
          Invokes a static method on a class loaded using an internal instrumentation capable class loader.
 

Method Detail

instantiate

<T> T instantiate(String className,
                  Class[] cstrArgTypes,
                  Object[] cstrArgs)
              throws Exception
Instantiates a class using an internal instrumentation capable class loader.

Class loaded through an instrumentation capable loader can interact directly through class scoped linkage with the toolkit API.

Type Parameters:
T - a public java super-type or interface of className
Parameters:
className - concrete class to instantiate
cstrArgTypes - array of constructor argument types
cstrArgs - array of constructor arguments
Returns:
newly constructed cluster loader java object
Throws:
Exception - if the class could not be loaded or instantiated

staticFactoryMethod

<T> T staticFactoryMethod(String className,
                          String methodName,
                          Class[] argTypes,
                          Object[] args)
                      throws Exception
Invokes a static method on a class loaded using an internal instrumentation capable class loader.

Type Parameters:
T - public java super-type or interface of the return type
Parameters:
className - concrete class through which to call the method
methodName - name of the method to invoke
argTypes - array of method argument types
args - array of method arguments
Returns:
the return value of the method
Throws:
Exception - if the class could not be loader or the method could not be called
See Also:
instantiate(String, Class[], Object[])

shutdown

void shutdown()
Shuts down this client reference.

Once all users of a client have called shutdown on a client instance, the client will terminate it's connections to the cluster and attempt to free any associated resources.



Copyright © 2015 Terracotta, Inc.. All Rights Reserved.