The Modified method is how the properties that are defined in the
mailSession object of the server.xml are extracted and stored in the
sessionProperties.

@param context
@param bundleContext
@throws Exception
358275
@Modified
    protected void modified(ComponentContext context) throws Exception {

        processProperties(context.getProperties());
        deregisterJavaMailMBean();
        registerJavaMailMBean();
    }
57341
public void afterPropertiesSet() throws Exception {
        if (loginService == null) {
            loginService = new SimpleLoginService();
            ((SimpleLoginService) loginService).setName(realm);
        }
    }
1322890
@Override
    public void setApplicationContext(ApplicationContext appContext) throws BeansException {
        if (this.appContext != null) {
            throw new ApplicationContextException("Attempt to reinitialize application context.");
        }
        
        this.appContext = appContext;
    }
1328312
@FFDCIgnore(IllegalStateException.class)
    private <T> T adaptSystemBundle(final BundleContext bundleContext,
                                    Class<T> target) {
        try {
            Bundle systemBundle = bundleContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
            if (systemBundle != null)
                return systemBundle.adapt(target);
        } catch (IllegalStateException e) {
        }
        return null;
    }
336906
@Override
    public void afterPropertiesSet() throws Exception {
        final Map<String, Set<String>> resultAttributeMapping = this.getResultAttributeMapping();
        if (this.setReturningAttributes && resultAttributeMapping != null) {
            this.searchControls.setReturningAttributes(resultAttributeMapping.keySet().toArray(new String[resultAttributeMapping.size()]));
        }

        if (this.contextSource == null) {
            throw new BeanCreationException("contextSource must be set");
        }
    }
977975
private static BundleContext getBundleContext(final Bundle bundle) {
        if (System.getSecurityManager() == null)
            return bundle.getBundleContext();
        else
            return AccessController.doPrivileged(new PrivilegedAction<BundleContext>() {
                @Override
                public BundleContext run() {
                    return bundle.getBundleContext();
                }
            });
    }
955363
protected void activate(Map<String, Object> properties, ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "activate");

        _sslOptions.activate(context);
        _sslFactoryProvider.activate(context);

        _isSSLChain = MetatypeUtils.parseBoolean(_OutboundChain_ConfigAlias, "useSSL", properties.get("useSSL"), false);

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            SibTr.debug(tc, "Chain is configured for  " + (_isSSLChain ? "Secure " : "Non-Secure"));

        String Outboundname = (String) properties.get("id");

        _chainName = Outboundname;
        _tcpChannelName = Outboundname + "_JfapTcp";
        _sslChannelName = Outboundname + "_JfapSsl";
        _jfapChannelName = Outboundname + "_JfapJfap";

        //if chain is started first destroy then create it freshly
        if (_isChainStarted)
            performAction(destroyChainAction);
        performAction(createChainAction);

        _isActivated = true;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "activate");
    }
902262
protected void activate(ComponentContext context) throws Exception {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Activating");
        }

        processConfig(context.getProperties());

        SystemLogger.setLogService(logService);
    }
335967
@Override
    public void start(BundleContext context) {

        initialContextFactories = initServiceTracker(context, InitialContextFactory.class, ServiceTrackerCustomizers.ICF_CACHE);
        objectFactories = initServiceTracker(context, ObjectFactory.class, ServiceTrackerCustomizers.URL_FACTORY_CACHE);
        icfBuilders = initServiceTracker(context, InitialContextFactoryBuilder.class, ServiceTrackerCustomizers.LAZY);
        urlObjectFactoryFinders = initServiceTracker(context, URLObjectFactoryFinder.class, ServiceTrackerCustomizers.LAZY);
        environmentAugmentors = initServiceTracker(context, EnvironmentAugmentation.class, null);
        environmentUnaugmentors = initServiceTracker(context, EnvironmentUnaugmentation.class, null);

        try {
            OSGiInitialContextFactoryBuilder builder = new OSGiInitialContextFactoryBuilder();
            setField(InitialContextFactoryBuilder.class, builder, true);
            icfBuilder = builder;
        } catch (IllegalStateException e) {
            // Log the problem at info level, but only log the exception at debug level, as in many cases this is not a real issue and people
            // don't want to see stack traces at info level when everything it working as expected.
            LOGGER.info(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB.already.exists", getClassName(InitialContextFactoryBuilder.class)));
            LOGGER.debug(Utils.MESSAGES.getMessage("unable.to.set.static.ICFB.already.exists", getClassName(InitialContextFactoryBuilder.class)), e);
        }

        try {
            OSGiObjectFactoryBuilder builder = new OSGiObjectFactoryBuilder(context);
            setField(ObjectFactoryBuilder.class, builder, true);
            ofBuilder = builder;
        } catch (IllegalStateException e) {
            // Log the problem at info level, but only log the exception at debug level, as in many cases this is not a real issue and people
            // don't want to see stack traces at info level when everything it working as expected.
            LOGGER.info(Utils.MESSAGES.getMessage("unable.to.set.static.OFB.already.exists", getClassName(ObjectFactoryBuilder.class)));
            LOGGER.debug(Utils.MESSAGES.getMessage("unable.to.set.static.OFB.already.exists", getClassName(ObjectFactoryBuilder.class)), e);
        }

        context.registerService(JNDIProviderAdmin.class.getName(),
                                new ProviderAdminServiceFactory(context),
                                null);

        context.registerService(InitialContextFactoryBuilder.class.getName(),
                                new JREInitialContextFactoryBuilder(),
                                null);

        context.registerService(JNDIContextManager.class.getName(),
                                new ContextManagerServiceFactory(),
                                null);

        context.registerService(AugmenterInvoker.class.getName(),
                                AugmenterInvokerImpl.getInstance(),
                                null);

        //Start the bundletracker that clears out the cache. (only interested in stopping events)
        // bt = new BundleTracker(context, Bundle.STOPPING, new ServiceTrackerCustomizers.CacheBundleTrackerCustomizer());
        // bt.open();
    }
794362
protected void activate(final ComponentContext context)
			throws InvalidSyntaxException {
		log.info("activate");

		bundleContext = context.getBundleContext();

		sl = new ServiceListener() {
			public void serviceChanged(ServiceEvent event) {
				if (event.getType() == ServiceEvent.UNREGISTERING) {
					cache.unregisterComponentBindingsProvider(event
							.getServiceReference());
				} else if (event.getType() == ServiceEvent.REGISTERED) {
					cache.registerComponentBindingsProvider(event
							.getServiceReference());
				}
			}
		};
		bundleContext.addServiceListener(sl, "(" + Constants.OBJECTCLASS + "="
				+ ComponentBindingsProvider.class.getName() + ")");
		reloadCache();
		log.info("Activation successful");
	}
895399
public void run(T configuration, Environment environment) throws Exception {
        for (ConfiguredBundle<? super T> bundle : configuredBundles) {
            bundle.run(configuration, environment);
        }
    }
1349032
public void afterPropertiesSet() throws Exception {
		this.connectSupport = new ConnectSupport(sessionStrategy);
		if (applicationUrl != null) {
			this.connectSupport.setApplicationUrl(applicationUrl);
		}
	}
1314424
public static void initialize(final Context context) {
    if (!initialized.compareAndSet(false, true)) {
      return;
    }

    applicationContext = context.getApplicationContext();

    final String packageName = applicationContext.getPackageName();
    localAppName = packageName;

    final PackageManager manager = applicationContext.getPackageManager();
    try {
      final PackageInfo pkgInfo = manager.getPackageInfo(packageName, 0);
      localAppVersion = pkgInfo.versionName;
    } catch (final NameNotFoundException e) {
      Log.d(TAG, "Failed to get version of application, will not send in device info.");
    }

    Log.d(TAG, "Initialized android SDK");
  }
88449
@Modified
    @Trivial
    protected void modified(ComponentContext context) throws MalformedObjectNameException {
        Dictionary<String, ?> properties = context.getProperties();
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "modified", properties);

        // Validate new config before we do anything destructive
        Config newConfig = new Config(properties);
        Config oldConfig = configRef.get();

        readyForPollingTask.remove(PollingManager.DS_READY);

        Future<?> previousFuture = pollingFutureRef.getAndSet(null);
        if (previousFuture != null)
            previousFuture.cancel(false);

        if (oldConfig.enableTaskExecution != newConfig.enableTaskExecution)
            if (newConfig.enableTaskExecution)
                readyForPollingTask.add(PollingManager.EXECUTION_ENABLED);
            else {
                readyForPollingTask.remove(PollingManager.EXECUTION_ENABLED);
                inMemoryTaskIds.clear();
            }

        if (oldConfig.initialPollDelay != newConfig.initialPollDelay)
            if (newConfig.initialPollDelay == -1)
                readyForPollingTask.add(PollingManager.SIGNAL_REQUIRED);
            else if (oldConfig.initialPollDelay == -1)
                readyForPollingTask.remove(PollingManager.SIGNAL_REQUIRED);

        configRef.set(newConfig);

        // If the JNDI name changes, notify the application recycle coordinator and re-register the mbean
        if (newConfig.jndiName == null ? oldConfig.jndiName != null : !newConfig.jndiName.equals(oldConfig.jndiName)) {
            if (!applications.isEmpty()) {
                ApplicationRecycleCoordinator appCoord = (ApplicationRecycleCoordinator) context.locateService(APP_RECYCLE_SERVICE);
                Set<String> members = new HashSet<String>(applications);
                applications.removeAll(members);
                appCoord.recycleApplications(members);
            }

            if (mbean != null)
                mbean.unregister();

            mbean = new PersistentExecutorMBeanImpl(this);
            mbean.register(InvokerTask.priv.getBundleContext(context));
        }

        if (readyForPollingTask.addAndCheckIfReady(PollingManager.DS_READY))
            startPollingTask(newConfig);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "modified");
    }
887931
protected void activate(ComponentContext context, Map<String, Object> properties) {
        if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "activate", "context=" + context);
            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "activate", "properties=" + properties);
        }
        embeddableWebSphereTransactionManagerRef.activate(context);
        localTransactionCurrentRef.activate(context);
        resourceConfigFactoryRef.activate(context);
        dataSourceFactoryRef.activate(context);
        uowCurrentRef.activate(context);
        userTransactionRef.activate(context);
        serializationServiceRef.activate(context);
        configurationProperties = properties;

    }
358459
@Override
    public void contextInitialized(ServletContextEvent sce) {
        ServletContext context = sce.getServletContext();
        String propertiesConfig = context.getInitParameter(PROPERTIES_CONFIG);
        if(propertiesConfig == null) {
            propertiesConfig = PROPERTIES_CONFIG_DEFAULT;
        }
        SystemProperties config = loadConfiguration(propertiesConfig, context);
        addProperties(config);
        if(config.getFile() != null) {
            addPropertiesFromFile(config, context);
        }
        
    }
906772
public boolean execute(Context context) throws Exception
   {
      GenericWebAppContext webCtx = (GenericWebAppContext)context;
      HttpServletResponse response = webCtx.getResponse();
      HttpServletRequest request = webCtx.getRequest();

      // standalone request?
      String servletPath = request.getPathInfo();
      boolean doClose = true;
      // or included?
      if (servletPath == null)
      {
         servletPath = (String)request.getAttribute("javax.servlet.include.path_info");
         if (servletPath != null)
            doClose = false;
      }

      Node file = (Node)webCtx.getSession().getItem((String)context.get(pathKey));
      file.refresh(false);

      Node content = null;

      try
      {
         content = JCRCommandHelper.getNtResourceRecursively(file);
      }
      catch (ItemNotFoundException e)
      {
         // Patch for ver 1.0 back compatibility
         // as exo:image was not primary item
         if (file.isNodeType("exo:article"))
         {
            try
            {
               content = file.getNode("exo:image");
            }
            catch (PathNotFoundException e1)
            {
               throw e; // new ItemNotFoundException("No nt:resource node found at
               // "+file.getPath()+" nor primary items of nt:resource type
               // ");
            }
         }
         else
         {
            throw e; // new ItemNotFoundException("No nt:resource node found at
            // "+file.getPath()+" nor primary items of nt:resource type
            // ");
         }

      }

      // if(file.isNodeType("nt:file")) {
      // content = file.getNode("jcr:content");
      // } else if(file.isNodeType("exo:article")) {
      // content = file.getNode("exo:image");
      // } else
      // throw new Exception("Invalid node type, expected nt:file or exo:article,
      // have "+file.getPrimaryNodeType().getName()+" at "+file.getPath());

      Property data;
      try
      {
         data = content.getProperty("jcr:data");
      }
      catch (PathNotFoundException e)
      {
         throw new PathNotFoundException("No jcr:data node found at " + content.getPath());
      }

      String mime = content.getProperty("jcr:mimeType").getString();
      String encoding =
         content.hasProperty("jcr:encoding") ? content.getProperty("jcr:encoding").getString() : DEFAULT_ENCODING;

      MimeTypeResolver resolver = new MimeTypeResolver();
      String fileName = file.getName();
      String fileExt = "";
      if (fileName.lastIndexOf(".") > -1)
      {
         fileExt = fileName.substring(fileName.lastIndexOf(".") + 1);
         fileName = fileName.substring(0, fileName.lastIndexOf("."));
      }
      String mimeExt = resolver.getExtension(mime);
      if (fileExt == null || fileExt.length() == 0)
      {
         fileExt = mimeExt;
      }
      response.setContentType(mime + "; charset=" + encoding);
      String parameter = (String)context.get("cache-control-max-age");
      String cacheControl = parameter == null ? "" : "public, max-age=" + parameter;
      response.setHeader("Cache-Control: ", cacheControl);
      response.setHeader("Pragma: ", ""); // leave blank to avoid IE errors
      response.setHeader("Content-disposition", "attachment; filename=\"" + fileName + "." + fileExt + "\"");

      if (mime.startsWith("text"))
      {
         PrintWriter out = response.getWriter();
         out.write(data.getString());
         out.flush();
         if (doClose)
            out.close();
      }
      else
      {
         InputStream is = data.getStream();
         byte[] buf = new byte[is.available()];
         is.read(buf);
         ServletOutputStream os = response.getOutputStream();
         os.write(buf);
         os.flush();
         if (doClose)
            os.close();
      }

      return true;
   }