/** * Simple factory to create a new context connection * of the requested type. * * @return \AppserverIo\RemoteMethodInvocation\ConnectionInterface The requested context connection */ public static function createContextConnection() { // initialize the remote method call parser and the session storage $sessions = new ArrayList(); $parser = new RemoteMethodCallParser(); // initialize the remote context connection $contextConnection = new RemoteContextConnection(); $contextConnection->injectParser($parser); $contextConnection->injectSessions($sessions); // return the initialized connection return $contextConnection; }