extract state enum

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

Branch: refs/heads/master
Commit: e44832a43cdd2a2627ede7aaf13c0c0a4e7354a2
Parents: dcf0569
Author: Otavio Santana <[email protected]>
Authored: Fri Dec 15 07:37:45 2017 -0300
Committer: Otavio Santana <[email protected]>
Committed: Fri Dec 15 07:37:45 2017 -0300

----------------------------------------------------------------------
 .../openejb/core/mdb/EndpointHandler.java       | 30 ------------
 .../openejb/core/mdb/PoolEndpointHandler.java   | 31 +------------
 .../java/org/apache/openejb/core/mdb/State.java | 49 ++++++++++++++++++++
 3 files changed, 50 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/e44832a4/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
index eaa86c4..21ce0f4 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/EndpointHandler.java
@@ -36,36 +36,6 @@ import java.util.Arrays;
 public class EndpointHandler implements InvocationHandler, MessageEndpoint {
     private volatile Boolean isAmq;
 
-    private static enum State {
-        /**
-         * The handler has been initialized and is ready for invoation
-         */
-        NONE,
-
-        /**
-         * The beforeDelivery method has been called, and the next method 
called must be a message delivery method
-         * or release.
-         */
-        BEFORE_CALLED,
-
-        /**
-         * The message delivery method has been called successfully, and the 
next method called must be
-         * another message delivery method, afterDelivery, or release.
-         */
-        METHOD_CALLED,
-
-        /**
-         * The message delivery threw a system exception, and the next method 
called must be afterDelivery
-         * or release.  This state notified the afterDelivery method that the 
instace must be replaced with a new
-         * instance.
-         */
-        SYSTEM_EXCEPTION,
-
-        /**
-         * This message endpoint handler has been released and can no longer 
be used.
-         */
-        RELEASED
-    }
 
     private final BaseMdbContainer container;
     private final BeanContext deployment;

http://git-wip-us.apache.org/repos/asf/tomee/blob/e44832a4/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/PoolEndpointHandler.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/PoolEndpointHandler.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/PoolEndpointHandler.java
index 6e9d9a7..cc1cc13 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/PoolEndpointHandler.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/PoolEndpointHandler.java
@@ -38,36 +38,7 @@ import java.util.Arrays;
 public class PoolEndpointHandler implements InvocationHandler, MessageEndpoint 
{
     private volatile Boolean isAmq;
 
-    private static enum State {
-        /**
-         * The handler has been initialized and is ready for invoation
-         */
-        NONE,
-
-        /**
-         * The beforeDelivery method has been called, and the next method 
called must be a message delivery method
-         * or release.
-         */
-        BEFORE_CALLED,
-
-        /**
-         * The message delivery method has been called successfully, and the 
next method called must be
-         * another message delivery method, afterDelivery, or release.
-         */
-        METHOD_CALLED,
-
-        /**
-         * The message delivery threw a system exception, and the next method 
called must be afterDelivery
-         * or release.  This state notified the afterDelivery method that the 
instace must be replaced with a new
-         * instance.
-         */
-        SYSTEM_EXCEPTION,
-
-        /**
-         * This message endpoint handler has been released and can no longer 
be used.
-         */
-        RELEASED
-    }
+ 
 
     private final BaseMdbContainer container;
     private final BeanContext deployment;

http://git-wip-us.apache.org/repos/asf/tomee/blob/e44832a4/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/State.java
----------------------------------------------------------------------
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/State.java 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/State.java
new file mode 100644
index 0000000..285468a
--- /dev/null
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/core/mdb/State.java
@@ -0,0 +1,49 @@
+/*
+ * 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.core.mdb;
+
+enum State {
+    /**
+     * The handler has been initialized and is ready for invoation
+     */
+    NONE,
+
+    /**
+     * The beforeDelivery method has been called, and the next method called 
must be a message delivery method
+     * or release.
+     */
+    BEFORE_CALLED,
+
+    /**
+     * The message delivery method has been called successfully, and the next 
method called must be
+     * another message delivery method, afterDelivery, or release.
+     */
+    METHOD_CALLED,
+
+    /**
+     * The message delivery threw a system exception, and the next method 
called must be afterDelivery
+     * or release.  This state notified the afterDelivery method that the 
instace must be replaced with a new
+     * instance.
+     */
+    SYSTEM_EXCEPTION,
+
+    /**
+     * This message endpoint handler has been released and can no longer be 
used.
+     */
+    RELEASED
+}

Reply via email to