Skip to content

Commit

Permalink
Merge pull request #14 from wagnert/master
Browse files Browse the repository at this point in the history
 Remove AbstractMessageListener::__constructor() method and inject Application it with @resource annotation
  • Loading branch information
wagnert committed Apr 11, 2018
2 parents 92d240b + 3e2c4a8 commit e56040b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
11 changes: 4 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@ php:
- 7.0
- 5.6
- 5.5
- 5.4

matrix:
allow_failures:
- php: 7.0

before_install:
- pecl install pthreads-2.0.10
- pecl install xdebug
- if [[ "$TRAVIS_PHP_VERSION" < "7.0" ]]; then pecl install pthreads-2.0.10; fi
- if [[ "$TRAVIS_PHP_VERSION" = "7.0" ]] || [[ "$TRAVIS_PHP_VERSION" > "7.0" ]]; then pecl install pthreads-3.1.6; fi
- pecl install xdebug-2.5.5
- phpenv rehash
- wget https://scrutinizer-ci.com/ocular.phar

before_script:
- composer selfupdate

script:
- ant composer-init
- ant build
- php ocular.phar code-coverage:upload --format=php-clover $TRAVIS_BUILD_DIR/target/reports/unit/clover.xml

notifications:
email: info@appserver.io
hipchat: 95d47a72c5372d4a0fef20048c3200@Appserver
hipchat: 95d47a72c5372d4a0fef20048c3200@Appserver
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Version 3.0.0

## Bugfixes

* None

## Features

* Remove AbstractMessageListener::__construct() method and inject Application it with @Resource annotation

# Version 2.0.1

## Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion build.default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
#--------------------------------------------------------------------------------

# ---- Module Release Settings --------------------------------------------------
release.version = 2.0.1
release.version = 3.0.0
17 changes: 3 additions & 14 deletions src/AppserverIo/Messaging/AbstractMessageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use AppserverIo\Psr\Pms\MessageListenerInterface;
use AppserverIo\Psr\Pms\MessageQueueException;
use AppserverIo\Psr\Application\ApplicationInterface;
use AppserverIo\Psr\Pms\QueueContextInterface;

/**
* An abstract implementation for a message listener.
Expand All @@ -41,22 +42,10 @@ abstract class AbstractMessageListener implements MessageListenerInterface
* The application instance that provides the entity manager.
*
* @var \AppserverIo\Psr\Application\ApplicationInterface
* @Resource(name="ApplicationInterface")
*/
protected $application;

/**
* Initializes the session bean with the Application instance.
*
* Checks on every start if the database already exists, if not
* the database will be created immediately.
*
* @param \AppserverIo\Psr\Application\ApplicationInterface $application The application instance
*/
public function __construct(ApplicationInterface $application)
{
$this->application = $application;
}

/**
* Returns the application instance.
*
Expand All @@ -79,7 +68,7 @@ protected function updateMonitor(MessageInterface $message)
{

// check if a application instance is available
$queueManager = $this->getApplication()->search('QueueContextInterface');
$queueManager = $this->getApplication()->search(QueueContextInterface::IDENTIFIER);
if ($queueManager == null) {
throw new MessageQueueException(
sprintf('Can\'t find queue manager instance in application %s', $this->getApplication()->getName())
Expand Down

0 comments on commit e56040b

Please sign in to comment.