Coverage Report - org.kuali.rice.ksb.messaging.AsynchronousCall
 
Classes in this File Line Coverage Branch Coverage Complexity
AsynchronousCall
0%
0/27
0%
0/2
1.167
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
 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  
 package org.kuali.rice.ksb.messaging;
 18  
 
 19  
 import java.io.Serializable;
 20  
 
 21  
 import org.apache.commons.lang.StringUtils;
 22  
 
 23  
 /**
 24  
  * Encapsulates an asynchronous call to a service.
 25  
  * 
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  */
 28  
 public class AsynchronousCall implements Serializable {
 29  
 
 30  
         private static final long serialVersionUID = -1036656564567726747L;
 31  
 
 32  
         private Object[] arguments;
 33  
 
 34  
         private Class[] paramTypes;
 35  
 
 36  
         private ServiceInfo serviceInfo;
 37  
         
 38  
         private Serializable context;
 39  
         
 40  
         private String methodName;
 41  
 
 42  
         private AsynchronousCallback callback;
 43  
         
 44  
         private boolean ignoreStoreAndForward;
 45  
         
 46  0
         public AsynchronousCall(Class[] paramTypes, Object[] arguments, ServiceInfo serviceInfo, String methodName, AsynchronousCallback callback, Serializable context) {
 47  0
             this.arguments = arguments;
 48  0
                 this.paramTypes = paramTypes;
 49  0
                 this.serviceInfo = serviceInfo;
 50  0
                 this.methodName = methodName;
 51  0
                 this.callback = callback;
 52  0
                 this.context = context;
 53  0
         }
 54  
 
 55  
         public Object[] getArguments() {
 56  0
                 return this.arguments;
 57  
         }
 58  
 
 59  
         public Class[] getParamTypes() {
 60  0
                 return this.paramTypes;
 61  
         }
 62  
 
 63  
         public ServiceInfo getServiceInfo() {
 64  0
                 return this.serviceInfo;
 65  
         }
 66  
 
 67  
         public String getMethodName() {
 68  0
                 return this.methodName;
 69  
         }
 70  
 
 71  
         public AsynchronousCallback getCallback() {
 72  0
                 return this.callback;
 73  
         }
 74  
 
 75  
         public String toString() {
 76  0
                 return "[AsynchronousCall: " + "serviceInfo=" + this.serviceInfo + ", methodName=" + this.methodName + ", paramTypes=" + getStringifiedArray(this.paramTypes) + ", arguments=" + getStringifiedArray(this.arguments) + "]";
 77  
         }
 78  
 
 79  
         /**
 80  
          * Takes an Object[] and returns a human-readable String of the contents
 81  
          * Candidate for relocation to a utility class
 82  
          * 
 83  
          * @param array
 84  
          *            the Object[]
 85  
          * @return a human-readable String of the contents
 86  
          */
 87  
         private static final String getStringifiedArray(Object[] array) {
 88  0
                 if (array == null) {
 89  0
                         return null;
 90  
                 }
 91  0
                 StringBuffer sb = new StringBuffer(array.getClass().toString());
 92  0
                 sb.append("[");
 93  0
                 StringUtils.join(array, ", ");
 94  0
                 sb.append("]");
 95  0
                 return sb.toString();
 96  
         }
 97  
 
 98  
         public boolean isIgnoreStoreAndForward() {
 99  0
                 return this.ignoreStoreAndForward;
 100  
         }
 101  
 
 102  
         public void setIgnoreStoreAndForward(boolean ignoreStoreAndForward) {
 103  0
                 this.ignoreStoreAndForward = ignoreStoreAndForward;
 104  0
         }
 105  
 
 106  
         public Serializable getContext() {
 107  0
             return this.context;
 108  
         }
 109  
 
 110  
         public void setContext(Serializable context) {
 111  0
             this.context = context;
 112  0
         }
 113  
 
 114  
 
 115  
 }