Liberty Change for CXF Begin
173944
@SuppressWarnings("unchecked")
    public static void injectManagedObjectContextField(AbstractResourceInfo cri,
                                                       Field f, Object o, Object value) {

        InjectionRuntimeContext irc = null;
        irc = InjectionRuntimeContextHelper.getRuntimeContext();
        irc.setRuntimeCtxObject(f.getType().getName(), value);
//      if (!cri.isSingleton()) {
//
//          irc.setRuntimeCtxObject(o.getClass().getName()
//                                  + "-" + f.getType().getName(), value);
//      } else {
//          ThreadLocalProxy<Object> proxy = (ThreadLocalProxy<Object>) cri.getContextFieldProxy(f);
//          if (proxy != null) {
//              proxy.set(value);
//          }
//
//      }
    }
410269
public final void start() throws XAException
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "start", new Object[]{_resource, printState(_state)});
        if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start", this);

        int rc = -1;  // not an XA RC
        try
        {
            int flags;
            // Check the current state of the XAResource.
            switch (_state)
            {
                case NOT_ASSOCIATED:
                    flags = _startFlag;
                    break;
                case NOT_ASSOCIATED_AND_TMJOIN:
                    flags = XAResource.TMJOIN;
                    break;
                case ACTIVE:
                    if (tc.isEntryEnabled()) Tr.exit(tc, "startAssociation");
                    return;
                case SUSPENDED:
                    if (!_supportResume)
                    {
                        Tr.warning(tc, "WTRN0021_TMRESUME_NOT_SUPPORTED");
                        throw new XAException(XAException.XAER_INVAL);
                    }

                    flags = XAResource.TMRESUME;
                    break;
                case ROLLBACK_ONLY:
                    throw new XAException(XAException.XA_RBROLLBACK);
                default:
                    //
                    // should never happen.
                    //
                    Tr.warning(tc, "WTRN0022_UNKNOWN_XARESOURCE_STATE");
                case FAILED:
                case IDLE:
                    throw new XAException(XAException.XAER_PROTO);
            }

            if (tc.isEventEnabled()) Tr.event(tc, "xa_start with flag: " + Util.printFlag(flags));

            _resource.start(_xid, flags);
            rc = XAResource.XA_OK;
            _state = ACTIVE;
        }
        catch (XAException xae)
        {
            processXAException("start", xae);
            rc = xae.errorCode;

            if (xae.errorCode >= XAException.XA_RBBASE && xae.errorCode <= XAException.XA_RBEND)
                _state = ROLLBACK_ONLY;
            else if (xae.errorCode != XAException.XAER_OUTSIDE)
                _state = FAILED;

            throw xae;
        }
        catch (Throwable t)
        { 
            _state = FAILED;
            processThrowable("start", t);
        }
        finally
        {
            if (tc.isEntryEnabled()) Tr.exit(tc, "start");
            if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start result:", XAReturnCodeHelper.convertXACode(rc));
        }
    }
87863
function xframeFactory(options) {
  options = options || {};

  var str = 'DENY';
  if (isString(options)) {
    str = options;
  } else {
    if (options.sameOrigin) {
      str = 'SAMEORIGIN';
    }
    if (options.allow) {
      if (options.sameOrigin) {
        throw new Error('Cannot specify both ALLOW-FROM and SAMEORIGIN');
      }

      str = 'ALLOW-FROM ' + options.allow;
    }
  }

  return function xframe(req, res, next) {
    res.setHeader(HEADER, str);
    next();
  };
}
1039679
public void doStartup(ConfigurationProvider cp, boolean isSQLRecoveryLog) {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "doStartup with cp: " + cp + " and flag: " + isSQLRecoveryLog);

        // Create an AppId that will be unique for this server to be used in the generation of Xids.

        // Locate the user directory in the Liberty install
        String userDirEnv = System.getenv("WLP_USER_DIR");

        if (tc.isDebugEnabled())
            Tr.debug(tc, "TMS, WLP_USER_DIR env variable is - " + userDirEnv);
        // Retrieve the server name.
        String serverName = cp.getServerName();

        if (tc.isDebugEnabled())
            Tr.debug(tc, "TMS, serverName is - " + serverName);
        // Retrieve the host name
        String hostName = "";
        hostName = AccessController.doPrivileged(new PrivilegedAction<String>() {
            @Override
            public String run() {

                String theHost = "";
                try {
                    InetAddress addr = InetAddress.getLocalHost();
                    theHost = addr.getCanonicalHostName().toLowerCase();
                } catch (UnknownHostException e) {
                    theHost = "localhost";
                }

                return theHost;
            }
        });

        byte[] theApplId = createApplicationId(userDirEnv, serverName, hostName);
        cp.setApplId(theApplId);
        if (tc.isDebugEnabled())
            Tr.debug(tc, "TMS, cp - " + cp + " set applid - " + Util.toHexString(theApplId));
        if (!xaFlowCallbacksInitialised) {
            // -------------------------------------------------------
            // Initialize the XA Flow callbacks by
            // attempting to load the test class.
            // -------------------------------------------------------
            if (tc.isDebugEnabled())
                Tr.debug(tc, "initialise the XA Flow callbacks");
            XAFlowCallbackControl.initialize();
            xaFlowCallbacksInitialised = true;
        }
        if (cp.isRecoverOnStartup()) {
            try {
                TMHelper.start(cp.isWaitForRecovery());
            } catch (Exception e) {
                FFDCFilter.processException(e, "com.ibm.ws.transaction.services.TransactionManagerService.doStartup", "60", this);
            }
        }
    }
715783
private void resetConfiguration() throws CryptoException, InvalidArgumentException {

        setSecurityLevel(securityLevel);

        setHashAlgorithm(hashAlgorithm);

        try {
            cf = CertificateFactory.getInstance(CERTIFICATE_FORMAT);
        } catch (CertificateException e) {
            CryptoException ex = new CryptoException("Cannot initialize " + CERTIFICATE_FORMAT + " certificate factory. Error = " + e.getMessage(), e);
            logger.error(ex.getMessage(), ex);
            throw ex;
        }
    }
409357
protected void configureSsl(SslContextFactory factory, Ssl ssl,
			SslStoreProvider sslStoreProvider) {
		factory.setProtocol(ssl.getProtocol());
		configureSslClientAuth(factory, ssl);
		configureSslPasswords(factory, ssl);
		factory.setCertAlias(ssl.getKeyAlias());
		if (!ObjectUtils.isEmpty(ssl.getCiphers())) {
			factory.setIncludeCipherSuites(ssl.getCiphers());
			factory.setExcludeCipherSuites();
		}
		if (ssl.getEnabledProtocols() != null) {
			factory.setIncludeProtocols(ssl.getEnabledProtocols());
		}
		if (sslStoreProvider != null) {
			try {
				factory.setKeyStore(sslStoreProvider.getKeyStore());
				factory.setTrustStore(sslStoreProvider.getTrustStore());
			}
			catch (Exception ex) {
				throw new IllegalStateException("Unable to set SSL store", ex);
			}
		}
		else {
			configureSslKeyStore(factory, ssl);
			configureSslTrustStore(factory, ssl);
		}
	}
875466
def _change_state(name, action, expected, *args, **kwargs):
    '''
    
    '''
    pre = state(name)
    if action != 'restart' and pre == expected:
        return {'result': False,
                'state': {'old': expected, 'new': expected},
                'comment': ('Container \'{0}\' already {1}'
                            .format(name, expected))}
    _client_wrapper(action, name, *args, **kwargs)
    _clear_context()
    try:
        post = state(name)
    except CommandExecutionError:
        # Container doesn't exist anymore
        post = None
    ret = {'result': post == expected,
           'state': {'old': pre, 'new': post}}
    return ret
96485
@Override
    protected void configure() {

        install(new GuiceJerseyBinder());

        // POJOs
        bind(MyDependency.class).to(DefaultMyDependency.class);

        // vertx-mod-jersey interfaces
        Multibinder.newSetBinder(binder(), VertxRequestProcessor.class).addBinding().to(GuiceRequestProcessor.class);
        Multibinder.newSetBinder(binder(), VertxResponseProcessor.class).addBinding().to(GuiceResponseProcessor.class);
        Multibinder.newSetBinder(binder(), VertxPostResponseProcessor.class).addBinding().to(GuicePostResponseProcessor.class);

        // Jersey interfaces
        Multibinder.newSetBinder(binder(), ContainerRequestFilter.class).addBinding().to(GuiceRequestFilter.class);
        Multibinder.newSetBinder(binder(), ContainerResponseFilter.class).addBinding().to(GuiceResponseFilter.class);

        Multibinder.newSetBinder(binder(), ExceptionMapper.class).addBinding().to(GuiceExceptionMapper.class);

    }
987243
@Override
    public void installProvider(boolean clientSide, List<Object> providers, Set<String> features) {
        if (!clientSide) {
            providers.add(new LibertySseEventSinkContextProvider());
            providers.add(new SseContextProvider());
        }
    }
124381
def setupTxns(self, key, force: bool = False):
        
        import data
        dataDir = os.path.dirname(data.__file__)

        # TODO: Need to get "test" and "live" from ENVS property in config.py
        # but that gives error due to some dependency issue
        allEnvs = {
            "local": Environment("pool_transactions_local",
                                 "domain_transactions_local"),
            "test": Environment("pool_transactions_sandbox",
                                "domain_transactions_sandbox"),
            "live": Environment("pool_transactions_live",
                                "domain_transactions_live")
        }
        for env in allEnvs.values():
            fileName = getattr(env, key, None)
            if not fileName:
                continue
            sourceFilePath = os.path.join(dataDir, fileName)
            if not os.path.exists(sourceFilePath):
                continue
            destFilePath = os.path.join(
                self.base_dir, genesis_txn_file(fileName))
            if os.path.exists(destFilePath) and not force:
                continue
            copyfile(sourceFilePath, destFilePath)

        return self
355160
public static void premain(String agentArgs, Instrumentation inst) {
        System.out.println(STARTUP_NOTICE) ;
        JMXetricAgent a = null ;
        try {
            a = new JMXetricAgent();
            XMLConfigurationService.configure(a, agentArgs);
            a.start();
        } catch ( Exception ex ) {
            // log.severe("Exception starting JMXetricAgent");
            ex.printStackTrace();
        }
    }
1019692
public void startUncurated(Configuration conf) throws Exception{
		IDatabaseDev db = (IDatabaseDev) em.getDB();//TODO make sure DB platform can be used for development
		ModelDefinitionProvider provider = new ModelDefinitionProvider(db, conf.dbUser, null, conf.includeSchema);
		ModelDef[] origModelList = provider.getTableDefinitions();
		
		//TODO: proper support for explicit ModelDefinitions
		ModelDef[] withExplecitList = overrideModelDefFromExplicit(origModelList, explicitMeta);
		ModelDef[] modelList = withExplecitList;
		
		ModelDef[] modelListOwned = setModelOwners(modelList, tableGroups);
		ModelDef[] modelListChilded = setDirectChildren(modelListOwned);

		new ModelMetaDataGenerator().start(modelListChilded, conf);
	}
11022
def start_bundle(self, element=None):
    """"""
    import tensorflow as tf
    from trainer import feature_transforms

    g = tf.Graph()
    session = tf.Session(graph=g)

    # Build the transformation graph
    with g.as_default():
      transformed_features, _, placeholders = (
          feature_transforms.build_csv_serving_tensors_for_transform_step(
              analysis_path=self._analysis_output_dir, 
              features=self._features, 
              schema=self._schema,
              stats=self._stats,
              keep_target=True))
      session.run(tf.tables_initializer())
    
    self._session = session
    self._transformed_features = transformed_features
    self._input_placeholder_tensor = placeholders['csv_example']
1265042
public static void establishSSLContext(HttpClient client, int port, LibertyServer server) {
        establishSSLContext(client, port, server, null, null, null, null, "TLSv1.2");
    }
1178830
@Reference(name = "libertyProcess", service = LibertyProcess.class, target = "(wlp.process.type=client)", cardinality = ReferenceCardinality.OPTIONAL)
    protected void setLibertyProcess(ServiceReference<LibertyProcess> sr) {
        isClientProcess = true;
    }
518605
protected void activate(ComponentContext cc) {
        // Save bundle context for later usage
        BundleContext context = cc.getBundleContext();
        JMXMBeanServerDelegation.INSTANCE.context = context;

        // Create instance of JmxInitializer, set single instance of this class
        // into JmxInitializer as MBeanServer
        LibertyApplicationBusFactory busFactory = LibertyApplicationBusFactory.getInstance();
        jmxInitializer = new JMXBusInitializer(JMXMBeanServerDelegation.getInstance());
        busFactory.registerApplicationBusListener(jmxInitializer);
    }
561208
protected void activate(ComponentContext cc) {
        Bundle usingBundle = cc.getUsingBundle();
        userContext = usingBundle.getBundleContext();
    }