当前位置: 首页>>代码示例>>Java>>正文


Java MethodCallback类代码示例

本文整理汇总了Java中org.fusesource.restygwt.client.MethodCallback的典型用法代码示例。如果您正苦于以下问题:Java MethodCallback类的具体用法?Java MethodCallback怎么用?Java MethodCallback使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MethodCallback类属于org.fusesource.restygwt.client包,在下文中一共展示了MethodCallback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeCallService

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Ignore
@Test
public void executeCallService() {
	doAnswer(invocationOnMock -> {
		logger.info(invocationOnMock.getMock().toString());

		((MethodCallback) invocationOnMock.getArguments()[0]).
				onSuccess(any(Method.class), anyObject());

		return null;
	}).when(abstractMethodCallback)
			.executeCallService(any(MethodCallback.class));

	abstractMethodCallback.executeCallService(any(MethodCallback.class));

	verify(abstractMethodCallback, times(1)).
			onSuccess(any(Method.class), anyObject());
}
 
开发者ID:interseroh,项目名称:demo-gwt-springboot,代码行数:19,代码来源:AbstractMethodCallbackTest.java

示例2: getEndereco

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
/**
 * Executa a consulta de endereço a partir de um CEP.
 * 
 * @param cep CEP da localidade onde se quer consultar o endereço. Precisa ter 8 dígitos - a formatação é feita pelo cliente.
 * CEPs válidos (que contém 8 dígitos): "20930-040", "abc0 1311000xy z", "20930 040". CEPs inválidos (que não contém 8 dígitos): "00000", "abc", "123456789"
 * 
 * @param callback O retorno da chamada ao webservice. Erros de validação de campos e de conexão são tratados no callback.
 */
public void getEndereco(String cep, MethodCallback<ViaCEPEndereco> callback){
	char[] chars = cep.toCharArray();
	
	StringBuilder builder = new StringBuilder();
	for (int i = 0; i< chars.length; i++){
		if (Character.isDigit(chars[i])){
			builder.append(chars[i]);
		}
	}
	cep = builder.toString();
	
	if (cep.length() != 8){
		callback.onFailure(null, new IllegalArgumentException("CEP inválido - deve conter 8 dígitos: " + cep));
		return;
	}
	
	ViaCEPGWTService service = getService();
	service.getEndereco(cep, callback);
}
 
开发者ID:gilberto-torrezan,项目名称:viacep,代码行数:28,代码来源:ViaCEPGWTClient.java

示例3: getEnderecos

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
/**
 * Executa a consulta de endereços a partir da UF, localidade e logradouro
 * 
 * @param uf Unidade Federativa. Precisa ter 2 caracteres.
 * @param localidade Localidade (p.e. município). Precisa ter ao menos 3 caracteres.
 * @param logradouro Logradouro (p.e. rua, avenida, estrada). Precisa ter ao menos 3 caracteres.
 * 
 * @param callback O retorno da chamada ao webservice. Erros de validação de campos e de conexão são tratados no callback.
 */
public void getEnderecos(String uf, String localidade, String logradouro, final MethodCallback<List<ViaCEPEndereco>> callback){
	if (uf == null || uf.length() != 2){
		callback.onFailure(null, new IllegalArgumentException("UF inválida - deve conter 2 caracteres: " + uf));
		return;
	}
	if (localidade == null || localidade.length() < 3){
		callback.onFailure(null, new IllegalArgumentException("Localidade inválida - deve conter pelo menos 3 caracteres: " + localidade));
		return;
	}
	if (logradouro == null || logradouro.length() < 3){
		callback.onFailure(null, new IllegalArgumentException("Logradouro inválido - deve conter pelo menos 3 caracteres: " + logradouro));
		return;
	}
	
	ViaCEPGWTService service = getService();
	service.getEnderecos(uf, localidade, logradouro, callback);
}
 
开发者ID:gilberto-torrezan,项目名称:viacep,代码行数:27,代码来源:ViaCEPGWTClient.java

示例4: onFailure

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Override
public void onFailure(Method method, Throwable exception) {
	fireResponseEvent(method);
	boolean caught = false;
	for (MethodCallback<T> methodCallback : callbackList) {
		try {
			methodCallback.onFailure(method, exception);
			caught = true;
		} catch (RuntimeException e) {
			// Exception not handled.
			continue;
		}
	}
	if (!caught) {
		GWT.reportUncaughtException(exception);
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:18,代码来源:CompositeMethodCallback.java

示例5: list

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@GET
public Request list(
	@QueryParam("type") Unit.Type type,
	@QueryParam("title") String title,
	@QueryParam("author") UUID authorId,
	@QueryParam("lecture") UUID lectureId,
	@QueryParam("count") Integer count,
	@QueryParam("offset") Integer offset,
	MethodCallback<List<Unit>> callback);
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:10,代码来源:UnitService.java

示例6: list

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@GET
public Request list(
	@QueryParam("title") String title,
	@QueryParam("author") UUID authorId,
	@QueryParam("course") UUID courseId,
	@QueryParam("count") Integer count,
	@QueryParam("offset") Integer offset,
	MethodCallback<List<Lecture>> callback);
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:9,代码来源:LectureService.java

示例7: list

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@GET
public Request list(
	@QueryParam("title") String title,
	@QueryParam("author") UUID authorId,
	@QueryParam("count") Integer count,
	@QueryParam("offset") Integer offset,
	MethodCallback<List<Course>> callback);
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:8,代码来源:CourseService.java

示例8: list

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@GET
public Request list(
	@QueryParam("name") String name,
	@QueryParam("email") String email,
	@QueryParam("count") Integer count,
	@QueryParam("offset") Integer offset,
	MethodCallback<List<User>> callback);
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:8,代码来源:UserService.java

示例9: getPersons

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Override
public void getPersons(Integer start, Integer length, MethodCallback<List<PersonDto>> callback) {
       logger.info("Mock getPersons...");

       List<PersonDto> personDtos = getPersonDtos();

       callback.onSuccess(null, personDtos);
   }
 
开发者ID:interseroh,项目名称:demo-gwt-springboot,代码行数:9,代码来源:MockPersonClient.java

示例10: filterPerson

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Override
public void filterPerson(String personName, Date fromDate, Date toDate, MethodCallback<List<PersonDto>> callback) {
       logger.info("Mock filterPerson...");

       List<PersonDto> personDtos = getPersonDtos();

       callback.onSuccess(null, personDtos);
   }
 
开发者ID:interseroh,项目名称:demo-gwt-springboot,代码行数:9,代码来源:MockPersonClient.java

示例11: filterPerson

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Override
@GET
@Path(DemoGwtServiceEndpoint.PERSON_FILTER)
void filterPerson(@QueryParam("nameSuggestBox") String personName,
				  @QueryParam("fromDateTimePicker") Date fromDate,
				  @QueryParam("untilDateTimePicker") Date toDate,
				  MethodCallback<List<PersonDto>> callback);
 
开发者ID:interseroh,项目名称:demo-gwt-springboot,代码行数:8,代码来源:RestPersonClient.java

示例12: onSuccess

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@Override
public void onSuccess(Method method, T response) {
	fireResponseEvent(method);
	for (MethodCallback<T> methodCallback : callbackList) {
		methodCallback.onSuccess(method, response);
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:8,代码来源:CompositeMethodCallback.java

示例13: load

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
/**
 * Get drawing
 *
 * @param dealId    deal id
 * @param drawingId drawing id
 * @param callback  callback
 */
@GET
@Path("/{userId}/{dealId}/{drawingId}")
@RequestId(LOAD_DRAWING) void load(
    @PathParam("userId") Long userId,
    @PathParam("dealId") Long dealId,
    @PathParam("drawingId") Long drawingId,
    MethodCallback<Drawing> callback);
 
开发者ID:Unisay,项目名称:preferanser,代码行数:15,代码来源:DrawingService.java

示例14: send

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@POST
@Path("somePath")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
void send(SomeRequest request,
          MethodCallback<SomeResponse> callback);
 
开发者ID:GwtDomino,项目名称:domino,代码行数:7,代码来源:AnnotatedClassWithRequestSender.java

示例15: send

import org.fusesource.restygwt.client.MethodCallback; //导入依赖的package包/类
@GET
@Path(PATH)
@Produces(MediaType.APPLICATION_JSON)
void send(@PathParam("id") @Attribute("id") SomeRequest id, @PathParam("code") @Attribute("code") SomeRequest code,
          MethodCallback<SomeResponse> callback);
 
开发者ID:GwtDomino,项目名称:domino,代码行数:6,代码来源:AnnotatedClassWithHandlerPathWithServiceRootSender.java


注:本文中的org.fusesource.restygwt.client.MethodCallback类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。