Skip to content

Commit

Permalink
Bugfixes, add LdapLoginModule + performance improvements for session …
Browse files Browse the repository at this point in the history
…beans
  • Loading branch information
wagnert committed May 26, 2017
1 parent 613a0b8 commit 54e829a
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 46 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# Version 1.1.4-beta11

## Bugfixes

* Fixed invalid use statement for RequestHandlerKeys in error.dhtml template
* Fixed that conditions based on per-request operands do not get cached aggressively anymore
* Fixed that rewrite rules do not forward their result to the next rule in the stack

## Features

* Add new LdapLoginModule to allow authentication against an OpenLdap server
* Improve session bean performance by replacing remote proxy with a lightweight local implementation

# Version 1.1.4-beta10

## Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MAINTAINER Tim Wagner <tw@appserver.io>
################################################################################

# define versions
ENV APPSERVER_RUNTIME_BUILD_VERSION 1.1.6-44
ENV APPSERVER_RUNTIME_BUILD_VERSION 1.1.7-45

# update the sources list
RUN apt-get update \
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE-1.1.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Upgrade from 1.1.3 to 1.1.4

Updating from 1.1.3 to 1.1.4 doesn't have any impacts. Please read the apropriate UPGRADE-1.x.x files for updates from older versions to 1.1.3.
2 changes: 1 addition & 1 deletion resources/templates/www/dhtml/error.dhtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @link http://www.appserver.io
*/

use AppserverIo\Appserver\ServletEngine\Utils\RequestHandlerKeys;
use AppserverIo\Psr\Servlet\Utils\RequestHandlerKeys;
use AppserverIo\Appserver\ServletEngine\Utils\ErrorUtil;

?>
Expand Down
65 changes: 64 additions & 1 deletion src/AppserverIo/Appserver/Core/AbstractEpbManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
namespace AppserverIo\Appserver\Core;

use AppserverIo\Psr\Naming\NamingException;
use AppserverIo\Psr\Di\ObjectManagerInterface;
use AppserverIo\RemoteMethodInvocation\LocalProxy;
use AppserverIo\Appserver\ServletEngine\RequestHandler;
use AppserverIo\Psr\EnterpriseBeans\BeanContextInterface;
use AppserverIo\Psr\EnterpriseBeans\PersistenceContextInterface;
use AppserverIo\Psr\EnterpriseBeans\Description\EpbReferenceDescriptorInterface;
use AppserverIo\Psr\EnterpriseBeans\Description\ResReferenceDescriptorInterface;
Expand All @@ -44,7 +48,6 @@ abstract class AbstractEpbManager extends AbstractManager
* @param \AppserverIo\Psr\EnterpriseBeans\Description\EpbReferenceDescriptorInterface $epbReference The EPB reference to register
*
* @return void
* @todo Replace lookupProxy callback with real proxy instance
*/
public function registerEpbReference(EpbReferenceDescriptorInterface $epbReference)
{
Expand Down Expand Up @@ -239,4 +242,64 @@ public function registerPersistenceUnitReference(PersistenceUnitReferenceDescrip
$application->getInitialContext()->getSystemLogger()->critical($e->__toString());
}
}

/**
* This returns a proxy to the requested session bean.
*
* @param string $lookupName The lookup name for the requested session bean
* @param string $sessionId The session-ID if available
*
* @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance
*/
public function lookupProxy($lookupName, $sessionId = null)
{

// load the initial context instance
$initialContext = $this->getInitialContext();

// query whether a request context is available
if ($servletRequest = RequestHandler::getRequestContext()) {
// inject the servlet request to handle SFSBs correctly
$initialContext->injectServletRequest($servletRequest);
}

// lookup the proxy by the name and session ID if available
return $initialContext->lookup($lookupName, $sessionId);
}

/**
* This returns a local proxy to the requested session bean.
*
* @param string $lookupName The lookup name for the requested session bean
* @param string $sessionId The session-ID if available
*
* @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance
*/
public function lookupLocalProxy($lookupName, $sessionId = null)
{

// extract the session bean name from the lookup name
$beanName = str_replace('/local', '', $lookupName);

// load the application
$application = $this->getApplication();

// load bean and object manager
$beanManager = $application->search(BeanContextInterface::IDENTIFIER);
$objectManager = $application->search(ObjectManagerInterface::IDENTIFIER);

// load the requested session bean
$sessionBean = $application->search($beanName, array($sessionId));

// load the bean descriptor
$sessionBeanDescriptor = $objectManager->getObjectDescriptors()->get(get_class($sessionBean));

// initialize the local proxy instance
return new LocalProxy(
$beanManager,
$sessionBeanDescriptor,
$sessionBean,
$sessionId
);
}
}
25 changes: 0 additions & 25 deletions src/AppserverIo/Appserver/Core/AbstractManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use AppserverIo\Psr\Application\ApplicationInterface;
use AppserverIo\Psr\Application\ManagerConfigurationInterface;
use AppserverIo\Psr\Naming\InitialContext as NamingDirectory;
use AppserverIo\Appserver\ServletEngine\RequestHandler;

/**
* Abstract manager implementation.
Expand Down Expand Up @@ -186,30 +185,6 @@ public function newReflectionClass($className)
return $this->getApplication()->search('ProviderInterface')->newReflectionClass($className);
}

/**
* This returns a proxy to the requested session bean.
*
* @param string $lookupName The lookup name for the requested session bean
* @param string $sessionId The session-ID if available
*
* @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy instance
*/
public function lookupProxy($lookupName, $sessionId = null)
{

// load the initial context instance
$initialContext = $this->getInitialContext();

// query whether a request context is available
if ($servletRequest = RequestHandler::getRequestContext()) {
// inject the servlet request to handle SFSBs correctly
$initialContext->injectServletRequest($servletRequest);
}

// lookup the proxy by the name and session ID if available
return $initialContext->lookup($lookupName, $sessionId);
}

/**
* Return's the manager configuration.
*
Expand Down
3 changes: 1 addition & 2 deletions src/AppserverIo/Appserver/Core/Extractors/PharExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@
namespace AppserverIo\Appserver\Core\Extractors;

use AppserverIo\Appserver\Core\AbstractExtractor;
use AppserverIo\Appserver\Core\Utilities\FileSystem;
use AppserverIo\Appserver\Core\Interfaces\ExtractorInterface;
use AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface;
use PDepend\Util\FileUtil;
use AppserverIo\Appserver\Core\Utilities\FileSystem;

/**
* An extractor implementation for phar files.
Expand Down
2 changes: 0 additions & 2 deletions src/AppserverIo/Appserver/Doctrine/Utils/ConnectionUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
use AppserverIo\Lang\Boolean;
use AppserverIo\Psr\Application\ApplicationInterface;
use AppserverIo\Appserver\Core\Api\Node\DatabaseNodeInterface;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySqlPlatform;

/**
* Utility class that helps to prepare the Doctrine DBAL connections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@

namespace AppserverIo\Appserver\PersistenceContainer;

use Psr\Log\LogLevel;
use AppserverIo\Logger\LoggerUtils;
use AppserverIo\Appserver\Core\AbstractDaemonThread;
use AppserverIo\Psr\Application\ApplicationInterface;
use AppserverIo\Appserver\Naming\Utils\NamingDirectoryKeys;
use Psr\Log\LogLevel;

/**
* The garbage collector for the stateful session beans.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

namespace AppserverIo\Appserver\ServletEngine\Session;

use AppserverIo\Lang\Reflection\ReflectionClass;
use AppserverIo\Psr\Servlet\ServletSessionInterface;
use AppserverIo\Appserver\ServletEngine\Http\Session;
use AppserverIo\Appserver\ServletEngine\SessionSettingsInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@

namespace AppserverIo\Appserver\ServletEngine\Session;

use AppserverIo\Lang\Reflection\ReflectionClass;
use AppserverIo\Psr\Servlet\ServletSessionInterface;
use AppserverIo\Appserver\ServletEngine\Http\Session;
use AppserverIo\Appserver\ServletEngine\SessionSettingsInterface;
use AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface;
use AppserverIo\Appserver\ServletEngine\SessionCanNotBeSavedException;
use AppserverIo\Appserver\ServletEngine\SessionCanNotBeDeletedException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@

namespace AppserverIo\Appserver\ServletEngine\Session;

use AppserverIo\Lang\Reflection\ReflectionClass;
use AppserverIo\Psr\Servlet\ServletSessionInterface;
use AppserverIo\Appserver\ServletEngine\Http\Session;
use AppserverIo\Appserver\ServletEngine\SessionSettingsInterface;
use AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface;
use AppserverIo\Appserver\ServletEngine\SessionCanNotBeSavedException;
use AppserverIo\Appserver\ServletEngine\SessionCanNotBeDeletedException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

use AppserverIo\Lang\Reflection\ReflectionClass;
use AppserverIo\Appserver\ServletEngine\SessionSettingsInterface;
use AppserverIo\Appserver\ServletEngine\SessionMarshallerInterface;
use AppserverIo\Appserver\Core\Api\Node\SessionHandlerNodeInterface;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace AppserverIo\Appserver\Core\Api\Node;

use AppserverIo\Appserver\Core\AbstractTest;
use AppserverIo\Configuration\Configuration;

/**
* Test for the analytic node implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@

namespace AppserverIo\Appserver\Core\Utilities\Mock;

use AppserverIo\Appserver\Core\Utilities\AppEnvironmentHelper;
use AppserverIo\Appserver\Core\Utilities\ConfigurationKeys;
use AppserverIo\Appserver\Core\Utilities\DirectoryKeys;
use AppserverIo\Properties\Properties;
use AppserverIo\Appserver\Core\Utilities\ConfigurationKeys;
use AppserverIo\Appserver\Core\Utilities\AppEnvironmentHelper;

/**
* Helper which provides static methods for handling different application environment settings
Expand Down

0 comments on commit 54e829a

Please sign in to comment.