Expert users can override this method for more complete control over the
execution of the Mapper.
@param context
@throws IOException
171
public void run(Context context) throws IOException, InterruptedException {
    setup(context);
    while (context.nextKeyValue()) {
      map(context.getCurrentKey(), context.getCurrentValue(), context);
    }
    cleanup(context);
  }
749294
@Override
	public final void cleanup(Context context) throws IOException, InterruptedException {
		cleanup(this.context, collector);
		collector.close();
		super.cleanup(context);
	}
1100494
@Activate
    protected void activate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
            Tr.event(tc, "activate", context);
    }
1334057
public static void closeContext(DirContext context) {
		if (context != null) {
			try {
				context.close();
			}
			catch (NamingException ex) {
				LOGGER.debug("Could not close JNDI DirContext", ex);
			}
			catch (Throwable ex) {
				// We don't trust the JNDI provider: It might throw
				// RuntimeException or Error.
				LOGGER.debug("Unexpected exception on closing JNDI DirContext", ex);
			}
		}
	}
998464
public static void setOutputs(Message message, KnowledgeOperation operation, Map<String, Object> contextOverrides) {
        try {
            setOutputsOrFaults(message, operation.getOutputExpressionMappings(), contextOverrides, RESULT, false);
        } catch (Exception e) {
            setOutputsOrFaults(message, operation.getOutputExpressionMappings(), contextOverrides, RESULT, true);
        }
    }
718728
public static synchronized void initialize(Context context) {
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.beginSection("ImagePipelineFactory#initialize");
    }
    initialize(ImagePipelineConfig.newBuilder(context).build());
    if (FrescoSystrace.isTracing()) {
      FrescoSystrace.endSection();
    }
  }
928268
public void associate(ServletContext context) {
		context.setAttribute(COMPONENTS, new ConcurrentHashMap<Descriptor<?>, Object>());
		this.context = context;
	}
406262
@Override
	public final void setup(
	    Mapper<INPUT_KEY, INPUT_VALUE, DatumWrapper<ITuple>, NullWritable>.Context context)
	    throws IOException, InterruptedException {
		try {
			super.setup(context);
			Configuration conf = context.getConfiguration();
			TupleMRConfig tupleMRConfig = TupleMRConfig.get(conf);
			this.context = new TupleMRContext(context, tupleMRConfig);
			this.collector = new Collector(context);
			setup(this.context, this.collector);
		} catch(TupleMRException e) {
			throw new RuntimeException(e);
		}
	}
881125
public static void beginContext(ControlContainerContext context)
    {
        Stack<ControlContainerContext> contextStack = _threadContexts.get();
        if (contextStack == null)
        {
            contextStack = new Stack<ControlContainerContext>();
            _threadContexts.set(contextStack);
        }
        contextStack.push(context);
    }
314239
@com.fasterxml.jackson.annotation.JsonProperty("Context")
    public void setContext(String context) {
        this.context = context;
    }
992489
public static synchronized void sdkInitialize(Context context) {
        if (sdkInitialized == true) {
          return;
        }
        BoltsMeasurementEventListener.getInstance(context.getApplicationContext());
        sdkInitialized = true;
    }
823110
private void init(Context context) {
    try {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.beginSection("DraweeView#init");
      }
      if (mInitialised) {
        return;
      }
      mInitialised = true;
      mDraweeHolder = DraweeHolder.create(null, context);
      if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        ColorStateList imageTintList = getImageTintList();
        if (imageTintList == null) {
          return;
        }
        setColorFilter(imageTintList.getDefaultColor());
      }
      // In Android N and above, visibility handling for Drawables has been changed, which breaks
      // activity transitions with DraweeViews.
      mLegacyVisibilityHandlingEnabled =
          sGlobalLegacyVisibilityHandlingEnabled
              && context.getApplicationInfo().targetSdkVersion >= 24; // Build.VERSION_CODES.N
    } finally {
      if (FrescoSystrace.isTracing()) {
        FrescoSystrace.endSection();
      }
    }
  }
551293
public static void bind(ApplicationContext context) {
        Object old = contextMap.putIfAbsent(getContextClassLoader(), context);
        if (old != null) {
            throw new IllegalStateException(
                "There is already a ApplicationContext associated with the context ClassLoader of the current thread!");
        }
    }
1224233
@Override
    public void setContext(Context context) {
        super.setContext(context);

        fsInfo = FSInfo.instance(context);

        contextUseOptimizedZip = options.getBoolean("useOptimizedZip", true);
        if (contextUseOptimizedZip)
            zipFileIndexCache = ZipFileIndexCache.getSharedInstance();

        mmappedIO = options.isSet("mmappedIO");
        symbolFileEnabled = !options.isSet("ignore.symbol.file");

        String sf = options.get("sortFiles");
        if (sf != null) {
            sortFiles = (sf.equals("reverse") ? SortFiles.REVERSE : SortFiles.FORWARD);
        }
    }
148033
protected void configureContext(Context context) {
		this.contextLifecycleListeners.forEach(context::addLifecycleListener);
		new DisableReferenceClearingContextCustomizer().customize(context);
		this.tomcatContextCustomizers
				.forEach((customizer) -> customizer.customize(context));
	}
1019974
private void store() throws IOException
   {
      Properties props = new Properties();

      // store mappings in properties
      Iterator<String> iter = prefixToURI.keySet().iterator();
      while (iter.hasNext())
      {
         String prefix = iter.next();
         String uri = prefixToURI.get(prefix);
         props.setProperty(prefix, uri);
      }

      OutputStream out = PrivilegedFileHelper.fileOutputStream(storage);
      try
      {
         out = new BufferedOutputStream(out);
         props.store(out, null);
      }
      finally
      {
         // make sure stream is closed
         out.close();
      }
   }
1112574
@Override
	public void execute(ExecutionContext context){

		final String[] args = context.getArguments();
		
		String clusterValue = getArgumentValue(ARG_CLUSTER_NAME,args,null); 

		if(clusterValue != null){
			// Add all the arguments which need to be validated	
			this.createCollectiveArgumentsValues();
			this.validateArgumentList(args, true);
			
			String serverValues = getArgumentValue(ARG_SERVER_ADDRESS, args, null);
			if(serverValues == null){
				throw new IllegalArgumentException(getMessage(MISSING_VALUE_MSG , 
						"["+ARG_SERVER_ADDRESS + "]"));
			}

			String targetPathValue = getArgumentValue(ARG_OPT_TARGET_PATH, args, null);

			GeneratePluginForCollective collectiveTask = 
					new GeneratePluginForCollective(serverValues, clusterValue ,targetPathValue,commandConsole);
			ParseLoginAddress controllerAddress = null;
			try {
				controllerAddress = collectiveTask.parseCollectiveAddressValue();
			} catch (IllegalArgumentException e) {
				throw e;
			}		
			invokeGeneratePluginCfgMBean(controllerAddress, collectiveTask.getCluster(),targetPathValue,"collective");		
		}
		else{
			// Add all the arguments which need to be validated	
			this.createServerArgumentsValues();
			String serverValues = getArgumentValue(ARG_SERVER_ADDRESS, args, null);
			if(serverValues == null){
				throw new IllegalArgumentException(getMessage(MISSING_VALUE_MSG , 
						"["+ARG_SERVER_ADDRESS + "]" ));
			}

			this.validateArgumentList(args, true);

			String targetPathValue = getArgumentValue(ARG_OPT_TARGET_PATH, args, null);			
			GeneratePluginForServer serverTask = 
					new GeneratePluginForServer(serverValues, targetPathValue, commandConsole);
			ParseLoginAddress serverAddress = null;
			try {
				serverAddress = serverTask.parseServerAddressValue();
			} catch (IllegalArgumentException e) {
				throw e;
			}
			this.invokeGeneratePluginCfgMBean(serverAddress, null, targetPathValue,"server");
		}
		
	
	}