Package com.ibm.commons.runtime

Examples of com.ibm.commons.runtime.Context


    String requestUrl = null;
    String authorizeUrl = null;
    String accessUrl = null;
    boolean shortKey = false;
    boolean shortSecret = false;
    Context context = Context.get();
    //    if (oaProvider != null) {
    callback = getCallbackUrl(context);
    secret = getConsumerSecret();
    if (StringUtil.isNotEmpty(secret)) {
      int pre = 0;
View Full Code Here


        proxyConfig.putJsonProperty("loadCssFiles", ctClient.isLoadCSS());
        return proxyConfig;
    }
   
    protected String getProxyUrl(FacesContext context, UISbtClient ctClient, Endpoint ctServer, String endpointName) {
       Context ctx = Context.getUnchecked();
         return ProxyEndpointService.getProxyUrlForEndpoint(ctx, ConnectionsProxyHandler.URL_PATH,endpointName, null);
    }
View Full Code Here

                logger.info(StringUtil.format(
                        "JavaMail Session not bound in context at {0}, creating one from MailSessionFactory",
                        EnvironmentConfig.INSTANCE.getSbtSessionResource()));
            }
            if (session == null) {
                Context appCtx = Context.get();
                Object obj = appCtx.getBean(EnvironmentConfig.INSTANCE
                        .getSbtSessionFactoryResource());
                if (!(obj instanceof MailSessionFactory)) {
                    throw new MimeEmailException(
                            "Could not get valid Session object.");
                }
View Full Code Here

     
    return (RootNode)imp.readAssets(new RootNode(), null);
  }
 
  private static String[] getRuntimes(HttpServletRequest request){
      Context context = Context.get();
      String environment = "defaultEnvironment";
      if(request.getParameter("env") != null){
          environment = request.getParameter("env");
      }
      else if (context.getProperty("environment") != null){
          environment = context.getProperty("environment");
      }
      Object obj = context.getBean(environment);
      if(obj != null){
          SBTEnvironment bean = (SBTEnvironment) obj;
          return bean.getRuntimesArray();
      }
      else {
View Full Code Here

                            String url = null;
                            if (args.size() >= 3) {
                                url = args.get(2).stringValue();
                            }
                            //TODO Padraic - shoudl this be facesContext?
                            Context ctx = Context.getUnchecked();

//                            String proxiedUrl = ProxyEndpointService.getProxyUrlForEndpoint(FacesContext.getCurrentInstance(), proxyName, endpoint, url);
                            String proxiedUrl = ProxyEndpointService.getProxyUrlForEndpoint(ctx, proxyName, endpoint, url);
                           
                           
View Full Code Here

   * @return
   */
  @Override
  public SBTEnvironment getEnvironment(String name) {
    // Find the bean
    Context ctx = Context.getUnchecked();
    if(ctx!=null) {
      return (SBTEnvironment)ctx.getBean(name);
    }
    return null;
  }
View Full Code Here

  }

  @Override
  public JSReference getAuthenticator(String endpointName, String sbtUrl) {
    Context ctx = Context.get();
    JSReference reference = new JSReference("sbt/authenticator/OAuth");
    StringBuilder b = new StringBuilder();
    RuntimeConstants.get().appendBaseProxyUrl(b, ctx);
    b.append("/");
    b.append(OAClientAuthentication.URL_PATH);
    b.append('/');
    b.append(endpointName);
    String url = b.toString();
    reference.getProperties().put("url", url);
    reference.getProperties().put("loginUi", ctx.getProperty("loginUi"));
    return reference;
  }
View Full Code Here

     
    return (RootNode)imp.readAssets(new RootNode(), null);
  }
 
  private static String[] getRuntimes(HttpServletRequest request){
      Context context = Context.get();
      String environment = "defaultEnvironment";
      if(request.getParameter("env") != null){
          environment = request.getParameter("env");
      }
      else if (context.getProperty("environment") != null){
          environment = context.getProperty("environment");
      }
      Object obj = context.getBean(environment);
      if(obj != null){
          SBTEnvironment bean = (SBTEnvironment) obj;
          return bean.getRuntimesArray();
      }
      else {
View Full Code Here

   */
  protected String getHttpProxy() throws ClientServicesException {
    if (endpoint != null) {
      String proxyinfo = endpoint.getHttpProxy();
      if (StringUtil.isEmpty(proxyinfo)) {
        Context context = Context.getUnchecked();
          if (context != null) {
          proxyinfo = Context.get().getProperty("sbt.httpProxy");
          }
      }
      return proxyinfo;
View Full Code Here

      String cls = getClientServiceClass();
      if(StringUtil.isNotEmpty(cls)) {
        try {
          ClientService clientService = null;
          // order of precedence for the classloader to use
          Context ctx = Context.getUnchecked();
          Application app = Application.getUnchecked();
          ClassLoader cl = Thread.currentThread().getContextClassLoader();
          if (ctx!=null) {
            clientService = (ClientService)ctx.getClassLoader().loadClass(cls).newInstance();
          } else if(app!=null) {
            clientService = (ClientService)app.getClassLoader().loadClass(cls).newInstance();
          } else if(cl!=null) {
            clientService = (ClientService)cl.loadClass(cls).newInstance();
          } else {
View Full Code Here

TOP

Related Classes of com.ibm.commons.runtime.Context

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.