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