Class Autograder.CallableMethod

  • All Implemented Interfaces:
    java.util.concurrent.Callable<java.lang.Object>
    Enclosing class:
    Autograder

    public class Autograder.CallableMethod
    extends java.lang.Object
    implements java.util.concurrent.Callable<java.lang.Object>
    A Class representing a method that can be called. Used to allow for timeouts when running students code so that instead of the whole autograder timing out and giving no feedback, the method just times out and they can still recieve feedback for their work.
    • Constructor Summary

      Constructors 
      Constructor Description
      CallableMethod​(java.lang.reflect.Method m, java.lang.Object caller, java.lang.Object... args)
      The constructor of CallableMethod Class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object call()
      The call that gets run when the method is run.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CallableMethod

        public CallableMethod​(java.lang.reflect.Method m,
                              java.lang.Object caller,
                              java.lang.Object... args)
        The constructor of CallableMethod Class.
        Parameters:
        m - the method to call
        caller - the object to call the method on
        args - the arguments to pass to the method
    • Method Detail

      • call

        public java.lang.Object call()
                              throws java.lang.Exception
        The call that gets run when the method is run.
        Specified by:
        call in interface java.util.concurrent.Callable<java.lang.Object>
        Returns:
        the result of invoking the method
        Throws:
        java.lang.Exception - on any failiure of m.invoke()