public function callTimeout(TimerInterface $timer, MethodInterface $timeoutMethod = null)
    {

        try {
            // synchronize the application instance and register the class loaders
            $application = $this->getApplication();
            $application->registerClassLoaders();

            // register the applications annotation registries
            $application->registerAnnotationRegistries();

            // initialize the initial context instance
            $initialContext = new InitialContext();
            $initialContext->injectApplication($application);

            // add the application instance to the environment
            Environment::singleton()->setAttribute(EnvironmentKeys::APPLICATION, $application);

            // create s simulated request/session ID whereas session equals request ID
            Environment::singleton()->setAttribute(EnvironmentKeys::SESSION_ID, $sessionId = SessionUtils::generateRandomString());
            Environment::singleton()->setAttribute(EnvironmentKeys::REQUEST_ID, $sessionId);

            // log a message with the timed object information
            \info(sprintf('Now invoke timed object "%s" with session ID "%s"', $this->getTimedObjectId(), $sessionId));

            // lookup the enterprise bean using the initial context
            $instance = $initialContext->lookup($this->getTimedObjectId());

            // check if the timeout method has been passed
            if ($timeoutMethod != null) {
                // if yes, invoke it on the proxy
                $callback = array($instance, $timeoutMethod->getMethodName());
                call_user_func_array($callback, array($timer));
                return;
            }

            // check if we've a default timeout method
            if ($this->defaultTimeoutMethod != null) {
                // if yes, invoke it on the proxy
                $callback = array($instance, $this->defaultTimeoutMethod->getMethodName());
                call_user_func_array($callback, array($timer));
                return;
            }

        } catch (\Exception $e) {
            error_log($e->__toString());
        }
    }