Skip to content

Commit 2965c61

Browse files
committed
* Factory example
1 parent 5b90868 commit 2965c61

File tree

5 files changed

+72
-5
lines changed

5 files changed

+72
-5
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
# Version 2.4.2
2+
3+
## Bugfixes
4+
5+
* None
6+
7+
## Features
8+
9+
* Factory example
10+
11+
# Version 2.4.1
12+
13+
## Bugfixes
14+
15+
* None
16+
17+
## Features
18+
19+
* Minor changes
20+
121
# Version 2.4.0
222

323
## Bugfixes

build.default.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# ---- Webapp Settings ----------------------------------------------------------
1212
appserver.webapp.name = example
13-
appserver.webapp.version = 2.4.0
13+
appserver.webapp.version = 2.4.2
1414
package.name = ${appserver.webapp.name}-${appserver.webapp.version}-${build.number}
1515
package.filename = ${package.name}.phar
1616

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"jms/serializer": "~1.0",
1111
"doctrine/orm": "2.5.*",
1212
"appserver-io/routlt": "2.4.*",
13-
"appserver-io/console": "10.0.*",
14-
"appserver-io/provisioning": "1.0.*"
13+
"appserver-io/console": "12.0.*"
1514
},
1615
"require-dev": {
1716
"appserver-io/phar": "~1.0",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/**
4+
* AppserverIo\Apps\Example\Actions\Test\RandomBeanFactory
5+
*
6+
* NOTICE OF LICENSE
7+
*
8+
* This source file is subject to the Open Software License (OSL 3.0)
9+
* that is available through the world-wide-web at this URL:
10+
* http://opensource.org/licenses/osl-3.0.php
11+
*
12+
* PHP version 5
13+
*
14+
* @author Tim Wagner <[email protected]>
15+
* @copyright 2015 TechDivision GmbH <[email protected]>
16+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17+
* @link https://github.com/appserver-io-apps/example
18+
* @link http://www.appserver.io
19+
*/
20+
21+
namespace AppserverIo\Apps\Example\Actions\Test;
22+
23+
use AppserverIo\Psr\EnterpriseBeans\Annotations as EPB;
24+
25+
/**
26+
* A factory for the random bean instances.
27+
*
28+
* @author Tim Wagner <[email protected]>
29+
* @copyright 2015 TechDivision GmbH <[email protected]>
30+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
31+
* @link https://github.com/appserver-io-apps/example
32+
* @link http://www.appserver.io
33+
*
34+
* @EPB\Inject
35+
*/
36+
class RandomBeanFactory
37+
{
38+
39+
/**
40+
* The factory method to create a new instance of a random bean instance.
41+
*
42+
* @return \AppserverIo\Apps\Example\Actions\Test\RandomBeanImplementation The bean instance
43+
*/
44+
public function createRandomBean()
45+
{
46+
return new RandomBeanImplementation();
47+
}
48+
}

src/WEB-INF/classes/AppserverIo/Apps/Example/Actions/Test/RandomBeanImplementation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
use AppserverIo\Psr\EnterpriseBeans\Annotations as EPB;
2424

2525
/**
26-
* A bean for testing purposes.
26+
* A bean for testing purposes that'll be created by a factory.
2727
*
2828
* @author Tim Wagner <[email protected]>
2929
* @copyright 2015 TechDivision GmbH <[email protected]>
3030
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
3131
* @link https://github.com/appserver-io-apps/example
3232
* @link http://www.appserver.io
3333
*
34-
* @EPB\Inject
34+
* @EPB\Inject(factory="RandomBeanFactory", factoryMethod="createRandomBean")
3535
*/
3636
class RandomBeanImplementation
3737
{

0 commit comments

Comments
 (0)