Examples of ScriptusRuntimeException


Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

      compiled = cx.compileFunction(globalScope, "function ___scriptus___ () {"+source+"}", sourceName, 0, null);

    } catch (ScriptusRuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new ScriptusRuntimeException(e);
    } finally {
      Context.exit();
    }

  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException


  public String get(String url) {
   
    if(url == null) {
      throw new ScriptusRuntimeException("no arg presented for sleep");
    }
   
    URL u;
   
    try {
      u = new URL(url);
    } catch (MalformedURLException e) {
      throw new ScriptusRuntimeException(e);
    }
   
    if( ! "http".equals(u.getProtocol())  && ! "https".equals(u.getProtocol())) {
      throw new ScriptusRuntimeException("only http and https supported right now");
    }
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Get(u));
    throw pending;
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

      }
     
    }
   
    if(msg == null){
      throw new WrappedException(new ScriptusRuntimeException("invalid args to ask function, format: ask(question, [{who:who, timeout:duration}]"));
    }

    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Ask(msg, who, timeout, rnd.nextLong()));
    throw pending;
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

      LOG.info("script continuation, state obj=" + state.getClass());

      if (state instanceof ScriptAction) {
        return (ScriptAction) state;
      } else {
        throw new ScriptusRuntimeException("Continuation state not ScriptAction:" + state);
      }

    }

    state = result;
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

      }
     
    }
   
    if(msg == null){
      throw new WrappedException(new ScriptusRuntimeException("no message argument to say function"));
    }
   
    ContinuationPending pending = Context.getCurrentContext().captureContinuation();
    pending.setApplicationState(new Say(msg, who));
    throw pending;
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

       
        socialAuthConfig = SocialAuthConfig.getDefault();
        try{
            socialAuthConfig.load(socialAuthProps);
        } catch(Exception e)  {
            throw new ScriptusRuntimeException(e);
        }
       

    }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

     
      AuthProvider provider;
        try {
            provider = manager.connect(paramsMap);
        } catch (Exception e) {
            throw new ScriptusRuntimeException(e);
        }

        String tokenKey = provider.getAccessGrant().getKey();
        String tokenSecret = provider.getAccessGrant().getSecret();
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

            req.getSession().setAttribute(SOCIAL_AUTH_MANAGER, manager);

            resp.sendRedirect(url);
           
        } catch (Exception e) {
            throw new ScriptusRuntimeException(e);
        }
       
  }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

        }
        if(transport == TransportType.Dummy){
            return dummy.send(userId, to, msg);
        }
       
        throw new ScriptusRuntimeException("transport type not recognised "+transport);
       
    }
View Full Code Here

Examples of net.ex337.scriptus.exceptions.ScriptusRuntimeException

      Cipher cipher = Cipher.getInstance(cipherScheme);
      cipher.init(Cipher.ENCRYPT_MODE, key);
      byte[] result = cipher.doFinal(plaintext);
      return result;
    } catch (Exception e) {
      throw new ScriptusRuntimeException("Problem with cipher", e);
    }
  }
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.