Package com.ibm.commons.runtime

Examples of com.ibm.commons.runtime.Context


        Application.destroy(application);
  }

  @Override
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
      Context ctx = Context.init(application,request,response);
      try {
        chain.doFilter(request, response);
      } finally {
        Context.destroy(ctx);
      }
View Full Code Here


        if(StringUtil.isEmpty(name)) {
            throw new SBTException(null,"The name of the endpoint is empty");
        }
       
        // Look for a property defining the bean associated to this server
        Context context = Context.get();
        String beanName = context.getProperty(SERVERPROP_PREFIX+name, null);
        if(StringUtil.isEmpty(beanName)) {
            beanName = SERVERBEAN_PREFIX+name;
        }
           
        // Look for a bean and/or class
        Object o = context.getBean(beanName);
        if(o!=null) {
            if(!(o instanceof Endpoint)) {
                throw new SBTException(null,"Invalid ServerBean implementation for bean {0} is instance of {1}",beanName,o.getClass());
            }
            else{
View Full Code Here

        }
        return null;
    }
   
    public static String getEndpointName(String name) {
        Context context = Context.get();
        String beanName = context.getProperty(SERVERPROP_PREFIX+name, null);
        if(StringUtil.isEmpty(beanName)) {
            beanName = SERVERBEAN_PREFIX+name;
            return beanName;
        }
        return beanName;
View Full Code Here

        }
        return null;
    }
   
    public static Endpoint getEndpointFromEnvironment(String endpointName, String environment){
      Context context = Context.getUnchecked();
      if (context == null) {
        return null;
      }
        if (environment == null ){
          environment = context.getProperty("environment");
        }
        if(environment != null) {
            SBTEnvironment env = (SBTEnvironment) context.getBean(environment);
            SBTEnvironment.Endpoint[] endpointsArray = env.getEndpointsArray();
            for(SBTEnvironment.Endpoint endpoint : endpointsArray){
                if(StringUtil.equals(endpointName, endpoint.getAlias())){
                    endpointName = endpoint.getName();
                    break;
View Full Code Here

    if (context == null) {
      RuntimeFactory runtimeFactory = new RuntimeFactoryStandalone() {
        @Override
        public Context initContext(Application application,
            Object request, Object response) {
          Context context = super.initContext(application, request,
              response);
          TestEnvironmentFactory.getEnvironment().decorateContext(
              context);
          return context;
        }
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.