This method is called internally by the CM obtain a ManagedConnection wrapped in a MCWrapper.
Used by: allocateConnection, reAssociate, and associateConnection.

@param mcWrapper The managed connection wrapper to involve.
421418
private void involveMCInTran(MCWrapper mcWrapper, UOWCoordinator uowCoord, com.ibm.ejs.j2c.ConnectionManager inUseCM) throws ResourceException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "involveMCInTran", inUseCM.toString());
        }

        if (!mcWrapper.involvedInTransaction()) { // this whole first part of the if statement is new.

            // Not involved in transaction, need to get involved in transaction.
            // Set a Reference to this CM instance into the McWrapper
            mcWrapper.setConnectionManager(inUseCM);

            /*
             * If isEnlistmentDisabled is true, log a message and return.
             */
            if (mcWrapper.isEnlistmentDisabled()) {

                if (isTraceOn && tc.isDebugEnabled()) {
                    Tr.debug(this, tc, "Managed connection isEnlistmentDisabled is true.");
                    Tr.debug(this, tc, "Returning without calling method initializeForUOW.");
                }
                if (isTraceOn && tc.isEntryEnabled()) {
                    Tr.exit(this, tc, "involveMCInTran");
                }

                return;

            }
            mcWrapper.setUOWCoordinator(uowCoord);

            // Do the transactional setup if required.
            initializeForUOW(mcWrapper, false);

        }

        if (isTraceOn && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "involveMCInTran");
        }

    }
129689
protected WSJdbcResultSet createWrapper(ResultSet rsetImpl) {
        // If the childWrapper is null, and the childWrappers is null or 
        // empty, set the result set to childWrapper;
        // Otherwise, add the result set to childWrappers
        WSJdbcResultSet rsetWrapper;
        if (childWrapper == null && (childWrappers == null || childWrappers.isEmpty())) {
            childWrapper = rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this);
            if (TraceComponent.isAnyTracingEnabled() &&  tc.isDebugEnabled())
                Tr.debug(tc, "Set the result set to child wrapper"); 
        } else {
            if (childWrappers == null) 
                childWrappers = new ArrayList<Wrapper>(5); 
            rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this);
            childWrappers.add(rsetWrapper);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Add the result set to child wrappers list."); 
        }

        return rsetWrapper;
    }
19372
private void registerServant(BusinessRemoteWrapper wrapper, int i)
    {
        // synchronized on the remote Wrapper to set the isRemoteRegistered flag
        synchronized (wrapper)
        {
            if (!ivBusinessRemoteRegistered[i])
            {
                try
                {
                    if (!isZOS)
                    {
                        // Since there may be multiple remote interfaces per bean
                        // type, a unique WrapperId must be formed by combining the
                        // BeanId with specific remote interface information. d419704
                        WrapperId wrapperId = new WrapperId
                                        (wrapper.beanId.getByteArrayBytes(),
                                                        wrapper.bmd.ivBusinessRemoteInterfaceClasses[i].getName(),
                                                        i);

                        // Servant registration must be performed with the application classloader
                        // in force.  This is especially needed for JITDeploy since
                        // the JIT pluggin will be on the application classloader.
                        // Without the JIT pluggin the classloader will not trigger
                        // JITDeploy to create the stub.  //d521388
                        Object originalLoader = ThreadContextAccessor.UNCHANGED;
                        try
                        {
                            if (ivBMD != null) // EJBFactories have no BMD.   d529446
                            {
                                originalLoader = EJBThreadData.svThreadContextAccessor.pushContextClassLoaderForUnprivileged(ivBMD.classLoader); //PK83186

                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                {
                                    if (originalLoader != ThreadContextAccessor.UNCHANGED)
                                    {
                                        Tr.debug(tc, "registerServant : old ClassLoader = " + originalLoader);
                                        Tr.debug(tc, "registerServant : new ClassLoader = " + ivBMD.classLoader);
                                    }
                                    else
                                    {
                                        Tr.debug(tc, "registerServant : current ClassLoader = " + ivBMD.classLoader);
                                    }
                                }
                            }
                            wrapper.container.getEJBRuntime().registerServant(wrapperId, wrapper);
                        } finally
                        {
                            EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(originalLoader);
                        } // finally

                    } // if( !isZOS )

                    ivBusinessRemoteRegistered[i] = true;
                } catch (Throwable ex)
                {
                    FFDCFilter.processException(ex, CLASS_NAME + ".registerServant", "439", this);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    {
                        Tr.event(tc, "Failed to register wrapper instance", new Object[] { wrapper, ex });
                    }
                }

            } // if ( ! ivBusinessRemoteRegistered[i] )

        } //synchronized( wrapper )

    }
670433
private SibRaManagedConnection getAssociatedManagedConnection()
                    throws SIResourceException {

        try {

            if (_managedConnection == null) {

                final ConnectionManager connectionManager = _connectionFactory
                                .getConnectionManager();
                if (connectionManager instanceof LazyAssociatableConnectionManager) {

                    ((LazyAssociatableConnectionManager) connectionManager)
                                    .associateConnection(this, _connectionFactory
                                                    .getManagedConnectionFactory(),
                                                         _requestInfo);

                } else {

                    // We shouldn't have been dissociated if the connection
                    // manager does not support lazy enlistment
                    final ResourceException exception = new ResourceAdapterInternalException(
                                    NLS.getFormattedMessage(
                                                            "LAZY_ENLIST_NOT_SUPPORTED_CWSIV0154",
                                                            new Object[] { connectionManager }, null));
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                        SibTr.exception(this, TRACE, exception);
                    }
                    throw exception;

                }

            }

        } catch (ResourceException exception) {

            FFDCFilter
                            .processException(
                                              exception,
                                              "com.ibm.ws.sib.ra.impl.SibRaConnection.getAssociatedManagedConnection",
                                              "1:1843:1.41", this);

            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                SibTr.exception(this, TRACE, exception);
            }
            throw new SIResourceException(NLS.getFormattedMessage(
                                                                  "REASSOCIATION_FAILED_CWSIV0155",
                                                                  new Object[] { exception }, null), exception);

        }

        return _managedConnection;

    }
1155156
public void loadMehtodAnnotations(Class cclass, ContainerWrapper containerWrapper) {
		try {

			for (Method method : ClassUtil.getAllDecaredMethods(cclass)) {
				if (method.isAnnotationPresent(OnCommand.class)) {
					addConsumerMethod(method, cclass, containerWrapper);
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

	}
479673
public void putChunkedMessageWrapper(long wrapperId, ChunkedMessageWrapper wrapper)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "putChunkedMessageWrapper", new Object[] { Long.valueOf(wrapperId), wrapper });
        inProgressMessages.put(Long.valueOf(wrapperId), wrapper);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "putChunkedMessageWrapper");
    }
430901
protected XATransactionWrapper getXATransactionWrapper() throws ResourceException {

        final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "getXATransactionWrapper");
        }

        if (xaTranWrapper == null) {
            boolean isJDBC41 = false;
            if (mc instanceof WSManagedConnection) {
                if (_managedConnectionFactory instanceof WSManagedConnectionFactory
                    && (((WSManagedConnectionFactory) _managedConnectionFactory).getJDBCRuntimeVersion().compareTo(new Version(4, 1, 0))) >= 0) {
                    isJDBC41 = true;
                }
            }
            if (isJDBC41) {
                xaTranWrapper = new AbortableXATransactionWrapper(this);
            } else {
                xaTranWrapper = new XATransactionWrapper(this);
            }
        }

        // Move the xaTranWrapper.initialize() call outside of the above "xaTranWrapper == null"
        // conditional.  Prior to this change, the xaResource within the xaTranWrapper was not
        // getting re-initialized for MCWrappers that were pulled from the MCWrapperPool.  This
        // call to initialize() for existing xaTranWrappers is safe and quick since we check
        // for an existing xaResource as the first thing in initialize().
        //
        xaTranWrapper.initialize();

        if (state == STATE_ACTIVE_INUSE) {
            state = STATE_TRAN_WRAPPER_INUSE;
            tranWrapperInUse = XATXWRAPPER;
        } else { // state not STATE_ACTIVE_INUSE
            if (state != STATE_TRAN_WRAPPER_INUSE) {
                IllegalStateException e = new IllegalStateException("getXATransactionWrapper: illegal state exception. State = " + getStateString() + " MCW = "
                                                                    + mcWrapperObject_hexString);
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "getXATransactionWrapper", e);
                throw e;
            } else { // state is STATE_TRAN_WRAPPER_INUSE
                if (tranWrapperInUse == NONE) {
                    tranWrapperInUse = XATXWRAPPER;
                } else { //tranWrapperInUse is NOT NONE
                    if (tranWrapperInUse != XATXWRAPPER) {
                        // Need RAS and Trace here.
                        IllegalStateException e = new IllegalStateException("getXATransactionWrapper: illegal transaction state exception. State = "
                                                                            + getTranWrapperString());
                        Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "getXATransactionWrapper", e);
                        throw e;
                    }
                }
            }
        }

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "getXATransactionWrapper");
        }

        return xaTranWrapper;
    }
597352
@Override
    public ManagedConnectionMetaData getMetaData() throws ResourceException {
        try {
            return new JcrManagedConnectionMetaData(mcf.getRepository(), session);
        } catch (Exception e) {
            throw new ResourceException(e);
        }
    }
1130918
@Override
  public synchronized void connect() throws AlluxioStatusException {
    if (mConnected) {
      return;
    }
    disconnect();
    Preconditions.checkState(!mClosed, "Client is closed, will not try to connect.");

    IOException lastConnectFailure = null;
    RetryPolicy retryPolicy = mRetryPolicySupplier.get();

    while (retryPolicy.attempt()) {
      if (mClosed) {
        throw new FailedPreconditionException("Failed to connect: client has been closed");
      }
      // Re-query the address in each loop iteration in case it has changed (e.g. master
      // failover).
      try {
        mAddress = getAddress();
      } catch (UnavailableException e) {
        LOG.warn("Failed to determine {} rpc address ({}): {}",
            getServiceName(), retryPolicy.getAttemptCount(), e.toString());
        continue;
      }
      if (mAddress.isUnresolved()) {
        // Sometimes the acquired addressed wasn't resolved, retry resolving before
        // using it to connect.
        LOG.info("Retry resolving address {}", mAddress);
        // Creates a new InetSocketAddress to force resolving the hostname again.
        mAddress = new InetSocketAddress(mAddress.getHostName(), mAddress.getPort());
        if (mAddress.isUnresolved()) {
          LOG.warn("Failed to resolve address on retry {}", mAddress);
        }
      }
      try {
        beforeConnect();
        LOG.info("Alluxio client (version {}) is trying to connect with {} @ {}",
            RuntimeConstants.VERSION, getServiceName(), mAddress);
        mChannel = GrpcChannelBuilder
            .newBuilder(new GrpcServerAddress(mAddress), mContext.getConf())
            .setSubject(mContext.getSubject())
            .build();
        // Create stub for version service on host
        mVersionService = ServiceVersionClientServiceGrpc.newBlockingStub(mChannel);
        mConnected = true;
        afterConnect();
        checkVersion(getServiceVersion());
        LOG.info("Alluxio client (version {}) is connected with {} @ {}", RuntimeConstants.VERSION,
            getServiceName(), mAddress);
        return;
      } catch (IOException e) {
        LOG.warn("Failed to connect ({}) with {} @ {}: {}", retryPolicy.getAttemptCount(),
            getServiceName(), mAddress, e.getMessage());
        lastConnectFailure = e;
      }
    }
    // Reaching here indicates that we did not successfully connect.

    if (mChannel != null) {
      mChannel.shutdown();
    }

    if (mAddress == null) {
      throw new UnavailableException(
          String.format("Failed to determine address for %s after %s attempts", getServiceName(),
              retryPolicy.getAttemptCount()));
    }

    /**
     * Throw as-is if {@link UnauthenticatedException} occurred.
     */
    if (lastConnectFailure instanceof UnauthenticatedException) {
      throw (AlluxioStatusException) lastConnectFailure;
    }

    throw new UnavailableException(String.format("Failed to connect to %s @ %s after %s attempts",
        getServiceName(), mAddress, retryPolicy.getAttemptCount()), lastConnectFailure);
  }
580161
protected LocalTransactionWrapper getLocalTransactionWrapper(boolean rrsTransactional) throws ResourceException {

        final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.entry(this, tc, "getLocalTransactionWrapper", rrsTransactional);
        }

        if (localTranWrapper == null) {
            localTranWrapper = new LocalTransactionWrapper(this);
        }

        // Move the localTranWrapper.initialize() call outside of the above "localTranWrapper == null"
        // conditional.  Prior to this change, the localTransaction within the localTranWrapper was not
        // getting re-initialized for MCWrappers that were pulled from the MCWrapperPool.  This
        // call to initialize() for existing localTranWrappers is safe and quick since we check
        // for an existing localTransaction as the first thing in initialize().
        //
        localTranWrapper.initialize();
        localTranWrapper.setRRSTransactional(rrsTransactional);
        tranWrapperInUse = LOCALTXWRAPPER;

        if (isTracingEnabled && tc.isEntryEnabled()) {
            Tr.exit(this, tc, "getLocalTransactionWrapper");
        }

        return localTranWrapper;

    }
14903
@Override
    final public ManagedConnection createManagedConnection(
                                                           final Subject subject, final ConnectionRequestInfo requestInfo)
                    throws ResourceException {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "createManagedConnection", new Object[] {
                                                                              JmsJcaManagedConnection.subjectToString(subject),
                                                                              requestInfo });
        }

        // If we have some request information then see if it already has a core
        // connection associated with it

        JmsJcaConnectionRequestInfo jmsJcaRequestInfo = null;
        SICoreConnection requestCoreConnection = null;
        SICoreConnection coreConnection = null;

        if (requestInfo != null) {

            // Check we have the right type of request information

            if (!(requestInfo instanceof JmsJcaConnectionRequestInfo)) {

                throw new ResourceAdapterInternalException(NLS
                                .getFormattedMessage(("EXCEPTION_RECEIVED_CWSJR1022"),
                                                     new Object[] {
                                                                   "createManagedConnection",
                                                                   JmsJcaConnectionRequestInfo.class
                                                                                   .getName(),
                                                                   requestInfo.getClass().getName() },
                                                     null));

            }

            jmsJcaRequestInfo = (JmsJcaConnectionRequestInfo) requestInfo;
            requestCoreConnection = jmsJcaRequestInfo.getSICoreConnection();

            if (requestCoreConnection != null) {
                // Check that the core connection is still available, ie hasn't been closed. If the
                // core connection is no longer available, null it out and continue without it.

                try {
                    // There is no isAvailable() method on a core connection we use getConnectionListeners()
                    // which is believed to be the cheapest alternative method.
                    requestCoreConnection.getConnectionListeners();

                } catch (final SIException e) {
                    // No FFDC code needed
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
                        SibTr.debug(TRACE, "Connection Request Info core connection no longer available");
                    jmsJcaRequestInfo.setSICoreConnection(null);
                    requestCoreConnection = null;
                } catch (final SIErrorException e) {
                    // No FFDC code needed
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
                        SibTr.debug(TRACE, "Connection Request Info core connection no longer available");
                    jmsJcaRequestInfo.setSICoreConnection(null);
                    requestCoreConnection = null;
                }
            }
        }

        // See if we can get a user name and password from the subject or
        // request information

        final JmsJcaUserDetails userDetails = getUserDetails(subject,
                                                             requestInfo);

        // If we didn't get any request information or we did but it didn't
        // contain a core connection, create a new one

        if (requestCoreConnection == null) {

            // Obtain a core connection factory

            final SICoreConnectionFactory coreConnectionFactory;

            if (!UTEHelperFactory.jmsTestEnvironmentEnabled) {

                try {

                    coreConnectionFactory = SICoreConnectionFactorySelector
                                    .getSICoreConnectionFactory(FactoryType.TRM_CONNECTION);

                } catch (final SIException exception) {

                    FFDCFilter.processException(exception, CLASS_NAME
                                                           + ".createManagedConnection", FFDC_PROBE_5, this);
                    throw new ResourceException(NLS.getFormattedMessage(
                                                                        "EXCEPTION_RECEIVED_CWSJR1021", new Object[] {
                                                                                                                      exception, "getSICoreConnectionFactory" },
                                                                        null), exception);

                }

            } else {

                coreConnectionFactory = UTEHelperFactory.getHelperInstance()
                                .setupJmsTestEnvironment();

            }

            // Check we have obtained a core connection factory successfully

            if (coreConnectionFactory == null) {

                throw new ResourceAdapterInternalException(NLS
                                .getFormattedMessage(
                                                     ("SICORECONNECTION_ERROR_CWSJR1023"),
                                                     new Object[] { "createManagedConnection" },
                                                     null));

            }

            // Create a connection

            try {

                final Map trmProperties = getTrmProperties();

                if (userDetails == null) {

                    requestCoreConnection = coreConnectionFactory
                                    .createConnection(subject, trmProperties);

                } else {

                    requestCoreConnection = coreConnectionFactory
                                    .createConnection(userDetails.getUserName(),
                                                      userDetails.getPassword(), trmProperties);

                }

            } catch (final SIException exception) {

                FFDCFilter.processException(exception, CLASS_NAME
                                                       + ".createManagedConnection", FFDC_PROBE_1, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                                                                    "EXCEPTION_RECEIVED_CWSJR1028", new Object[] {
                                                                                                                  exception, "createManagedConnection" }, null),
                                exception);

            } catch (final SIErrorException exception) {

                FFDCFilter.processException(exception, CLASS_NAME
                                                       + ".createManagedConnection", FFDC_PROBE_2, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                                                                    "EXCEPTION_RECEIVED_CWSJR1028", new Object[] {
                                                                                                                  exception, "createManagedConnection" }, null),
                                exception);

            }

            // If we have some request information, set the core connection back
            // into it

            if (jmsJcaRequestInfo != null) {

                jmsJcaRequestInfo.setSICoreConnection(requestCoreConnection);

            }

            // This is a new coreConnection so set this parent coreConnection in 
            // the managedConnection by assigning it to the coreConnection here.
            // The managedconnection will now have full control over the parent
            // coreconnection.
            coreConnection = requestCoreConnection;
        }
        else
        {

            try {
                // We are here as we already have a valid coreconnection in our requestInfo, this
                // means we already have a managedConnection that is looking at the parent, so we
                // need to create a clone of that coreConnection to pass into our new managedConnection.

                // Create a clone to give to the managed connection object which will be stored in the 
                // J2C connection pool.
                coreConnection = requestCoreConnection.cloneConnection();
            } catch (final SIException e) {
                FFDCFilter.processException(e, CLASS_NAME + ".createManagedConnection", FFDC_PROBE_7, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                    SibTr.exception(this, TRACE, e);
                throw new ResourceException(NLS.getFormattedMessage("EXCEPTION_RECEIVED_CWSJR1028",
                                                                    new Object[] { e, "createManagedConnection" },
                                                                    null), e);
            } catch (final SIErrorException e) {
                FFDCFilter.processException(e, CLASS_NAME + ".createManagedConnection", FFDC_PROBE_8, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                    SibTr.exception(this, TRACE, e);
                throw new ResourceException(NLS.getFormattedMessage("EXCEPTION_RECEIVED_CWSJR1028",
                                                                    new Object[] { e, "createManagedConnection" },
                                                                    null), e);
            }
        }

        final JmsJcaManagedConnection managedConnection;

        try {

            // Create a managed connection

            if ((getShareDataSourceWithCMP() != null)
                && (getShareDataSourceWithCMP().booleanValue())) {

                // ShareDataSourceWithCMP is set - return a managed connection
                // implementing SynchronizationProvider

                managedConnection = new JmsJcaManagedConnectionSynchronizationProvider(
                                this, coreConnection, userDetails, subject);

            } else {

                // ShareDataSourceWithCMP is not set - return a normal managed
                // connection

                managedConnection = new JmsJcaManagedConnection(this,
                                coreConnection, userDetails, subject);

            }

        } catch (final SIException exception) {

            FFDCFilter.processException(exception, CLASS_NAME
                                                   + ".createManagedConnection", FFDC_PROBE_3, this);
            throw new ResourceException(NLS.getFormattedMessage(
                                                                "EXCEPTION_RECEIVED_CWSJR1026", new Object[] { exception,
                                                                                                              "createManagedConnection" }, null), exception);

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "createManagedConnection",
                       managedConnection);
        }
        return managedConnection;

    }
1139239
void associate(final JmsJcaManagedConnection managedConnection) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "associate", managedConnection);
        }

        if (_managedConnection != null) {
            _managedConnection.disassociateSession(this);
        }
        _managedConnection = managedConnection;

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "associate");
        }

    }
484991
void addWorkWrapper(WorkWrapper ww)
   {
      synchronized (activeWorkWrappers)
      {
         activeWorkWrappers.add(ww);

         if (statisticsEnabled)
            statistics.setWorkActive(activeWorkWrappers.size());
      }
   }
1294777
protected MultiStringWrapper asMultiStringWrapper(StringWrapper w) 
	{
		if (w instanceof MultiStringWrapper) return (MultiStringWrapper)w;
		else 	{
			MultiStringWrapper mw = new MultiStringWrapper( w.unwrap(), innerLearners.length, delim);
			for (int i=0; i<mw.size(); i++) {
				mw.set(i, prepareForLearner( mw.get(i), innerLearners[mw.getDistanceLearnerIndex(i)] ) );
			}
			return mw;
		}
	}
809711
private void addToWrapper(EntityMetadata entityMetadata, AttributeWrapper wrapper, Object embeddedObject,
            Attribute attrib, Attribute embeddedAttrib)
    {
        if (embeddedObject == null)
        {
            return;
        }
        
        byte[] value = PropertyAccessorHelper.get(embeddedObject, (Field) attrib.getJavaMember());
        byte[] name;
        if (value != null)
        {
            if (embeddedAttrib == null)
            {
                name = getEncodedBytes(((AbstractAttribute) attrib).getJPAColumnName());
            }
            else
            {
                name = getEncodedBytes(getHashKey(embeddedAttrib.getName(),
                        ((AbstractAttribute) attrib).getJPAColumnName()));
            }
            // add column name as key and value as value
            wrapper.addColumn(name, value);
            // // {tablename:columnname,hashcode} for value

            // selective indexing.
            if (entityMetadata.getIndexProperties().containsKey(((AbstractAttribute) attrib).getJPAColumnName()))
            {
                String valueAsStr = PropertyAccessorHelper.getString(embeddedObject, (Field) attrib.getJavaMember());
                wrapper.addIndex(
                        getHashKey(entityMetadata.getTableName(), ((AbstractAttribute) attrib).getJPAColumnName()),
                        getDouble(valueAsStr));

                wrapper.addIndex(
                        getHashKey(entityMetadata.getTableName(),
                                getHashKey(((AbstractAttribute) attrib).getJPAColumnName(), valueAsStr)),
                        getDouble(valueAsStr));
            }
        }
    }
1033723
private void applyConnectionManagerConfiguration(ConnectionManagerConfiguration cmc,
      org.ironjacamar.common.api.metadata.common.XaPool xp)
   {
      if (xp != null)
      {
         if (xp.isIsSameRmOverride() != null)
            cmc.setIsSameRMOverride(xp.isIsSameRmOverride());

         if (xp.isPadXid() != null)
            cmc.setPadXid(xp.isPadXid());

         if (xp.isWrapXaResource() != null)
            cmc.setWrapXAResource(xp.isWrapXaResource());
      }
   }
321943
private synchronized void registerCacheEventListener(EventListenerWrapper<K, V> wrapper) {
    if(aSyncListenersList.contains(wrapper) || syncListenersList.contains(wrapper)) {
      throw new IllegalStateException("Cache Event Listener already registered: " + wrapper.getListener());
    }

    if (wrapper.isOrdered() && orderedListenerCount++ == 0) {
      storeEventSource.setEventOrdering(true);
    }

    switch (wrapper.getFiringMode()) {
      case ASYNCHRONOUS:
        aSyncListenersList.add(wrapper);
        break;
      case SYNCHRONOUS:
        syncListenersList.add(wrapper);
        break;
      default:
        throw new AssertionError("Unhandled EventFiring value: " + wrapper.getFiringMode());
    }

    if (listenersCount++ == 0) {
      storeEventSource.addEventListener(eventListener);
    }
  }