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


Java ExecutionContext类代码示例

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


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

示例1: exec

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public LoginResult exec(LoginAction in, ExecutionContext context) throws ActionException {

		final String login = in.getLogin();
		final String passwd = in.getPasswd();

		com.gbourquet.yaph.serveur.metier.generated.Account account = null;
		LoginService service = (LoginService) BeanFactory.getInstance().getService("loginService");
		try {
			account = service.login(login, passwd);
		} catch (ServiceException e) {
			throw new ActionException(e.getMessage());
		}

		session().setAttribute("account", account);
		String token = generateToken();
		session().setAttribute("token", token);
		return new LoginResult(account, token);

	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:20,代码来源:LoginHandler.java

示例2: exec

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public AllFieldResult exec(AllFieldAction in, ExecutionContext context) throws ActionException {

		final Account account = (Account) session().getAttribute("account");
		final PasswordCard password = in.getPassword();

		List<PasswordField> out;
		PasswordService service = (PasswordService) BeanFactory.getInstance().getService("passwordService");
		try {
			out = service.getFields(password,account);
		} catch (ServiceException e) {
			throw new ActionException(e.getMessage());
		}

		return new AllFieldResult(out);

	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:17,代码来源:AllFieldFromPasswordHandler.java

示例3: exec

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public SyncPasswordResult exec(SyncPasswordAction in, ExecutionContext context) throws ActionException {

		final List<PasswordCard> passwordToDelete = in.getPasswordsToDelete();
		final HashMap<PasswordCard, List<PasswordField>> dataToUpdate = in.getDataToUpdate();
		final Account account = in.getAccount();
		HashMap<PasswordCard, List<PasswordField>> outData;
		PasswordService service = (PasswordService) BeanFactory.getInstance().getService("passwordService");
		try {
			outData = service.sync(account,passwordToDelete, dataToUpdate);
		} catch (ServiceException e) {
			throw new ActionException(e.getMessage());
		}

		return new SyncPasswordResult(outData);

	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:17,代码来源:SyncPasswordHandler.java

示例4: execute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public final R execute(A action, ExecutionContext context) throws ActionException {
	// TODO : Gestion des droits
	// HttpSession session = session();
	// String token = (String) session.getAttribute("token");

	/*
	 * if (token != null && !token.equals(action.getToken())) throw new
	 * IllegalUserException();
	 */
	boolean present = true; // à modifier - tout le monde a tous les droits
							// pour le moment

	if (!present)
		throw new IllegalUserException();

	return exec(action, context);
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:18,代码来源:AbstractHandler.java

示例5: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected GenericActionResult doExecute(LangChangeAction action, ExecutionContext context)
    throws AuthenticationException,
    DispatchException {

    if (action.getCurrentState()) {
        moduleDao.removeLang(action.getLangId(), action.getModuleId());
    } else {
        SessionScopedAuthStat stat = authProv.get();
        Long userId;
        synchronized (stat) {
            userId = stat.getUserId();
        }

        moduleDao.addLang(action.getLangId(), action.getModuleId(), userId);
    }

    return new GenericActionResult();
}
 
开发者ID:inepex,项目名称:ineform,代码行数:20,代码来源:LangChangeActionHandler.java

示例6: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected CaptchaInfoResult doExecute(CaptchaInfoAction action, ExecutionContext context)
    throws AuthenticationException,
    DispatchException {

    switch (action.getType()) {
        case 0:
            LoginCaptchaInfo loginInfo = loginCaptchaInfoProvider.get();
            synchronized (loginInfo) {
                return new CaptchaInfoResult(loginInfo.needCaptcha());
            }
        case 1:
            RegistrationCaptchaInfo regInfo = regCaptchaInfoProvider.get();
            synchronized (regInfo) {
                return new CaptchaInfoResult(regInfo.needCaptcha());

            }
        default:
            return new CaptchaInfoResult(false);
    }

}
 
开发者ID:inepex,项目名称:ineform,代码行数:23,代码来源:CaptchaInfoHandler.java

示例7: execute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
public AddUserResult execute(AddUserAction action, ExecutionContext context)
		throws DispatchException {
	LOGGER.debug(">>AddUserActionHandler.execute");

	// add an user
	ClassroomUser user = new ClassroomUser();
	user.setUserName(action.getUserName());
	user.setPic(action.getPic());
	userService.createUser(user);

	// get all users by executing another action or by the user service
	GetAllUsersResult allUsersRlt = context
			.execute(new GetAllUsersAction());
	AddUserResult rlt = new AddUserResult();
	rlt.getAllUsers().addAll(allUsersRlt.getAllUsers());

	return rlt;
}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:20,代码来源:AddUserActionHandler.java

示例8: execute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
public ListUploadsResult execute(ListUploadsAction action,
		ExecutionContext context) throws DispatchException {
	LOGGER.debug(">>ListUploadsActionHandler.execute");

	// get all uploads
	ListUploadsResult rlt = new ListUploadsResult();
	String catalinaBase = System.getenv(IConstants.ENV_CATALINA_BASE);
	if (catalinaBase == null || catalinaBase.trim().length() == 0) {
		LOGGER.error("{} is not set properly", IConstants.ENV_CATALINA_BASE);
		throw new ActionException("CATALINA_BASE is not set properly");
	}

	File f = new File(catalinaBase + IConstants.UPLOADS_FOLDER);
	LOGGER.info("list all files from=" + f.getAbsolutePath());
	for (String strName : f.list()) {
		UploadItem item = new UploadItem();
		item.setFilename(strName);
		rlt.getAllItems().add(item);
	}

	return rlt;
}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:24,代码来源:ListUploadsActionHandler.java

示例9: execute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
public AddUserResult execute(AddUserAction action, ExecutionContext context)
    throws DispatchException {
  LOGGER.debug(">>AddUserActionHandler.execute");

  // add an user
  HappyUser user = new HappyUser();
  user.setUserName(action.getUserName());
  user.setPic(action.getPic());
  userService.createUser(user);

  // get all users by executing another action or by the user service
  GetAllUsersResult allUsersRlt = context.execute(new GetAllUsersAction());
  AddUserResult rlt = new AddUserResult();
  rlt.getAllUsers().addAll(allUsersRlt.getAllUsers());

  return rlt;
}
 
开发者ID:jlSites,项目名称:funWithGwt,代码行数:19,代码来源:AddUserActionHandler.java

示例10: exec

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public AllPasswordResult exec(AllPasswordAction in, ExecutionContext context) throws ActionException {

		final Account account = in.getAccount();

		HashMap<PasswordCard, List<PasswordField>> outData = null;
		PasswordService service = (PasswordService) BeanFactory.getInstance().getService("passwordService");
		try {
			outData = service.getPasswords(account);
		} catch (ServiceException e) {
			throw new ActionException(e.getMessage());
		}
		
		return new AllPasswordResult(outData);

	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:16,代码来源:AllPasswordFromAccountHandler.java

示例11: exec

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
public DeletePasswordResult exec(DeletePasswordAction in, ExecutionContext context) throws ActionException {

		final Account account = (Account) session().getAttribute("account");
		final PasswordCard password = in.getPasswordCard();

		PasswordService service = (PasswordService) BeanFactory.getInstance().getService("passwordService");
		try {
			service.delete(password,account);
		} catch (ServiceException e) {
			throw new ActionException(e.getMessage());
		}

		return new DeletePasswordResult();

	}
 
开发者ID:guiguib,项目名称:yaph,代码行数:16,代码来源:DeletePasswordHandler.java

示例12: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected ObjectManipulationActionResult doExecute(RegAction action, ExecutionContext context)
    throws AuthenticationException,
    DispatchException {
    if (action == null || action.getRegKvo() == null)
        return createFailResult("Invalid action!");

    ObjectManipulationActionResult res = checkRegistrationReq(action.getRegKvo());
    if (res != null)
        return res;

    return doRegistration(action.getRegKvo());
}
 
开发者ID:inepex,项目名称:ineform,代码行数:14,代码来源:RegActionHandler.java

示例13: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected TestLangChangeResult doExecute(TestLangChangeAction action, ExecutionContext context)
    throws AuthenticationException,
    DispatchException {

    Object[] nums = dao.countForLangAndModule(action.getLangId(), action.getModuleId());

    TestLangChangeResult res = new TestLangChangeResult();
    res.setWillBeDeletedWithEmpty(nums[0] == null ? 0 : ((Number) nums[0]).longValue());
    res.setWillBeDeletedWithText(nums[1] == null ? 0 : ((Number) nums[1]).longValue());
    return res;
}
 
开发者ID:inepex,项目名称:ineform,代码行数:13,代码来源:TestLangChangeActionHandler.java

示例14: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected PingResult doExecute(PingAction action, ExecutionContext context)
    throws AuthenticationException,
    DispatchException {
    SessionScopedAuthStat authStat = authStatProvider.get();
    PingResult pingResult = new PingResult();
    synchronized (authStat) {
        AuthStatusResultBase result = authStat.getAuthStatusResultBase();
        pingResult.setSessionAlive(result != null && result.getUserId() != null);
    }
    return pingResult;
}
 
开发者ID:inepex,项目名称:ineform,代码行数:13,代码来源:PingActionHandler.java

示例15: doExecute

import net.customware.gwt.dispatch.server.ExecutionContext; //导入依赖的package包/类
@Override
protected
    GetTimeZoneNamesResult
    doExecute(GetTimeZoneNamesAction action, ExecutionContext context)
        throws AuthenticationException,
        DispatchException {
    return new GetTimeZoneNamesResult(TimeZoneEnum.getValueRange());
}
 
开发者ID:inepex,项目名称:ineform,代码行数:9,代码来源:GetTimeZoneNamesHandler.java


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