1 package org.mortbay.cxf.demo; 2 3 // ======================================================================== 4 // Copyright 2007 Mort Bay Consulting Pty. Ltd. 5 // ------------------------------------------------------------------------ 6 // Licensed under the Apache License, Version 2.0 (the "License"); 7 // you may not use this file except in compliance with the License. 8 // You may obtain a copy of the License at 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 // ======================================================================== 16 17 18 import ebay.apis.eblbasecomponents.FindItemsResponseType; 19 20 import javax.xml.ws.AsyncHandler; 21 import javax.xml.ws.Response; 22 23 24 public class EbayFindItemAsyncHandler implements AsyncHandler<FindItemsResponseType> 25 { 26 private EbayFindItemAsync finder; 27 private FindItemsResponseType reply; 28 29 public EbayFindItemAsyncHandler(EbayFindItemAsync finder) 30 { 31 this.finder=finder; 32 } 33 34 public void handleResponse(Response<FindItemsResponseType> response) 35 { 36 try 37 { 38 reply = response.get(); 39 } 40 catch (Exception ex) 41 { 42 ex.printStackTrace(); 43 } 44 finally 45 { 46 finder.done(); 47 } 48 } 49 50 public FindItemsResponseType getResponse() 51 { 52 return reply; 53 } 54 } 55