Remove this <code>SessionBeanO</code> instance. <p>
323655
@Override
    public final void remove() throws RemoteException, RemoveException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "remove");

        //canBeRemoved();//94781

        // For stateless beans, it is not upto the client to remove objects
        // so just return at this point. The container can decide to remove
        // objects at some point (the pool manager drives this decision)
        // at which point we will call ejbRemove on the bean

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "remove");
        return;
    }
484823
private boolean internalRemove(Object o, boolean publicApi) {

        if (!contains(o)) return false;

        // todo: for multithreaded usage this block needs to be synchronized
        BeanContextChild bcc = null;
        if (o instanceof BeanContextProxy) {
            bcc = ((BeanContextProxy) o).getBeanContextProxy();
        }
        else if (o instanceof BeanContextChild) {
            bcc = (BeanContextChild) o;
        }

        if (bcc != null) {

            /*
             If remove invoked as a result of the BeanContext receiving an unexpected PropertyChangeEvent
             notification as a result of a 3rd party invoking setBeanContext() then the remove implementation
             shall not invoke setBeanContext(null) on that child as part of the remove() semantics, since
             doing so would overwrite the value previously set by the 3rd party.
            */
            if (publicApi) {

                // remove the property/veto listeners -- we know we want to remove the bean
                // and don't need to be notified if we have initiated the removal
                bcc.removePropertyChangeListener("beanContext", _childPcl);
                bcc.removeVetoableChangeListener("beanContext", _childVcl);

                try {
                    bcc.setBeanContext(null);
                }
                catch (PropertyVetoException e) {
                    // rewire the listeners we removed above then except
                    bcc.addPropertyChangeListener("beanContext", _childPcl);
                    bcc.addVetoableChangeListener("beanContext", _childVcl);
                    throw new IllegalStateException(e);
                }
            }
        }

        if (o instanceof BeanContextMembershipListener) {
            removeBeanContextMembershipListener((BeanContextMembershipListener) o);
        }

        BCChild bc = _children.get(o);
        if (bc.isProxy()) {
            _children.remove(bc.getChild());
        }
        else if (bc.hasProxy()) {
            _children.remove(bc.getProxy());
        }
        _children.remove(o);

        BeanContextMembershipEvent bcme = new BeanContextMembershipEvent((BeanContext) getPeer(), new Object[]{o});
        fireMembershipEvent(bcme, false);
        // end synchronized block
        return true;
    }
650287
void removeProducerSession(ProducerSessionImpl producer)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "removeProducerSession");
        synchronized (_producers)
        {
            _producers.remove(producer);
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "removeProducerSession");
    }
458522
public void removeEventListener(EventListener listener)
    {
        if (listener instanceof HttpSessionAttributeListener)
            _sessionAttributeListeners.remove(listener);
        if (listener instanceof HttpSessionListener)
            _sessionListeners.remove(listener);
    }
901997
private void removeListener(CmsUUID listenerId) {

        getRequest().getSession().removeAttribute(SESSION_ATTRIBUTE_LISTENER_ID);
        m_listeners.remove(listenerId);
    }
674621
private void destroySession() {
        currentSessionId = 0;
        setAppLaunchPushed(false);
        getConfigLogger().verbose(getAccountId(),"Session destroyed; Session ID is now 0");
        clearSource();
        clearMedium();
        clearCampaign();
        clearWzrkParams();
    }
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

    }
1059646
public void destorySession(Session session) {
        session.attributes().clear();
        sessionMap.remove(session.id());

        Event event = new Event();
        event.attribute("session", session);

        eventManager.fireEvent(EventType.SESSION_DESTROY, event);
    }
575683
void removeSession(JmsSessionImpl sess) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "removeSession", sess);

        synchronized (stateLock) {
            // Remove the Session
            // Note that this is a synchronized collection.
            boolean res = sessions.remove(sess);

            // Release the ordering context associated with the session
            unusedOrderingContexts.add(sess.getOrderingContext());

            if (!res && TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                SibTr.debug(this, tc, "session not found in list");
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "removeSession");
    }
895560
synchronized void removeSession(long sessionID) {

        LongKeyIntValueHashMap scsMap;
        long                   csid;
        Iterator               i;

        scsMap = (LongKeyIntValueHashMap) sessionUseMap.remove(sessionID);

        if (scsMap == null) {
            return;
        }

        i = scsMap.keySet().iterator();

        while (i.hasNext()) {
            csid = i.nextLong();

            int usecount = useMap.get(csid, 1) - 1;

            if (usecount == 0) {
                Statement cs = (Statement) csidMap.remove(csid);

                if (cs != null) {
                    int schemaid = cs.getSchemaName().hashCode();
                    LongValueHashMap sqlMap =
                        (LongValueHashMap) schemaMap.get(schemaid);
                    String sql = (String) sqlLookup.remove(csid);

                    sqlMap.remove(sql);
                }

                useMap.remove(csid);
            } else {
                useMap.put(csid, usecount);
            }
        }
    }
1350935
public final void removeBrowserSession(AOBrowserSessionKey key)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "removeBrowserSession", key);

    browserSessionTable.remove(key);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "removeBrowserSession");

  }
1035175
public <T> void destroy() {
        final Set<Entry<Bean<?>, Object>> beanSet = beanReferences.entrySet();
        final Iterator<Entry<Bean<?>, Object>> i = beanSet.iterator();
        Bean<?> bean;
        while (i.hasNext()) {
            bean = i.next().getKey();
            final T instance = (T) beanReferences.get(bean);

            destroyReference((Bean<T>) bean, instance);
        }

        beanReferences.clear();
    }
892021
private void destroy() {
        final boolean bTrace = TraceComponent.isAnyTracingEnabled();
        if (bTrace && tc.isEventEnabled()) {
            Tr.event(tc, "Session being destroyed; " + this);
        }
        // List<HttpSessionListener> list = this.myConfig.getSessionListeners();
        // if (null != list) {
        // HttpSessionEvent event = new HttpSessionEvent(this);
        // for (HttpSessionListener listener : list) {
        // if (bTrace && tc.isDebugEnabled()) {
        // Tr.debug(tc, "Notifying listener of destroy; " + listener);
        // }
        // listener.sessionDestroyed(event);
        // }
        // }
        for (String key : this.attributes.keySet()) {
            Object value = this.attributes.get(key);
            HttpSessionBindingEvent event = new HttpSessionBindingEvent(this, key);
            if (value instanceof HttpSessionBindingListener) {
                if (bTrace && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Notifying attribute of removal: " + value);
                }
                ((HttpSessionBindingListener) value).valueUnbound(event);
            }
        }
        this.attributes.clear();
        this.myContext = null;
    }
883566
public void removeCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey sipApplicationSession) {
		joinApplicationSession.remove(sipApplicationSession);
		replacesApplicationSession.remove(sipApplicationSession);
		Iterator<MobicentsSipApplicationSessionKey> it = joinApplicationSession.values().iterator();
		boolean found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				joinApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
		it = replacesApplicationSession.values().iterator();
		found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				replacesApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
	}
1088810
public void removeInstance( String applicationName, String instancePath ) {
		this.logger.finer( String.format( "Removing instance \"%s\" from application \"%s\"...",
				instancePath, applicationName ) );

		WebResource path = this.resource
				.path( UrlConstants.APP )
				.path( applicationName )
				.path( "instances" )
				.queryParam( "instance-path", instancePath );

		this.wsClient.createBuilder( path ).delete();
		this.logger.finer( String.format( "Instance \"%s\" has been removed from application \"%s\"",
				instancePath, applicationName ) );
	}
71027
@Override
    public Object remove(String name) {
        final HttpSession session = this.getPortalSesion(false);
        if (session == null) {
            return null;
        }

        final Object sessionMutex = WebUtils.getSessionMutex(session);
        synchronized (sessionMutex) {
            final Object attribute = session.getAttribute(name);
            if (attribute != null) {
                session.removeAttribute(name);
            }

            return attribute;
        }
    }
105298
@Override
    protected boolean remove(final NoSqlSession session)
    {
        if (session == null)
        {
            return false;
        }
        else
        {
            return deleteKey(session.getId());
        }
    }