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


Java ServiceException类代码示例

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


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

示例1: show

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public void show(Attendee attendee) {
    attendeeBean = new BeanItem<>(attendee);
    fieldGroup.setItemDataSource(attendeeBean);
    if (attendee.getPaidAmount() == null) {
        try {
            paidAmount.setValue(attendee.getBadge().getCostForAge(attendee.getAge()).toString());
        } catch(ServiceException e) {
            Notification.show(e.getMessage());
        }
    }
    badge.select(attendee.getBadge());
    setMinorFieldsEnabled(attendee.isMinor());
    checkedIn.setVisible(attendee.getCheckedIn()); // Hide checked in checkbox if attendee is not checked in
    parentFormReceived.setVisible(attendee.getCheckedIn()); // Hide parentFormReceived if attendee is not checked in
    badgeNumber.setEnabled(false);
    showHistory(attendee.getHistory());
    firstName.focus();
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:19,代码来源:AttendeeDetailForm.java

示例2: generateYouthAttendee

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public Attendee generateYouthAttendee(Badge badge) {
    Attendee attendee = generateDemoAttendee(badge);
    attendee.setFirstName("Firstname");
    attendee.setFanName("Fan Name");
    attendee.setBadgeNumber("TST12341");
    attendee.setBirthDate(LocalDate.now().minusYears(13L));
    attendee.setParentFullName(attendee.getEmergencyContactFullName());
    attendee.setParentPhone(attendee.getEmergencyContactPhone());
    attendee.setParentIsEmergencyContact(true);
    try {
        attendee.setPaidAmount(attendee.getBadge().getCostForAge(attendee.getAge()));
    } catch (ServiceException e) {
        log.error(e.getMessage(), e);
    }

    return attendee;
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:18,代码来源:AttendeeFactory.java

示例3: createRequestHandlers

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected List<RequestHandler> createRequestHandlers()
    throws ServiceException {
    List<RequestHandler> handlers = super.createRequestHandlers();
    handlers.add(0, new ServletBootstrapHandler());
    handlers.add(new ServletUIInitHandler());
    if (isAtmosphereAvailable()) {
        handlers.add((RequestHandler) (session, request, response) -> {
            if (!ServletPortletHelper.isPushRequest(request)) {
                return false;
            }
            if (request instanceof VertxVaadinRequest) {
                ((VertxVaadinRequest) request).getRoutingContext().next();
            }
            return true;
        });
    }
    return handlers;
}
 
开发者ID:mcollovati,项目名称:vaadin-vertx-samples,代码行数:20,代码来源:VertxVaadinService.java

示例4: servletInitialized

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
	super.servletInitialized();
	getService().addSessionInitListener(new SessionInitListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -8279023207169735541L;

		@Override
		public void sessionInit(SessionInitEvent event)
				throws ServiceException {
			event.getSession().addUIProvider(uiProvider);

		}
	});
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:19,代码来源:CustomVaadinServlet.java

示例5: portletInitialized

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected void portletInitialized() throws PortletException {
    getService().addSessionInitListener(new SessionInitListener() {
        private static final long serialVersionUID = -4571879262155039969L;

        @Override
        public void sessionInit(SessionInitEvent event) throws ServiceException {
            try {
                ApplicationContext context = PortletApplicationContextUtils
                        .getRequiredWebApplicationContext(getPortletContext());
                SpringAwareUIProvider uiProvider = new SpringAwareUIProvider(context);
                event.getSession().addUIProvider(uiProvider);
            } catch (IllegalStateException e) {
                throw new ServiceException(e);
            }
        }
    });
}
 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:19,代码来源:SpringAwareVaadinPortlet.java

示例6: TestSpringVaadinServletService

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public TestSpringVaadinServletService(VaadinServlet servlet, WebApplicationContext applicationContext)
		throws ServiceException {
	super(servlet, new DefaultDeploymentConfiguration(TestSpringVaadinServletService.class, new Properties()),
			"");
	this.appContext = applicationContext;
	init();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:8,代码来源:AbstractVaadinSpringTest.java

示例7: createServletService

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration)
		throws ServiceException {
	JMeterService service = new JMeterService(this, deploymentConfiguration);
	service.init();
	return service;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:8,代码来源:AppServletJMeter.java

示例8: createServletService

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration)
        throws ServiceException {
    VaadinServletService servletService = super.createServletService(deploymentConfiguration);
    servletService.addSessionInitListener(e -> e.getSession().addUIProvider(this.uiProvider));
    servletService.addSessionInitListener(e -> sessions.add(e.getSession()));
    servletService.addSessionDestroyListener(e -> sessions.remove(e.getSession()));
    return servletService;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:10,代码来源:UiServlet.java

示例9: servletInitialized

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
	super.servletInitialized();

          HeaderTagHandler.init(getService());
	
	getService().addSessionInitListener(new SessionInitListener() {

		@Override
		public void sessionInit(SessionInitEvent event) throws ServiceException {
			event.getSession().addRequestHandler(new RequestHandler() {

				@Override
				public boolean handleRequest(VaadinSession session, VaadinRequest request,
						VaadinResponse response) throws IOException {

					String pathInfo = request.getPathInfo();
					InputStream in = null;

					if (pathInfo.endsWith("sw.js")) {
						response.setContentType("application/javascript");
						in = getClass().getResourceAsStream("/sw.js");
					}

					if (in != null) {
						OutputStream out = response.getOutputStream();
						IOUtils.copy(in, out);
						in.close();
						out.close();

						return true;
					} else {

						return false;
					}
				}
			});
		}
	});
}
 
开发者ID:amahdy,项目名称:java-pwa,代码行数:41,代码来源:MyUI.java

示例10: showBadges

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public void showBadges(List<Badge> badges) {
    for (Badge badge : badges) {
        try {
            passTypesTable.addRow(badge.getName(),
                    badge.getCostForAge(35L),
                    badge.getCostForAge(17L),
                    badge.getCostForAge(11L),
                    badge.getCostForAge(4L));
        } catch (ServiceException e) {
            notifyError("Error getting age ranges for badge " + badge.getName());
        }
    }
    passTypesTable.setHeightByRows(badges.size());
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:15,代码来源:HomeView.java

示例11: generateDemoAttendee

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public Attendee generateDemoAttendee(Badge badge) {
    Attendee attendee = new Attendee();
    attendee.setFirstName("Firstname");
    attendee.setLastName("Lastname");
    attendee.setFanName("Fan Name");
    attendee.setBadgeNumber("TST12340");
    attendee.setBadge(badge);
    attendee.setCountry("United States of America");
    attendee.setZip("97201");
    attendee.setPhoneNumber("123-123-1234");
    attendee.setCheckedIn(true);
    attendee.setEmergencyContactFullName("Mom");
    attendee.setEmergencyContactPhone("321-321-4321");
    attendee.setBirthDate(LocalDate.now().minusYears(30L));
    attendee.setPaid(true);
    attendee.setStaffDepartment("Membership");
    List<String> positions = new ArrayList<>();
    positions.addAll(Arrays.asList("Position 1", "Position 2", "Position 3"));
    attendee.setStaffPositions(positions);
    attendee.setStaffDepartmentColor("#FFDDDD");
    try {
        attendee.setPaidAmount(attendee.getBadge().getCostForAge(attendee.getAge()));
    } catch (ServiceException e) {
        log.error(e.getMessage(), e);
    }
    return attendee;
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:28,代码来源:AttendeeFactory.java

示例12: generateChildAttendee

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public Attendee generateChildAttendee(Badge badge) {
    Attendee attendee = generateDemoAttendee(badge);
    attendee.setFirstName("Firstname");
    attendee.setFanName("Fan Name");
    attendee.setBirthDate(LocalDate.now().minusYears(7L));
    attendee.setBadgeNumber("TST12342");
    try {
        attendee.setPaidAmount(attendee.getBadge().getCostForAge(attendee.getAge()));
    } catch (ServiceException e) {
        log.error(e.getMessage(), e);
    }
    return attendee;
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:14,代码来源:AttendeeFactory.java

示例13: getCostForAge

import com.vaadin.server.ServiceException; //导入依赖的package包/类
public BigDecimal getCostForAge(Long age) throws ServiceException {
    // No birthdate? Charge for adult badge
    if (age == null) { return getCostForAge(40L); }
    for (AgeRange ageRange : ageRanges) {
        if (ageRange.isValidForAge(age)) {
            return ageRange.getCost();
        }
    }
    throw new ServiceException("Error: No valid age range found in badge {} for age {}".format(this.name, age));
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:11,代码来源:Badge.java

示例14: servletInitialized

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected void servletInitialized() throws ServletException {
    super.servletInitialized();
    getService().addSessionInitListener(new SessionInitListener() {

        @Override
        public void sessionInit(SessionInitEvent event)
                throws ServiceException {
            event.getSession().addBootstrapListener(bootstrapListener);
        }
    });
}
 
开发者ID:tehapo,项目名称:webcam,代码行数:13,代码来源:GifBoothServlet.java

示例15: createServletService

import com.vaadin.server.ServiceException; //导入依赖的package包/类
@Override
protected VaadinServletService createServletService(DeploymentConfiguration deploymentConfiguration) throws ServiceException {
    VaadinServletService servletService = super.createServletService(deploymentConfiguration);
    servletService.addSessionInitListener(new SessionInitListener() {
        @Override
        public void sessionInit(SessionInitEvent sessionInitEvent) throws ServiceException {
            sessionInitEvent.getSession().addUIProvider(provider);
        }
    });
    return servletService;
}
 
开发者ID:peergreen,项目名称:vaadin-osgi,代码行数:12,代码来源:BaseVaadinServlet.java


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