001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.phase;
019:
020: public class Phase implements Comparable {
021:
022: // can be removed from once defined as default value in configuration metadata for bus
023:
024: public static final String SETUP = "setup";
025: public static final String SETUP_ENDING = "setup-ending";
026: public static final String PRE_LOGICAL = "pre-logical";
027: public static final String PRE_LOGICAL_ENDING = "pre-logical-ending";
028: public static final String USER_LOGICAL = "user-logical";
029: public static final String USER_LOGICAL_ENDING = "user-logical-ending";
030: public static final String POST_LOGICAL = "post-logical";
031: public static final String POST_LOGICAL_ENDING = "post-logical-ending";
032: public static final String PRE_MARSHAL = "pre-marshal";
033: public static final String MARSHAL = "marshal";
034: public static final String POST_MARSHAL = "post-marshal";
035: public static final String MARSHAL_ENDING = "marshal-ending";
036: public static final String PRE_PROTOCOL = "pre-protocol";
037: public static final String PRE_PROTOCOL_ENDING = "pre-protocol-ending";
038: public static final String USER_PROTOCOL = "user-protocol";
039: public static final String USER_PROTOCOL_ENDING = "user-protocol-ending";
040: public static final String POST_PROTOCOL = "post-protocol";
041: public static final String POST_PROTOCOL_ENDING = "post-protocol-ending";
042: public static final String PREPARE_SEND = "prepare-send";
043: public static final String PREPARE_SEND_ENDING = "prepare-send-ending";
044: public static final String PRE_STREAM = "pre-stream";
045: public static final String PRE_STREAM_ENDING = "pre-stream-ending";
046: public static final String USER_STREAM = "user-stream";
047: public static final String USER_STREAM_ENDING = "user-stream-ending";
048: public static final String POST_STREAM = "post-stream";
049: public static final String POST_STREAM_ENDING = "post-stream-ending";
050: public static final String WRITE = "write";
051: public static final String WRITE_ENDING = "write-ending";
052: public static final String SEND = "send";
053: public static final String SEND_ENDING = "send-ending";
054:
055: public static final String RECEIVE = "receive";
056: public static final String READ = "read";
057: public static final String PROTOCOL = "protocol";
058: public static final String UNMARSHAL = "unmarshal";
059: public static final String PRE_INVOKE = "pre-invoke";
060: public static final String INVOKE = "invoke";
061: public static final String POST_INVOKE = "post-invoke";
062:
063: private String name;
064: private int priority;
065:
066: public Phase() {
067: }
068:
069: public Phase(String n, int p) {
070: this .name = n;
071: this .priority = p;
072: }
073:
074: public String getName() {
075: return name;
076: }
077:
078: public void setName(String n) {
079: this .name = n;
080: }
081:
082: public int getPriority() {
083: return priority;
084: }
085:
086: public void setPriority(int p) {
087: this .priority = p;
088: }
089:
090: public int hashCode() {
091: return priority;
092: }
093:
094: public boolean equals(Object o) {
095: Phase p = (Phase) o;
096:
097: return p.priority == priority && p.name.equals(name);
098: }
099:
100: public int compareTo(Object o) {
101: Phase p = (Phase) o;
102:
103: if (priority == p.priority) {
104: return name.compareTo(p.name);
105: }
106: return priority - p.priority;
107: }
108:
109: public String toString() {
110: return "Phase(" + getName() + ")";
111: }
112: }
|