FileDocCategorySizeDatePackage
ObjectServerDecorator.javaAPI DocApache Lucene 2.1.02285Wed Feb 14 10:46:04 GMT 2007org.apache.lucene.gdata.storage.db4o

ObjectServerDecorator

public class ObjectServerDecorator extends Object implements InvocationHandler
author
Simon Willnauer

Fields Summary
private final int
port
private final String
user
private final String
password
private final String
host
private Method
openClient
Constructors Summary
public ObjectServerDecorator(String user, String password, String host, int port)

        this.user = user;
        this.password = password;
        this.host = host;
        this.port = port;
        try {
            this.openClient = ObjectServer.class.getMethod("openClient",new Class[]{});
        } catch (Exception e) {
         //ignore method is visible   
            e.printStackTrace();
        }
    
Methods Summary
public java.lang.Objectinvoke(java.lang.Object arg0, java.lang.reflect.Method arg1, java.lang.Object[] arg2)

see
java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])

        if(arg1.equals(this.openClient)){
            return Db4o.openClient(this.host,this.port, this.user, this.password);
        }
        Class clazz = arg1.getReturnType();
        
        if(!clazz.isPrimitive())
            return null;
        if(clazz == Boolean.TYPE)
            return false;
        return 0;