src/main/java/js/container/ManagedMethod.java
@SuppressWarnings("unchecked")
	@Override
	public <T> T invoke(Object object, Object... args) throws AuthorizationException, IllegalArgumentException, InvocationException {
		if (remotelyAccessible && !isPublic() && !container.isAuthenticated()) {
			log.info("Reject not authenticated access to |%s|.", method);
			throw new AuthorizationException();
		}

		// arguments processor converts <args> to empty array if it is null
		// it can be null if on invocation chain there is Proxy invoked with no arguments
		args = argumentsProcessor.preProcessArguments(this, args);

		if (object instanceof Proxy) {
			// if object is a Java Proxy does not apply method services implemented by below block
			// instead directly invoke Java method on the Proxy instance
			// container will call again this method but with the real object instance, in which case executes the next logic
			try {
				return (T) method.invoke(object, args);
			} catch (InvocationTargetException e) {
				throw new InvocationException(e.getTargetException());
			} catch (IllegalAccessException e) {
				throw new BugError("Illegal access on method with accessibility set true.");
			}
		}

		if (meter == null) {
			try {
				return (T) invoker.invoke(object, args);
			} catch (InvocationTargetException e) {
				throw new InvocationException(e.getTargetException());
			} catch (IllegalAccessException e) {
				throw new BugError("Illegal access on method with accessibility set true.");
			}
		}

		meter.incrementInvocationsCount();
		meter.startProcessing();
		T returnValue = null;
		try {
			returnValue = (T) invoker.invoke(object, args);
		} catch (InvocationTargetException e) {
			meter.incrementExceptionsCount();
			throw new InvocationException(e.getTargetException());
		} catch (IllegalAccessException e) {
			// this condition is a bug; do not increment exceptions count
			throw new BugError("Illegal access on method with accessibility set true.");
		}
		meter.stopProcessing();
		return returnValue;
	}
@SuppressWarnings("unchecked")
	@Override
	public <T> T invoke(Object object, Object... args) throws AuthorizationException, IllegalArgumentException, InvocationException {
		if (remotelyAccessible && !isPublic() && !container.isAuthenticated()) {
			log.info("Reject not authenticated access to |%s|.", method);
			throw new AuthorizationException();
		}

		// arguments processor converts <args> to empty array if it is null
		// it can be null if on invocation chain there is Proxy invoked with no arguments
		args = argumentsProcessor.preProcessArguments(this, args);

		if (object instanceof Proxy) {
			// if object is a Java Proxy does not apply method services implemented by below block
			// instead directly invoke Java method on the Proxy instance
			// container will call again this method but with the real object instance, in which case executes the next logic
			try {
				return (T) method.invoke(object, args);
			} catch (InvocationTargetException e) {
				throw new InvocationException(e.getTargetException());
			} catch (IllegalAccessException e) {
				throw new BugError("Illegal access on method with accessibility set true.");
			}
		}

		if (meter == null) {
			try {
				return (T) invoker.invoke(object, args);
			} catch (InvocationTargetException e) {
				throw new InvocationException(e.getTargetException());
			} catch (IllegalAccessException e) {
				throw new BugError("Illegal access on method with accessibility set true.");
			}
		}

		meter.incrementInvocationsCount();
		meter.startProcessing();
		T returnValue = null;
		try {
			returnValue = (T) invoker.invoke(object, args);
		} catch (InvocationTargetException e) {
			meter.incrementExceptionsCount();
			throw new InvocationException(e.getTargetException());
		} catch (IllegalAccessException e) {
			// this condition is a bug; do not increment exceptions count
			throw new BugError("Illegal access on method with accessibility set true.");
		}
		meter.stopProcessing();
		return returnValue;
	}
@ SuppressWarnings ( "unchecked" ) @ Override public < T > T invoke ( Object object , Object ... args ) throws AuthorizationException , IllegalArgumentException , InvocationException { if ( remotelyAccessible && ! isPublic ( ) && ! container . isAuthenticated ( ) ) { log . info ( "Reject not authenticated access to |%s|." , method ) ; throw new AuthorizationException ( ) ; } // arguments processor converts <args> to empty array if it is null
 // it can be null if on invocation chain there is Proxy invoked with no arguments
 args = argumentsProcessor . preProcessArguments ( this , args ) ; if ( object instanceof Proxy ) { // if object is a Java Proxy does not apply method services implemented by below block
 // instead directly invoke Java method on the Proxy instance
 // container will call again this method but with the real object instance, in which case executes the next logic
 try { return ( T ) method . invoke ( object , args ) ; } catch ( InvocationTargetException e ) { throw new InvocationException ( e . getTargetException ( ) ) ; } catch ( IllegalAccessException e ) { throw new BugError ( "Illegal access on method with accessibility set true." ) ; } } if ( meter == null ) { try { return ( T ) invoker . invoke ( object , args ) ; } catch ( InvocationTargetException e ) { throw new InvocationException ( e . getTargetException ( ) ) ; } catch ( IllegalAccessException e ) { throw new BugError ( "Illegal access on method with accessibility set true." ) ; } } meter . incrementInvocationsCount ( ) ; meter . startProcessing ( ) ; T returnValue = null ; try { returnValue = ( T ) invoker . invoke ( object , args ) ; } catch ( InvocationTargetException e ) { meter . incrementExceptionsCount ( ) ; throw new InvocationException ( e . getTargetException ( ) ) ; } catch ( IllegalAccessException e ) { // this condition is a bug; do not increment exceptions count
 throw new BugError ( "Illegal access on method with accessibility set true." ) ; } meter . stopProcessing ( ) ; return returnValue ; }
Invoke managed method and applies method level services. Delegates this managed method {@link #invoker}; accordingly
selected strategy invoker can be {@link DefaultInvoker} or {@link InterceptedInvoker}, if this managed method is
annotated with {@link Interceptor}. Also takes care to update {@link #meter}.

@param object managed instance against which method is executed,
@param args optional managed method invocation arguments.
@param <T> returned value type.
@return value returned by method or null for void.
@throws AuthorizationException if method is private and {@link SecurityContext} is not authenticated.
@throws IllegalArgumentException if invocation arguments does not match method signature.
@throws InvocationException if method execution fails for whatever reason.
Invoke managed method and applies method level services . Delegates this managed method { @link #invoker } ; accordingly selected strategy invoker can be { @link DefaultInvoker } or { @link InterceptedInvoker } if this managed method is annotated with { @link Interceptor } . Also takes care to update { @link #meter } .