| java.lang.Object net.sf.hajdbc.sql.AbstractInvocationHandler
AbstractInvocationHandler | abstract public class AbstractInvocationHandler implements InvocationHandler,SQLProxy<D, T>(Code) | | author: Paul Ferraro< Parameters: D - > < Parameters: T - > |
Inner Class :protected class SimpleInvoker implements Invoker<D, T, Object> | |
Method Summary | |
final public void | addChild(SQLProxy<D, ?> child) | abstract protected void | close(Database<D> database, T object) | abstract protected T | createObject(Database<D> database) | protected void | detectClusterPanic(Map<Boolean, List<Database<D>>> aliveMap) | public Set<Map.Entry<Database<D>, T>> | entries() | public Map.Entry<Database<D>, T> | entry() | final public DatabaseCluster<D> | getDatabaseCluster() | protected InvocationStrategy<D, T, ?> | getInvocationStrategy(T object, Method method, Object[] parameters) Returns the appropriate
InvocationStrategy for the specified method.
This implementation detects
java.sql.Wrapper methods; and
Object.equals ,
Object.hashCode , and
Object.toString .
Default invocation strategy is
DatabaseWriteInvocationStrategy . | protected Invoker<D, T, ?> | getInvoker(T object, Method method, Object[] parameters) Return the appropriate invoker for the specified method. | final public T | getObject(Database<D> database) Returns the underlying SQL object for the specified database.
If the sql object does not exist (this might be the case if the database was newly activated), it will be created from the stored operation.
Any recorded operations are also executed. | public void | handleFailure(Database<D> database, Exception exception) | public void | handleFailures(SortedMap<Database<D>, Exception> exceptionMap) | public SortedMap<Database<D>, R> | handlePartialFailure(SortedMap<Database<D>, R> resultMap, SortedMap<Database<D>, Exception> exceptionMap) | final public Object | invoke(Object object, Method method, Object[] parameters) | protected boolean | isSQLMethod(Method method) Indicates whether or not the specified method accepts a SQL string as its first parameter. | protected boolean | isSetMethod(Method method) | protected void | postInvoke(T proxy, Method method, Object[] parameters) Called after method is invoked. | protected void | record(Method method, Invoker<D, T, ?> invoker) | final public void | removeChild(SQLProxy<D, ?> child) | final public void | removeChildren() | protected void | replay(Database<D> database, T object) | final public void | retain(Set<Database<D>> databaseSet) |
logger | protected Logger logger(Code) | | |
AbstractInvocationHandler | protected AbstractInvocationHandler(DatabaseCluster<D> cluster, Class<T> proxyClass, Map<Database<D>, T> objectMap)(Code) | | Parameters: cluster - the database cluster Parameters: proxyClass - the interface being proxied Parameters: objectMap - a map of database to sql object. |
close | abstract protected void close(Database<D> database, T object)(Code) | | |
detectClusterPanic | protected void detectClusterPanic(Map<Boolean, List<Database<D>>> aliveMap) throws Exception(Code) | | Detect cluster panic if all conditions are met:
- We're in distributable mode
- We're the only group member
- All alive databases are local
- All dead databases are remote
Parameters: aliveMap - throws: Exception - |
getInvoker | protected Invoker<D, T, ?> getInvoker(T object, Method method, Object[] parameters) throws Exception(Code) | | Return the appropriate invoker for the specified method.
Parameters: object - Parameters: method - Parameters: parameters - an invoker throws: Exception - |
getObject | final public T getObject(Database<D> database)(Code) | | Returns the underlying SQL object for the specified database.
If the sql object does not exist (this might be the case if the database was newly activated), it will be created from the stored operation.
Any recorded operations are also executed. If the object could not be created, or if any of the executed operations failed, then the specified database is deactivated.
Parameters: database - a database descriptor. an underlying SQL object |
isSQLMethod | protected boolean isSQLMethod(Method method)(Code) | | Indicates whether or not the specified method accepts a SQL string as its first parameter.
Parameters: method - a method true, if the specified method accepts a SQL string as its first parameter, false otherwise. |
isSetMethod | protected boolean isSetMethod(Method method)(Code) | | |
postInvoke | protected void postInvoke(T proxy, Method method, Object[] parameters)(Code) | | Called after method is invoked.
Parameters: proxy - the proxied object Parameters: method - the method that was just invoked Parameters: parameters - the parameters of the method that was just invoked |
|
|