Package org.megatome.frame2.event

Examples of org.megatome.frame2.event.Event


  public void run() {
   
    // Writes 100 events
    for (int i=1; i<100; i++) {
      // Creates and initializes the Event objects
      Event event=new Event();
      event.setDate(new Date());
      event.setEvent(String.format("The thread %s has generated an event",Thread.currentThread().getId()));
     
      // Add to the data structure
      deque.addFirst(event);
      try {
        // Sleeps during one second
View Full Code Here


      return;
    }
   
    delete=false;
    do {
      Event e = deque.getLast();
      difference = date.getTime() - e.getDate().getTime();
      if (difference > 10000) {
        System.out.printf("Cleaner: %s\n",e.getEvent());
        deque.removeLast();
        delete=true;
     
    } while (difference > 10000);
    if (delete){
View Full Code Here

  logger.warning(message);
  display.bell(-50);
    }

    private void readAndDispatchEvent() {
  Event firstEvent = null;
  try {
      firstEvent = display.next_event();
  } catch (Exception e) {
      // We may get an exception at this point if the XS server goes
      // away. Just ignore it and exit the window manager.
View Full Code Here

        List<FileItem> fileItems = null;
        try {
            fileItems = upload.parseRequest(request);
        } catch (FileUploadException fue) {
            LOGGER.severe("File Upload Error", fue); //$NON-NLS-1$
            throw new Frame2Exception("File Upload Exception", fue); //$NON-NLS-1$
        }

        for (FileItem fi : fileItems) {
            String fieldName = fi.getFieldName();
View Full Code Here

        try {
            String eventName = getEventName(this.request.getServletPath());
            Event event = getEvent();

            if (this.requestParams == null) {
                Frame2Exception e = null;
                if (this.fileUploadException != null) {
                    e = new Frame2Exception(this.fileUploadException);
                    this.fileUploadException = null;
                } else {
                    e = new Frame2Exception(
                            "File Upload Error: There was an error parsing file upload parameters."); //$NON-NLS-1$
                }
                throw e;
            }
View Full Code Here

        if (isMultipartRequest(rq)) {

            try {
                Class.forName("org.apache.commons.fileupload.DiskFileUpload"); //$NON-NLS-1$
            } catch (ClassNotFoundException e) {
                this.fileUploadException = new Frame2Exception(
                        "The Commons FileUpload library is missing." //$NON-NLS-1$
                                + " It is required to process file uploads."); //$NON-NLS-1$
                LOGGER.severe("File Upload Error", this.fileUploadException); //$NON-NLS-1$
                return null;
            }
View Full Code Here

                throw new ParserException("Error finding config file "); //$NON-NLS-1$
            }

            reader.parse(this.is);
        } catch (ParserException e) {
            throw new Frame2Exception("Unable to load configuration", e); //$NON-NLS-1$
        }
    }
View Full Code Here

    Arg arg = field.getArg(0);
    String validatorKey = va.getMsg();
    if (arg != null) {
      String fieldMsgKey = arg.getKey();
      if (fieldMsgKey != null) {
        Error fieldMsg = ErrorFactory.createError(fieldMsgKey);
        Error validateError = ErrorFactory.createError(validatorKey,
            fieldMsg, validatorErrorValue1, validatorErrorValue2);
        errors.add(validateError);
      }
    }
  }
View Full Code Here

    String value2 = ValidatorUtils.getValueAsString(bean, sProperty2);
    if (!GenericValidator.isBlankOrNull(value)) {
      try {
        if (!value.equals(value2)) {
          Arg arg = field.getArg(1);
          Error fieldMsg = null;
          if (arg != null) {
            String fieldMsgKey = arg.getKey();
            if (fieldMsgKey != null) {
              fieldMsg = ErrorFactory.createError(fieldMsgKey);
            }
View Full Code Here

     * @param value2 Second value to insert into message
     * @param value3 Third value to insert into message
     */
    public Error add(final String key, final Object value1,
            final Object value2, final Object value3) {
        Error e = ErrorFactory.createError(key, value1, value2, value3);
        add(e);
        return e;
    }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.event.Event

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.