View Javadoc

1   /***
2    *
3    * Copyright 2005 LogicBlaze, Inc.
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    * http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   *
17   **/
18  package org.logicblaze.lingo;
19  
20  import java.io.Serializable;
21  
22  /***
23   * Represents the Message Exchange Pattern characteristics of a specific method
24   * invocation.
25   * 
26   * @version $Revision: 1.4 $
27   */
28  public class MethodMetadata implements Serializable {
29      private static final long serialVersionUID = 7969481427004071349L;
30  
31      private boolean oneWay;
32      private boolean stateful;
33      private boolean endSession;
34      private boolean[] remoteParameters;
35  
36      public MethodMetadata(boolean oneWay) {
37          this(oneWay, null);
38      }
39  
40      public MethodMetadata(boolean oneWay, boolean[] remoteParameters) {
41          this.oneWay = oneWay;
42          this.remoteParameters = remoteParameters;
43      }
44  
45      public MethodMetadata(boolean oneWay, boolean[] remoteParameters, boolean stateful, boolean endSession) {
46          this.oneWay = oneWay;
47          this.remoteParameters = remoteParameters;
48          this.stateful = stateful;
49          this.endSession = endSession;
50      }
51  
52      public boolean isOneWay() {
53          return oneWay;
54      }
55  
56      /***
57       * Returns true if the parameter at the given index is remote method
58       */
59      public boolean isRemoteParameter(int i) {
60          return remoteParameters != null && remoteParameters[i];
61      }
62  
63      /***
64       * Should sticky load balancing be used to refer to a remote stateful
65       * service
66       */
67      public boolean isStateful() {
68          return stateful;
69      }
70  
71      /***
72       * Returns whether or not this method ends the session if used on a callback
73       * object. e.g. does this method terminate the use of a callback object
74       */
75      public boolean isEndSession() {
76          return endSession;
77      }
78  
79  }