org.equanda.util.accessor
Class ObjectAccessor

java.lang.Object
  extended by org.equanda.util.accessor.ObjectAccessor

public final class ObjectAccessor
extends Object

Helper class used by for access to equanda selectors, getters, setters and other methods

Author:
NetRom team, Joachim Van der Auwera

Field Summary
protected static long CACHE_TIMEOUT
           
protected static WeakHashMap<String,Method> METHOD_CACHE
           
protected static Class[] UOID_CLASS
           
 
Method Summary
static void add(Object obj, String fieldName, Class[] param, Object[] values)
           
protected static void addToCache(Class clsName, String methodName, Method method)
           
static void clean()
           
static Object createBean(String jndi, String name, Object uoid)
          Creates a SFSB for the given uoid.
static Object createProxy(String prefix, String name)
          Creates a proxy for the given table.
static Object get(Object obj, String fieldName)
           
protected static Method getFromCache(Class clsName, String methodName)
           
static Method getMethod(Class objClass, String name, Class[] param)
           
static Class getProxyClass(String proxyName)
          Get the class instance used for a specific proxy.
static Class getProxyClass(String prefix, String name)
          Get the class instance used for a specific proxy.
static Object getSelector(String jndi, String name)
           
static void init()
           
static void init(String server, String login, String password)
           
static void set(Object obj, String fieldName, Class[] param, Object[] values)
           
static UserTransaction startTransaction()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_CACHE

protected static final WeakHashMap<String,Method> METHOD_CACHE

CACHE_TIMEOUT

protected static long CACHE_TIMEOUT

UOID_CLASS

protected static Class[] UOID_CLASS
Method Detail

init

public static void init(String server,
                        String login,
                        String password)

init

public static void init()

clean

public static void clean()

getSelector

public static Object getSelector(String jndi,
                                 String name)
                          throws ObjectAccessorException
Throws:
ObjectAccessorException

createBean

public static Object createBean(String jndi,
                                String name,
                                Object uoid)
                         throws ObjectAccessorException
Creates a SFSB for the given uoid.

Parameters:
jndi - can be specified as both selector jndi or sfsb jndi
name - can be specified as both selector jndi or sfsb jndi
uoid - to lookup
Returns:
the SFSB for the given uoid
Throws:
ObjectAccessorException - oops

createProxy

public static Object createProxy(String prefix,
                                 String name)
                          throws ObjectAccessorException
Creates a proxy for the given table.

Parameters:
prefix - package name for the proxy
name - table name for the proxy
Returns:
proxy object
Throws:
ObjectAccessorException - oops

getProxyClass

public static Class getProxyClass(String prefix,
                                  String name)
                           throws ObjectAccessorException
Get the class instance used for a specific proxy.

Parameters:
prefix - package name for the proxy
name - table name for the proxy
Returns:
proxy object
Throws:
ObjectAccessorException - oops

getProxyClass

public static Class getProxyClass(String proxyName)
                           throws ObjectAccessorException
Get the class instance used for a specific proxy.

Parameters:
proxyName - full classname for the proxy
Returns:
proxy object
Throws:
ObjectAccessorException - oops

get

public static Object get(Object obj,
                         String fieldName)
                  throws ObjectAccessorException
Throws:
ObjectAccessorException

set

public static void set(Object obj,
                       String fieldName,
                       Class[] param,
                       Object[] values)
                throws ObjectAccessorException
Throws:
ObjectAccessorException

add

public static void add(Object obj,
                       String fieldName,
                       Class[] param,
                       Object[] values)
                throws ObjectAccessorException
Throws:
ObjectAccessorException

getMethod

public static Method getMethod(Class objClass,
                               String name,
                               Class[] param)
                        throws ObjectAccessorException
Throws:
ObjectAccessorException

addToCache

protected static void addToCache(Class clsName,
                                 String methodName,
                                 Method method)

getFromCache

protected static Method getFromCache(Class clsName,
                                     String methodName)

startTransaction

public static UserTransaction startTransaction()
                                        throws Exception
Throws:
Exception


Copyright © 2007-2009. All Rights Reserved.