public final Future<?> invokeAsync(T param, AsyncHandler<T> asyncHandler) { Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); try { if (LOGGER.isLoggable(Level.FINE)) { dumpParam(param, "invokeAsync(T, AsyncHandler<T>)"); } AsyncInvoker invoker = new DispatchAsyncInvoker(param); AsyncResponseImpl<T> ft = new AsyncResponseImpl<T>(invoker,asyncHandler); invoker.setReceiver(ft); invoker.setNonNullAsyncHandlerGiven(asyncHandler != null); ft.run(); return ft; } finally { ContainerResolver.getDefault().exitContainer(old); } }
/** * * @param positionId * @param employeeId * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "changePosition") @RequestWrapper(localName = "changePosition", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangePosition") @ResponseWrapper(localName = "changePositionResponse", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangePositionResponse") public Future<?> changePositionAsync( @WebParam(name = "employeeId", targetNamespace = "") int employeeId, @WebParam(name = "PositionId", targetNamespace = "") int positionId, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<ChangePositionResponse> asyncHandler);
/** * * @param gradeId * @param employeeId * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "changeGrade") @RequestWrapper(localName = "changeGrade", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangeGrade") @ResponseWrapper(localName = "changeGradeResponse", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangeGradeResponse") public Future<?> changeGradeAsync( @WebParam(name = "employeeId", targetNamespace = "") int employeeId, @WebParam(name = "GradeId", targetNamespace = "") int gradeId, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<ChangeGradeResponse> asyncHandler);
/** * * @param employeeId * @param salary * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "changeSalary") @RequestWrapper(localName = "changeSalary", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangeSalary") @ResponseWrapper(localName = "changeSalaryResponse", targetNamespace = "http://ws.technoserv.ru/", className = "ru.technoserv.ws.ChangeSalaryResponse") public Future<?> changeSalaryAsync( @WebParam(name = "employeeId", targetNamespace = "") int employeeId, @WebParam(name = "Salary", targetNamespace = "") BigDecimal salary, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<ChangeSalaryResponse> asyncHandler);
protected final Response<Object> doInvoke(Object proxy, Object[] args, AsyncHandler handler) { AsyncInvoker invoker = new SEIAsyncInvoker(proxy, args); invoker.setNonNullAsyncHandlerGiven(handler != null); AsyncResponseImpl<Object> ft = new AsyncResponseImpl<Object>(invoker,handler); invoker.setReceiver(ft); ft.run(); return ft; }
@ResponseWrapper(localName = "avisoEntradasResponse", targetNamespace = "urn:es:caib:bantel:ws:v1:model:BantelFacade", className = "es.caib.bantel.wsClient.v1.model.AvisoEntradasResponse") @RequestWrapper(localName = "avisoEntradas", targetNamespace = "urn:es:caib:bantel:ws:v1:model:BantelFacade", className = "es.caib.bantel.wsClient.v1.model.AvisoEntradas") @WebMethod(operationName = "avisoEntradas") public Future<?> avisoEntradasAsync( @WebParam(name = "numeroEntradas", targetNamespace = "urn:es:caib:bantel:ws:v1:model:BantelFacade") es.caib.bantel.wsClient.v1.model.ReferenciasEntrada numeroEntradas, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<es.caib.bantel.wsClient.v1.model.AvisoEntradasResponse> asyncHandler );
@ResponseWrapper(localName = "avisoEntradasResponse", targetNamespace = "urn:es:caib:bantel:ws:v2:model:BantelFacade", className = "es.caib.bantel.wsClient.v2.model.AvisoEntradasResponse") @RequestWrapper(localName = "avisoEntradas", targetNamespace = "urn:es:caib:bantel:ws:v2:model:BantelFacade", className = "es.caib.bantel.wsClient.v2.model.AvisoEntradas") @WebMethod(operationName = "avisoEntradas") public Future<?> avisoEntradasAsync( @WebParam(name = "numeroEntradas", targetNamespace = "urn:es:caib:bantel:ws:v2:model:BantelFacade") es.caib.bantel.wsClient.v2.model.ReferenciasEntrada numeroEntradas, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<es.caib.bantel.wsClient.v2.model.AvisoEntradasResponse> asyncHandler );
/** * * @param requests * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "GetPIArchiveData", action = "http://xml.osisoft.com/services/IPITimeSeries/GetPIArchiveData") @RequestWrapper(localName = "GetPIArchiveData", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPIArchiveData") @ResponseWrapper(localName = "GetPIArchiveDataResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPIArchiveDataResponse") public Future<?> getPIArchiveDataAsync( @WebParam(name = "requests", targetNamespace = "http://xml.osisoft.com/services/PIDataService") ArrayOfPIArcDataRequest requests, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetPIArchiveDataResponse> asyncHandler);
/** * * @param evtFilter * @param maxWaitForUpdates * @param updateTicket * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "GetPIUpdates", action = "http://xml.osisoft.com/services/IPITimeSeries/GetPIUpdates") @RequestWrapper(localName = "GetPIUpdates", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPIUpdates") @ResponseWrapper(localName = "GetPIUpdatesResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPIUpdatesResponse") public Future<?> getPIUpdatesAsync( @WebParam(name = "updateTicket", targetNamespace = "http://xml.osisoft.com/services/PIDataService") String updateTicket, @WebParam(name = "maxWaitForUpdates", targetNamespace = "http://xml.osisoft.com/services/PIDataService") int maxWaitForUpdates, @WebParam(name = "evtFilter", targetNamespace = "http://xml.osisoft.com/services/PIDataService") UpdateFilterType evtFilter, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetPIUpdatesResponse> asyncHandler);
/** * * @param paths * @param expiration * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "SignUpForPIUpdates", action = "http://xml.osisoft.com/services/IPITimeSeries/SignUpForPIUpdates") @RequestWrapper(localName = "SignUpForPIUpdates", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.SignUpForPIUpdates") @ResponseWrapper(localName = "SignUpForPIUpdatesResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.SignUpForPIUpdatesResponse") public Future<?> signUpForPIUpdatesAsync( @WebParam(name = "paths", targetNamespace = "http://xml.osisoft.com/services/PIDataService") ArrayOfString paths, @WebParam(name = "expiration", targetNamespace = "http://xml.osisoft.com/services/PIDataService") int expiration, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<SignUpForPIUpdatesResponse> asyncHandler);
/** * * @param updateTicket * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "CancelSignUpForPIUpdates", action = "http://xml.osisoft.com/services/IPITimeSeries/CancelSignUpForPIUpdates") @RequestWrapper(localName = "CancelSignUpForPIUpdates", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.CancelSignUpForPIUpdates") @ResponseWrapper(localName = "CancelSignUpForPIUpdatesResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.CancelSignUpForPIUpdatesResponse") public Future<?> cancelSignUpForPIUpdatesAsync( @WebParam(name = "updateTicket", targetNamespace = "http://xml.osisoft.com/services/PIDataService") String updateTicket, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<CancelSignUpForPIUpdatesResponse> asyncHandler);
/** * * @param updateTicket * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "ListPathsByUpdateTicket", action = "http://xml.osisoft.com/services/IPITimeSeries/ListPaths") @RequestWrapper(localName = "ListPathsByUpdateTicket", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.ListPathsByUpdateTicket") @ResponseWrapper(localName = "ListPathsByUpdateTicketResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.ListPathsByUpdateTicketResponse") public Future<?> listPathsByUpdateTicketAsync( @WebParam(name = "updateTicket", targetNamespace = "http://xml.osisoft.com/services/PIDataService") String updateTicket, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<ListPathsByUpdateTicketResponse> asyncHandler);
/** * * @param paths * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "GetPISnapshotData", action = "http://xml.osisoft.com/services/IPITimeSeries/GetPISnapshotData") @RequestWrapper(localName = "GetPISnapshotData", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPISnapshotData") @ResponseWrapper(localName = "GetPISnapshotDataResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPISnapshotDataResponse") public Future<?> getPISnapshotDataAsync( @WebParam(name = "paths", targetNamespace = "http://xml.osisoft.com/services/PIDataService") ArrayOfString paths, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetPISnapshotDataResponse> asyncHandler);
/** * * @param requests * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "GetPISummaryData", action = "http://xml.osisoft.com/services/IPITimeSeries/GetPISummaryData") @RequestWrapper(localName = "GetPISummaryData", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPISummaryData") @ResponseWrapper(localName = "GetPISummaryDataResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetPISummaryDataResponse") public Future<?> getPISummaryDataAsync( @WebParam(name = "requests", targetNamespace = "http://xml.osisoft.com/services/PIDataService") ArrayOfPISummaryDataRequest requests, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetPISummaryDataResponse> asyncHandler);
/** * * @param events * @param asyncHandler * @param duplicateSwitch * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "InsertPIData", action = "http://xml.osisoft.com/services/IPITimeSeries/InsertPIData") @RequestWrapper(localName = "InsertPIData", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.InsertPIData") @ResponseWrapper(localName = "InsertPIDataResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.InsertPIDataResponse") public Future<?> insertPIDataAsync( @WebParam(name = "events", targetNamespace = "http://xml.osisoft.com/services/PIDataService") ArrayOfTimeSeries events, @WebParam(name = "duplicateSwitch", targetNamespace = "http://xml.osisoft.com/services/PIDataService") String duplicateSwitch, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<InsertPIDataResponse> asyncHandler);
/** * * @param asyncHandler * @return * returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "GetProductVersion", action = "http://xml.osisoft.com/services/IPITimeSeries/GetProductVersion") @RequestWrapper(localName = "GetProductVersion", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetProductVersion") @ResponseWrapper(localName = "GetProductVersionResponse", targetNamespace = "http://xml.osisoft.com/services/PIDataService", className = "com.osisoft.xml.services.pidataservice.GetProductVersionResponse") public Future<?> getProductVersionAsync( @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetProductVersionResponse> asyncHandler);
@ResponseWrapper(localName = "GetRelevanceResultResponse", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.GetRelevanceResultResponse") @RequestWrapper(localName = "GetRelevanceResult", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.GetRelevanceResult") @WebMethod(operationName = "GetRelevanceResult") public Future<?> getRelevanceResultAsync( @WebParam(name = "relevanceExpr", targetNamespace = "http://schemas.bigfix.com/Relevance") java.lang.String relevanceExpr, @WebParam(name = "username", targetNamespace = "http://schemas.bigfix.com/Relevance") java.lang.String username, @WebParam(name = "password", targetNamespace = "http://schemas.bigfix.com/Relevance") java.lang.String password, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<com.bigfix.schemas.relevance.GetRelevanceResultResponse> asyncHandler );
@ResponseWrapper(localName = "CreateUserResponse", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.CreateUserResponse") @RequestWrapper(localName = "CreateUser", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.CreateUser") @WebMethod(operationName = "CreateUser") public Future<?> createUserAsync( @WebParam(name = "user", targetNamespace = "http://schemas.bigfix.com/Relevance") com.bigfix.schemas.relevance.UserAccount user, @WebParam(name = "RequestHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) RequestHeader requestHeader, @WebParam(mode = WebParam.Mode.OUT, name = "ResponseHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) javax.xml.ws.Holder<ResponseHeader> responseHeader, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<com.bigfix.schemas.relevance.CreateUserResponse> asyncHandler );
@ResponseWrapper(localName = "DeleteSharedVariableResponse", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.DeleteSharedVariableResponse") @RequestWrapper(localName = "DeleteSharedVariable", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.DeleteSharedVariable") @WebMethod(operationName = "DeleteSharedVariable") public Future<?> deleteSharedVariableAsync( @WebParam(name = "dashboardVariableIdentifier", targetNamespace = "http://schemas.bigfix.com/Relevance") com.bigfix.schemas.relevance.DashboardVariableIdentifier dashboardVariableIdentifier, @WebParam(name = "RequestHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) RequestHeader requestHeader, @WebParam(mode = WebParam.Mode.OUT, name = "ResponseHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) javax.xml.ws.Holder<ResponseHeader> responseHeader, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<com.bigfix.schemas.relevance.DeleteSharedVariableResponse> asyncHandler );
/** * * @param asyncHandler * @param arg0 * @return returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "getResults") @RequestWrapper(localName = "getResults", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.GetResults") @ResponseWrapper(localName = "getResultsResponse", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.GetResultsResponse") public Future<?> getResultsAsync( @WebParam(name = "arg0", targetNamespace = "") int arg0, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<GetResultsResponse> asyncHandler);
/** * * @param asyncHandler * @param arg0 * @return returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "submitSequence") @RequestWrapper(localName = "submitSequence", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.SubmitSequence") @ResponseWrapper(localName = "submitSequenceResponse", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.SubmitSequenceResponse") public Future<?> submitSequenceAsync( @WebParam(name = "arg0", targetNamespace = "") String arg0, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<SubmitSequenceResponse> asyncHandler);
/** * * @param asyncHandler * @param arg0 * @return returns java.util.concurrent.Future<? extends java.lang.Object> */ @WebMethod(operationName = "isJobDone") @RequestWrapper(localName = "isJobDone", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.IsJobDone") @ResponseWrapper(localName = "isJobDoneResponse", targetNamespace = "http://ws.philius.yeastrc.org/", className = "org.yeastrc.www.philiusws.IsJobDoneResponse") public Future<?> isJobDoneAsync( @WebParam(name = "arg0", targetNamespace = "") int arg0, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<IsJobDoneResponse> asyncHandler);
@ResponseWrapper(localName = "StoreSharedVariableResponse", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.StoreSharedVariableResponse") @RequestWrapper(localName = "StoreSharedVariable", targetNamespace = "http://schemas.bigfix.com/Relevance", className = "com.bigfix.schemas.relevance.StoreSharedVariable") @WebMethod(operationName = "StoreSharedVariable") public Future<?> storeSharedVariableAsync( @WebParam(name = "dashboardVariableIdentifier", targetNamespace = "http://schemas.bigfix.com/Relevance") com.bigfix.schemas.relevance.DashboardVariableIdentifier dashboardVariableIdentifier, @WebParam(name = "variableValue", targetNamespace = "http://schemas.bigfix.com/Relevance") java.lang.String variableValue, @WebParam(name = "RequestHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) RequestHeader requestHeader, @WebParam(mode = WebParam.Mode.OUT, name = "ResponseHeaderElement", targetNamespace = "http://schemas.bigfix.com/Relevance", header = true) javax.xml.ws.Holder<ResponseHeader> responseHeader, @WebParam(name = "asyncHandler", targetNamespace = "") AsyncHandler<com.bigfix.schemas.relevance.StoreSharedVariableResponse> asyncHandler );
@Test @RunAsClient public void testInvokeAsyncHandler() throws Exception { AsyncHandler<String> handler = new AsyncHandler<String>() { @Override public void handleResponse(Response<String> response) { try { System.out.println("AsyncHandler.handleResponse() method called"); String retStr = response.get(5000, TimeUnit.MILLISECONDS); assertEquals("Hello", retStr); asyncHandlerProxyCalled = true; } catch (Exception ex) { handlerProxyException = ex; } } }; Endpoint port = createProxy(); Future<?> future = port.echoAsync("Hello", handler); long start = System.currentTimeMillis(); future.get(5000, TimeUnit.MILLISECONDS); long end = System.currentTimeMillis(); System.out.println("Time spent in future.get() was " + (end - start) + "milliseconds"); if (handlerProxyException != null) throw handlerProxyException; assertTrue("Async handler called", asyncHandlerProxyCalled); }
@Override public Future<?> downloadCampaignsByAccountIdsAsync(DownloadCampaignsByAccountIdsRequest parameters, AsyncHandler<DownloadCampaignsByAccountIdsResponse> asyncHandler) { onDownloadCampaignsByAccountIds.accept(parameters); Response response = new CompleteResponse(getDownloadCampaignsByAccountIdsResponse.get(), getInboundHeadersSupplier().get()); if (asyncHandler != null) { asyncHandler.handleResponse(response); } return response; }
@Override public Future<?> getBulkDownloadStatusAsync(GetBulkDownloadStatusRequest parameters, AsyncHandler<GetBulkDownloadStatusResponse> asyncHandler) { onGetBulkDownloadStatus.accept(parameters); Response response = new CompleteResponse(getBulkDownloadStatusResponse.get(), getInboundHeadersSupplier().get()); if (asyncHandler != null) { asyncHandler.handleResponse(response); } return response; }
Future<?> invoke(Object proxy, Object[] args) throws WebServiceException { // the spec requires the last argument final AsyncHandler handler = (AsyncHandler)args[handlerPos]; return doInvoke(proxy, args, handler); }
@Override public Future<?> heartbeatAsync(HeartbeatRequest parameters, String chargeBoxIdentity, AsyncHandler<HeartbeatResponse> asyncHandler) { return null; }
@Override public Future<?> startTransactionAsync(StartTransactionRequest parameters, String chargeBoxIdentity, AsyncHandler<StartTransactionResponse> asyncHandler) { return null; }
@Override public Future<?> stopTransactionAsync(StopTransactionRequest parameters, String chargeBoxIdentity, AsyncHandler<StopTransactionResponse> asyncHandler) { return null; }