[3/4] tomee git commit: TOMEE-2391

2018-12-26 Thread jlmonteiro
TOMEE-2391


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/14aa6531
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/14aa6531
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/14aa6531

Branch: refs/heads/master
Commit: 14aa65318afe31e70cb847b2173fbff2d4c547b8
Parents: c041d98
Author: Mariani Federico 
Authored: Wed Dec 26 21:40:08 2018 +0100
Committer: Mariani Federico 
Committed: Wed Dec 26 21:40:08 2018 +0100

--
 examples/pojo-webservice/README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/14aa6531/examples/pojo-webservice/README.md
--
diff --git a/examples/pojo-webservice/README.md 
b/examples/pojo-webservice/README.md
index 40585c5..ab26f15 100644
--- a/examples/pojo-webservice/README.md
+++ b/examples/pojo-webservice/README.md
@@ -4,7 +4,7 @@ status=published
 title=JAX-WS @WebService example
 ~~
 
-Creating Web Services with JAX-WS is quite easy.  Little has to be done aside 
from annotating a class with `@WebService`.  Thie example shows the use of CDI 
with webservice annotation. The web.xml expose the webservice servlet at the 
address http://${host}:${port}/pojo-webservice?wsdl. To run the sample you can 
use the tomee maven plugin, mvn tomee:run.
+Creating Web Services with JAX-WS is quite easy.  Little has to be done aside 
from annotating a class with `@WebService`.  Thie example shows the use of CDI 
with webservice annotation. The web.xml expose the webservice servlet at the 
address http://${host}:${port}/pojo-webservice?wsdl. To run the sample you can 
use the tomee maven plugin, mvn tomee:run. 
 
 ## web.xml
 



[2/4] tomee git commit: TOMEE-2391

2018-12-26 Thread jlmonteiro
80"]
+26-Dec-2018 21:20:55.873 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Using a shared selector for 
servlet write/read
+26-Dec-2018 21:20:55.893 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Initializing ProtocolHandler 
["ajp-nio-8009"]
+26-Dec-2018 21:20:55.896 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Using a shared selector for 
servlet write/read
+26-Dec-2018 21:20:56.206 INFO [main] 
org.apache.openejb.util.OptionsLog.info Using 'tomee.remote.support=true'
+26-Dec-2018 21:20:56.217 INFO [main] 
org.apache.openejb.util.OptionsLog.info Using 
'openejb.jdbc.datasource-creator=org.apache.tomee.jdbc.TomEEDataSourceCreator'
+26-Dec-2018 21:20:56.302 INFO [main] 
org.apache.openejb.OpenEJB$Instance. 

+26-Dec-2018 21:20:56.302 INFO [main] 
org.apache.openejb.OpenEJB$Instance. OpenEJB http://tomee.apache.org/
+26-Dec-2018 21:20:56.302 INFO [main] 
org.apache.openejb.OpenEJB$Instance. Startup: Wed Dec 26 21:20:56 CET 2018
+26-Dec-2018 21:20:56.302 INFO [main] 
org.apache.openejb.OpenEJB$Instance. Copyright 1999-2018 (C) Apache 
OpenEJB Project, All Rights Reserved.
+26-Dec-2018 21:20:56.302 INFO [main] 
org.apache.openejb.OpenEJB$Instance. Version: 8.0.0-SNAPSHOT
+26-Dec-2018 21:20:56.303 INFO [main] 
org.apache.openejb.OpenEJB$Instance. Build date: 20181226
+26-Dec-2018 21:20:56.303 INFO [main] 
org.apache.openejb.OpenEJB$Instance. Build time: 02:24
+26-Dec-2018 21:20:56.303 INFO [main] 
org.apache.openejb.OpenEJB$Instance. 

+26-Dec-2018 21:20:56.303 INFO [main] 
org.apache.openejb.OpenEJB$Instance. openejb.home = 
/tomee/examples/pojo-webservice/target/apache-tomee
+26-Dec-2018 21:20:56.303 INFO [main] 
org.apache.openejb.OpenEJB$Instance. openejb.base = 
/tomee/examples/pojo-webservice/target/apache-tomee
+26-Dec-2018 21:20:56.305 INFO [main] 
org.apache.openejb.cdi.CdiBuilder.initializeOWB Created new singletonService 
org.apache.openejb.cdi.ThreadSingletonServiceImpl@159f197
+26-Dec-2018 21:20:56.305 INFO [main] 
org.apache.openejb.cdi.CdiBuilder.initializeOWB Succeeded in installing 
singleton service
+26-Dec-2018 21:20:56.344 INFO [main] 
org.apache.openejb.config.ConfigurationFactory.init TomEE configuration file is 
'/tomee/examples/pojo-webservice/target/apache-tomee/conf/tomee.xml'
+26-Dec-2018 21:20:56.431 INFO [main] 
org.apache.openejb.config.ConfigurationFactory.configureService Configuring 
Service(id=Tomcat Security Service, type=SecurityService, provider-id=Tomcat 
Security Service)
+26-Dec-2018 21:20:56.433 INFO [main] 
org.apache.openejb.config.ConfigurationFactory.configureService Configuring 
Service(id=Default Transaction Manager, type=TransactionManager, 
provider-id=Default Transaction Manager)
+26-Dec-2018 21:20:56.435 INFO [main] 
org.apache.openejb.util.OptionsLog.info Using 'openejb.system.apps=false'
+26-Dec-2018 21:20:56.436 INFO [main] 
org.apache.openejb.util.OptionsLog.info Using 
'openejb.deployments.classpath=false'
+26-Dec-2018 21:20:56.454 INFO [main] 
org.apache.openejb.assembler.classic.Assembler.createRecipe Creating 
TransactionManager(id=Default Transaction Manager)
+26-Dec-2018 21:20:56.504 INFO [main] 
org.apache.openejb.assembler.classic.Assembler.createRecipe Creating 
SecurityService(id=Tomcat Security Service)
+26-Dec-2018 21:20:56.564 INFO [main] 
org.apache.openejb.server.ServiceManager.initServer Creating 
ServerService(id=cxf)
+26-Dec-2018 21:20:56.724 INFO [main] 
org.apache.openejb.server.ServiceManager.initServer Creating 
ServerService(id=cxf-rs)
+26-Dec-2018 21:20:56.778 INFO [main] 
org.apache.openejb.server.SimpleServiceManager.start   ** Bound Services **
+26-Dec-2018 21:20:56.778 INFO [main] 
org.apache.openejb.server.SimpleServiceManager.printRow   NAME 
IP  PORT  
+26-Dec-2018 21:20:56.778 INFO [main] 
org.apache.openejb.server.SimpleServiceManager.start ---
+26-Dec-2018 21:20:56.779 INFO [main] 
org.apache.openejb.server.SimpleServiceManager.start Ready!
+26-Dec-2018 21:20:56.779 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Initialization processed in 
1609 ms
+26-Dec-2018 21:20:56.806 INFO [main] 
org.apache.tomee.catalina.OpenEJBNamingContextListener.bindResource Importing a 
Tomcat Resource with id 'UserDatabase' of type 
'org.apache.catalina.UserDatabase'.
+26-Dec-2018 21:20:56.807 INFO [main] 
org.apache.openejb.assembler.classic.Assembler.createRecipe Creating 
Resource(id=UserDatabase)
+26-Dec-2018 21:20:56.822 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Starting service [Catalina]
+26-Dec-2018 21:20:56.822 INFO [main] 
sun.reflect.DelegatingMethodAccessorImpl.invoke Starting Servlet Engine: Apache 
Tomcat

[4/4] tomee git commit: This closes #311. Thanks Croway.

2018-12-26 Thread jlmonteiro
This closes #311. Thanks Croway.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/4289150f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/4289150f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/4289150f

Branch: refs/heads/master
Commit: 4289150f02d3b68a5ac7c98c88329559be7cf469
Parents: 14aa653
Author: Jean-Louis Monteiro 
Authored: Thu Dec 27 08:59:09 2018 +0100
Committer: Jean-Louis Monteiro 
Committed: Thu Dec 27 08:59:09 2018 +0100

--

--




[1/4] tomee git commit: TOMEE-2388

2018-12-26 Thread jlmonteiro
mple can be done from maven with a simple 'mvn clean install' 
command run from the 'multi-jpa-provider-testing' directory.
+
+When run you should see output similar to the following.
+
+---
+T E S T S
+---
+Running org.superbiz.JPATest
+INFO - 

+INFO - OpenEJB http://tomee.apache.org/
+INFO - Startup: Wed Dec 26 17:55:31 CET 2018
+INFO - Copyright 1999-2018 (C) Apache OpenEJB Project, All Rights Reserved.
+INFO - Version: 8.0.0-SNAPSHOT
+INFO - Build date: 20181226
+INFO - Build time: 02:26
+INFO - 

+INFO - openejb.home = /tomee/examples/multi-jpa-provider-testing
+INFO - openejb.base = /tomee/examples/multi-jpa-provider-testing
+INFO - Created new singletonService 
org.apache.openejb.cdi.ThreadSingletonServiceImpl@5db45159
+INFO - Succeeded in installing singleton service
+INFO - Cannot find the configuration file [conf/openejb.xml].  Will 
attempt to create one for the beans deployed.
+INFO - Configuring Service(id=Default Security Service, 
type=SecurityService, provider-id=Default Security Service)
+INFO - Configuring Service(id=Default Transaction Manager, 
type=TransactionManager, provider-id=Default Transaction Manager)
+INFO - Using 'openejb.deployments.classpath=false'
+INFO - Creating TransactionManager(id=Default Transaction Manager)
+INFO - Creating SecurityService(id=Default Security Service)
+INFO - Using 'openejb.classloader.forced-load=org.superbiz.model'
+INFO - Configuring enterprise application: 
/tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war
+INFO - Configuring Service(id=Default Managed Container, type=Container, 
provider-id=Default Managed Container)
+INFO - Auto-creating a container for bean 
413724ac-4a44-48a3-ae4a-db190b95cc62_org.superbiz.JPATest: 
Container(type=MANAGED, id=Default Managed Container)
+INFO - Creating Container(id=Default Managed Container)
+INFO - Using directory /tmp for stateful session passivation
+INFO - Configuring PersistenceUnit(name=jpa)
+INFO - Configuring Service(id=Default JDBC Database, type=Resource, 
provider-id=Default JDBC Database)
+INFO - Auto-creating a Resource with id 'Default JDBC Database' of type 
'DataSource for 'jpa'.
+INFO - Creating Resource(id=Default JDBC Database)
+INFO - Configuring Service(id=Default Unmanaged JDBC Database, 
type=Resource, provider-id=Default Unmanaged JDBC Database)
+INFO - Auto-creating a Resource with id 'Default Unmanaged JDBC Database' 
of type 'DataSource for 'jpa'.
+INFO - Creating Resource(id=Default Unmanaged JDBC Database)
+INFO - Adjusting PersistenceUnit jpa  to Resource ID 
'Default JDBC Database' from 'jdbc/jpa'
+INFO - Adjusting PersistenceUnit jpa  to Resource ID 
'Default Unmanaged JDBC Database' from 'null'
+INFO - Using 
'javax.persistence.provider=org.hibernate.ejb.HibernatePersistence'
+INFO - Enterprise application 
"/tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war"
 loaded.
+INFO - Assembling app: 
/tomee/examples/multi-jpa-provider-testing/413724ac-4a44-48a3-ae4a-db190b95cc62.war
+INFO - HCANN01: Hibernate Commons Annotations {4.0.2.Final}
+INFO - HHH000412: Hibernate Core {4.2.18.Final}
+INFO - HHH000206: hibernate.properties not found
+INFO - HHH21: Bytecode provider name : javassist
+INFO - HHH000204: Processing PersistenceUnitInfo [
+name: jpa
+...]
+INFO - HHH000130: Instantiating explicit connection provider: 
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
+INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
+INFO - HHH000268: Transaction strategy: 
org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
+INFO - HHH000397: Using ASTQueryTranslatorFactory
+INFO - HHH000227: Running hbm2ddl schema export
+INFO - HHH000230: Schema export complete
+INFO - PersistenceUnit(name=jpa, 
provider=org.hibernate.ejb.HibernatePersistence) - provider time 1053ms
+INFO - Existing thread singleton service in SystemInstance(): 
org.apache.openejb.cdi.ThreadSingletonServiceImpl@5db45159
+INFO - Some Principal APIs could not be loaded: 
org.eclipse.microprofile.jwt.JsonWebToken out of 
org.eclipse.microprofile.jwt.JsonWebToken not found
+INFO - OpenWebBeans Container is starting...
+INFO - Adding OpenWebBeansPlugin : [CdiPlugin]
+INFO - HV01: Hibernate Validator 5.1.3.Final
+INFO - All injection points were validated successfully.
+INFO - OpenWebBeans Container has started, it took 194 ms.
+INFO - Deployed 
Application(path=/tomee/examples/multi-jpa-p

[jira] [Resolved] (TOMEE-2388) Add README.adoc to multi-jpa-provider-testing/

2018-12-26 Thread Jean-Louis MONTEIRO (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Louis MONTEIRO resolved TOMEE-2388.

   Resolution: Fixed
Fix Version/s: 8.0.0-M2

Thanks Croway

> Add README.adoc to multi-jpa-provider-testing/
> --
>
> Key: TOMEE-2388
> URL: https://issues.apache.org/jira/browse/TOMEE-2388
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
> Fix For: 8.0.0-M2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (TOMEE-2391) Add README.adoc to pojo-webservice/

2018-12-26 Thread Jean-Louis MONTEIRO (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Louis MONTEIRO resolved TOMEE-2391.

   Resolution: Fixed
Fix Version/s: 8.0.0-M2

Thanks Croway

> Add README.adoc to pojo-webservice/
> ---
>
> Key: TOMEE-2391
> URL: https://issues.apache.org/jira/browse/TOMEE-2391
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
> Fix For: 8.0.0-M2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (TOMEE-2334) MicroProfile JWT Example for JsonWebToken as Principal injection

2018-12-26 Thread Roberto Cortez (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roberto Cortez reassigned TOMEE-2334:
-

Assignee: Mitja Jeseničnik Kotnik

> MicroProfile JWT Example for JsonWebToken as Principal injection
> 
>
> Key: TOMEE-2334
> URL: https://issues.apache.org/jira/browse/TOMEE-2334
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: Roberto Cortez
>Assignee: Mitja Jeseničnik Kotnik
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (TOMEE-2332) MicroProfile JWT Example for JWK

2018-12-26 Thread JIRA


[ 
https://issues.apache.org/jira/browse/TOMEE-2332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729150#comment-16729150
 ] 

Mitja Jeseničnik Kotnik edited comment on TOMEE-2332 at 12/26/18 7:33 PM:
--

Hello, I would like to take this example for starters.


was (Author: cotnic):
Hello I would like to takethis example for starters.

> MicroProfile JWT Example for JWK
> 
>
> Key: TOMEE-2332
> URL: https://issues.apache.org/jira/browse/TOMEE-2332
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: Roberto Cortez
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (TOMEE-2332) MicroProfile JWT Example for JWK

2018-12-26 Thread JIRA


[ 
https://issues.apache.org/jira/browse/TOMEE-2332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729150#comment-16729150
 ] 

Mitja Jeseničnik Kotnik edited comment on TOMEE-2332 at 12/26/18 7:33 PM:
--

Hello I would like to takethis example for starters.


was (Author: cotnic):
Hello I would like to take the two examples for MicroProfile for JWT. The other 
one is TOMEE-2334

> MicroProfile JWT Example for JWK
> 
>
> Key: TOMEE-2332
> URL: https://issues.apache.org/jira/browse/TOMEE-2332
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: Roberto Cortez
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2332) MicroProfile JWT Example for JWK

2018-12-26 Thread JIRA


[ 
https://issues.apache.org/jira/browse/TOMEE-2332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729150#comment-16729150
 ] 

Mitja Jeseničnik Kotnik commented on TOMEE-2332:


Hello I would like to take the two examples for MicroProfile for JWT. The other 
one is TOMEE-2334

> MicroProfile JWT Example for JWK
> 
>
> Key: TOMEE-2332
> URL: https://issues.apache.org/jira/browse/TOMEE-2332
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: Roberto Cortez
>Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (TOMEE-2373) Add README.adoc to cdi-session-scope/

2018-12-26 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated TOMEE-2373:
--
Labels: pull-request-available  (was: )

> Add README.adoc to cdi-session-scope/
> -
>
> Key: TOMEE-2373
> URL: https://issues.apache.org/jira/browse/TOMEE-2373
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2373) Add README.adoc to cdi-session-scope/

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729142#comment-16729142
 ] 

ASF GitHub Bot commented on TOMEE-2373:
---

GitHub user puneethps opened a pull request:

https://github.com/apache/tomee/pull/312

TOMEE-2373 Add README.adoc to cdi-session-scope/

Added README.md to cdi-session-scope/.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/puneethps/tomee master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tomee/pull/312.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #312


commit 3dc82cc1a1450193e142828331635aacb8f855b2
Author: puneethps 
Date:   2018-12-26T16:51:49Z

Merge pull request #1 from apache/master

update

commit 8c6c4fccfaa7b4e3702a462de1f7271e917111fc
Author: puneethps 
Date:   2018-12-26T18:56:23Z

Add files via upload




> Add README.adoc to cdi-session-scope/
> -
>
> Key: TOMEE-2373
> URL: https://issues.apache.org/jira/browse/TOMEE-2373
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (TOMEE-2388) Add README.adoc to multi-jpa-provider-testing/

2018-12-26 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated TOMEE-2388:
--
Labels: pull-request-available  (was: )

> Add README.adoc to multi-jpa-provider-testing/
> --
>
> Key: TOMEE-2388
> URL: https://issues.apache.org/jira/browse/TOMEE-2388
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2388) Add README.adoc to multi-jpa-provider-testing/

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729121#comment-16729121
 ] 

ASF GitHub Bot commented on TOMEE-2388:
---

GitHub user Croway opened a pull request:

https://github.com/apache/tomee/pull/311

TOMEE-2388



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/Croway/tomee TOMEE-2388

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tomee/pull/311.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #311


commit b50392f1342093a95d8f865bc4c1b86be4cf412f
Author: Mariani Federico 
Date:   2018-12-26T17:43:56Z

TOMEE-2388




> Add README.adoc to multi-jpa-provider-testing/
> --
>
> Key: TOMEE-2388
> URL: https://issues.apache.org/jira/browse/TOMEE-2388
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2286) MicroProfile Metrics Example for @Gauge

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729108#comment-16729108
 ] 

ASF GitHub Bot commented on TOMEE-2286:
---

Github user ivanjunckes commented on the issue:

https://github.com/apache/tomee/pull/213
  
done @radcortez 


> MicroProfile Metrics Example for @Gauge
> ---
>
> Key: TOMEE-2286
> URL: https://issues.apache.org/jira/browse/TOMEE-2286
> Project: TomEE
>  Issue Type: Sub-task
>  Components: Examples and Documentation
>Affects Versions: 8.0.0-M1
>Reporter: Ivan Junckes Filho
>Assignee: Ivan Junckes Filho
>Priority: Minor
>  Labels: examples, pull-request-available
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2422) Add correct title to examples

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729087#comment-16729087
 ] 

ASF GitHub Bot commented on TOMEE-2422:
---

GitHub user ivanjunckes opened a pull request:

https://github.com/apache/tomee/pull/310

TOMEE-2422 - Fixing titles



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ivanjunckes/tomee TOMEE-2422

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tomee/pull/310.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #310


commit 0efe6d0b9ca044d2be312f7baa4b0918a059ee6c
Author: ivanjunckes 
Date:   2018-12-26T15:50:55Z

TOMEE-2422 - Fixing titles




> Add correct title to examples
> -
>
> Key: TOMEE-2422
> URL: https://issues.apache.org/jira/browse/TOMEE-2422
> Project: TomEE
>  Issue Type: Bug
>Reporter: Ivan Junckes Filho
>Priority: Minor
>  Labels: pull-request-available
>
> Some of the examples are putting the project name as the title and not in a 
> user friendly way.
> See for example mp-metrics-counted:
> http://tomee.apache.org/tomee-8.0/examples/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (TOMEE-2422) Add correct title to examples

2018-12-26 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated TOMEE-2422:
--
Labels: pull-request-available  (was: )

> Add correct title to examples
> -
>
> Key: TOMEE-2422
> URL: https://issues.apache.org/jira/browse/TOMEE-2422
> Project: TomEE
>  Issue Type: Bug
>Reporter: Ivan Junckes Filho
>Priority: Minor
>  Labels: pull-request-available
>
> Some of the examples are putting the project name as the title and not in a 
> user friendly way.
> See for example mp-metrics-counted:
> http://tomee.apache.org/tomee-8.0/examples/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (TOMEE-2422) Add correct title to examples

2018-12-26 Thread Ivan Junckes Filho (JIRA)
Ivan Junckes Filho created TOMEE-2422:
-

 Summary: Add correct title to examples
 Key: TOMEE-2422
 URL: https://issues.apache.org/jira/browse/TOMEE-2422
 Project: TomEE
  Issue Type: Bug
Reporter: Ivan Junckes Filho


Some of the examples are putting the project name as the title and not in a 
user friendly way.

See for example mp-metrics-counted:

http://tomee.apache.org/tomee-8.0/examples/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2301) Concurrency utilities example

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729045#comment-16729045
 ] 

ASF GitHub Bot commented on TOMEE-2301:
---

Github user asfgit closed the pull request at:

https://github.com/apache/tomee/pull/289


> Concurrency utilities example
> -
>
> Key: TOMEE-2301
> URL: https://issues.apache.org/jira/browse/TOMEE-2301
> Project: TomEE
>  Issue Type: Improvement
>  Components: Examples and Documentation
>Affects Versions: 8.0.0-M2
>Reporter: Bruno Baptista
>Priority: Major
>  Labels: concurrency, examples, pull-request-available
> Fix For: 8.0.0-M2
>
>
> This is an example to demontrate the Concurrency Utilities introduced in JEE7:
> [https://docs.oracle.com/javaee/7/tutorial/concurrency-utilities.htm#top]
> It will use CompletableFutures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2386) Add README.adoc to mp-metrics-metered/

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729046#comment-16729046
 ] 

ASF GitHub Bot commented on TOMEE-2386:
---

Github user asfgit closed the pull request at:

https://github.com/apache/tomee/pull/308


> Add README.adoc to mp-metrics-metered/
> --
>
> Key: TOMEE-2386
> URL: https://issues.apache.org/jira/browse/TOMEE-2386
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
> Fix For: 8.0.0-M2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (TOMEE-2386) Add README.adoc to mp-metrics-metered/

2018-12-26 Thread Jean-Louis MONTEIRO (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Louis MONTEIRO resolved TOMEE-2386.

   Resolution: Fixed
Fix Version/s: 8.0.0-M2

> Add README.adoc to mp-metrics-metered/
> --
>
> Key: TOMEE-2386
> URL: https://issues.apache.org/jira/browse/TOMEE-2386
> Project: TomEE
>  Issue Type: Sub-task
>Reporter: David Blevins
>Priority: Major
>  Labels: pull-request-available
> Fix For: 8.0.0-M2
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[1/2] tomee git commit: Add files via upload

2018-12-26 Thread jlmonteiro
Repository: tomee
Updated Branches:
  refs/heads/master 113644b66 -> b489fca7a


Add files via upload

Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/197b44fa
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/197b44fa
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/197b44fa

Branch: refs/heads/master
Commit: 197b44fa88a6c207e9cba093d21c16b7a607665f
Parents: 16052e0
Author: puneethps 
Authored: Mon Dec 24 23:17:08 2018 +0530
Committer: GitHub 
Committed: Mon Dec 24 23:17:08 2018 +0530

--
 examples/mp-metrics-metered/README.md | 130 +
 1 file changed, 130 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/197b44fa/examples/mp-metrics-metered/README.md
--
diff --git a/examples/mp-metrics-metered/README.md 
b/examples/mp-metrics-metered/README.md
new file mode 100644
index 000..8008fbe
--- /dev/null
+++ b/examples/mp-metrics-metered/README.md
@@ -0,0 +1,130 @@
+index-group=Unrevised
+type=page
+status=published
+~~
+# Microprofile Metrics
+This is an example on how to use microprofile metrics in TomEE.
+
+# Run the application:
+
+mvn clean install tomee:run 
+
+Within the application, there is an enpoint that will give you a weather 
weather status for the day and week.
+
+# For the day status call:
+
+GET http://localhost:8080/mp-metrics-metered/weather/day/status
+
+# Response:
+
+Hi, today is a sunny day!
+
+ Metered Feature
+MicroProfile metrics has a feature that can be used to find the rate of 
requests to a service.
+
+To use this feature you need to annotate the JAX-RS resource method with 
@Metered.
+
+@Path("/weather")
+@Produces(MediaType.APPLICATION_JSON)
+@Consumes(MediaType.APPLICATION_JSON)
+@ApplicationScoped
+public class WeatherService {
+
+@Path("/day/status")
+@Metered(name = "dailyStatus", unit = MetricUnits.MINUTES, description 
= "Metrics to daily weather status method", absolute = true)
+@GET
+@Produces(MediaType.TEXT_PLAIN)
+public String dayStatus() {
+return "Hi, today is a sunny day!";
+}
+...
+}
+
+There are some configurations, as part of @Metered, that you need to know:
+
+**String name**
+Optional. Sets the name of the metric. If not explicitly given the name of the 
annotated object is used.
+
+**boolean absolute**
+If true, uses the given name as the absolute name of the metric. If false, 
prepends the package name and class name before the given name. Default value 
is false.
+
+**String displayName**
+Optional. A human-readable display name for metadata.
+
+**String description**
+Optional. A description of the metric.
+
+**String[] tags**
+Optional. Array of Strings in the = format to supply special tags 
to a metric.
+
+**boolean reusable**
+Denotes if a metric with a certain name can be registered in more than one 
place. Does not apply to gauges.
+
+**String unit**
+Unit of the metric. Default for @Metered is nanoseconds.
+
+ Metric data
+
+Check the Metered metric doing a _GET_ request:
+
+# Prometheus format:
+
+GET 
http://localhost:8080/mp-metrics-metered/metrics/application/dailyStatus
+
+# Response:
+ 
+   # TYPE application:daily_status_seconds_count meter
+   application:daily_status_seconds_count 1.2E-7
+   # TYPE application:daily_status_rate_per_second meter
+   application:daily_status_rate_per_second 0.0
+   # TYPE application:daily_status_one_min_rate_per_second meter
+   application:daily_status_one_min_rate_per_second 1.3376002644204984E-19
+   # TYPE application:daily_status_five_min_rate_per_second meter
+   application:daily_status_five_min_rate_per_second 3.5942838529305413E-20
+   # TYPE application:daily_status_fifteen_min_rate_per_second meter
+   application:daily_status_fifteen_min_rate_per_second 
3.4665766454142955E-21
+
+  
+# JSON Format:
+
+For json format add the header _Accept=application/json_ to the request. 
+  
+   {
+   "dailyStatus": {
+   "count": 2,
+   "fifteenMinRate": 5.77762774235716e-14,
+   "fiveMinRate": 5.990473088217569e-13,
+   "meanRate": 0,
+   "oneMinRate": 2.229333774034164e-12,
+   "unit": "minutes"
+   }
+   }
+   
+ Metric metadata
+A metric will have a metadata so you can know more information about it, like 
displayName, description, tags  etc.
+
+Check the metric metadata doing a _OPTIONS_ request:
+
+# Request
+
+OPTIONS 
http://localhost:8080/mp-metrics-metered/metrics/application/dailyStatus
+
+# Response:
+
+   

[2/2] tomee git commit: This closes #308. Thanks puneethps.

2018-12-26 Thread jlmonteiro
This closes #308. Thanks puneethps.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/b489fca7
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/b489fca7
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/b489fca7

Branch: refs/heads/master
Commit: b489fca7ac6ec08a3d9d14e882c32e18cb10162a
Parents: 113644b 197b44f
Author: Jean-Louis Monteiro 
Authored: Wed Dec 26 15:03:50 2018 +0100
Committer: Jean-Louis Monteiro 
Committed: Wed Dec 26 15:03:50 2018 +0100

--
 examples/mp-metrics-metered/README.md | 130 +
 1 file changed, 130 insertions(+)
--




[jira] [Resolved] (TOMEE-2301) Concurrency utilities example

2018-12-26 Thread Jean-Louis MONTEIRO (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jean-Louis MONTEIRO resolved TOMEE-2301.

   Resolution: Fixed
 Assignee: Bruno Baptista
Fix Version/s: 8.0.0-M2

> Concurrency utilities example
> -
>
> Key: TOMEE-2301
> URL: https://issues.apache.org/jira/browse/TOMEE-2301
> Project: TomEE
>  Issue Type: Improvement
>  Components: Examples and Documentation
>Affects Versions: 8.0.0-M2
>Reporter: Bruno Baptista
>Assignee: Bruno Baptista
>Priority: Major
>  Labels: concurrency, examples, pull-request-available
> Fix For: 8.0.0-M2
>
>
> This is an example to demontrate the Concurrency Utilities introduced in JEE7:
> [https://docs.oracle.com/javaee/7/tutorial/concurrency-utilities.htm#top]
> It will use CompletableFutures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[09/13] tomee git commit: use countdownlatch

2018-12-26 Thread jlmonteiro
use countdownlatch

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/cc2cd4cf
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/cc2cd4cf
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/cc2cd4cf

Branch: refs/heads/master
Commit: cc2cd4cf5fcf8b44829d75461de544003ed8e1db
Parents: fad8df9
Author: brunobat 
Authored: Mon Dec 24 16:08:54 2018 +
Committer: brunobat 
Committed: Mon Dec 24 16:08:54 2018 +

--
 .../superbiz/executor/ThreadFactoryService.java | 28 
 1 file changed, 11 insertions(+), 17 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/cc2cd4cf/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index 223b592..629e9db 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -5,6 +5,7 @@ import javax.enterprise.concurrent.ManagedThreadFactory;
 import javax.enterprise.context.RequestScoped;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Logger;
 
 /**
@@ -34,47 +35,34 @@ public class ThreadFactoryService {
 /**
  * Happy path.
  *
- * @param value to compute
- * @return The thread we created
+ * @param longTask to compute
  */
-public int asyncTask(final int value) throws InterruptedException {
+public void asyncTask(final LongTask longTask) throws InterruptedException 
{
 LOGGER.info("Create asyncTask");
-final CountDownLatch countDownLatch = new CountDownLatch(1);
-final LongTask longTask = new LongTask(value, 100, countDownLatch);
 
 final Thread thread = factory.newThread(longTask);
 thread.setName("pretty asyncTask");
 thread.start();
-
-countDownLatch.await(200, TimeUnit.MILLISECONDS);
-
-return longTask.getResult();
 }
 
 /**
  * Example where we have to stop a thread.
  *
- * @param value
- * @return The thread we created
+ * @param longTask
  * @throws InterruptedException
  */
-public int asyncHangingTask(final int value) throws InterruptedException {
+public void asyncHangingTask(final Runnable longTask) {
 LOGGER.info("Create asyncHangingTask");
-final CountDownLatch countDownLatch = new CountDownLatch(1);
-final LongTask longTask = new LongTask(value, 100, countDownLatch);
 
 final Thread thread = factory.newThread(longTask);
 thread.setName("pretty asyncHangingTask");
 thread.start();
 
-countDownLatch.await(200, TimeUnit.MILLISECONDS);
-
 if (thread.isAlive()) {
 // This will cause any wait in the thread to resume.
 // This will call the InterruptedException block in the 
longRunnableTask method.
 thread.interrupt();
 }
-return longTask.getResult();
 }
 
 /**
@@ -85,6 +73,7 @@ public class ThreadFactoryService {
 private final long taskDurationMs;
 private final CountDownLatch countDownLatch;
 private int result;
+private AtomicBoolean isTerminated = new AtomicBoolean(false);
 
 public LongTask(final int value,
 final long taskDurationMs,
@@ -98,12 +87,17 @@ public class ThreadFactoryService {
 return result;
 }
 
+public boolean getIsTerminated() {
+return isTerminated.get();
+}
+
 @Override
 public void run() {
 try {
 // Simulate a long processing task using TimeUnit to sleep.
 TimeUnit.MILLISECONDS.sleep(taskDurationMs);
 } catch (InterruptedException e) {
+isTerminated.set(false);
 throw new RuntimeException("Problem while waiting");
 }
 



[12/13] tomee git commit: Use CountDownLatch instead of sleep while waiting for other threads.

2018-12-26 Thread jlmonteiro
Use CountDownLatch instead of sleep while waiting for other threads.

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/40b41a38
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/40b41a38
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/40b41a38

Branch: refs/heads/master
Commit: 40b41a38df22fc3f9c531684b8ecbc76edabd5b9
Parents: 2f63669
Author: brunobat 
Authored: Wed Dec 26 12:30:28 2018 +
Committer: brunobat 
Committed: Wed Dec 26 12:30:28 2018 +

--
 .../executor/ManagedScheduledService.java   | 53 ++--
 .../superbiz/executor/ThreadFactoryService.java |  4 +-
 .../executor/ManagedScheduledServiceTest.java   | 11 ++--
 3 files changed, 36 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/40b41a38/examples/concurrency-utils/src/main/java/org/superbiz/executor/ManagedScheduledService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ManagedScheduledService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ManagedScheduledService.java
index c0f2bdb..e9e2cb5 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ManagedScheduledService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ManagedScheduledService.java
@@ -21,6 +21,7 @@ import javax.annotation.Resource;
 import javax.enterprise.concurrent.ManagedScheduledExecutorService;
 import javax.enterprise.context.RequestScoped;
 import java.util.concurrent.Callable;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.TimeUnit;
@@ -56,15 +57,17 @@ public class ManagedScheduledService {
  * executor uses a runnable to perform the operations.
  * If an exception happens, the task will stop and you can catch the 
exception with the {@link ScheduledFuture}.
  *
- * @param valueThe value to compute
- * @param errorMessage If not null an exception with be thrown with this 
message
+ * @param value  The value to compute
+ * @param errorMessage   If not null an exception with be thrown with this 
message
+ * @param countDownLatch
  * @return An object where you can cancel the periodic task and check for 
exceptions.
  */
 public ScheduledFuture periodicFixedDelayTask(final int value,
- final String 
errorMessage) {
+ final String errorMessage,
+ final CountDownLatch 
countDownLatch) {
 LOGGER.info("longRunnableTask scheduled");
 return executor.scheduleAtFixedRate(
-longRunnableTask(value, 10, errorMessage), 0, 100, 
TimeUnit.MILLISECONDS);
+longRunnableTask(value, 10, errorMessage, countDownLatch), 0, 
100, TimeUnit.MILLISECONDS);
 }
 
 /**
@@ -77,22 +80,14 @@ public class ManagedScheduledService {
  */
 private Runnable longRunnableTask(final int value,
   final int taskDurationMs,
-  final String errorMessage) {
+  final String errorMessage,
+  final CountDownLatch countDownLatch) {
 return () -> {
-if (nonNull(errorMessage)) {
-LOGGER.severe("Exception will be thrown");
-throw new RuntimeException(errorMessage);
-}
-try {
-// Simulate a long processing task using TimeUnit to sleep.
-TimeUnit.MILLISECONDS.sleep(taskDurationMs);
-} catch (InterruptedException e) {
-throw new RuntimeException("Problem while waiting");
-}
-
+failOrWait(taskDurationMs, errorMessage);
 Integer result = value + 1;
 LOGGER.info("longRunnableTask complete. Value is " + result);
 // Cannot return result with a Runnable.
+countDownLatch.countDown();
 };
 }
 
@@ -109,21 +104,25 @@ public class ManagedScheduledService {
final String errorMessage) {
 return () -> {
 LOGGER.info("longCallableTask start");
-if (nonNull(errorMessage)) {
-LOGGER.severe("Exception will be thrown");
-throw new RuntimeException(errorMessage);
-}
-
-try {
-// Simulate a long processing task using TimeUnit to sleep.
-

[11/13] tomee git commit: Finish ThreadFactory Example

2018-12-26 Thread jlmonteiro
Finish ThreadFactory Example

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2f636699
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2f636699
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2f636699

Branch: refs/heads/master
Commit: 2f636699d8ba79e753c37887a60cda50ac749329
Parents: 1d99d91
Author: brunobat 
Authored: Wed Dec 26 12:14:11 2018 +
Committer: brunobat 
Committed: Wed Dec 26 12:14:11 2018 +

--
 .../superbiz/executor/ThreadFactoryService.java |  3 +-
 .../executor/ThreadFactoryServiceTest.java  | 50 ++--
 2 files changed, 28 insertions(+), 25 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/2f636699/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index 629e9db..93df490 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -97,7 +97,8 @@ public class ThreadFactoryService {
 // Simulate a long processing task using TimeUnit to sleep.
 TimeUnit.MILLISECONDS.sleep(taskDurationMs);
 } catch (InterruptedException e) {
-isTerminated.set(false);
+isTerminated.set(true);
+countDownLatch.countDown();
 throw new RuntimeException("Problem while waiting");
 }
 

http://git-wip-us.apache.org/repos/asf/tomee/blob/2f636699/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
--
diff --git 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
index efe2771..de5ba56 100644
--- 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
+++ 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
@@ -1,5 +1,22 @@
 package org.superbiz.executor;
 
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -17,22 +34,11 @@ import java.util.logging.Logger;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+/*
+ * This demonstrates used managed threads inside a container.
+ * 
+ * We use CountDownLatch to demonstrate the thread management because it's 
faster and
+ * safer that simply using a sleep and hope the other thread has completed.
  */
 @RunWith(Arquillian.class)
 public class ThreadFactoryServiceTest {
@@ -66,15 +72,11 @@ public class ThreadFactoryServiceTest {
 final CountDownLatch 

[07/13] tomee git commit: TOMEE-2301 - add javadoc

2018-12-26 Thread jlmonteiro
TOMEE-2301 - add javadoc

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/624693bb
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/624693bb
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/624693bb

Branch: refs/heads/master
Commit: 624693bbc1fbcb790c6c4a4f1944e8f3c2d818e5
Parents: 5a6818b
Author: brunobat 
Authored: Wed Dec 19 23:59:58 2018 +
Committer: brunobat 
Committed: Wed Dec 19 23:59:58 2018 +

--
 .../src/main/java/org/superbiz/executor/ThreadFactoryService.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/624693bb/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index c0166f7..223b592 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -77,6 +77,9 @@ public class ThreadFactoryService {
 return longTask.getResult();
 }
 
+/**
+ * Runnable rung task simulating a lengthy operation
+ */
 public static class LongTask implements Runnable {
 private final int value;
 private final long taskDurationMs;



[13/13] tomee git commit: Merge remote-tracking branch 'upstream/master' into executor-example

2018-12-26 Thread jlmonteiro
Merge remote-tracking branch 'upstream/master' into executor-example


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/113644b6
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/113644b6
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/113644b6

Branch: refs/heads/master
Commit: 113644b665415b0908b0948cb323be4ef40251ef
Parents: 40b41a3 1ff8ad8
Author: brunobat 
Authored: Wed Dec 26 12:34:48 2018 +
Committer: brunobat 
Committed: Wed Dec 26 12:34:48 2018 +

--
 .../arquillian/tests/filter/AllFilterTest.java  |   1 -
 .../tests/realm/CdiLazyRealmTOMEE1490Test.java  |   4 +-
 arquillian/arquillian-tomee-tests/pom.xml   |  39 ++
 docs/configuration.adoc |   2 +-
 docs/embedded-and-remotable.adoc|   2 +-
 docs/embedding.adoc |   2 +-
 docs/faq.adoc   |   2 +-
 docs/getting-started.adoc   |   2 +-
 docs/installation.adoc  |   2 +-
 docs/local-server.adoc  |   2 +-
 docs/manual-installation.adoc   |   2 +-
 docs/property-overriding.adoc   |   2 +-
 docs/remote-server.adoc |   2 +-
 docs/securing-a-web-service.adoc|   2 +-
 docs/system-properties-files.adoc   |   2 +-
 docs/telnet-console.adoc|   2 +-
 docs/validation-tool.adoc   |   2 +-
 examples/jpa-hibernate/README.md|  15 +-
 examples/moviefun-rest/README.md| 404 +++
 examples/mp-custom-healthcheck/README.adoc  | 146 +++
 examples/mp-custom-healthcheck/pom.xml  |  94 +
 .../java/org/superbiz/WeatherApiStatus.java |  52 +++
 .../main/java/org/superbiz/WeatherEndpoint.java |  45 +++
 .../java/org/superbiz/WeatherException.java |  27 ++
 .../main/java/org/superbiz/WeatherGateway.java  |  63 +++
 .../org/superbiz/WeatherServiceHealthCheck.java |  48 +++
 .../src/main/resources/beans.xml|   7 +
 .../org/superbiz/test/WeatherServiceTest.java   | 124 ++
 .../src/test/resources/arquillian.xml   |  29 ++
 examples/mp-faulttolerance-fallback/README.adoc | 121 ++
 examples/mp-faulttolerance-fallback/pom.xml | 107 +
 .../rest/WeatherDayStatusFallbackHandler.java   |  34 ++
 .../org/superbiz/rest/WeatherException.java |  20 +
 .../java/org/superbiz/rest/WeatherService.java  |  60 +++
 .../org/superbiz/rest/WeatherServiceTest.java   |  74 
 .../src/test/resources/arquillian.xml   |  30 ++
 .../src/test/resources/beans.xml|   7 +
 examples/mp-opentracing-traced/README.adoc  |  64 +++
 examples/mvc-cxf/README.adoc|  24 ++
 examples/mvc-cxf/README.md  |  23 --
 examples/mvc-resteasy/README.adoc   |  23 ++
 examples/mvc-resteasy/pom.xml   | 143 +++
 .../java/org/superbiz/mvc/MVCApplication.java   |  22 +
 .../java/org/superbiz/mvc/TomeeController.java  |  38 ++
 .../src/main/resources/META-INF/beans.xml   |  23 ++
 .../src/main/webapp/WEB-INF/views/hello.jsp |  28 ++
 .../src/main/webapp/WEB-INF/web.xml |  28 ++
 examples/mvc-resteasy/src/main/webapp/index.jsp |  28 ++
 .../src/test/java/org/superbiz/mvc/MVCTest.java |  74 
 .../src/test/resources/arquillian.xml   |  31 ++
 examples/persistence-fragment/README.md |   6 +-
 examples/pom.xml|   3 +
 .../META-INF/org.apache.openejb.extension   |   1 -
 owasp-dc-suppression.xml|  80 
 pom.xml |  61 ++-
 .../apache/openejb/server/rest/RESTService.java |   7 +-
 .../apache-tomee/src/main/resources/service.bat |   2 +-
 tomee/tomee-plume-webapp/pom.xml|   3 +-
 tomee/tomee-plus-webapp/pom.xml |   3 +-
 59 files changed, 2242 insertions(+), 52 deletions(-)
--




[10/13] tomee git commit: use countdownlatch

2018-12-26 Thread jlmonteiro
use countdownlatch

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/1d99d91b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/1d99d91b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/1d99d91b

Branch: refs/heads/master
Commit: 1d99d91bf9711396cca3c80c01331a2296c53683
Parents: cc2cd4c
Author: brunobat 
Authored: Mon Dec 24 16:09:04 2018 +
Committer: brunobat 
Committed: Mon Dec 24 16:09:04 2018 +

--
 .../executor/ThreadFactoryServiceTest.java  | 32 +---
 1 file changed, 27 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/1d99d91b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
--
diff --git 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
index 7ab2d15..efe2771 100644
--- 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
+++ 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
@@ -7,11 +7,15 @@ import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.superbiz.executor.ThreadFactoryService.LongTask;
 
 import javax.inject.Inject;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import java.util.logging.Logger;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
 
 /**
@@ -33,6 +37,8 @@ import static org.junit.Assert.assertEquals;
 @RunWith(Arquillian.class)
 public class ThreadFactoryServiceTest {
 
+private static final Logger LOGGER = 
Logger.getLogger(ThreadFactoryServiceTest.class.getSimpleName());
+
 @Inject
 private ThreadFactoryService factoryService;
 
@@ -43,16 +49,32 @@ public class ThreadFactoryServiceTest {
 .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
 }
 
-//TODO failing to load due to missing DeployerBusinessRemote
 @Test
 public void asyncTask() throws InterruptedException {
-//task was completed
-assertEquals(2, factoryService.asyncTask(1));
+final CountDownLatch countDownLatch = new CountDownLatch(1);
+final LongTask longTask = new LongTask(1, 50, countDownLatch);
+factoryService.asyncTask(longTask);
+
+countDownLatch.await(200, TimeUnit.MILLISECONDS); // With the 
countdown latch we don't block unnecessarily.
+LOGGER.info("task was completed");
+
+assertEquals(2, longTask.getResult());
 }
 
 @Test
 public void asyncHangingTask() throws InterruptedException {
-// task was interrupted and operation was not completed.
-assertEquals(1, factoryService.asyncHangingTask(1));
+final CountDownLatch countDownLatch = new CountDownLatch(1);
+final LongTask longTask = new LongTask(1, 100, countDownLatch);
+
+try {
+factoryService.asyncHangingTask(longTask);
+} catch (RuntimeException e) {
+//
+}
+countDownLatch.await(200, TimeUnit.MILLISECONDS);
+LOGGER.info("task was interrupted and operation was not completed.");
+
+//assertTrue(longTask.getIsTerminated());
+assertEquals(1, longTask.getResult());
 }
 }
\ No newline at end of file



[08/13] tomee git commit: TOMEE-2301 - todo

2018-12-26 Thread jlmonteiro
TOMEE-2301 - todo

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/fad8df9f
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/fad8df9f
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/fad8df9f

Branch: refs/heads/master
Commit: fad8df9f59cf80d4207a416b0c282ccd666c17d8
Parents: 624693b
Author: brunobat 
Authored: Thu Dec 20 00:00:13 2018 +
Committer: brunobat 
Committed: Thu Dec 20 00:00:13 2018 +

--
 .../test/java/org/superbiz/executor/ThreadFactoryServiceTest.java   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/fad8df9f/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
--
diff --git 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
index 9a4c205..7ab2d15 100644
--- 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
+++ 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
@@ -43,6 +43,7 @@ public class ThreadFactoryServiceTest {
 .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
 }
 
+//TODO failing to load due to missing DeployerBusinessRemote
 @Test
 public void asyncTask() throws InterruptedException {
 //task was completed



[05/13] tomee git commit: TOMEE-2301 - use countDownLatch and runnable class

2018-12-26 Thread jlmonteiro
TOMEE-2301 - use countDownLatch and runnable class

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/46cb50f4
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/46cb50f4
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/46cb50f4

Branch: refs/heads/master
Commit: 46cb50f4a0a819863f8b6b3c9e5b85b158d890b0
Parents: 69c9f67
Author: brunobat 
Authored: Tue Dec 18 23:34:41 2018 +
Committer: brunobat 
Committed: Tue Dec 18 23:34:41 2018 +

--
 .../superbiz/executor/ThreadFactoryService.java | 77 
 1 file changed, 45 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/46cb50f4/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index 43e93d9..c0166f7 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -3,11 +3,10 @@ package org.superbiz.executor;
 import javax.annotation.Resource;
 import javax.enterprise.concurrent.ManagedThreadFactory;
 import javax.enterprise.context.RequestScoped;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.logging.Logger;
 
-import static java.util.Objects.nonNull;
-
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -38,12 +37,18 @@ public class ThreadFactoryService {
  * @param value to compute
  * @return The thread we created
  */
-public Thread asyncTask(final int value) {
+public int asyncTask(final int value) throws InterruptedException {
 LOGGER.info("Create asyncTask");
-final Thread thread = factory.newThread(longRunnableTask(value, 100, 
null));
+final CountDownLatch countDownLatch = new CountDownLatch(1);
+final LongTask longTask = new LongTask(value, 100, countDownLatch);
+
+final Thread thread = factory.newThread(longTask);
 thread.setName("pretty asyncTask");
 thread.start();
-return thread;
+
+countDownLatch.await(200, TimeUnit.MILLISECONDS);
+
+return longTask.getResult();
 }
 
 /**
@@ -53,37 +58,45 @@ public class ThreadFactoryService {
  * @return The thread we created
  * @throws InterruptedException
  */
-public Thread asyncHangingTask(final int value) throws 
InterruptedException {
-LOGGER.info("Create asyncTask");
-final Thread thread = factory.newThread(longRunnableTask(value, 
100, null));
-thread.setName("pretty asyncTask");
+public int asyncHangingTask(final int value) throws InterruptedException {
+LOGGER.info("Create asyncHangingTask");
+final CountDownLatch countDownLatch = new CountDownLatch(1);
+final LongTask longTask = new LongTask(value, 100, countDownLatch);
+
+final Thread thread = factory.newThread(longTask);
+thread.setName("pretty asyncHangingTask");
 thread.start();
-TimeUnit.MILLISECONDS.sleep(50);
+
+countDownLatch.await(200, TimeUnit.MILLISECONDS);
+
 if (thread.isAlive()) {
 // This will cause any wait in the thread to resume.
 // This will call the InterruptedException block in the 
longRunnableTask method.
 thread.interrupt();
 }
-return thread;
+return longTask.getResult();
 }
 
-/**
- * TODO create a proper runnable class were we store the result and we 
check periodically if we need to stop the execution.
- * Will simulate a long running operation
- *
- * @param value  The value to compute
- * @param taskDurationMs the time length of the operation
- * @param errorMessage   If not null an exception with be thrown with this 
message
- * @return a {@link Runnable}
- */
-private Runnable longRunnableTask(final int value,
-  final int taskDurationMs,
-  final String errorMessage) {
-return () -> {
-if (nonNull(errorMessage)) {
-LOGGER.severe("Exception will be thrown");
-throw new RuntimeException(errorMessage);
-}
+public static class LongTask implements Runnable {
+private final int value;
+private final long taskDurationMs;
+private final 

[02/13] tomee git commit: Merge remote-tracking branch 'upstream/master' into executor-example

2018-12-26 Thread jlmonteiro
Merge remote-tracking branch 'upstream/master' into executor-example


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2c6ce4ac
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2c6ce4ac
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2c6ce4ac

Branch: refs/heads/master
Commit: 2c6ce4ac6c71af538b1f9107e7584e4dc4aa42e2
Parents: 92b291b d5d191d
Author: brunobat 
Authored: Mon Dec 17 19:11:22 2018 +
Committer: brunobat 
Committed: Mon Dec 17 19:11:22 2018 +

--
 .gitignore  |2 +
 .../arquillian/common/TomEEContainer.java   |4 +
 .../arquillian/remote/RemoteTomEEContainer.java |3 +
 .../arquillian-tomee-webprofile-tests/pom.xml   |2 +-
 .../arquillian/tests/bmp/local/BigFinder.java   |   22 +
 .../tests/bmp/local/BigFinderBean.java  |   57 +
 .../tests/bmp/local/BigFinderHome.java  |   25 +
 .../arquillian/tests/bmp/local/BigFinderPK.java |   24 +
 .../tests/bmp/local/BmpLocalEntityTest.java |   62 +
 .../tests/bmp/local/FinderServlet.java  |   33 +
 .../arquillian/tests/bmp/local/FinderTest.java  |   25 +
 .../tests/bmp/local/FinderTestBean.java |   86 +
 .../tests/bmp/local/FinderTestHome.java |   25 +
 .../arquillian/tests/bmp/local/IntegerPK.java   |   99 +
 .../tests/bmp/local/LittleFinder.java   |   22 +
 .../tests/bmp/local/LittleFinderBean.java   |   55 +
 .../tests/bmp/local/LittleFinderHome.java   |   25 +
 .../tests/bmp/local/LittleFinderPK.java |   25 +
 .../arquillian/tests/bmp/local/StringPK.java|   71 +
 .../arquillian/tests/bmp/remote/BigFinder.java  |   22 +
 .../tests/bmp/remote/BigFinderBean.java |   57 +
 .../tests/bmp/remote/BigFinderHome.java |   25 +
 .../tests/bmp/remote/BigFinderPK.java   |   24 +
 .../tests/bmp/remote/BmpRemoteEntityTest.java   |   62 +
 .../tests/bmp/remote/FinderServlet.java |   33 +
 .../arquillian/tests/bmp/remote/FinderTest.java |   24 +
 .../tests/bmp/remote/FinderTestBean.java|   82 +
 .../tests/bmp/remote/FinderTestHome.java|   25 +
 .../arquillian/tests/bmp/remote/IntegerPK.java  |   99 +
 .../tests/bmp/remote/LittleFinder.java  |   22 +
 .../tests/bmp/remote/LittleFinderBean.java  |   55 +
 .../tests/bmp/remote/LittleFinderHome.java  |   25 +
 .../tests/bmp/remote/LittleFinderPK.java|   25 +
 .../arquillian/tests/bmp/remote/StringPK.java   |   71 +
 .../arquillian/tests/cmp/CmpServlet.java|   16 +
 .../openejb/arquillian/tests/cmp/MyCmpBean.java |   16 +
 .../arquillian/tests/cmp/MyLocalHome.java   |   16 +
 .../arquillian/tests/cmp/MyLocalObject.java |   16 +
 .../arquillian/tests/cmp/MyRemoteHome.java  |   16 +
 .../arquillian/tests/cmp/MyRemoteObject.java|   16 +
 .../arquillian/tests/cmp/sample/ActorBean.java  |   70 +
 .../tests/cmp/sample/ActorDetails.java  |   39 +
 .../tests/cmp/sample/CustomOrmXmlTest.java  |   76 +
 .../arquillian/tests/cmp/sample/LocalActor.java |   29 +
 .../tests/cmp/sample/LocalActorHome.java|   31 +
 .../arquillian/tests/cmp/sample/LocalMovie.java |   39 +
 .../tests/cmp/sample/LocalMovieHome.java|   33 +
 .../arquillian/tests/cmp/sample/MovieBean.java  |  118 +
 .../tests/cmp/sample/MovieDetails.java  |   45 +
 .../tests/cmp/sample/MoviesBusiness.java|   25 +
 .../tests/cmp/sample/MoviesBusinessBean.java|   80 +
 .../tests/cmp/sample/MoviesBusinessHome.java|   27 +
 .../tests/cmp/sample/MoviesServlet.java |   91 +
 .../securityejb/SecurityEJBPropagationTest.java |4 +-
 .../src/test/resources/arquillian.xml   |2 +
 .../arquillian/tests/bmp/local/ejb-jar.xml  |   65 +
 .../openejb/arquillian/tests/bmp/local/web.xml  |   42 +
 .../arquillian/tests/bmp/remote/ejb-jar.xml |   65 +
 .../openejb/arquillian/tests/bmp/remote/web.xml |   42 +
 .../arquillian/tests/cmp/sample/custom-orm.xml  |   54 +
 .../arquillian/tests/cmp/sample/ejb-jar.xml |  164 +
 .../arquillian/tests/cmp/sample/openejb-jar.xml |   34 +
 .../arquillian/tests/cmp/sample/persistence.xml |   32 +
 .../openejb/arquillian/tests/cmp/sample/web.xml |   48 +
 .../src/test/resources/test/context.xml |   20 +
 .../java/org/apache/openejb/BeanContext.java|   11 +-
 .../org/apache/openejb/ClassLoaderUtil.java |3 +-
 .../org/apache/openejb/OpenEjbContainer.java|3 +-
 .../openejb/assembler/classic/Assembler.java|   35 +-
 .../openejb/assembler/classic/EjbResolver.java  |2 +-
 .../classic/EnterpriseBeanBuilder.java  |3 +-
 .../classic/InterceptorBindingBuilder.java  |4 +-
 .../openejb/assembler/classic/JndiBuilder.java  |2 +-
 .../assembler/classic/JndiEncBuilder.java   |2 +-
 .../assembler/classic/MethodInfoUtil.java   |3 +-
 

[06/13] tomee git commit: TOMEE-2301 - update test

2018-12-26 Thread jlmonteiro
TOMEE-2301 - update test

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/5a6818be
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/5a6818be
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/5a6818be

Branch: refs/heads/master
Commit: 5a6818be981f4ee719d252bc953a2700fb1a3581
Parents: 46cb50f
Author: brunobat 
Authored: Tue Dec 18 23:35:04 2018 +
Committer: brunobat 
Committed: Tue Dec 18 23:35:04 2018 +

--
 .../executor/ThreadFactoryServiceTest.java  | 23 +---
 1 file changed, 5 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/5a6818be/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
--
diff --git 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
index e2e15c6..9a4c205 100644
--- 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
+++ 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
@@ -9,11 +9,9 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import javax.inject.Inject;
-import java.util.concurrent.TimeUnit;
 import java.util.logging.Logger;
 
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
 
 
 /**
@@ -35,8 +33,6 @@ import static org.junit.Assert.assertTrue;
 @RunWith(Arquillian.class)
 public class ThreadFactoryServiceTest {
 
-private static final Logger LOGGER = 
Logger.getLogger(ThreadFactoryServiceTest.class.getSimpleName());
-
 @Inject
 private ThreadFactoryService factoryService;
 
@@ -49,22 +45,13 @@ public class ThreadFactoryServiceTest {
 
 @Test
 public void asyncTask() throws InterruptedException {
-
-final Thread thread = factoryService.asyncTask(1);
-assertTrue(thread.isAlive());
-
-LOGGER.info("Do something else");
-TimeUnit.MILLISECONDS.sleep(200);
-
-assertFalse(thread.isAlive());
+//task was completed
+assertEquals(2, factoryService.asyncTask(1));
 }
 
 @Test
 public void asyncHangingTask() throws InterruptedException {
-
-final Thread thread = factoryService.asyncHangingTask(1);
-LOGGER.info("Do something else");
-TimeUnit.MILLISECONDS.sleep(200);
-assertFalse(thread.isAlive());
+// task was interrupted and operation was not completed.
+assertEquals(1, factoryService.asyncHangingTask(1));
 }
 }
\ No newline at end of file



[04/13] tomee git commit: Merge remote-tracking branch 'upstream/master' into executor-example

2018-12-26 Thread jlmonteiro
Merge remote-tracking branch 'upstream/master' into executor-example


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/69c9f671
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/69c9f671
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/69c9f671

Branch: refs/heads/master
Commit: 69c9f6712833442449db37e7671710c9c5cdf68c
Parents: ab1de6c ce2998f
Author: brunobat 
Authored: Tue Dec 18 19:27:31 2018 +
Committer: brunobat 
Committed: Tue Dec 18 19:27:31 2018 +

--
 .../resource/AutoConnectionTrackerTest.java |  46 ++-
 docs/app-clients-and-jndi.adoc  |   4 +-
 docs/application-composer/getting-started.adoc  |   2 +-
 ...application-discovery-via-the-classpath.adoc |   2 +-
 docs/application-resources.adoc |   4 +-
 docs/basics---getting-things.adoc   |   2 +-
 docs/basics---transactions.adoc |   2 +-
 docs/configuring-datasources.adoc   |   4 +-
 docs/constructor-injection.adoc |   2 +-
 docs/datasource-config.adoc |   2 +-
 docs/developer/json/index.adoc  |   4 +-
 .../testing/applicationcomposer/index.adoc  |  26 +-
 docs/developer/testing/arquillian/index.adoc|   2 +-
 docs/documentation.adoc |   2 +-
 docs/documentation.old.adoc |   2 +-
 docs/ejb-local-ref.adoc |   2 +-
 docs/ejb-ref.adoc   |   2 +-
 docs/ejb-refs.adoc  |   4 +-
 docs/embedded-and-remotable.adoc|  10 +-
 docs/generating-ejb-3-annotations.adoc  |   4 +-
 docs/hello-world.adoc   |   2 +-
 docs/jndi-names.adoc|   4 +-
 docs/jpa-concepts.adoc  |   4 +-
 docs/local-client-injection.adoc|  20 +-
 docs/lookup-of-other-ejbs-example.adoc  |   8 +-
 docs/new-in-openejb-3.0.adoc|   6 +-
 docs/persistence-context.adoc   |   2 +-
 docs/persistence-unit-ref.adoc  |   6 +-
 docs/quickstart.adoc|   2 +-
 docs/resource-injection.adoc|   6 +-
 docs/resource-ref-for-datasource.adoc   |   2 +-
 docs/security-annotations.adoc  |   8 +-
 docs/singleton-beans.adoc   |  44 +--
 docs/spring-and-openejb-3.0.adoc|   4 +-
 docs/spring-ejb-and-jpa.adoc|  10 +-
 docs/tomcat-object-factory.adoc |   2 +-
 docs/tomee-and-security.adoc|   2 +-
 docs/transaction-annotations.adoc   |   6 +-
 examples/mp-rest-client/README.md   | 138 +
 examples/mp-rest-client/pom.xml | 121 
 .../org/superbiz/rest/ApplicationConfig.java|  26 ++
 .../src/main/java/org/superbiz/rest/Book.java   |  50 
 .../main/java/org/superbiz/rest/BookBean.java   |  60 
 .../java/org/superbiz/rest/BookResource.java|  71 +
 .../org/superbiz/rest/BookResourceClient.java   |  57 
 .../org/superbiz/rest/BookResourceTest.java |  77 +
 .../src/test/resources/META-INF/beans.xml   |   1 +
 .../META-INF/microprofile-config.properties |   1 +
 .../src/test/resources/arquillian.xml   |  38 +++
 examples/pom.xml|   4 +-
 .../maven/plugin/AbstractAddressMojo.java   |  21 ++
 .../maven/plugin/AbstractCommandMojo.java   |   9 +
 .../maven/plugin/AbstractDeployMojo.java|   6 +
 .../maven/plugin/AbstractSynchronizable.java|  63 +
 .../openejb/maven/plugin/AbstractTomEEMojo.java | 281 +++
 .../openejb/maven/plugin/BuildTomEEMojo.java|  20 ++
 .../maven/plugin/ConfigTestTomEEMojo.java   |   2 +
 .../openejb/maven/plugin/DebugTomEEMojo.java|   1 +
 .../apache/openejb/maven/plugin/DeployMojo.java |  11 +
 .../apache/openejb/maven/plugin/ExecMojo.java   |  11 +
 .../openejb/maven/plugin/ListEjbMojo.java   |  13 +
 .../openejb/maven/plugin/RunTomEEMojo.java  |   2 +
 .../openejb/maven/plugin/StartTomEEMojo.java|   1 +
 .../openejb/maven/plugin/StopTomEEMojo.java |   1 +
 .../org/apache/openejb/maven/plugin/Synch.java  |  24 ++
 .../openejb/maven/plugin/Synchronization.java   |  43 +++
 .../openejb/maven/plugin/TomEEException.java|  14 +
 .../openejb/maven/plugin/UnDeployMojo.java  |   1 +
 .../maven/plugin/UpdatableTomEEMojo.java|  41 +++
 .../apache/openejb/maven/plugin/cli/Args.java   |   9 +
 .../maven/plugin/customizer/monkey/Monkey.java  |  12 +-
 .../monkey/classloader/ClassLoaderFactory.java  |  15 +
 .../monkey/file/PatchFolderFinder.java  |  10 +
 .../customizer/monkey/index/FileIndexer.java|  30 ++
 .../plugin/customizer/monkey/index/Item.java

[01/13] tomee git commit: TOMEE-2301 - Add ThreadFactory example

2018-12-26 Thread jlmonteiro
Repository: tomee
Updated Branches:
  refs/heads/master 1ff8ad889 -> 113644b66


TOMEE-2301 - Add ThreadFactory example

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/92b291b1
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/92b291b1
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/92b291b1

Branch: refs/heads/master
Commit: 92b291b1d652734fbd87c75d76eeae8d95d0617c
Parents: 2aaca11
Author: brunobat 
Authored: Mon Dec 17 11:30:16 2018 +
Committer: brunobat 
Committed: Mon Dec 17 11:30:16 2018 +

--
 .../superbiz/executor/ThreadFactoryService.java  | 17 -
 .../executor/ThreadFactoryServiceTest.java   | 19 ++-
 2 files changed, 34 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/92b291b1/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index 17086e5..6847c54 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -32,11 +32,26 @@ public class ThreadFactoryService {
 @Resource
 private ManagedThreadFactory factory;
 
-public void asyncTask(final int value) {
+public Thread asyncTask(final int value) {
 LOGGER.info("Create asyncTask");
 final Thread thread = factory.newThread(longRunnableTask(value, 100, 
null));
 thread.setName("pretty asyncTask");
 thread.start();
+return thread;
+}
+
+public Thread asyncHangingTask(final int value) throws 
InterruptedException {
+LOGGER.info("Create asyncTask");
+final Thread thread = factory.newThread(longRunnableTask(value, 
100, null));
+thread.setName("pretty asyncTask");
+thread.start();
+TimeUnit.MILLISECONDS.sleep(50);
+if (thread.isAlive()) {
+// This will cause any wait in the thread to resume.
+// This will call the InterruptedException block in the 
longRunnableTask method.
+thread.interrupt();
+}
+return thread;
 }
 
 /**

http://git-wip-us.apache.org/repos/asf/tomee/blob/92b291b1/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
--
diff --git 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
index 8518c28..e2e15c6 100644
--- 
a/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
+++ 
b/examples/concurrency-utils/src/test/java/org/superbiz/executor/ThreadFactoryServiceTest.java
@@ -12,6 +12,10 @@ import javax.inject.Inject;
 import java.util.concurrent.TimeUnit;
 import java.util.logging.Logger;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+
 /**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -46,8 +50,21 @@ public class ThreadFactoryServiceTest {
 @Test
 public void asyncTask() throws InterruptedException {
 
-factoryService.asyncTask(1);
+final Thread thread = factoryService.asyncTask(1);
+assertTrue(thread.isAlive());
+
+LOGGER.info("Do something else");
+TimeUnit.MILLISECONDS.sleep(200);
+
+assertFalse(thread.isAlive());
+}
+
+@Test
+public void asyncHangingTask() throws InterruptedException {
+
+final Thread thread = factoryService.asyncHangingTask(1);
 LOGGER.info("Do something else");
 TimeUnit.MILLISECONDS.sleep(200);
+assertFalse(thread.isAlive());
 }
 }
\ No newline at end of file



[03/13] tomee git commit: TOMEE-2301 - Add javadoc and a TODO

2018-12-26 Thread jlmonteiro
TOMEE-2301 - Add javadoc and a TODO

Signed-off-by: brunobat 


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/ab1de6cb
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/ab1de6cb
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/ab1de6cb

Branch: refs/heads/master
Commit: ab1de6cb4b3f4d2c51bb24f3340910a83e5fffbe
Parents: 2c6ce4a
Author: brunobat 
Authored: Mon Dec 17 19:23:08 2018 +
Committer: brunobat 
Committed: Mon Dec 17 19:23:08 2018 +

--
 .../org/superbiz/executor/ThreadFactoryService.java   | 14 ++
 1 file changed, 14 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/ab1de6cb/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
--
diff --git 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
index 6847c54..43e93d9 100644
--- 
a/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
+++ 
b/examples/concurrency-utils/src/main/java/org/superbiz/executor/ThreadFactoryService.java
@@ -32,6 +32,12 @@ public class ThreadFactoryService {
 @Resource
 private ManagedThreadFactory factory;
 
+/**
+ * Happy path.
+ *
+ * @param value to compute
+ * @return The thread we created
+ */
 public Thread asyncTask(final int value) {
 LOGGER.info("Create asyncTask");
 final Thread thread = factory.newThread(longRunnableTask(value, 100, 
null));
@@ -40,6 +46,13 @@ public class ThreadFactoryService {
 return thread;
 }
 
+/**
+ * Example where we have to stop a thread.
+ *
+ * @param value
+ * @return The thread we created
+ * @throws InterruptedException
+ */
 public Thread asyncHangingTask(final int value) throws 
InterruptedException {
 LOGGER.info("Create asyncTask");
 final Thread thread = factory.newThread(longRunnableTask(value, 
100, null));
@@ -55,6 +68,7 @@ public class ThreadFactoryService {
 }
 
 /**
+ * TODO create a proper runnable class were we store the result and we 
check periodically if we need to stop the execution.
  * Will simulate a long running operation
  *
  * @param value  The value to compute



[jira] [Commented] (TOMEE-2301) Concurrency utilities example

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16729021#comment-16729021
 ] 

ASF GitHub Bot commented on TOMEE-2301:
---

Github user brunobat commented on the issue:

https://github.com/apache/tomee/pull/289
  
Hey, This should be ok for reviewing now.


> Concurrency utilities example
> -
>
> Key: TOMEE-2301
> URL: https://issues.apache.org/jira/browse/TOMEE-2301
> Project: TomEE
>  Issue Type: Improvement
>  Components: Examples and Documentation
>Affects Versions: 8.0.0-M2
>Reporter: Bruno Baptista
>Priority: Major
>  Labels: concurrency, examples, pull-request-available
>
> This is an example to demontrate the Concurrency Utilities introduced in JEE7:
> [https://docs.oracle.com/javaee/7/tutorial/concurrency-utilities.htm#top]
> It will use CompletableFutures.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2267) Check the signatures of the Bean Validation API at build time

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16728992#comment-16728992
 ] 

ASF GitHub Bot commented on TOMEE-2267:
---

Github user gsmet commented on the issue:

https://github.com/apache/tomee/pull/180
  
@brunobat done!


> Check the signatures of the Bean Validation API at build time
> -
>
> Key: TOMEE-2267
> URL: https://issues.apache.org/jira/browse/TOMEE-2267
> Project: TomEE
>  Issue Type: Task
>  Components: TomEE Build
>Reporter: Guillaume Smet
>Priority: Major
>  Labels: pull-request-available
>
> When certifying Apache BVal/TomEE, we need to be certain that the included 
> APIs for Bean Validation are correct.
> This is especially important since you do not use the official jars.
> PR to come.
> (Work done as part of the Bean Validation certification process)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (TOMEE-2267) Check the signatures of the Bean Validation API at build time

2018-12-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/TOMEE-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16728985#comment-16728985
 ] 

ASF GitHub Bot commented on TOMEE-2267:
---

Github user brunobat commented on the issue:

https://github.com/apache/tomee/pull/180
  
@gsmet can you please rebase?


> Check the signatures of the Bean Validation API at build time
> -
>
> Key: TOMEE-2267
> URL: https://issues.apache.org/jira/browse/TOMEE-2267
> Project: TomEE
>  Issue Type: Task
>  Components: TomEE Build
>Reporter: Guillaume Smet
>Priority: Major
>  Labels: pull-request-available
>
> When certifying Apache BVal/TomEE, we need to be certain that the included 
> APIs for Bean Validation are correct.
> This is especially important since you do not use the official jars.
> PR to come.
> (Work done as part of the Bean Validation certification process)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (TOMEE-2267) Check the signatures of the Bean Validation API at build time

2018-12-26 Thread ASF GitHub Bot (JIRA)


 [ 
https://issues.apache.org/jira/browse/TOMEE-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated TOMEE-2267:
--
Labels: pull-request-available  (was: )

> Check the signatures of the Bean Validation API at build time
> -
>
> Key: TOMEE-2267
> URL: https://issues.apache.org/jira/browse/TOMEE-2267
> Project: TomEE
>  Issue Type: Task
>  Components: TomEE Build
>Reporter: Guillaume Smet
>Priority: Major
>  Labels: pull-request-available
>
> When certifying Apache BVal/TomEE, we need to be certain that the included 
> APIs for Bean Validation are correct.
> This is especially important since you do not use the official jars.
> PR to come.
> (Work done as part of the Bean Validation certification process)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)