This is invoked only on the receiving node, before {@link #perform(org.infinispan.context.InvocationContext)}.
328551
@Override
   public void setCacheManager(EmbeddedCacheManager cm) {
      String name = cacheName.toString();
      if (cm.cacheExists(name)) {
         Cache cache = cm.getCache(name);
         searchFactory = ComponentRegistryUtils.getSearchIntegrator(cache);
         queryInterceptor = ComponentRegistryUtils.getQueryInterceptor(cache);
      } else {
         throw new CacheException("Cache named '" + name + "' does not exist on this CacheManager, or was not started");
      }
   }
1209424
@Override
  public void process(Node externs, Node root) {
    checkState(topLevelStatements.isEmpty(), "process() called more than once");
    NodeTraversal t = new NodeTraversal(compiler, this, scopeCreator);
    t.traverseRoots(externs, root);
  }
611397
protected void sendEvent(final T event) {
        if (isStatic) {
            sendEvent(event, null, null);
        } else {
            CreationalContext<X> creationalContext = null;
            try {
                Object receiver = getReceiverIfExists(null);
                if (receiver == null && reception != Reception.IF_EXISTS) {
                    // creational context is created only if we need it for obtaining receiver
                    // ObserverInvocationStrategy takes care of creating CC for parameters, if needed
                    creationalContext = beanManager.createCreationalContext(declaringBean);
                    receiver = getReceiverIfExists(creationalContext);
                }
                if (receiver != null) {
                    sendEvent(event, receiver, creationalContext);
                }
            } finally {
                if (creationalContext != null) {
                    creationalContext.release();
                }
            }
        }
    }
1117214
@Override
    public <T> T invoke(Context context, Class<T> classOfT) {
        return invoke(context, classOfT, null);
    }
609210
public void invoke(Node root, Action result) throws IOException {
        doInvoke(0, root, root.isLink(), new ArrayList<>(includes), new ArrayList<>(excludes), result);
    }
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;
   }
629267
@Override
    protected final void performAction(HistoryReference historyReference) {
        final SiteNode siteNode = getSiteNode(historyReference);
        if (siteNode != null) {
            performAction(siteNode);
        }
    }
463355
@Override
	protected void onNode(String name, String currentPath) throws SAXException
    {
        if (currentPath.equals("bridgeDefinition"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/name"))
        {
            bridgeDefinition.setName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/enabled"))
        {
            bridgeDefinition.setEnabled(getElementValue().equalsIgnoreCase("true"));
        }
        else if (currentPath.equals("bridgeDefinition/retryInterval"))
        {
            bridgeDefinition.setRetryInterval(Integer.parseInt(getElementValue()));
        }
        else if (currentPath.equals("bridgeDefinition/commitSourceFirst"))
        {
            bridgeDefinition.setCommitSourceFirst(getElementValue().equalsIgnoreCase("true"));
        }
        else if (currentPath.equals("bridgeDefinition/producerTransacted"))
        {
            bridgeDefinition.setProducerTransacted(getElementValue().equalsIgnoreCase("true"));
        }
        else if (currentPath.equals("bridgeDefinition/consumerTransacted"))
        {
            bridgeDefinition.setConsumerTransacted(getElementValue().equalsIgnoreCase("true"));
        }
        else if (currentPath.equals("bridgeDefinition/consumerAcknowledgeMode"))
        {
            bridgeDefinition.setConsumerAcknowledgeMode(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/producerDeliveryMode"))
        {
            bridgeDefinition.setProducerDeliveryMode(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/source/peer"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/source/peer/jdniInitialContextFactoryName"))
        {
            bridgeDefinition.getSource().setJdniInitialContextFactoryName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/peer/jndiConnectionFactoryName"))
        {
            bridgeDefinition.getSource().setJndiConnectionFactoryName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/peer/providerURL"))
        {
            bridgeDefinition.getSource().setProviderURL(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/peer/userName"))
        {
            bridgeDefinition.getSource().setUserName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/peer/password"))
        {
            bridgeDefinition.getSource().setPassword(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/destination"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/source/destination/destinationType"))
        {
            bridgeDefinition.getSourceDestination().setDestinationType(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/source/destination/destinationName"))
        {
            bridgeDefinition.getSourceDestination().setDestinationName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/target/peer"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/target/peer/jdniInitialContextFactoryName"))
        {
            bridgeDefinition.getTarget().setJdniInitialContextFactoryName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/peer/jndiConnectionFactoryName"))
        {
            bridgeDefinition.getTarget().setJndiConnectionFactoryName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/peer/providerURL"))
        {
            bridgeDefinition.getTarget().setProviderURL(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/peer/userName"))
        {
            bridgeDefinition.getTarget().setUserName(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/peer/password"))
        {
            bridgeDefinition.getTarget().setPassword(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/destination"))
        {
            // Nothing
        }
        else if (currentPath.equals("bridgeDefinition/target/destination/destinationType"))
        {
            bridgeDefinition.getTargetDestination().setDestinationType(getElementValue());
        }
        else if (currentPath.equals("bridgeDefinition/target/destination/destinationName"))
        {
            bridgeDefinition.getTargetDestination().setDestinationName(getElementValue());
        }
        else
            throw new SAXException("Unexpected node : " + name + " (" + currentPath + ")");
    }
615451
public boolean performFinish() {
		final String containerName = page.getContainerName();
		final int    mep = page.getSelectedMep();
		final TransportEnum inboundTransport = page.getSelectedInboundTransport();
		final TransportEnum outboundTransport = page.getSelectedOutboundTransport();
		final TransformerEnum transformerType = page.getTransformerType(); 

		IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
		final String mavenHome = prefs.getString(P_MAVEN_HOME);
		final int mavenEclipseGoalType = MavenEclipseGoalEnum.ECLIPSE_ECLIPSE.ordinal();
		
		final String serviceName = page.getServiceName();
		IRunnableWithProgress op = new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {
				try {
					doFinish(mavenHome, mavenEclipseGoalType, containerName, mep, inboundTransport, outboundTransport, transformerType, serviceName, monitor);
				} catch (CoreException e) {
					e.printStackTrace();
					throw new InvocationTargetException(e);
				} catch (Throwable e) {
					e.printStackTrace();
					if (e instanceof RuntimeException) {
						throw (RuntimeException)e;
					} else {
						throw new InvocationTargetException(e);
					}
				} finally {
					monitor.done();
				}
			}
		};
		try {
			getContainer().run(true, false, op);
		} catch (InterruptedException e) {
			return false;
		} catch (InvocationTargetException e) {
			Throwable realException = e.getTargetException();
			MessageDialog.openError(getShell(), "Error", realException.getMessage());
			return false;
		}
		return true;
	}
363018
@Override
    public void beforeEach(final ExtensionContext context) {
        Set<Object> testInstances = new LinkedHashSet<>();
        testInstances.add(context.getRequiredTestInstance());

        this.collectParentTestInstances(context, testInstances);

        Strictness actualStrictness = this.retrieveAnnotationFromTestClasses(context)
            .map(MockitoSettings::strictness)
            .orElse(strictness);

        MockitoSession session = Mockito.mockitoSession()
            .initMocks(testInstances.toArray())
            .strictness(actualStrictness)
            .logger(new MockitoSessionLoggerAdapter(Plugins.getMockitoLogger()))
            .startMocking();

        context.getStore(MOCKITO).put(SESSION, session);
    }
962174
@Override
    public void onBeforeExecutionEvent(BeforeExecutionEvent event) {
        LepManager manager = event.getSource();
        ScopedContext threadContext = manager.getContext(ContextScopes.THREAD);
        if (threadContext == null) {
            throw new IllegalStateException("LEP manager thread context doesn't initialized");
        }

        TenantContext tenantContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_TENANT_CONTEXT,
                                                       TenantContext.class);
        XmAuthenticationContext authContext = getRequiredValue(threadContext, THREAD_CONTEXT_KEY_AUTH_CONTEXT,
                                                               XmAuthenticationContext.class);

        ScopedContext executionContext = manager.getContext(ContextScopes.EXECUTION);
        // add contexts
        executionContext.setValue(BINDING_KEY_TENANT_CONTEXT, tenantContext);
        executionContext.setValue(BINDING_KEY_AUTH_CONTEXT, authContext);

        bindExecutionContext(executionContext);
    }
804825
@Override
    public Object preInvoke() throws SecurityViolationException {
        Subject invokedSubject = subjectManager.getInvocationSubject();
        Subject receivedSubject = subjectManager.getCallerSubject();

        subjectManager.clearSubjects();

        return null;
    }
315039
public void onNodeStarted(final IExecutionNode node) {

        if (!node.equals(this.theLastNode)) {

            if (this.theLastNode != null) {
                printStarted("Starting: " + format(this.theLastNode));
            }

            this.theLastNode = node;
        } else {
            // not sure how this would happen
            printStarted("Starting: " + format(node));
        }

    }
363063
public void executeBeforeMethods(final Object obj) {
        // Invoke element only if not parameterized
        if (this.element.getDataProvider() == null) {
            // invoking once the beforeFirstRun-method
            if (!beforeFirstRun) {
                beforeFirstRun = true;

                Method[] beforeFirst = null;
                try {
                    beforeFirst = element.findBeforeFirstRun();
                    if (beforeFirst.length != 0) {
                        checkAndExecuteBeforeAfters(obj, BeforeFirstRun.class, beforeFirst);
                    }
                } catch (final PerfidixMethodCheckException e) {
                    BENCHRES.addException(e);
                }
            }

            // invoking the beforeEachRun-method
            Method[] beforeEach = null;
            try {
                beforeEach = element.findBeforeEachRun();
                if (beforeEach.length != 0) {
                    checkAndExecuteBeforeAfters(obj, BeforeEachRun.class, beforeEach);
                }
            } catch (final PerfidixMethodCheckException e) {
                BENCHRES.addException(e);
            }
        }
    }
1163806
public static void beforeRequest (@Nonnull final HttpUriRequest aRequest, @Nullable final HttpContext aHttpContext)
  {
    if (isEnabled ())
      if (LOGGER.isInfoEnabled ())
        LOGGER.info ("Before HTTP call: " +
                        aRequest.getMethod () +
                        " " +
                        aRequest.getURI () +
                        (aHttpContext != null ? " (with special HTTP context)" : ""));
  }
342876
@Override
  @SuppressWarnings("deprecation")
  public <T extends CoreExecution> void performOperation(CoreAtomicOperation<T> operation) {
    if (operation instanceof AtomicOperation) {
      performOperation((AtomicOperation) operation);
    } else {
      super.performOperation(operation);
    }
  }
294358
public void invokeNodeRequest (String nodeName, NodeRequest request,
        InvocationService.ResultListener listener)
    {
        invokeNodeRequest(nodeName, flattenRequest(request), listener);
    }