Creates and seriazlies a IpcConnectionContextProto (not delimited)
341204
def create_connection_context(self):
        ''''''
        context = IpcConnectionContextProto()
        context.userInfo.effectiveUser = self.effective_user
        context.protocol = "org.apache.hadoop.hdfs.protocol.ClientProtocol"

        s_context = context.SerializeToString()
        log_protobuf_message("RequestContext (len: %d)" % len(s_context), context)
        return s_context
335968
public final static PipeConnectionEvent build(AbstractPipe source, EventType type, IProvider provider, Map<String, Object> paramMap) {
        return new PipeConnectionEvent(source, type, provider, paramMap);
    }
236635
JmsConnectionImpl instantiateConnection(JmsJcaConnection jcaConnection, Map _passThruProps) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateConnection", jcaConnection);
    JmsTopicConnectionImpl jmsTopicConnection = new JmsTopicConnectionImpl(jcaConnection, isManaged(), _passThruProps);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "instantiateConnection",  jmsTopicConnection);
    return jmsTopicConnection;
  }
825037
public void create()
          throws SIConnectionUnavailableException, SIConnectionDroppedException, SIErrorException
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "create");

      CommsByteBuffer request = getCommsByteBuffer();
      request.putShort(getConnectionObjectID());

      CommsByteBuffer reply = null;

      try
      {
         // Pass on call to server
         reply = jfapExchange(request,
                              JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT,
                              JFapChannelConstants.PRIORITY_HIGH,
                              true);

         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SIConnectionUnavailableException(reply, err);
            checkFor_SIConnectionDroppedException(reply, err);
            checkFor_SIConnectionLostException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }

         short ocId = reply.getShort();
         if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Created the order proxy. ID: " + ocId);

         // Now save the id
         setProxyID(ocId);
      }
      catch (SIConnectionLostException e)
      {
         // No FFDC Code needed
         // Temporarily re-throw as dropped
         throw new SIConnectionDroppedException("", e);
      }
      finally
      {
         if (reply != null) reply.release();
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "create");
   }
1029543
function createConnectionObject(context) {
  const { req } = context.bindings;
  const xForwardedFor = req.headers ? req.headers["x-forwarded-for"] : undefined;

  return {
    encrypted     : req.originalUrl && req.originalUrl.toLowerCase().startsWith("https"),
    remoteAddress : removePortFromAddress(xForwardedFor)
  };
}
516323
@FFDCIgnore(NamingException.class)
    public TimedDirContext createDirContext(String principal, byte[] credential) throws NamingException {
        final String METHODNAME = "createDirContext(String, byte[])";

        String activeURL = getActiveURL();
        Hashtable<String, Object> environment = getEnvironment(URLTYPE_SINGLE, activeURL);
        environment.put(Context.SECURITY_PRINCIPAL, principal);
        environment.put(Context.SECURITY_CREDENTIALS, credential);

        SSLUtilImpl sslUtil = new SSLUtilImpl();
        Properties currentSSLProps = sslUtil.getSSLPropertiesOnThread();
        try {
            if (iSSLAlias != null) {
                try {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, METHODNAME + " Use WAS SSL Configuration.");
                    sslUtil.setSSLAlias(iSSLAlias, environment);
                } catch (Exception ssle) {
                    throw new NamingException(ssle.getMessage());
                }
            }

            // Set the classloader so that a class in the package can be loaded by JNDI
            ClassLoader origCL = getContextClassLoader();
            setContextClassLoader(getClass());
            try {
                TimedDirContext ctx = null;
                try {
                    ctx = new TimedDirContext(environment, getConnectionRequestControls(), roundToSeconds(System.currentTimeMillis()));
                } catch (NamingException e) {
                    if (!isConnectionException(e)) {
                        throw e;
                    } else {
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, "Encountered an exception while creating a context: " + e.getMessage());
                    }

                    // Get the Next URL
                    environment = getEnvironment(URLTYPE_SEQUENCE, getNextURL(activeURL));
                    // Reset the security credentials on the environment.
                    environment.put(Context.SECURITY_PRINCIPAL, principal);
                    environment.put(Context.SECURITY_CREDENTIALS, credential);

                    ctx = new TimedDirContext(environment, getConnectionRequestControls(), roundToSeconds(System.currentTimeMillis()));
                    String newURL = getProviderURL(ctx);
                    long creationTimeMillisec = System.currentTimeMillis();

                    synchronized (iLock) {
                        // Refresh context pool if another thread hasn't already done so
                        if (creationTimeMillisec > iPoolCreateTimestampMillisec) {
                            createContextPool(iLiveContexts, newURL);
                            ctx.setCreateTimestamp(iPoolCreateTimestampSeconds);
                        }
                    }
                }
                return ctx;
            } finally {
                setContextClassLoader(origCL);
            }
        } finally {
            sslUtil.setSSLPropertiesOnThread(currentSSLProps);
        }
    }
723084
function createPlatformFactory(parentPlaformFactory, name, providers) {
	        if (providers === void 0) { providers = []; }
	        var marker = new OpaqueToken("Platform: " + name);
	        return function (extraProviders) {
	            if (extraProviders === void 0) { extraProviders = []; }
	            if (!getPlatform()) {
	                if (parentPlaformFactory) {
	                    parentPlaformFactory(providers.concat(extraProviders).concat({ provide: marker, useValue: true }));
	                }
	                else {
	                    createPlatform(ReflectiveInjector.resolveAndCreate(providers.concat(extraProviders).concat({ provide: marker, useValue: true })));
	                }
	            }
	            return assertPlatform(marker);
	        };
	    }
391693
@SuppressWarnings("unchecked")
    public static <T> ThreadLocalProxy<T> createThreadLocalProxy(Class<T> type) {
        ThreadLocalProxy<?> proxy = null;
        if (UriInfo.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalUriInfo();
        } else if (HttpHeaders.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalHttpHeaders();
        } else if (ProtocolHeaders.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalProtocolHeaders();
        } else if (SecurityContext.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalSecurityContext();
        } else if (ContextResolver.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalContextResolver<Object>();
        } else if (Request.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalRequest();
        } else if (Providers.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalProviders();
        } else if (MessageContext.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalMessageContext();
// Liberty Change for CXF Begin
        } else if (type.getName().equals(MessageContext.class.getName())) {
            MessageContextProxyClassLoader loader = new MessageContextProxyClassLoader(Proxy.class.getClassLoader(), type.getClassLoader(), ThreadLocalProxy.class.getClassLoader());
            proxy = (ThreadLocalProxy<T>) Proxy.newProxyInstance(loader,
                                                                 new Class[] { type, ThreadLocalProxy.class },
                                                                 new ProxyInvocationHandler(new ThreadLocalMessageContext()));
// Liberty Change for CXF Begin
        }

        if (proxy == null && isServletApiContext(type.getName())) {
            proxy = createThreadLocalServletApiContext(type.getName());
        }
        if (proxy == null) {
            ProxyClassLoader loader = new ProxyClassLoader(Proxy.class.getClassLoader());
            loader.addLoader(type.getClassLoader());
            loader.addLoader(ThreadLocalProxy.class.getClassLoader());
            return (ThreadLocalProxy<T>) Proxy.newProxyInstance(loader,
                                                                new Class[] { type, ThreadLocalProxy.class },
                                                                new ThreadLocalInvocationHandler<T>());
        }

        return (ThreadLocalProxy<T>) proxy;
    }
494283
private InvocationContextImpl<?> callAroundConstructInterceptors(InterceptorProxy[] proxies, CallbackContextHelper contextHelper) {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "callAroundConstructInterceptors");
        InvocationContextImpl invCtx = createInvocationContext();
        try {
            BeanMetaData bmd = home.beanMetaData;
            ManagedObjectFactory<?> managedObjectFactory = bmd.ivEnterpriseBeanFactory;
            invCtx.initializeForAroundConstruct(ivEjbManagedObjectContext, ivInterceptors, proxies);

            if (managedObjectFactory == null) {
                setEnterpriseBean(invCtx.aroundConstruct(this, new Object[0], null));
            } else {
                ivManagedObject = managedObjectFactory.createManagedObject(invCtx);
                setEnterpriseBean(ivManagedObject.getObject());
            }

            return invCtx;
        } catch (Throwable t) {
            if (! (t instanceof ManagedObjectException)) {
                FFDCFilter.processException(t, CLASS_NAME + ".callAroundConstructInterceptors", "377", this);
                // If a root cause exception was captured, then return the context and let the caller
                // properly report the failure and cause; otherwise throw generic EJBException.
                if (invCtx.ivAroundConstructException != null) {
                    return invCtx;
                }
                throw ExceptionUtil.EJBException("AroundConstruct interceptor failure", t);
            } else {
                Throwable cause = t.getCause();
                FFDCFilter.processException(cause, CLASS_NAME + ".callAroundConstructInterceptors", "386", this);
                // If a root cause exception was captured, then return the context and let the caller
                // properly report the failure and cause; otherwise throw generic EJBException.
                if (invCtx.ivAroundConstructException != null) {
                    return invCtx;
                }
                throw ExceptionUtil.EJBException("AroundConstruct interceptor failure", cause);
            }
        } finally {
            if (contextHelper != null) {
                contextHelper.resetContextData();
            }
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "callAroundConstructInterceptors");
        }
    }
911258
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/connector-connection-pool",
			data={
				"id": self.__name,
				"resourceAdapterName": self.__res_adapter_name,
				"connectiondefinitionname": self.__conn_def_name,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
1161262
@Override
	public Connector createConnector(String address, int port,
				     String protocol) {

        Connector connector = null;

	if (address != null) {
	    /*
	     * InetAddress.toString() returns a string of the form
	     * "<hostname>/<literal_IP>". Get the latter part, so that the
	     * address can be parsed (back) into an InetAddress using
	     * InetAddress.getByName().
	     */
	    int index = address.indexOf('/');
	    if (index != -1) {
		address = address.substring(index + 1);
	    }
	}

	if (log.isDebugEnabled()) {
            log.debug("Creating connector for address='" +
		      ((address == null) ? "ALL" : address) +
		      "' port='" + port + "' protocol='" + protocol + "'");
	}

        try {

            if (protocol.equals("ajp")) {
                connector = new Connector("org.apache.jk.server.JkCoyoteHandler");
            } else if (protocol.equals("memory")) {
                connector = new Connector("org.apache.coyote.memory.MemoryProtocolHandler");
            } else if (protocol.equals("http")) {
                connector = new Connector();
            } else if (protocol.equals("https")) {
                connector = new Connector();
                connector.setScheme("https");
                connector.setSecure(true);
                connector.setProperty("SSLEnabled","true");
            } else {
                connector = new Connector(protocol);
            }

            if (address != null) {
                IntrospectionUtils.setProperty(connector, "address", 
                                               "" + address);
            }
            IntrospectionUtils.setProperty(connector, "port", "" + port);

        } catch (Exception e) {
            log.error("Couldn't create connector.");
        } 

        return (connector);

    }
1336776
static ExecutorService makeContextAware(ExecutorService delegate, CurrentTraceContext traceCtx) {
    class TracingCurrentRequestContextExecutorService extends WrappingExecutorService {

      @Override protected ExecutorService delegate() {
        return delegate;
      }

      @Override protected <C> Callable<C> wrap(Callable<C> task) {
        return RequestContext.current().makeContextAware(traceCtx.wrap(task));
      }

      @Override protected Runnable wrap(Runnable task) {
        return RequestContext.current().makeContextAware(traceCtx.wrap(task));
      }
    }
    return new TracingCurrentRequestContextExecutorService();
  }
253916
protected void activate(ComponentContext cc) {
        //Create default server side global bus
        ClassLoader orignalClassLoader = THREAD_CONTEXT_ACCESSOR.getContextClassLoader(Thread.currentThread());
        try {
            //Make sure the current ThreadContextClassLoader is not an App classloader
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), JaxWsServiceImpl.class.getClassLoader());
            Map<String, Object> properties = new HashMap<String, Object>();
            properties.put("org.apache.cxf.bus.id", "Default Bus");
            Bus defaultBus = LibertyApplicationBusFactory.getInstance().createBus(null, properties);
            LibertyApplicationBusFactory.setDefaultBus(defaultBus);
        } finally {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);
        }

        //Eager initialize the StaxUtils
        try {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), StAXUtils.getStAXProviderClassLoader());
            Class.forName("org.apache.cxf.staxutils.StaxUtils");
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException(e);
        } finally {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);
        }
    }
410876
public ThreadContextDescriptor captureThreadContext(final Map<String, Map<String, ?>> threadContextConfigurations, final Map<String, String> execProps) {
        int initialCapacity = threadContextConfigurations == null ? 5 : threadContextConfigurations.size() + 5;
        final ThreadContextDescriptorImpl capturedThreadContext = new ThreadContextDescriptorImpl(execProps, initialCapacity, this);

        if (!ALL_CONTEXT_TYPES.equals(execProps.get(DEFAULT_CONTEXT))) {
            final List<ThreadContextProvider> configuredProviders = new ArrayList<ThreadContextProvider>(threadContextConfigurations.size());
            final List<Map.Entry<String, Map<String, ?>>> configuredProviderProps = new ArrayList<Map.Entry<String, Map<String, ?>>>(threadContextConfigurations.size());

            final List<ThreadContextProvider> alwaysEnabledProviders = new ArrayList<ThreadContextProvider>(alwaysEnabled.size());
            final List<String> alwaysEnabledProviderNames = new ArrayList<String>(alwaysEnabled.size());

            // Lazily obtaining services is a privileged operation
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
                @Override
                public Void run() {
                    // Identify thread context that is configurable per contextService
                    if (threadContextConfigurations != null)
                        for (Map.Entry<String, Map<String, ?>> threadContextConfig : threadContextConfigurations.entrySet()) {
                            String threadContextProviderName = threadContextConfig.getKey();
                            if (!capturedThreadContext.providerNamesToSkip.contains(threadContextProviderName)) {
                                ThreadContextProvider provider = threadContextProviders.getService(threadContextProviderName);
                                if (provider != null) {
                                    configuredProviders.add(provider);
                                    configuredProviderProps.add(threadContextConfig);
                                }
                            }
                        }

                    // Identify context that is always captured per the alwaysCaptureThreadContext service property
                    for (String threadContextProviderName : alwaysEnabled)
                        if (!capturedThreadContext.providerNamesToSkip.contains(threadContextProviderName)) {
                            ThreadContextProvider provider = threadContextProviders.getServiceWithException(threadContextProviderName);
                            alwaysEnabledProviders.add(provider);
                            alwaysEnabledProviderNames.add(threadContextProviderName);
                        }

                    return null;
                }
            });

            // capture thread context that is configurable per contextService
            for (int i = 0; i < configuredProviders.size(); i++) {
                ThreadContextProvider provider = configuredProviders.get(i);
                Map.Entry<String, Map<String, ?>> threadContextConfig = configuredProviderProps.get(i);
                ThreadContext context = provider.captureThreadContext(execProps, threadContextConfig.getValue());
                capturedThreadContext.add(threadContextConfig.getKey(), context);
            }

            // context that is always captured per the alwaysCaptureThreadContext service property
            for (int i = 0; i < alwaysEnabledProviders.size(); i++) {
                ThreadContextProvider provider = alwaysEnabledProviders.get(i);
                ThreadContext context = provider.captureThreadContext(execProps, null);
                capturedThreadContext.add(alwaysEnabledProviderNames.get(i), context);
            }
        }

        return capturedThreadContext;
    }
1314926
@Override
    public ConnectionConsumer createSharedConnectionConsumer(Topic arg0, String arg1, String arg2, ServerSessionPool arg3, int arg4) throws javax.jms.IllegalStateException, InvalidDestinationException, InvalidSelectorException, JMSException {

        if (isManaged) {
            throw (javax.jms.JMSException) JmsErrorUtils.newThrowable(javax.jms.JMSException.class,
                                                                      "MGD_ENV_CWSIA0025",
                                                                      new Object[] { "createSharedConnectionConsumer" }, tc);
        }
        // This is an ASF function that we do not support in Jetstream
        throw (JMSException) JmsErrorUtils.newThrowable(
                                                        JMSException.class,
                                                        "UNSUPPORTED_FUNC_CWSIA0026",
                                                        new Object[] { "JmsConnectionImpl.createSharedConnectionConsumer()" },
                                                        tc
                        );
    }
325108
@Override
    public JMSContext createContext() throws JMSRuntimeException, JMSSecurityRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createContext");

        JMSContext jmsContext = null;
        try {

            // Pass sessionMode as AUTO_ACKNOWLEDGE. The sessionMode is used to create a session.In simplified
            // API(JMS 2.0), AUTO_ACKNOWLEDGE is the default sessionMode  
            jmsContext = createContext(null, null, JMSContext.AUTO_ACKNOWLEDGE);

        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createContext");
        }
        return jmsContext;
    }
1100370
public static RequestContext create(String projectId, String instanceId, String appProfileId) {
    return new AutoValue_RequestContext(projectId, instanceId, appProfileId);
  }