Examples of ScriptusRuntimeException


Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    twitter = new TwitterFactory(cb.build()).getInstance();
    try {
            screenName = twitter.verifyCredentials().getScreenName();
        } catch (TwitterException e) {
            throw new ScriptusRuntimeException(e);
        }
    }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

//          t.
//        result.add(tt);
//      }
     
    } catch (TwitterException e) {
      throw new ScriptusRuntimeException(e);
    }
   
    return new ArrayList<Tweet>(result);
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

  @Override
  public long tweet(String txt) {
   
    if(txt.length() > 140) {
      throw new ScriptusRuntimeException("tweet > 140 characters: "+txt);
    }
   
    Status s;
    try {
      s = twitter.updateStatus(new StatusUpdate(txt));
    } catch (TwitterException e) {
      throw new ScriptusRuntimeException(e);
    }
    return s.getId();
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

  public long tweet(String txt) {
     
      statusUpdates.add(txt);
   
    if(txt.length() > 140) {
      throw new ScriptusRuntimeException("tweet > 140 characters: "+txt);
    }
   
    return ctr++;
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

            if (!processedIncomings.isEmpty()) {
                try {
                    datastore.updateTransportCursor(TransportType.Twitter, new String(SerializableUtils.serialiseObject(processedIncomings), ScriptusConfig.CHARSET));
                } catch (IOException e) {
                    throw new ScriptusRuntimeException(e);
                }
            }
           
        }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    }

    private byte[] getKey(String keyId) {
        byte[] key = keys.get(keyId);
        if (key == null) {
            throw new ScriptusRuntimeException("key with ID " + keyId + " not found");
        }
        return Arrays.copyOf(key, key.length);
    }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

       
        Properties r;
        try {
            r = getProperties();
        } catch (IOException e) {
            throw new ScriptusRuntimeException(e);
        }
       
        if(r != null){
            load(r);
        }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

    String source;
    try {
      source = IOUtils.toString(globalScope.getClass().getClassLoader().getResourceAsStream("wait.js"));
    } catch (IOException e) {
      throw new ScriptusRuntimeException(e);
    }

    Function getLastPid = new FunctionObject("_intern_getLastPid", this.getClass().getMethod("_intern_getLastPid"),
        globalScope);
    Function wait_intern = new FunctionObject("_intern_wait", this.getClass().getMethod("_intern_wait", String.class), globalScope);
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

            case 'M':  calUnit = Calendar.MONTH;        break;
            case 'q':  calUnit = Calendar.MONTH; dur *= 3;    break;
            case 'y':  calUnit = Calendar.YEAR;          break;
            case 'D':  calUnit = Calendar.YEAR; dur *= 10;    break; // decade
            case 'C':  calUnit = Calendar.YEAR;  dur *= 100;    break; // century :-D go long!
            default : throw new WrappedException(new ScriptusRuntimeException("unrecognised unit: "+unit));
          }
         
          until.add(calUnit, dur);
        }
      }
    }
   
    if( ! foundDate) {
      throw new WrappedException(new ScriptusRuntimeException("Could not recognise duration argument: "+o+" must either be integer >1, or match date format "+ScriptusConfig.DATE_FORMAT+" or duration format regexp "+ScriptusConfig.DURATION_FORMAT));
    }

    return until;
   
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

  }

  public Object sleep(Object untilArg) {
   
    if(untilArg == null) {
      throw new ScriptusRuntimeException("no arg presented for sleep");
    }
   
    Calendar until = getDuration(untilArg);
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.