[jira] [Created] (TOMEE-2861) Translate to Portuguese: examples/webservice-holder
Evaldo Junior created TOMEE-2861: Summary: Translate to Portuguese: examples/webservice-holder Key: TOMEE-2861 URL: https://issues.apache.org/jira/browse/TOMEE-2861 Project: TomEE Issue Type: Sub-task Components: Examples and Documentation Affects Versions: 8.0.4 Reporter: Evaldo Junior Translate into Portuguese the README file using a suffix `_pt` to allow the Tomee Website to pick up and configure this version and corresponding language -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Resolved] (TOMEE-2827) Translate to Portuguese: examples/mbean-auto-registration
[ https://issues.apache.org/jira/browse/TOMEE-2827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dias resolved TOMEE-2827. Resolution: Fixed > Translate to Portuguese: examples/mbean-auto-registration > - > > Key: TOMEE-2827 > URL: https://issues.apache.org/jira/browse/TOMEE-2827 > Project: TomEE > Issue Type: Sub-task >Reporter: Daniel Dias >Assignee: Daniel Dias >Priority: Trivial > > Translate into Portuguese the README file using a suffix `_pt` to allow the > Tomee Website to pick up and configure this version and corresponding language -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch master updated: TOMEE-2827
This is an automated email from the ASF dual-hosted git repository. dds pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/master by this push: new e3ee871 TOMEE-2827 new 2b0c515 Merge pull request #650 from Daniel-Dos/TOMEE-2827 e3ee871 is described below commit e3ee871448e08d78532d0ee34cc30d04ea84bacb Author: Daniel Dias AuthorDate: Thu May 21 16:49:18 2020 -0300 TOMEE-2827 --- examples/mbean-auto-registration/README_pt.adoc | 155 1 file changed, 155 insertions(+) diff --git a/examples/mbean-auto-registration/README_pt.adoc b/examples/mbean-auto-registration/README_pt.adoc new file mode 100644 index 000..c1c48a2 --- /dev/null +++ b/examples/mbean-auto-registration/README_pt.adoc @@ -0,0 +1,155 @@ +:index-group: Other Features +:jbake-type: page +:jbake-status: status=published += Registro automático do Mbean + +Este exemplo mostra como criar e registrar automaticamente Mbeans usando features do TomEE. + +== Dependências + +Para poder usá-lo, você precisa importar a API do mbean (anotações): + + + + org.apache.openejb + mbean-annotation-api + 4.5.0 + provided + + + +== O MBean + +O mbean implementa um jogo simples em que o objetivo é adivinhar um número. + +Também permite que o usuário altere o valor. + + +package org.superbiz.mbean; + +import javax.management.Description; +import javax.management.MBean; +import javax.management.ManagedAttribute; +import javax.management.ManagedOperation; + +@MBean +@Description("play with me to guess a number") +public class GuessHowManyMBean { +private int value = 0; + +@ManagedAttribute +@Description("you are cheating!") +public int getValue() { +return value; +} + +@ManagedAttribute +public void setValue(int value) { +this.value = value; +} + +@ManagedOperation +public String tryValue(int userValue) { +if (userValue == value) { +return "winner"; +} +return "not the correct value, please have another try"; +} +} + + +Para registrar um MBean, basta especificar uma propriedade em +system.properties ou nas propriedades do contexto inicial. + + +Properties properties = new Properties(); +properties.setProperty("openejb.user.mbeans.list", GuessHowManyMBean.class.getName()); +EJBContainer.createEJBContainer(properties); + + +== Acessando o MBean + +Em seguida, basta obter o servidor da plataforma e você pode jogar com parâmetros e operações: + + +package org.superbiz.mbean; + +import org.junit.Test; + +import javax.ejb.embeddable.EJBContainer; +import javax.management.Attribute; +import javax.management.MBeanInfo; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import java.lang.management.ManagementFactory; +import java.util.Properties; + +import static junit.framework.Assert.assertEquals; + +public class GuessHowManyMBeanTest { +private static final String OBJECT_NAME = "openejb.user.mbeans:group=org.superbiz.mbean,application=mbean-auto-registration,name=GuessHowManyMBean"; + +@Test +public void play() throws Exception { +Properties properties = new Properties(); +properties.setProperty("openejb.user.mbeans.list", GuessHowManyMBean.class.getName()); +EJBContainer container = EJBContainer.createEJBContainer(properties); + +MBeanServer server = ManagementFactory.getPlatformMBeanServer(); +ObjectName objectName = new ObjectName(OBJECT_NAME); +MBeanInfo infos = server.getMBeanInfo(objectName); +assertEquals(0, server.getAttribute(objectName, "value")); +server.setAttribute(objectName, new Attribute("value", 3)); +assertEquals(3, server.getAttribute(objectName, "value")); +assertEquals("winner", server.invoke(objectName, "tryValue", new Object[]{3}, null)); +assertEquals("not the correct value, please have another try", server.invoke(objectName, "tryValue", new Object[]{2}, null)); + +container.close(); +} +} + + +=== Nota + +Se o OpenEJB não encontrar nenhum módulo, ele não poderá ser iniciado. Então, para forçá-lo a iniciar, mesmo que o exemplo tenha apenas o mbean como classe java, adicionamos um arquivo `beans.xml` para transformar nosso projeto em um módulo Java EE. + +== Executando + + +--- + T E S T S +--- +Running org.superbiz.mbean.GuessHowManyMBeanTest +Apache OpenEJB 4.0.0-beta-1build: 20111002-04:06 +http://tomee.apache.org/ +INFO - openejb.home = /Users/dblevins/examples/mbean-auto-registration +INFO - openejb.base = /Users/dblevins/examples/mbean-auto-registration +INFO - Using 'javax.ejb.embeddable.EJBContainer=true' +INFO - Configuring Service(id=Default Security Service, type=SecurityService, provider-id=Default Security Service)
[jira] [Resolved] (TOMEE-2857) Translate to Portuguese: examples/webservice-ws-with-resources-config
[ https://issues.apache.org/jira/browse/TOMEE-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dias resolved TOMEE-2857. Resolution: Fixed merged . > Translate to Portuguese: examples/webservice-ws-with-resources-config > - > > Key: TOMEE-2857 > URL: https://issues.apache.org/jira/browse/TOMEE-2857 > Project: TomEE > Issue Type: Sub-task > Components: Examples and Documentation >Affects Versions: 8.0.4 >Reporter: Evaldo Junior >Assignee: Evaldo Junior >Priority: Major > > Translate into Portuguese the README file using a suffix `_pt` to allow the > Tomee Website to pick up and configure this version and corresponding language -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch master updated (8004754 -> 9773abf)
This is an automated email from the ASF dual-hosted git repository. dds pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git. from 8004754 Merge pull request #667 from gacsnic/TOMEE-2858 new ffe6735 Portuguese translation README.adoc file examples/webservice-ws-with-resources-config new c484d72 Portuguese translation README.adoc file examples/webservice-ws-with-resources-config new 54fac01 Portuguese translation README.adoc file examples/webservice-ws-with-resources-config new 9773abf Merge pull request #668 from jrxxjr/TOMEE-2857 The 13342 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../README_pt.adoc | 86 ++ 1 file changed, 86 insertions(+) create mode 100644 examples/webservice-ws-with-resources-config/README_pt.adoc
[jira] [Resolved] (TOMEE-2858) Translate to Spanish: example/simple-singlento
[ https://issues.apache.org/jira/browse/TOMEE-2858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dias resolved TOMEE-2858. Resolution: Fixed merged. thanks . > Translate to Spanish: example/simple-singlento > -- > > Key: TOMEE-2858 > URL: https://issues.apache.org/jira/browse/TOMEE-2858 > Project: TomEE > Issue Type: Sub-task >Reporter: Gustavo Castro >Assignee: Gustavo Castro >Priority: Minor > > Translate into Spanish the README file using a suffix `_es` > (simple-singleton/README.adoc into file simple-singleton/README_es.adoc) to > allow the Tomee Website to pick up and configure this version and > corresponding language -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch master updated: Translate to Spanish: example/simple-singlento
This is an automated email from the ASF dual-hosted git repository. dds pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/master by this push: new 42b4916 Translate to Spanish: example/simple-singlento new 8004754 Merge pull request #667 from gacsnic/TOMEE-2858 42b4916 is described below commit 42b4916b299be3e04ce898ad8062d2588b48650c Author: GACS AuthorDate: Sat Jul 4 23:02:17 2020 -0600 Translate to Spanish: example/simple-singlento --- examples/simple-singleton/README_es.adoc | 364 +++ 1 file changed, 364 insertions(+) diff --git a/examples/simple-singleton/README_es.adoc b/examples/simple-singleton/README_es.adoc new file mode 100644 index 000..fc13a8a --- /dev/null +++ b/examples/simple-singleton/README_es.adoc @@ -0,0 +1,364 @@ +:index-group: Session Beans +:jbake-type: page +:jbake-status: status=published += Simple Singleton + +Como su nombre lo indica, un `javax.ejb.Singleton`, es un bean de sesión con la garantía de que existe como máximo una instancia en la aplicación. + +Lo que falta por completo en EJB 3.0 y versiones anteriores, es la capacidad de tener un EJB que se notifique cuando la aplicación se inicia y cuando se detiene. Por lo tanto, puede hacer todo tipo de cosas que anteriormente solo podía hacer con un servlet de carga al inicio. También le brinda un lugar para almacenar datos que pertenecen a toda la aplicación y a todos los usuarios que la utilizan, sin la necesidad de un estático. Además, los beans Singleton pueden ser invocados por múlti [...] +al mismo tiempo similar a un servlet. + +Vea link:../../singleton-beans.html[Singleton Beans] para obtener una página completa de la descripción de la API javax.ejb.Singleton. + +#El codigo + +== Concurrencia Bean-Managed de PropertyRegistry +Aquí vemos un bean que usa la opción de concurrencia Bean-Managed, así como la anotación @Startup que hace que el bean sea confirmado por el contenedor cuando se inicia la aplicación. +Los beans Singleton con @ConcurrencyManagement(BEAN) son responsables de su propia seguridad de subprocesos. El bean que se muestra es un simple ``registry'' de propiedad y proporciona un lugar donde todos los beans de aplicación podrían establecer y recuperar opciones. + + +package org.superbiz.registry; + +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.ejb.ConcurrencyManagement; +import javax.ejb.Singleton; +import javax.ejb.Startup; +import java.util.Properties; + +import static javax.ejb.ConcurrencyManagementType.BEAN; + +@Singleton +@Startup +@ConcurrencyManagement(BEAN) +public class PropertyRegistry { + + +// Tenga en cuenta que el objeto java.util.Properties es una +// colección segura para subprocesos que utiliza sincronización. Si no fuera así, +// tendría que usar alguna forma de sincronización para asegurarse +// de que PropertyRegistryBean sea seguro para subprocesos. +private final Properties properties = new Properties(); + +// La anotación @Startup garantiza que se +// llame a este método cuando se inicia la aplicación. +@PostConstruct +public void applicationStartup() { +properties.putAll(System.getProperties()); +} + +@PreDestroy +public void applicationShutdown() { +properties.clear(); +} + +public String getProperty(final String key) { +return properties.getProperty(key); +} + +public String setProperty(final String key, final String value) { +return (String) properties.setProperty(key, value); +} + +public String removeProperty(final String key) { +return (String) properties.remove(key); +} +} + + +== ComponentRegistry Container-Managed Concurrency + +Aquí vemos un bean que usa la opción de concurrencia 'Container-Managed', el valor predeterminado. Con `@ConcurrencyManagement(CONTAINER)` el contenedor controla si se debe permitir el acceso multiproceso al bean +(`@Lock(READ)`) o si se debe forzar el acceso de un solo subproceso +(`@Lock(WRITE)`). + + +package org.superbiz.registry; + +import javax.ejb.Lock; +import javax.ejb.Singleton; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import static javax.ejb.LockType.READ; +import static javax.ejb.LockType.WRITE; + +@Singleton +@Lock(READ) +public class ComponentRegistry { + +private final Map components = new HashMap(); + +public T getComponent(final Class type) { +return (T) components.get(type); +} + +public Collection getComponents() { +return new ArrayList(components.values()); +} + +@Lock(WRITE) +public T setComponent(final Class type, final T value) { +return (T) components.put(type, value); +} + +@Lock(WRITE) +public T removeComponent(final Class type) { +return (T) components.remove(type);
[jira] [Resolved] (TOMEE-2860) References to svn in Securing A WebService page
[ https://issues.apache.org/jira/browse/TOMEE-2860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dias resolved TOMEE-2860. Resolution: Fixed merged. thanks : ) > References to svn in Securing A WebService page > --- > > Key: TOMEE-2860 > URL: https://issues.apache.org/jira/browse/TOMEE-2860 > Project: TomEE > Issue Type: Documentation > Components: Examples and Documentation >Reporter: David Salter >Assignee: David Salter >Priority: Major > > Within the Securing A WebService page (docs/securing-a-web-services.adoc) it > references tomme svn rather than the latest tomee on github. > The formatting of a couple of headers is also incorrect on the page. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Assigned] (TOMEE-2860) References to svn in Securing A WebService page
[ https://issues.apache.org/jira/browse/TOMEE-2860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dias reassigned TOMEE-2860: -- Assignee: David Salter > References to svn in Securing A WebService page > --- > > Key: TOMEE-2860 > URL: https://issues.apache.org/jira/browse/TOMEE-2860 > Project: TomEE > Issue Type: Documentation > Components: Examples and Documentation >Reporter: David Salter >Assignee: David Salter >Priority: Major > > Within the Securing A WebService page (docs/securing-a-web-services.adoc) it > references tomme svn rather than the latest tomee on github. > The formatting of a couple of headers is also incorrect on the page. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch master updated: Removed reference to svn
This is an automated email from the ASF dual-hosted git repository. dds pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/master by this push: new 1a959ef Removed reference to svn new f00bd55 Merge pull request #669 from davidsalter/TOMEE-2860 1a959ef is described below commit 1a959ef2329079519b9c0d67c8ff8e009a4eeace Author: David Salter AuthorDate: Mon Jul 6 21:58:12 2020 +0100 Removed reference to svn --- docs/securing-a-web-service.adoc | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/securing-a-web-service.adoc b/docs/securing-a-web-service.adoc index 34829d1..c23825d 100644 --- a/docs/securing-a-web-service.adoc +++ b/docs/securing-a-web-service.adoc @@ -34,7 +34,7 @@ configured JAAS provider. This will honour any EJB security roles you have setup using . See the webservice-security example in the OpenEJB codebase -http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/ +https://github.com/apache/tomee/tree/master/examples _Warning: Currently only BASIC is the only HTTP authentication mechanism available when running OpenEJB standalone or in a unit test, but we hope @@ -79,7 +79,9 @@ you can configure either one or the other or both. You can decide to check client credentials for incoming messages and sign outgoing messages (response). -= Configuration principles The configuration is made in the += Configuration principles + +The configuration is made in the _openejb-jar.xml_. Each endpoint web service can provide a set of properties to customize WS-Security behavior through the element. The content of this element is consistent with the overall structure of @@ -100,8 +102,9 @@ naming conventions. Each property is made of ..= For example : _wss4j.in.action = UsernameToken_ -= Username Token (Password digest) example Excerpt from -_openejb-jar.xml_. += Username Token (Password digest) example + +Excerpt from _openejb-jar.xml_. [source,xml] @@ -126,7 +129,9 @@ _openejb-jar.xml_. -== Request sent by the client. This request contains SOAP headers to +== Request sent by the client. + +This request contains SOAP headers to manage security. You can see _UsernameToken_ tag from the WS-Security specification. @@ -236,5 +241,6 @@ public class CustomPasswordHandler implements CallbackHandler { } -= Examples A full example (webservice-ws-security) is available with -OpenEJB Examples. += Examples + +A full example (webservice-ws-security) is available with https://github.com/apache/tomee/tree/master/examples/webservice-ws-security[OpenEJB Examples].
[jira] [Commented] (TOMEE-2860) References to svn in Securing A WebService page
[ https://issues.apache.org/jira/browse/TOMEE-2860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17152324#comment-17152324 ] David Salter commented on TOMEE-2860: - PR submitted: https://github.com/apache/tomee/pull/669 > References to svn in Securing A WebService page > --- > > Key: TOMEE-2860 > URL: https://issues.apache.org/jira/browse/TOMEE-2860 > Project: TomEE > Issue Type: Documentation > Components: Examples and Documentation >Reporter: David Salter >Priority: Major > > Within the Securing A WebService page (docs/securing-a-web-services.adoc) it > references tomme svn rather than the latest tomee on github. > The formatting of a couple of headers is also incorrect on the page. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Created] (TOMEE-2860) References to svn in Securing A WebService page
David Salter created TOMEE-2860: --- Summary: References to svn in Securing A WebService page Key: TOMEE-2860 URL: https://issues.apache.org/jira/browse/TOMEE-2860 Project: TomEE Issue Type: Documentation Components: Examples and Documentation Reporter: David Salter Within the Securing A WebService page (docs/securing-a-web-services.adoc) it references tomme svn rather than the latest tomee on github. The formatting of a couple of headers is also incorrect on the page. -- This message was sent by Atlassian Jira (v8.3.4#803005)
buildbot failure in on tomee-trunk-ubuntu-jvm8
The Buildbot has detected a new failure on builder tomee-trunk-ubuntu-jvm8 while building tomee. Full details are available at: https://ci.apache.org/builders/tomee-trunk-ubuntu-jvm8/builds/1363 Buildbot URL: https://ci.apache.org/ Buildslave for this Build: bb_qnode7_ubuntu Build Reason: The SingleBranchScheduler scheduler named 'on-tomee-trunk-ubuntu-jvm8-commit' triggered this build Build Source Stamp: [branch master] d48d0a48d5d568e32b333d1c0b18d3d21a1419d5 Blamelist: Jonathan Gallimore BUILD FAILED: failed test Sincerely, -The Buildbot
[jira] [Resolved] (TOMEE-1396) Invalid compiler version in example: projectstage-demo
[ https://issues.apache.org/jira/browse/TOMEE-1396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Salter resolved TOMEE-1396. - Resolution: Resolved The code has already been changed to use Java 1.8 so marking this issue as resolved. > Invalid compiler version in example: projectstage-demo > -- > > Key: TOMEE-1396 > URL: https://issues.apache.org/jira/browse/TOMEE-1396 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.0 >Reporter: Daniel Kasmeroglu >Priority: Minor > Attachments: tomee-1396.patch > > > The _ProjectStageProducer_ class uses _@Override_ on some methods. As the > compiler version had not been set and therefore was the default of 1.5 this > caused a compilation error. The following commit changes the module pom to > use 1.7 instead: > https://kasisoft.com/stash/projects/TOMEE/repos/tomee/commits/a57ab7a7dce858865a3e95047eb9651d3f3fcb14 -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Resolved] (TOMEE-2859) InstanceLimit not set on MDB container correctly
[ https://issues.apache.org/jira/browse/TOMEE-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Gallimore resolved TOMEE-2859. --- Resolution: Fixed > InstanceLimit not set on MDB container correctly > > > Key: TOMEE-2859 > URL: https://issues.apache.org/jira/browse/TOMEE-2859 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.8, 7.1.3, 8.0.3, 9.0.0-M1 >Reporter: Jonathan Gallimore >Assignee: Jonathan Gallimore >Priority: Major > Fix For: 7.0.9, 8.0.4, 7.1.4, 9.0.0-M2 > > > Looks like the introduction of the pooled mode has lead to the InstanceLimit > not being set on the container correctly. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Resolved] (TOMEE-1397) Invalid web.xml in example project
[ https://issues.apache.org/jira/browse/TOMEE-1397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Salter resolved TOMEE-1397. - Resolution: Resolved This issue has already been resolved, so marking as closed. > Invalid web.xml in example project > -- > > Key: TOMEE-1397 > URL: https://issues.apache.org/jira/browse/TOMEE-1397 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.0 >Reporter: Daniel Kasmeroglu >Priority: Minor > Fix For: 7.0.9 > > Attachments: tomee-1397.patch > > > The _web.xml_ specifies the value _Transactional_ for a > _persistence-context-type_ which is incorrect as it should be _Transaction_ . > The corresponding commit on my local git could be found on: > * > https://kasisoft.com/stash/projects/TOMEE/repos/tomee/commits/88315131c9b804fe166c2a909cd749768ab45eef -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (TOMEE-2859) InstanceLimit not set on MDB container correctly
[ https://issues.apache.org/jira/browse/TOMEE-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Gallimore updated TOMEE-2859: -- Fix Version/s: 7.1.4 8.0.4 7.0.9 9.0.0-M2 > InstanceLimit not set on MDB container correctly > > > Key: TOMEE-2859 > URL: https://issues.apache.org/jira/browse/TOMEE-2859 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.8, 7.1.3, 8.0.3, 9.0.0-M1 >Reporter: Jonathan Gallimore >Assignee: Jonathan Gallimore >Priority: Major > Fix For: 7.0.9, 8.0.4, 7.1.4, 9.0.0-M2 > > > Looks like the introduction of the pooled mode has lead to the InstanceLimit > not being set on the container correctly. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Updated] (TOMEE-2859) InstanceLimit not set on MDB container correctly
[ https://issues.apache.org/jira/browse/TOMEE-2859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jonathan Gallimore updated TOMEE-2859: -- Affects Version/s: 7.0.8 7.1.3 8.0.3 9.0.0-M1 > InstanceLimit not set on MDB container correctly > > > Key: TOMEE-2859 > URL: https://issues.apache.org/jira/browse/TOMEE-2859 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.8, 7.1.3, 8.0.3, 9.0.0-M1 >Reporter: Jonathan Gallimore >Assignee: Jonathan Gallimore >Priority: Major > > Looks like the introduction of the pooled mode has lead to the InstanceLimit > not being set on the container correctly. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch master updated: TOMEE-2859 set instancelimit correctly on the container
This is an automated email from the ASF dual-hosted git repository. jgallimore pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/master by this push: new d48d0a4 TOMEE-2859 set instancelimit correctly on the container d48d0a4 is described below commit d48d0a48d5d568e32b333d1c0b18d3d21a1419d5 Author: Jonathan Gallimore AuthorDate: Mon Jul 6 20:37:46 2020 +0100 TOMEE-2859 set instancelimit correctly on the container --- .../org/apache/openejb/core/mdb/MdbContainer.java | 51 +++- .../openejb/core/mdb/MdbContainerFactory.java | 2 +- .../core/mdb/MaxInstanceEndpointHandlerTest.java | 142 + 3 files changed, 188 insertions(+), 7 deletions(-) diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java index bbf1b4c..0f763c1 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java @@ -33,10 +33,7 @@ import org.apache.openejb.core.timer.EjbTimerService; import org.apache.openejb.core.transaction.TransactionPolicy; import org.apache.openejb.loader.Options; import org.apache.openejb.loader.SystemInstance; -import org.apache.openejb.monitoring.LocalMBeanServer; -import org.apache.openejb.monitoring.ManagedMBean; -import org.apache.openejb.monitoring.ObjectNameBuilder; -import org.apache.openejb.monitoring.StatsInterceptor; +import org.apache.openejb.monitoring.*; import org.apache.openejb.resource.XAResourceWrapper; import org.apache.openejb.spi.SecurityService; import org.apache.openejb.util.LogCategory; @@ -182,18 +179,19 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { beanContext.setContainerData(endpointFactory); deployments.put(deploymentId, beanContext); +final MBeanServer server = LocalMBeanServer.get(); + // Create stats interceptor if (StatsInterceptor.isStatsActivated()) { final StatsInterceptor stats = new StatsInterceptor(beanContext.getBeanClass()); beanContext.addFirstSystemInterceptor(stats); -final MBeanServer server = LocalMBeanServer.get(); final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); jmxName.set("J2EEServer", "openejb"); jmxName.set("J2EEApplication", null); jmxName.set("EJBModule", beanContext.getModuleID()); -jmxName.set("StatelessSessionBean", beanContext.getEjbName()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); jmxName.set("j2eeType", ""); jmxName.set("name", beanContext.getEjbName()); @@ -210,6 +208,29 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { } } +// Expose InstanceLimit/InstanceCount stats through JMX +{ +final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); +jmxName.set("J2EEServer", "openejb"); +jmxName.set("J2EEApplication", null); +jmxName.set("EJBModule", beanContext.getModuleID()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); +jmxName.set("j2eeType", ""); +jmxName.set("name", beanContext.getEjbName()); + +try { +final ObjectName objectName = jmxName.set("j2eeType", "Instances").build(); +if (server.isRegistered(objectName)) { +server.unregisterMBean(objectName); +} +server.registerMBean(new ManagedMBean(new InstanceMonitor(instanceFactory)), objectName); +endpointFactory.jmxNames.add(objectName); +} catch (final Exception e) { +logger.error("Unable to register MBean ", e); +} +} + + // activate the endpoint CURRENT.set(beanContext); try { @@ -731,4 +752,22 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { return ATTRIBUTE_LIST; } } + +public static class InstanceMonitor { +private final MdbInstanceFactory instanceFactory; + +public InstanceMonitor(MdbInstanceFactory instanceFactory) { +this.instanceFactory = instanceFactory; +} + +@Managed +public int getInstanceLimit() { +return instanceFactory.getInstanceLimit(); +} + +@Managed +public int getInstanceCount() { +return instanceFactory.getInstanceCount(); +} +} } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
[tomee] branch tomee-7.1.x updated: TOMEE-2859 set instancelimit correctly on the container
This is an automated email from the ASF dual-hosted git repository. jgallimore pushed a commit to branch tomee-7.1.x in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/tomee-7.1.x by this push: new 3ae5d6b TOMEE-2859 set instancelimit correctly on the container 3ae5d6b is described below commit 3ae5d6bdb38675c40cf84385663bf6b71bbe18b5 Author: Jonathan Gallimore AuthorDate: Mon Jul 6 20:37:46 2020 +0100 TOMEE-2859 set instancelimit correctly on the container --- .../org/apache/openejb/core/mdb/MdbContainer.java | 51 +++- .../openejb/core/mdb/MdbContainerFactory.java | 2 +- .../core/mdb/MaxInstanceEndpointHandlerTest.java | 142 + 3 files changed, 188 insertions(+), 7 deletions(-) diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java index bfbc65a..d5e182f 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java @@ -33,10 +33,7 @@ import org.apache.openejb.core.timer.EjbTimerService; import org.apache.openejb.core.transaction.TransactionPolicy; import org.apache.openejb.loader.Options; import org.apache.openejb.loader.SystemInstance; -import org.apache.openejb.monitoring.LocalMBeanServer; -import org.apache.openejb.monitoring.ManagedMBean; -import org.apache.openejb.monitoring.ObjectNameBuilder; -import org.apache.openejb.monitoring.StatsInterceptor; +import org.apache.openejb.monitoring.*; import org.apache.openejb.resource.XAResourceWrapper; import org.apache.openejb.spi.SecurityService; import org.apache.openejb.util.LogCategory; @@ -182,18 +179,19 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { beanContext.setContainerData(endpointFactory); deployments.put(deploymentId, beanContext); +final MBeanServer server = LocalMBeanServer.get(); + // Create stats interceptor if (StatsInterceptor.isStatsActivated()) { final StatsInterceptor stats = new StatsInterceptor(beanContext.getBeanClass()); beanContext.addFirstSystemInterceptor(stats); -final MBeanServer server = LocalMBeanServer.get(); final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); jmxName.set("J2EEServer", "openejb"); jmxName.set("J2EEApplication", null); jmxName.set("EJBModule", beanContext.getModuleID()); -jmxName.set("StatelessSessionBean", beanContext.getEjbName()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); jmxName.set("j2eeType", ""); jmxName.set("name", beanContext.getEjbName()); @@ -210,6 +208,29 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { } } +// Expose InstanceLimit/InstanceCount stats through JMX +{ +final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); +jmxName.set("J2EEServer", "openejb"); +jmxName.set("J2EEApplication", null); +jmxName.set("EJBModule", beanContext.getModuleID()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); +jmxName.set("j2eeType", ""); +jmxName.set("name", beanContext.getEjbName()); + +try { +final ObjectName objectName = jmxName.set("j2eeType", "Instances").build(); +if (server.isRegistered(objectName)) { +server.unregisterMBean(objectName); +} +server.registerMBean(new ManagedMBean(new InstanceMonitor(instanceFactory)), objectName); +endpointFactory.jmxNames.add(objectName); +} catch (final Exception e) { +logger.error("Unable to register MBean ", e); +} +} + + // activate the endpoint CURRENT.set(beanContext); try { @@ -731,4 +752,22 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { return ATTRIBUTE_LIST; } } + +public static class InstanceMonitor { +private final MdbInstanceFactory instanceFactory; + +public InstanceMonitor(MdbInstanceFactory instanceFactory) { +this.instanceFactory = instanceFactory; +} + +@Managed +public int getInstanceLimit() { +return instanceFactory.getInstanceLimit(); +} + +@Managed +public int getInstanceCount() { +return instanceFactory.getInstanceCount(); +} +} } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
[tomee] branch tomee-7.0.x updated: TOMEE-2859 set instancelimit correctly on the container
This is an automated email from the ASF dual-hosted git repository. jgallimore pushed a commit to branch tomee-7.0.x in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/tomee-7.0.x by this push: new dcc15d0 TOMEE-2859 set instancelimit correctly on the container dcc15d0 is described below commit dcc15d09238cf585ec707e45eea944e5b553ba3b Author: Jonathan Gallimore AuthorDate: Mon Jul 6 20:37:46 2020 +0100 TOMEE-2859 set instancelimit correctly on the container --- .../org/apache/openejb/core/mdb/MdbContainer.java | 51 +++- .../openejb/core/mdb/MdbContainerFactory.java | 2 +- .../core/mdb/MaxInstanceEndpointHandlerTest.java | 142 + 3 files changed, 188 insertions(+), 7 deletions(-) diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java index bfbc65a..d5e182f 100644 --- a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java +++ b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainer.java @@ -33,10 +33,7 @@ import org.apache.openejb.core.timer.EjbTimerService; import org.apache.openejb.core.transaction.TransactionPolicy; import org.apache.openejb.loader.Options; import org.apache.openejb.loader.SystemInstance; -import org.apache.openejb.monitoring.LocalMBeanServer; -import org.apache.openejb.monitoring.ManagedMBean; -import org.apache.openejb.monitoring.ObjectNameBuilder; -import org.apache.openejb.monitoring.StatsInterceptor; +import org.apache.openejb.monitoring.*; import org.apache.openejb.resource.XAResourceWrapper; import org.apache.openejb.spi.SecurityService; import org.apache.openejb.util.LogCategory; @@ -182,18 +179,19 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { beanContext.setContainerData(endpointFactory); deployments.put(deploymentId, beanContext); +final MBeanServer server = LocalMBeanServer.get(); + // Create stats interceptor if (StatsInterceptor.isStatsActivated()) { final StatsInterceptor stats = new StatsInterceptor(beanContext.getBeanClass()); beanContext.addFirstSystemInterceptor(stats); -final MBeanServer server = LocalMBeanServer.get(); final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); jmxName.set("J2EEServer", "openejb"); jmxName.set("J2EEApplication", null); jmxName.set("EJBModule", beanContext.getModuleID()); -jmxName.set("StatelessSessionBean", beanContext.getEjbName()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); jmxName.set("j2eeType", ""); jmxName.set("name", beanContext.getEjbName()); @@ -210,6 +208,29 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { } } +// Expose InstanceLimit/InstanceCount stats through JMX +{ +final ObjectNameBuilder jmxName = new ObjectNameBuilder("openejb.management"); +jmxName.set("J2EEServer", "openejb"); +jmxName.set("J2EEApplication", null); +jmxName.set("EJBModule", beanContext.getModuleID()); +jmxName.set("MessageDrivenBean", beanContext.getEjbName()); +jmxName.set("j2eeType", ""); +jmxName.set("name", beanContext.getEjbName()); + +try { +final ObjectName objectName = jmxName.set("j2eeType", "Instances").build(); +if (server.isRegistered(objectName)) { +server.unregisterMBean(objectName); +} +server.registerMBean(new ManagedMBean(new InstanceMonitor(instanceFactory)), objectName); +endpointFactory.jmxNames.add(objectName); +} catch (final Exception e) { +logger.error("Unable to register MBean ", e); +} +} + + // activate the endpoint CURRENT.set(beanContext); try { @@ -731,4 +752,22 @@ public class MdbContainer implements RpcContainer, BaseMdbContainer { return ATTRIBUTE_LIST; } } + +public static class InstanceMonitor { +private final MdbInstanceFactory instanceFactory; + +public InstanceMonitor(MdbInstanceFactory instanceFactory) { +this.instanceFactory = instanceFactory; +} + +@Managed +public int getInstanceLimit() { +return instanceFactory.getInstanceLimit(); +} + +@Managed +public int getInstanceCount() { +return instanceFactory.getInstanceCount(); +} +} } diff --git a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/MdbContainerFactory.java
[jira] [Created] (TOMEE-2859) InstanceLimit not set on MDB container correctly
Jonathan Gallimore created TOMEE-2859: - Summary: InstanceLimit not set on MDB container correctly Key: TOMEE-2859 URL: https://issues.apache.org/jira/browse/TOMEE-2859 Project: TomEE Issue Type: Bug Reporter: Jonathan Gallimore Assignee: Jonathan Gallimore Looks like the introduction of the pooled mode has lead to the InstanceLimit not being set on the container correctly. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Resolved] (TOMEE-1395) Invalid package in example: simple-mdb-with-descriptor
[ https://issues.apache.org/jira/browse/TOMEE-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Salter resolved TOMEE-1395. - Fix Version/s: (was: 7.0.9) Resolution: Fixed This issue has been ersolved with the linked PR. > Invalid package in example: simple-mdb-with-descriptor > -- > > Key: TOMEE-1395 > URL: https://issues.apache.org/jira/browse/TOMEE-1395 > Project: TomEE > Issue Type: Bug >Affects Versions: 7.0.0 >Reporter: Daniel Kasmeroglu >Priority: Minor > Labels: pull-request-available > Attachments: tomee-1395.patch > > > Just an invalid package name. A corresponding diff can be found here: > https://kasisoft.com/stash/projects/TOMEE/repos/tomee/commits/e8f8d08b5733bd93a090fe2ff9e5dbe7f95f817e -- This message was sent by Atlassian Jira (v8.3.4#803005)
[tomee] branch tomee-7.0.x updated: Fixing version numbers in build
This is an automated email from the ASF dual-hosted git repository. jgallimore pushed a commit to branch tomee-7.0.x in repository https://gitbox.apache.org/repos/asf/tomee.git The following commit(s) were added to refs/heads/tomee-7.0.x by this push: new 73498ee Fixing version numbers in build 73498ee is described below commit 73498eeec223a078bddf844717380a375ab718c3 Author: Jonathan Gallimore AuthorDate: Mon Jul 6 12:53:41 2020 +0100 Fixing version numbers in build --- arquillian/arquillian-tomee-tests/pom.xml | 30 +++--- examples/applet/pom.xml| 6 ++--- examples/arquillian-jpa/pom.xml| 2 +- .../bean-validation-design-by-contract/pom.xml | 2 +- .../bval-evaluation-redeployment/WebApp1/pom.xml | 2 +- .../bval-evaluation-redeployment/WebApp2/pom.xml | 2 +- examples/bval-evaluation-redeployment/pom.xml | 8 +++--- .../bval-evaluation-redeployment/runner/pom.xml| 4 +-- examples/cdi-realm/pom.xml | 2 +- examples/change-jaxws-url/pom.xml | 4 +-- examples/connector-ear/pom.xml | 2 +- examples/connector-war/pom.xml | 2 +- examples/datasource-ciphered-password/pom.xml | 2 +- examples/datasource-definition/pom.xml | 2 +- examples/datasource-versioning/pom.xml | 2 +- examples/deltaspike-fullstack/pom.xml | 2 +- examples/dynamic-datasource-routing/pom.xml| 2 +- examples/mbean-auto-registration/pom.xml | 2 +- examples/moviefun-rest/pom.xml | 2 +- examples/moviefun/pom.xml | 2 +- examples/mtom/pom.xml | 2 +- examples/multi-jpa-provider-testing/pom.xml| 4 +-- examples/multiple-arquillian-adapters/pom.xml | 2 +- examples/multiple-tomee-arquillian/pom.xml | 2 +- examples/pojo-webservice/pom.xml | 4 +-- examples/polling-parent/pom.xml| 2 +- examples/projectstage-demo/pom.xml | 2 +- examples/quartz-app/pom.xml| 2 +- examples/resources-declared-in-webapp/pom.xml | 4 +-- examples/resources-jmx-example/pom.xml | 2 +- examples/rest-example-with-application/pom.xml | 4 +-- examples/rest-example/pom.xml | 4 +-- examples/rest-on-ejb/pom.xml | 4 +-- examples/simple-cmp2/pom.xml | 6 ++--- .../src/main/java/org/superbiz/mdb/ChatBean.java | 11 ++-- pom.xml| 2 +- tomee/tomee-deb/pom.xml| 2 +- 37 files changed, 74 insertions(+), 67 deletions(-) diff --git a/arquillian/arquillian-tomee-tests/pom.xml b/arquillian/arquillian-tomee-tests/pom.xml index cc655df..2f17dd6 100644 --- a/arquillian/arquillian-tomee-tests/pom.xml +++ b/arquillian/arquillian-tomee-tests/pom.xml @@ -219,7 +219,7 @@ ${maven.test.skip} -javaagent:${settings.localRepository}/org/apache/tomee/openejb-javaagent/${project.version}/openejb-javaagent-${project.version}.jar -7.0.8 +7.0.9-SNAPSHOT tomee-embedded tomee-embedded @@ -318,7 +318,7 @@ ${skip.remote.webprofile} true -7.0.8 +7.0.9-SNAPSHOT webprofile tomee-remote tomee-remote @@ -352,7 +352,7 @@ ${skip.embedded} -javaagent:${settings.localRepository}/org/apache/tomee/openejb-javaagent/${project.version}/openejb-javaagent-${project.version}.jar -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=768M -7.0.8 +7.0.9-SNAPSHOT tomee-embedded tomee-embedded @@ -368,7 +368,7 @@ ${skip.remote.plume} true -7.0.8 +7.0.9-SNAPSHOT plume tomee-remote tomee-remote @@ -388,7 +388,7 @@ ${skip.remote.plus} true -7.0.8 +7.0.9-SNAPSHOT plus tomee-remote tomee-remote @@ -404,7 +404,7 @@ ${skip.webapp.webprofile} -7.0.8 +7.0.9-SNAPSHOT ${tomcat.version} tomee-webapp tomee-webapp @@ -421,7 +421,7 @@