Repository: tomee Updated Branches: refs/heads/tomee-7.0.x 1b73ff86c -> 6709b3d9a
Add required interface implementations etc Project: http://git-wip-us.apache.org/repos/asf/tomee/repo Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/515306f7 Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/515306f7 Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/515306f7 Branch: refs/heads/tomee-7.0.x Commit: 515306f7ba0fa1c13720c4426f67854a339d2e30 Parents: df1983f Author: Jonathan S. Fisher <exabr...@gmail.com> Authored: Sat Sep 29 13:10:49 2018 -0500 Committer: Jonathan S. Fisher <exabr...@gmail.com> Committed: Mon Oct 8 13:12:57 2018 -0500 ---------------------------------------------------------------------- .../MBeanOpenEJBRuntimeServices.java | 26 ++++++++++++ .../MBeanOpenEJBRuntimeServicesMBean.java | 22 ++++++++++ .../eclipselink/OpenEJBRuntimeServices.java | 42 ++++++++++++++++++++ .../eclipselink/OpenEJBServerPlatform.java | 11 ++++- 4 files changed, 100 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tomee/blob/515306f7/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServices.java ---------------------------------------------------------------------- diff --git a/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServices.java b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServices.java new file mode 100644 index 0000000..c3aae0d --- /dev/null +++ b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServices.java @@ -0,0 +1,26 @@ +/* + * 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. + */ +package org.apache.openejb.jpa.integration.eclipselink; + +import org.eclipse.persistence.internal.sessions.AbstractSession; +import org.eclipse.persistence.sessions.Session; + +public class MBeanOpenEJBRuntimeServices extends OpenEJBRuntimeServices implements MBeanOpenEJBRuntimeServicesMBean { + public MBeanOpenEJBRuntimeServices(Session session) { + super((AbstractSession) session); + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/515306f7/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServicesMBean.java ---------------------------------------------------------------------- diff --git a/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServicesMBean.java b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServicesMBean.java new file mode 100644 index 0000000..c7b5942 --- /dev/null +++ b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/MBeanOpenEJBRuntimeServicesMBean.java @@ -0,0 +1,22 @@ +/* + * 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. + */ +package org.apache.openejb.jpa.integration.eclipselink; + +import org.eclipse.persistence.services.mbean.MBeanRuntimeServicesMBean; + +public interface MBeanOpenEJBRuntimeServicesMBean extends MBeanRuntimeServicesMBean { +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/515306f7/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBRuntimeServices.java ---------------------------------------------------------------------- diff --git a/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBRuntimeServices.java b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBRuntimeServices.java new file mode 100644 index 0000000..db962b0 --- /dev/null +++ b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBRuntimeServices.java @@ -0,0 +1,42 @@ +/* + * 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. + */ +package org.apache.openejb.jpa.integration.eclipselink; + +import java.util.Locale; + +import org.eclipse.persistence.internal.sessions.AbstractSession; +import org.eclipse.persistence.services.RuntimeServices; + +public class OpenEJBRuntimeServices extends RuntimeServices { + + static { + PLATFORM_NAME = "OpenEJB"; + } + + public OpenEJBRuntimeServices() { + super(); + } + + public OpenEJBRuntimeServices(AbstractSession session) { + super(); + this.session = session; + this.updateDeploymentTimeData(); + } + + public OpenEJBRuntimeServices(Locale locale) { + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tomee/blob/515306f7/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBServerPlatform.java ---------------------------------------------------------------------- diff --git a/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBServerPlatform.java b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBServerPlatform.java index ea074c6..f68a962 100644 --- a/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBServerPlatform.java +++ b/container/openejb-jpa-integration/src/main/java/org/apache/openejb/jpa/integration/eclipselink/OpenEJBServerPlatform.java @@ -17,6 +17,7 @@ package org.apache.openejb.jpa.integration.eclipselink; import org.apache.geronimo.transaction.manager.TransactionImpl; +import org.eclipse.persistence.platform.server.JMXEnabledPlatform; import org.eclipse.persistence.platform.server.JMXServerPlatformBase; import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.transaction.AbstractSynchronizationListener; @@ -26,13 +27,14 @@ import javax.management.MBeanServer; import javax.transaction.Synchronization; import javax.transaction.TransactionManager; -public class OpenEJBServerPlatform extends JMXServerPlatformBase { +public class OpenEJBServerPlatform extends JMXServerPlatformBase implements JMXEnabledPlatform { public OpenEJBServerPlatform(final DatabaseSession newDatabaseSession) { super(newDatabaseSession); try { mBeanServer = MBeanServer.class.cast( OpenEJBServerPlatform.class.getClassLoader().loadClass("org.apache.openejb.monitoring.LocalMBeanServer") .getMethod("get").invoke(null)); + this.prepareServerSpecificServicesMBean(); } catch (final Exception e) { // no-op } @@ -63,4 +65,11 @@ public class OpenEJBServerPlatform extends JMXServerPlatformBase { transaction.registerInterposedSynchronization(synchronization); } } + + @Override + public void prepareServerSpecificServicesMBean() { + if (getDatabaseSession() != null && shouldRegisterRuntimeBean) { + this.setRuntimeServicesMBean(new MBeanOpenEJBRuntimeServices(getDatabaseSession())); + } + } }