sdk/src/com/socialize/SocializeActionProxy.java
@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		try {
			if(synchronous || method.isAnnotationPresent(Synchronous.class) || !isVoidMethod(method)) {
				
				Context context = findContext(args);
				
				if(context != null) {
					synchronized (this) {
                        SocializeService socialize = Socialize.getSocialize();

                        if(!socialize.isInitialized(context)) {
							socialize.init(context);
							if(!socialize.isAuthenticated() && !method.isAnnotationPresent(NoAuth.class)) {
								socialize.authenticateSynchronous(context);
							}
						}
					}
				}
				
				return method.invoke(getBean(), args);
			}
			else {
				Activity context = findActivity(args);
				
				if(context != null) {
					SocializeListener listener = findListener(args);
					
					// Always init to set the context
					invokeWithInit(context, listener, method, args);
				}
				else {
					throw new MethodNotSupportedException("No activity found in method arguments for method [" +
							method.getName() +
							"]");
				}
			}
			
			// Always void
			return null;
		}
		catch (Throwable e) {
			SocializeLogger.e(e.getMessage(), e);
			throw e;
		}
	}
@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		try {
			if(synchronous || method.isAnnotationPresent(Synchronous.class) || !isVoidMethod(method)) {
				
				Context context = findContext(args);
				
				if(context != null) {
					synchronized (this) {
                        SocializeService socialize = Socialize.getSocialize();

                        if(!socialize.isInitialized(context)) {
							socialize.init(context);
							if(!socialize.isAuthenticated() && !method.isAnnotationPresent(NoAuth.class)) {
								socialize.authenticateSynchronous(context);
							}
						}
					}
				}
				
				return method.invoke(getBean(), args);
			}
			else {
				Activity context = findActivity(args);
				
				if(context != null) {
					SocializeListener listener = findListener(args);
					
					// Always init to set the context
					invokeWithInit(context, listener, method, args);
				}
				else {
					throw new MethodNotSupportedException("No activity found in method arguments for method [" +
							method.getName() +
							"]");
				}
			}
			
			// Always void
			return null;
		}
		catch (Throwable e) {
			SocializeLogger.e(e.getMessage(), e);
			throw e;
		}
	}
@ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { try { if ( synchronous || method . isAnnotationPresent ( Synchronous . class ) || ! isVoidMethod ( method ) ) { Context context = findContext ( args ) ; if ( context != null ) { synchronized ( this ) { SocializeService socialize = Socialize . getSocialize ( ) ; if ( ! socialize . isInitialized ( context ) ) { socialize . init ( context ) ; if ( ! socialize . isAuthenticated ( ) && ! method . isAnnotationPresent ( NoAuth . class ) ) { socialize . authenticateSynchronous ( context ) ; } } } } return method . invoke ( getBean ( ) , args ) ; } else { Activity context = findActivity ( args ) ; if ( context != null ) { SocializeListener listener = findListener ( args ) ; // Always init to set the context invokeWithInit ( context , listener , method , args ) ; } else { throw new MethodNotSupportedException ( "No activity found in method arguments for method [" + method . getName ( ) + "]" ) ; } } // Always void return null ; } catch ( Throwable e ) { SocializeLogger . e ( e . getMessage ( ) , e ) ; throw e ; } }
/* (non-Javadoc)
@see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
/ * ( non - Javadoc )