Perform actions required following method invocation; this is
the complement to activateBean, and should be called by the container
to balance activateBean. <p>
170269
public void postInvoke(ContainerTx tx, BeanO bean)
    {
        bean.getActivationStrategy().atPostInvoke(tx, bean);
    }
885546
public void activate() {
        if (entries.get() != null) {
            throw new IllegalStateException("Scope " + JoynrMessageScope.class.getSimpleName() + " is already active.");
        }
        logger.trace("Activating {} scope", JoynrMessageScope.class.getSimpleName());
        entries.set(new HashMap<Key<?>, Object>());
    }
242527
public void activate() {
        // Notify ActivationListeners
    	SipApplicationSessionEvent event = null;
    	if(sipApplicationSessionAttributeMap != null) {
	        Set<String> keySet = sipApplicationSessionAttributeMap.keySet();
	        for (String key : keySet) {
	        	Object attribute = sipApplicationSessionAttributeMap.get(key);
	            if (attribute instanceof SipApplicationSessionActivationListener) {
	                if (event == null)
	                	event = new SipApplicationSessionActivationEvent(this, SessionActivationNotificationCause.ACTIVATION);
	                try {
	                    ((SipApplicationSessionActivationListener)attribute)
	                        .sessionDidActivate(event);
	                } catch (Throwable t) {
	                    logger.error("SipApplicationSessionActivationListener threw exception", t);
	                }
	            }
			}
	    }
    }
421456
public void resolveActionBeanClass(BeanMethodActionRule beanMethodActionRule) throws IllegalRuleException {
        String beanIdOrClass = beanMethodActionRule.getBeanId();
        if (beanIdOrClass != null) {
            Class<?> beanClass = resolveBeanClass(beanIdOrClass, beanMethodActionRule);
            if (beanClass != null) {
                beanMethodActionRule.setBeanClass(beanClass);
                reserveBeanReference(beanClass, beanMethodActionRule);
            } else {
                reserveBeanReference(beanIdOrClass, beanMethodActionRule);
            }
        }
    }
1027367
void enableManagement(boolean enabled) {
    requireNotClosed();

    synchronized (configuration) {
      if (enabled) {
        JmxRegistration.registerMXBean(this, cacheMXBean, MBeanType.Configuration);
      } else {
        JmxRegistration.unregisterMXBean(this, MBeanType.Configuration);
      }
      configuration.setManagementEnabled(enabled);
    }
  }
14487
protected void activate(ComponentContext compcontext) {
        if (TC.isDebugEnabled()) {
            Tr.debug(TC, "Activating " + this.getClass().getName());
        }
        this.userTransaction.activate(compcontext);
        this.transactionManager.activate(compcontext);
    }
247599
function() {
        if(this.strategies) {
            var strategy, i, len;
            for(i=0, len=this.strategies.length; i<len; i++) {
                strategy = this.strategies[i];
                if(strategy.autoActivate) {
                    strategy.activate();
                }
            }
        }
    }
1172121
public void run() {
		// need <bean id="..." class="org.esupportail.commons.context.ApplicationContextHolder" />
		ApplicationContext applicationContext = ApplicationContextHolder.getContext();

		SessionFactory sessionFactory = HibernateUtils.getSessionFactory(applicationContext);
		boolean participate = HibernateUtils.openSession(sessionFactory);

		try {
			if (logger.isDebugEnabled()) {
				logger.debug("Starting new Thread to manage ack with : " + 
					     " - smid : " + acknowledgment.getSmsId() + 
					     " - ack status : " + acknowledgment.getSmsStatus());
			}

			// Send the ack to the business layer 
			final AckManagerBusiness ackManagerBusiness = (AckManagerBusiness) applicationContext.getBean(ACK_BUSINESS_MGR_BEAN_NAME);
			ackManagerBusiness.manageAck(acknowledgment);

		// error case, rollback
		} catch (RuntimeException e) {
			logger.error("Catching exception in AckManagerThread, now rollback : ", e);
			throw e;
		// close the session every time	
		} finally {
		    HibernateUtils.closeSession(sessionFactory, participate);
		}
	 }
625712
public void executeNext() {

        if (!m_idle) {
            if (m_actions.isEmpty()) {
                m_idle = true;
            } else {
                CmsValidationController action = m_actions.removeFirst();
                action.internalStartValidation();
            }
        } else {
            assert false; // this shouldn't happen
        }
    }
942186
public void runAction(ActionType action) {

        m_mode = action;
        setActionFlags();
        setCommonParameters();
        m_checkinBean.clearModules();
        for (String moduleName : getSelectedModules()) {
            m_checkinBean.addModuleToExport(moduleName);
        }
        int result = m_checkinBean.checkIn();
        String log = m_checkinBean.getLogText();
        String message = null;
        boolean error = false;
        switch (action) {
            case checkIn:
                String messageToSave = m_checkinBean.getCommitMessage();
                String emailToSave = m_checkinBean.getGitUserEmail();
                String userToSave = m_checkinBean.getGitUserName();
                CmsObject cms = m_checkinBean.getCmsObject();
                CmsUser user = cms.getRequestContext().getCurrentUser();
                setUserInfo(user, ADDINFO_USER, userToSave);
                setUserInfo(user, ADDINFO_EMAIL, emailToSave);
                setUserInfo(user, ADDINFO_MESSAGE, messageToSave);
                try {
                    cms.writeUser(user);
                } catch (CmsException e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }

                List<Button> resetButtons = new ArrayList<Button>();

                Button resetHead = new Button(CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_HEAD_0));
                resetHead.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_HEAD_DESC_0));
                resetHead.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        runAction(ActionType.resetHead);
                    }
                });

                Button resetRemoteHead = new Button(
                    CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_REMOTE_HEAD_0));
                resetRemoteHead.setDescription(
                    CmsVaadinUtils.getMessageText(Messages.GUI_GIT_BUTTON_RESET_REMOTE_HEAD_DESC_0));
                resetRemoteHead.addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        runAction(ActionType.resetRemoteHead);
                    }
                });

                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_SUCCESSFUL_0);
                } else if (result == 10) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_FAILED_0);
                    error = true;
                    resetButtons.add(resetRemoteHead);
                    resetButtons.add(resetHead);
                } else {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_CHECKIN_FAILED_0);
                    error = true;
                    resetButtons.add(resetRemoteHead);
                }
                CmsGitActionResultPanel panel = new CmsGitActionResultPanel(message, log, error, resetButtons);
                addAsWindow(panel);
                break;
            case checkOut:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_IMPORT_SUCCESSFUL_0);
                } else {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_IMPORT_FAILED_0);
                }
                CmsGitActionResultPanel checkoutResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(checkoutResult);
                break;
            case resetHead:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_SUCCESSFUL_0);
                } else {
                    error = true;
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_FAILED_0);
                }
                CmsGitActionResultPanel resetResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(resetResult);
                break;
            case resetRemoteHead:
                if (result == 0) {
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_SUCCESSFUL_0);
                } else {
                    error = true;
                    message = CmsVaadinUtils.getMessageText(Messages.GUI_GIT_RESET_FAILED_0);
                }
                CmsGitActionResultPanel resetRemoteResult = new CmsGitActionResultPanel(
                    message,
                    log,
                    error,
                    new ArrayList<Button>());
                addAsWindow(resetRemoteResult);
                break;
            default:
                // Should never happen
        }
    }
905877
public void activate(StatefulBeanO beanO, BeanMetaData bmd) // d648122
    throws RemoteException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) //130050
            Tr.entry(tc, "activate: " + beanO);

        Object sb = null; // d367572.7
        ManagedObjectContext ejbState = null;
        BeanId bid = beanO.getId();
        ClassLoader classLoader = bmd.classLoader; // d648122

        // LI2775-107.2 Begins WS18354.02a,MD19305C
        Object credToken = ivContainer.getEJBRuntime().pushServerIdentity();

        // LI2775-107.2 Ends

        ObjectInputStream beanStream = null;
        GZIPInputStream istream = null;
        try
        {
            //PK69093 - Only allow one stream to be open for reading at one time
            synchronized (ivActivateLock)
            {
                // LIDB2018-1 begins
                // Check whether SFSB failover is enabled.
                if (!beanO.sfsbFailoverEnabled())
                {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Failover is NOT enabled");

                    istream = ivBeanStore.getGZIPInputStream(bid);
                    beanStream = createActivationInputStream(istream, beanO, classLoader);
                }
                else
                {
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "Failover is enabled");

                    // SFSB failover is enabled.  Determine whether to
                    // get compressed data from passivation file or
                    // from failover cache.
                    byte[] data = null;
                    if (ivStatefulFailoverCache.beanExists(bid))
                    {
                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "Retrieving data from failover cache");

                        // Exists in failover cache, so activate using data in failover cache.
                        boolean isSticky = ivStatefulFailoverCache.inStickyUOW(bid); // d209857
                        data = ivStatefulFailoverCache.getAndRemoveData(bid, beanO.ivSfFailoverClient); // d209857 //d229518
                        if (isSticky)
                        {
                            // SFSB failover occured while in middle of a sticky BMT.
                            // This is not supported, so throw an exception.
                            throw new NoSuchObjectException("Bean Managed Transaction is active, SFSB failover not supported");
                        }

                        if (data == null)
                        {
                            // For some reason failover cache entry exists, but replication
                            // of SFSB to this server was unsuccessful.
                            throw new NoSuchObjectException("SFSB replication failed.");
                        }
                    }
                    else
                    {
                        //SFSB not in failover cache. so get data from passivation file.
                        InputStream fis = ivBeanStore.getInputStream(bid);
                        ObjectInputStream beanStream2 = createActivationInputStream(fis, beanO, classLoader);
                        int n = beanStream2.readInt();
                        data = new byte[n];

                        if (isTraceOn && tc.isDebugEnabled())
                            Tr.debug(tc, "length of compressed bytes is: " + n);

                        int bytesRead = 0;
                        for (int offset = 0; offset < n; offset += bytesRead)
                        {
                            bytesRead = beanStream2.read(data, offset, n - offset);
                            if (isTraceOn && tc.isDebugEnabled())
                            {
                                Tr.debug(tc, "bytes read from input stream is: " + bytesRead);
                            }

                            if (bytesRead == -1)
                            {
                                throw new IOException("end of input stream while reading compressed bytes");
                            }
                        }

                        beanStream2.close();
                    }

                    // create an input stream for decompressing the SFSB data.
                    ByteArrayInputStream bais = new ByteArrayInputStream(data);
                    istream = new GZIPInputStream(bais);
                    beanStream = createActivationInputStream(istream, beanO, classLoader);
                }

                // If failover was enabled and the EJB module is pre-3.0, the old format is used
                boolean oldFormat = beanO.sfsbFailoverEnabled() && (getEJBModuleVersion(beanO) < BeanMetaData.J2EE_EJB_VERSION_3_0);

                //  d204278.2 begin
                // First read in last access time from input stream
                // and set it in the StatefulBeanO.
                long lastAccessTime = beanStream.readLong();
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "read from data last access time: " + lastAccessTime);
                beanO.setLastAccessTime(lastAccessTime);
                // d204278.2 end

                // Read the JPAExPcBindingContext.
                // TODO: ejbteam - Since we are very late in the EJB3 FP cycle I will not
                // make this change now, but we really should only be passivating and
                // activating this value when this EJB has ContainerManaged Extended
                // Persistence Context.    When this change is made we will need to
                // change this method, but also the passivate method and StatefulBeanO.remove().
                // It can also be removed from the logic for activating and passivating
                // 2.0 and 2.1 SFSB's since they will not have an extendedPC
                // An incomplete change will result in NPE's in certain circumstances.  //d477342
                Object exPC = beanStream.readObject();
                beanO.setJPAExPcBindingContext(exPC);

                Map<String, Map<String, Field>> passivatorFields = null;
                if (oldFormat)
                {
                    // Now read SFSB data from the input stream and close
                    // the input stream.
                    sb = beanStream.readObject(); // d367572.7
                    ejbState = null;
                }
                else
                {
                    EJBObjectInfo sbObjectInfo = (EJBObjectInfo) beanStream.readObject();
                    passivatorFields = getPassivatorFields(bmd); // d648122

                    if (sbObjectInfo.isSerializable())
                    {
                        sb = sbObjectInfo.getSerializableObject();
                    }
                    else
                    {
                        sb = activateObjectFromInfo(sbObjectInfo, bmd.enterpriseBeanClass, passivatorFields); // d648122
                    }

                    ejbState = readManagedObjectContext(beanStream, bmd, sb); // F87720

                    int expectedNumInterceptors = 0;
                    if (bmd.ivInterceptorMetaData != null && bmd.ivInterceptorMetaData.ivInterceptorClasses != null)
                    {
                        expectedNumInterceptors = bmd.ivInterceptorMetaData.ivInterceptorClasses.length;
                    }

                    // Handle interceptors
                    int n = beanStream.readInt();
                    if (isTraceOn && tc.isDebugEnabled())
                        Tr.debug(tc, "number of interceptors is " + n);

                    if (n == -1)
                    {
                        n = 0;
                    }

                    if (n != expectedNumInterceptors) // RTC97224
                    {
                        throw new RemoteException("interceptor count " + n +
                                                  " in serialization data does not match actual count " + expectedNumInterceptors);
                    }

                    if (n != 0)
                    {
                        Class<?>[] interceptorClasses = bmd.ivInterceptorMetaData.ivInterceptorClasses;
                        Object[] interceptors = new Object[n];

                        for (int i = 0; i < n; i++)
                        {
                            EJBObjectInfo interceptorObjectInfo = (EJBObjectInfo) beanStream.readObject();
                            if (interceptorObjectInfo.isSerializable())
                            {
                                interceptors[i] = interceptorObjectInfo.getSerializableObject();
                            }
                            else
                            {
                                interceptors[i] = activateObjectFromInfo(interceptorObjectInfo, interceptorClasses[i], passivatorFields); // d648122
                            }

                        }
                        beanO.setInterceptors(interceptors);
                    }

                    beanO.setLastAccessTime(lastAccessTime);
                }

                beanStream.close();
            }

            beanO.setEnterpriseBean(sb, ejbState);

            // PK69093 - beanStore.remove will access a file, as such lets synch this call
            // such that only one file can be open for remove at a time.
            synchronized (ivRemoveLock)
            {
                // Now delete the file used to passivate the bean.
                ivBeanStore.remove(bid); //d248470
            }

            // LIDB2018-1 ends
        } catch (StreamUnavailableException ex)
        {
            FFDCFilter.processException(ex, CLASS_NAME + ".activate", "146", this);
            throw new NoSuchObjectException("");
        } catch (CSIException ex)
        {
            FFDCFilter.processException(ex, CLASS_NAME + ".activate", "149", this);
            throw new RemoteException("activation failed", ex);
        } catch (ClassNotFoundException e)
        {
            FFDCFilter.processException(e, CLASS_NAME + ".activate", "152", this);
            Tr.warning(tc, "CANNOT_ACTIVATE_STATEFUL_BEAN_CNTR0003W",
                       new Object[] { beanO.toString(), this, e }); //p111002.3
            throw new RemoteException("", e);
        } catch (RemoteException rex)
        {
            // RemoteException (including NoSuchObjectExcetpion) is a subclass
            // of IOException... but it should not get wrapped inside another
            // RemoteException, which IOException catch block will do.   d350987
            FFDCFilter.processException(rex, CLASS_NAME + ".activate", "576", this);
            Tr.warning(tc, "CANNOT_ACTIVATE_STATEFUL_BEAN_CNTR0003W",
                       new Object[] { beanO.toString(), this, rex });
            throw rex;
        } catch (IOException e)
        {
            FFDCFilter.processException(e, CLASS_NAME + ".activate", "157", this);
            Tr.warning(tc, "CANNOT_ACTIVATE_STATEFUL_BEAN_CNTR0003W",
                       new Object[] { beanO.toString(), this, e }); //p111002.3
            throw new RemoteException("", e);
            // LI2775-107.2 Begins WS18354.02a,MD19305C
        } finally
        {
            if (credToken != null) // d646413.2
            {
                ivContainer.getEJBRuntime().popServerIdentity(credToken);
            }
            // LI2775-107.2 Begins WS18354.02a,MD19305C
        }

        if (isTraceOn && tc.isEntryEnabled()) //130050
            Tr.exit(tc, "activate");
    }
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);
    }
637604
@InternalFunction(precedence=1,isAssign=true)
    public void activate(RuleContext ruleContext,RuleProxyField ruleProxyField)
    {
        setActivate(ruleProxyField,ruleContext);
    }
550886
public T withPostLoadBeanValidation(boolean enablePostLoadBeanValidation) {
        if (enablePostLoadBeanValidation) {
            Validator.validateTrue(configMap.containsKey(BEAN_VALIDATION_ENABLE) && configMap.<Boolean>getTyped(BEAN_VALIDATION_ENABLE),
                    "Before activating Post Load Bean Validation, you should activate first Bean Validation by calling 'withBeanValidation(true)' ");
        }
        configMap.put(POST_LOAD_BEAN_VALIDATION_ENABLE, enablePostLoadBeanValidation);
        return getThis();
    }
516184
public void setActionFlags() {

        m_checkinBean.setFetchAndResetBeforeImport(m_fetchAndReset.getValue().booleanValue());
        switch (m_mode) {
            case checkOut:
                m_checkinBean.setCheckout(true);
                m_checkinBean.setResetHead(false);
                m_checkinBean.setResetRemoteHead(false);
                break;
            case checkIn:
                m_checkinBean.setCheckout(false);
                m_checkinBean.setResetHead(false);
                m_checkinBean.setResetRemoteHead(false);
                break;
            case resetHead:
                m_checkinBean.setCheckout(false);
                m_checkinBean.setResetHead(true);
                m_checkinBean.setResetRemoteHead(false);
                break;
            case resetRemoteHead:
                m_checkinBean.setCheckout(false);
                m_checkinBean.setResetHead(false);
                m_checkinBean.setResetRemoteHead(true);
                break;
            default:
                break;
        }

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

        //Eager initialize the StaxUtils
        try {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), StAXUtils.getStAXProviderClassLoader());
            Class.forName("org.apache.cxf.staxutils.StaxUtils");
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException(e);
        } finally {
            THREAD_CONTEXT_ACCESSOR.setContextClassLoader(Thread.currentThread(), orignalClassLoader);
        }
    }
1263378
public void registerControlAdapterAsMBean()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
	  SibTr.entry(tc, "registerControlAdapterAsMBean");
    if (isRegistered() ) {
      // Don't register a 2nd time.
    } else {
      super.registerControlAdapterAsMBean();
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    SibTr.exit(tc, "registerControlAdapterAsMBean");
  }