Remove the given <code>BeanO</code> in this container transaction.

@return true if the specified BeanO was successfully removed from the
transaction; returns false if the bean was not enlisted.
977117
public boolean delist(BeanO beanO)
                    throws TransactionRolledbackException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "delist",
                     new Object[] { Boolean.valueOf(globalTransaction), this, beanO });

        boolean removed = false; // d145697

        ensureActive();

        if (beanOs == null) { // d111555
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "delist : false : no beanOs");
            return removed;
        }

        //synchronized(beanOs)  //d173022.2
        //{
        // Can't delist after beforeCompletion                          d132828
        if (origLock == true) {
            if (isTraceOn && tc.isEventEnabled()) // d144064
                Tr.event(tc, "Attempt to delist after beforeCompletion");
            throw new RuntimeException("Delisted after starting beforeCompletion");
        } else {
            // Only remove the BeanO from the transaction if it was already
            // enlisted. Note that only this specific BeanO is removed, not
            // just any BeanO that may have the same beanId.             d145697
            if (beanOList.contains(beanO)) {
                beanOs.remove(beanO.beanId);
                beanOList.remove(beanOList.indexOf(beanO));
                afterList.remove(afterList.indexOf(beanO));
                removed = true;

                // If CMP 2.0 bean, remove from CMP 2.0 list that is sorted
                // by home.... used for intelligent flush.             d140003.22
                if (beanO.home.beanMetaData.cmpVersion == InternalConstants.CMP_VERSION_2_X)
                {
                    ArrayList<BeanO> bundle =
                                    homesForPMManagedBeans.get(beanO.home);

                    bundle.remove(bundle.lastIndexOf(beanO));
                }
            }
        }
        //}

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.exit(tc, "delist : " + removed);

        return removed; // d145697
    }
494570
public boolean removeAll(Collection<?> collection) {
        boolean result = false;
        synchronized (mLock) {
            Iterator<?> it;
            if (mOriginalValues != null) {
                it = mOriginalValues.iterator();

            } else {
                it = mObjects.iterator();
            }
            while (it.hasNext()) {
                if (collection.contains(it.next())) {
                    it.remove();
                    result = true;
                }
            }
        }
        if (mNotifyOnChange) notifyDataSetChanged();
        return result;
    }
780137
private boolean removeServantRoutingAffinity() {
        if (ivServantRoutingAffinity) {
            StatefulSessionKey sskey = (StatefulSessionKey) beanId.getPrimaryKey();
            byte[] pKeyBytes = sskey.getBytes();

            int retcode = container.ivStatefulBeanEnqDeq.SSBeanDeq(pKeyBytes, !home.beanMetaData.sessionActivateTran, true);
            if (retcode != 0) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    Tr.event(tc, "Could not DEQ session bean with key = " + sskey);
                return false;
            }

            ivServantRoutingAffinity = false;
        }

        return true;
    }
43299
public boolean remove( LocalSession localSession , TransactionItem[] items ) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	int volatileCommitted = 0;
    	int persistentCommitted = 0;
    	
        synchronized (storeLock)
        {
    		for (int n = 0 ; n < items.length ; n++)
            {
    			TransactionItem transactionItem = items[n];
            	if (transactionItem.getDestination() != this)
            		continue;
            	
            	if (traceEnabled)
                	log.trace(localSession+" COMMIT "+transactionItem.getMessageId());
            	
            	// Delete message from store
            	if (transactionItem.getDeliveryMode() == DeliveryMode.PERSISTENT)
            	{
            		persistentStore.delete(transactionItem.getHandle());
            		persistentCommitted++;
            	}
            	else
            	{
            		volatileStore.delete(transactionItem.getHandle());
            		volatileCommitted++;
            	}
            }
        }
        acknowledgedGetCount.addAndGet(volatileCommitted + persistentCommitted);
        
        if (persistentCommitted > 0 && requiresTransactionalUpdate())
        {
        	pendingChanges = true;
        	return true;
        }
        else
        	return false;
    }
736460
public boolean remove() {
		if (exists() && !isRemoved()) {
			isRemoved = true;
			node.getParent().removeChild(nodeFqn.getLastElement());
			if (doTraceLogs) {
				logger.trace("removed cache node "+nodeFqn);
			}	
			return true;
		}
		else {
			return false;
		}
	}
957340
@Override
    public final synchronized void remove() throws RemoteException, RemoveException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "remove: " + this);

        //--------------------------------------------------------------------
        // It's debatable whether a session bean whose ejbRemove fails
        // should be kept around or whether the container should
        // unilaterally destroy it. For now, allow the remove to fail and
        // allow the client to "recover" from the failure, i.e. don't
        // destroy the session bean if it raises a checked exception
        // (any subclass of RemoteException).
        //--------------------------------------------------------------------

        canBeRemoved();

        setState(REMOVING); // d159152

        // d367572.1  start
        String lifeCycle = null; // d367572.4
        CallbackContextHelper contextHelper = null; // d399469
        try {
            BeanMetaData bmd = home.beanMetaData;

            if (ivExPcContext != null) // d515803
            {
                container.getEJBRuntime().getEJBJPAContainer().onRemoveOrDiscard(ivExPcContext); // d416151.3 d416151.3.5
            }

            if (ivCallbackKind != CallbackKind.None) {
                contextHelper = new CallbackContextHelper(this); // d630940
                beginLifecycleCallback(LifecycleInterceptorWrapper.MID_PRE_DESTROY,
                                       contextHelper, CallbackContextHelper.Contexts.All);

                // Invoke the PreDestroy callback if any needs to be called.
                if (ivCallbackKind == CallbackKind.SessionBean) {
                    if (isTraceOn && // d527372
                        TEBeanLifeCycleInfo.isTraceEnabled()) // d367572.4
                    {
                        lifeCycle = "ejbRemove";
                        TEBeanLifeCycleInfo.traceEJBCallEntry(lifeCycle); // d161864
                    }
                    sessionBean.ejbRemove();
                } else if (ivCallbackKind == CallbackKind.InvocationContext) {
                    // Invoke the PreDestroy interceptor methods.
                    InterceptorMetaData imd = home.beanMetaData.ivInterceptorMetaData;
                    InterceptorProxy[] proxies = imd.ivPreDestroyInterceptors;
                    if (proxies != null) {
                        if (isTraceOn && // d527372
                            TEBeanLifeCycleInfo.isTraceEnabled()) // d367572.4
                        {
                            lifeCycle = "PreDestroy";
                            TEBeanLifeCycleInfo.traceEJBCallEntry(lifeCycle);
                        }
                        InvocationContextImpl<?> inv = getInvocationContext();
                        inv.doLifeCycle(proxies, bmd._moduleMetaData); //d450431, F743-14982
                    }
                }
            }

            // d383586 - mark removed and destroy since no exception occurred.
            // If there is an exception, the bean will be removed in destroy().
            // We count beanRemoved (if any) in destroy() too.
            if (pmiBean != null) {
                pmiBean.beanRemoved();
            }
            removed = true;
            destroy();
        } catch (RemoteException ex) {
            FFDCFilter.processException(ex, CLASS_NAME + ".remove", "611", this);
            if (isTraceOn && tc.isEventEnabled()) // d144064
            {
                Tr.event(tc, "remove caught exception", new Object[] { this, ex }); // d367572.4 // d402681
            }

            // d383586 - discard the instance.
            discard(); // d383586

            // It is wrong to convert RemoteException to RemoveException, but we
            // keep this for backwards compatibility. d591915
            throw new RemoveException(ex.getMessage());
        } catch (Throwable ex) // d367572.4
        {
            FFDCFilter.processException(ex, CLASS_NAME + ".remove", "611", this);
            if (isTraceOn && tc.isEventEnabled()) // d144064
            {
                Tr.event(tc, "remove caught exception:", new Object[] { this, ex }); // d367572.4 // d402681
            }

            // d383586 - discard the instance.
            // d591915
            //
            // It looks like we are non spec-compliant here.  In all cases, we
            // bury the exception that we caught from the above try block.
            // However, the spec implies that there are many cases where we do
            // want to throw an exception here.
            //
            // In the above try block, we do a number of things, including the
            // SessionBean.ejbRemove() method on the user's underlying bean instance.
            // Presumably, this is a result of the user invoking the .ejbRemove()
            // method on the interface, and in this case it seems like we would
            // fall under the goverence of section 14.3.2 (tables 17 and 18) of the EJB 3.1 spec,
            // which indicates that in all cases where we get an exception, we
            // have to re-throw some type of exception (as opposed to what we
            // are doing here, which is to not throw any exception).
            //
            // Additionally, it appears that this .remove() method gets called into
            // when the transaction that the session bean is on is either committed
            // or rolled back, which presumably can happen as the result of user
            // invoked business method...and so the argument could be made that
            // this also falls under section 14.3.1 (tables 15 and 16) of the EJB 3.1 spec, which also
            // seems to indicate that in all cases where we get an exception, we
            // have to re-throw some type of exception.
            //
            // If we ever wanted to fix this, things are further complicated
            // because it seems like in some cases its the correct behavior to
            // not throw an exception here.  In the try block above we are also
            // executing the preDestroy interceptor methods, and so that seems to
            // fall under section 14.3.3 (table 19) of the EJB 3.1 spec, which
            // says that we should swallow the exception.
            //
            discard(); // d383586
        } finally {
            if (isTraceOn && // d527372
                TEBeanLifeCycleInfo.isTraceEnabled()) {
                if (lifeCycle != null) // d367572.4
                {
                    TEBeanLifeCycleInfo.traceEJBCallExit(lifeCycle);
                }
            }

            // Resume the TX context if it was suspended.
            if (contextHelper != null) // d399469
            {
                contextHelper.complete(true);
            }

            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "remove: " + this);
        } // d367572.1  end

    }
453982
@Override
    public boolean remove(Object o) {
        Integer id = indexOf((Record) o);
        if(id == null) {
            return false;
        }
        remove(id);
        return true;
    }
27140
public boolean remove() {
        Entry e = flushedEntry;
        if (e == null) {
            clearNioBuffers();
            return false;
        }
        Object msg = e.msg;

        ChannelPromise promise = e.promise;
        int size = e.pendingSize;

        removeEntry(e);

        if (!e.cancelled) {
            // only release message, notify and decrement if it was not canceled before.
            ReferenceCountUtil.safeRelease(msg);
            safeSuccess(promise);
            decrementPendingOutboundBytes(size, false, true);
        }

        // recycle the entry
        e.recycle();

        return true;
    }
94203
public void remove(Object primaryKey)
                    throws RemoteException,
                    RemoveException,
                    FinderException
    {
        // d141216 method rewritten to avoid calling preinvoke/postinvoke
        //         twice in code path (i.e. don't just call remove on the
        //         bean after it is activated).  With the re-write, the
        //         bean will be activated and removed in the same tran
        //         as defined by the tx attribute on home.remove().

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "remove(pk) : " + primaryKey);

        homeEnabled();

        // Session beans and MDBs cannot be removed using this method.
        // For session beans, the spec calls for throwing an exception
        // to indicate this (no PK). MDB section not specific, thus do
        // the same for consistency.

        if (statefulSessionHome || statelessSessionHome || messageDrivenHome)
        {
            throw new RemoveException();
        }

        BeanId beanId = ivEntityHelper.remove(this, primaryKey);

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "remove(pk) : " + beanId);
    }
41927
@Override
    public boolean remove(Object o) {

        for (;;) {
            final long head = this.head.sum();
            // we are optimistically advancing the head by one
            // if the object does not exist we have to put it back
            if (headCursor.compareAndSet(head, head + 1)) {
                for (;;) {
                    final long tail = this.tail.sum();
                    if (tailCursor.compareAndSet(tail, tail + 1)) {
                        // number removed
                        int n = 0;

                        // just blocked access to the entire queue - go for it
                        for (int i = 0; i < size(); i++) {
                            final int slot = (int) ((this.head.sum() + i) & mask);
                            if (buffer[slot] != null && buffer[slot].equals(o)) {
                                n++;

                                for (int j = i; j > 0; j--) {
                                    final int cSlot = (int) ((this.head.sum() + j - 1) & mask);
                                    final int nextSlot = (int) ((this.head.sum() + j) & mask);
                                    // overwrite ith element with previous
                                    buffer[nextSlot] = buffer[cSlot];
                                }
                            }
                        }

                        if (n > 0) {
                            // head is advanced once for each
                            headCursor.set(head + n);

                            // undo the change to tail state - this was only
                            // done to block others from changing
                            tailCursor.set(tail);
                            // tail is unchanged
                            this.head.add(n);


                            // queue is not full now
                            queueNotFullCondition.signal();
                            return true;


                        } else {
                            // no change to the queue - unblock others
                            tailCursor.set(tail);
                            headCursor.set(head);
                            return false;
                        }
                    }
                }
            }
        }
    }
1072507
public void delist(BeanO beanO)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "delist : " + beanO);
        ensureActive();
        ivBeanOs.remove(beanO.beanId); // d130022
        ivBeanOList.remove(beanO); // d130022

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "delist : " + beanO);
    }
20506
public boolean remove(V value) {
        // peek at what is in the map
        K key = value.getKey();
        Ref<V> ref = map.get(key);
        // only try to remove the mapping if it matches the provided class loader
        return (ref != null && ref.get() == value) ? map.remove(key, ref) : false;
    }
761264
protected boolean enlist(BeanO beanO)
                    throws TransactionRolledbackException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.entry(tc, "enlist"
                     , new Object[] { Boolean.valueOf(globalTransaction), this, beanO }
                            ); //123293

        ensureActive();

        if (ivBeanOsEnlistedInTx == false) // d532639.2
        {
            initialize_beanO_vectors(); // d111555
        }

        boolean wasEnlisted = false;//d132828 avoid multiple returns

        //synchronized (beanOs) {  //d173022.2

        BeanO oldBeanO = beanOs.put(beanO.beanId, beanO);

        //d115597 begins

        if (oldBeanO == null) {

            // d140003.22 -- If CMP 2.0 bean, add bean to CMP 2.0 list for later use
            // Except, don't add ReadOnly/Interval beans to CMP 2.0 list; they
            // never need to be included in pre-find flush.               LI3408
            BeanMetaData bmd = beanO.home.beanMetaData;
            if (bmd.cmpVersion == InternalConstants.CMP_VERSION_2_X &&
                bmd.ivCacheReloadType == BeanMetaData.CACHE_RELOAD_NONE)
            {
                ArrayList<BeanO> bundle = homesForPMManagedBeans.get(beanO.home);

                if (bundle == null) { // here, value of null indicates no bundle in map
                    bundle = new ArrayList<BeanO>();
                    homesForPMManagedBeans.put(beanO.home, bundle);
                }

                bundle.add(beanO);
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "Added this BeanO to CMP20 structure");
            }

            afterList.add(beanO);//d115597 if new BeanO add to afterList
            if (origLock == false) {
                beanOList.add(beanO);//d115597 have not started beforeCompletion

            } else {
                setupTempLists();//d132828
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "sec enlist new : " + beanO);

                currentBeanOs.put(beanO.beanId, beanO);//d115597 new bean added once beforeCompletion called
                tempList.add(beanO); //d115597 add to the tempList
            }

            wasEnlisted = true;//d132828 avoid multiple returns

        }//new beanO
        else {
            // d115597 this bean is already in the tran, need to determine if this is a reenlistment
            if (origLock == true) {
                // d115597 this path is that beforeCompletion has started
                setupTempLists(); //d132828

                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "enlist in beforeCompletion: putting in list");

                BeanO obO = currentBeanOs.put(beanO.beanId, beanO);

                if (obO == null) {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Secondary enlist old : " + beanO);

                    // d115597 is this in the current list if not add?
                    tempList.add(beanO);
                }// d115597 not in current tran list

                // d115597 should return false
            }// d115597 not in original list of beanos (2nd or greater run through

        }// old beanO
         //d115597 end
         //}//synch end

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.exit(tc, "enlist : " + wasEnlisted); // d144064

        return wasEnlisted;// d132828 avoid multiple returns
    }
1268650
public <T> void delete(T bean) throws StorageException {
        EntityManager entityManager = getActiveEntityManager();
        try {
            entityManager.remove(bean);
        } catch (Throwable t) {
            logger.error(t.getMessage(), t);
            throw new StorageException(t);
        }
    }
105298
@Override
    protected boolean remove(final NoSqlSession session)
    {
        if (session == null)
        {
            return false;
        }
        else
        {
            return deleteKey(session.getId());
        }
    }
1187530
@Override
    public boolean remove(Object o) {

        if (o == null) {
            return false;
        }

        if (size() == 0) {
            return false;
        }

        synchronized (this) {
            //First check the expedited buffer
            synchronized (lock) {
                //Check if we wrap around the end of the array before iterating
                if (expeditedPutIndex > expeditedTakeIndex) {
                    for (int i = expeditedTakeIndex; i <= expeditedPutIndex; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements
                            for (int j = i; j < expeditedPutIndex; j++) {
                                expeditedBuffer[j] = expeditedBuffer[j + 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedPutIndex] = null;
                            expeditedPutIndex--;

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = expeditedTakeIndex; i < expeditedBuffer.length; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements up
                            for (int j = i; j > expeditedTakeIndex; j--) {
                                expeditedBuffer[j] = expeditedBuffer[j - 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedTakeIndex] = null;
                            if (expeditedTakeIndex == expeditedBuffer.length - 1) {
                                expeditedTakeIndex = 0;
                            } else {
                                expeditedTakeIndex++;
                            }

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                    for (int i = 0; i < expeditedPutIndex; i++) {
                        if (o.equals(expeditedBuffer[i])) {
                            //Remove element and shift all remaining elements down
                            for (int j = i; j < expeditedPutIndex; j++) {
                                expeditedBuffer[j] = expeditedBuffer[j + 1];
                            }
                            //Null the putIndex
                            expeditedBuffer[expeditedPutIndex] = null;
                            expeditedPutIndex--;

                            //Decrement used slots counter
                            numberOfUsedExpeditedSlots.getAndDecrement();

                            //TODO if expedited is added for put or offer with timeout add notification here

                            return true;
                        }
                    }
                }

                //Next check the main buffer
                //Check if we wrap around the end of the array before iterating
                if (putIndex > takeIndex) {
                    for (int i = takeIndex; i <= putIndex; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements
                            for (int j = i; j < putIndex; j++) {
                                buffer[j] = buffer[j + 1];
                            }
                            //Null the putIndex
                            buffer[putIndex] = null;
                            putIndex--;

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                } else {
                    //We wrap around the array. Loop through in two passes(upper and lower)
                    for (int i = takeIndex; i < buffer.length; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements up
                            for (int j = i; j > takeIndex; j--) {
                                buffer[j] = buffer[j - 1];
                            }
                            //Null the putIndex
                            buffer[takeIndex] = null;
                            if (takeIndex == buffer.length - 1) {
                                takeIndex = 0;
                            } else {
                                takeIndex++;
                            }

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                    for (int i = 0; i < putIndex; i++) {
                        if (o.equals(buffer[i])) {
                            //Remove element and shift all remaining elements down
                            for (int j = i; j < putIndex; j++) {
                                buffer[j] = buffer[j + 1];
                            }
                            //Null the putIndex
                            buffer[putIndex] = null;
                            putIndex--;

                            //Decrement used slots counter
                            numberOfUsedSlots.getAndDecrement();

                            //Notify a waiting put thread that space has cleared
                            notifyPut_();

                            return true;
                        }
                    }
                }
            }
        }
        return false;
    }
1031437
public void removeBean(ContainerTx tx, BeanO bean)
    {
        bean.getActivationStrategy().atRemove(tx, bean);
    }