Examples of InvocationImpl


Examples of com.sun.midp.content.InvocationImpl

    /**
     * Generate new requests as needed and tally the response.
     * The final invoke is the termination request/response.
     */
    void doInvoker() {
        InvocationImpl request = new InvocationImpl();
    while (numTerminations > 0) {
            int rand = nextRandom(10);
            if (numInvokes < maxInvokes &&
                (numResponses == numInvokes || (rand < 5))) {
                // produce a new INIT request for a random app, class
                int targetid = nextRandom(nappIDs);
                int targetcn = nextRandom(nclassnames);
                request.suiteId = getAppID(targetid);
                request.classname = getClassname(targetcn);
                request.invokingSuiteId = appID;
                request.invokingClassname = classname;
                request.responseRequired = true;
        request.ID = Integer.toString(numInvokes);
                request.status = Invocation.INIT;
                int wait = nextRandom(500);
                sleep(wait);
                InvocationStore.put(request);
        ++numInvokes;
                println("invoke: +" + wait + " ", request);
            }

        // Consume a response; block until some
        InvocationImpl response = new InvocationImpl();
            response = InvocationStore.getResponse(response,
                           appID, classname, true);
            if (response != null) {
                if (response.status == Invocation.OK) {
            testcase.assertEquals(appID +
                      " verify target appID",
                      appID, response.suiteId);
            testcase.assertEquals(appID +
                      " verify target classname",
                      classname, response.classname);
            println("response", response);

            if ("terminate".equals(response.action)) {
            numTerminations--;
            } else {
            // Keep track of responses
            scorecard[Integer.parseInt(response.ID)] += 1;
            ++numResponses;

            /*
             * If just finished receiving the max responses;
             * send the terminations
             */
            if (numResponses == maxInvokes) {
                sendAll(Invocation.INIT, "terminate");
            }
            }
        } else {
            testcase.assertNull(appID + " illegal response:",
                    response);
                }
        }
    }

        sleep(2000L);
        do {
            request = InvocationStore.getResponse(new InvocationImpl(),
                          appID, classname, false);
        } while (request != null);

    // Terminate responder thread
    stop();
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

    /**
     * Handle and respond to any response that comes back.
     */
    void doResponder() {
    InvocationImpl request;
    while (!stopping) {

            // consume any request and send a response
            request = InvocationStore.getRequest(appID, classname, true);
            if (request != null) {
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

     * Send a request to every other consumer.
     * @param status a status to send
     * @param action an action string to send
     */
    void sendAll(int status, String action) {
        InvocationImpl request = new InvocationImpl();
        request.invokingSuiteId = appID;
        request.invokingClassname = classname;
        request.status = status;
    request.action = action;
    request.ID = Integer.toString(numInvokes);
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

     * Run the test for blocking get and cancel.
     */
    private void blockingGet() {
  while (!stopping) {
      numTry++;
      InvocationImpl get =
    InvocationStore.getResponse(new InvocationImpl(),
              appl.getStorageId(), appl.getClassname(),
              true);
      if (get == null) {
    numNotPending++;
      } else {
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

  if (previous != null &&
            previous.getStatus() != Invocation.ACTIVE) {
      throw new IllegalStateException();
  }
       
  InvocationImpl invocImpl = invocation.getInvocImpl();
 
  InvocationImpl prevImpl = null;
  if (previous != null) {
      prevImpl = previous.getInvocImpl();
  }

  return impl.invoke(invocImpl, prevImpl);
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

     * @see javax.microedition.content.Registry#invoke
     * @see javax.microedition.content.ContentHandlerServer#finish
     */
    public Invocation getRequest(boolean wait) {
  Invocation request = new Invocation((InvocationImpl)null);
        InvocationImpl invoc = super.getRequest(wait, request);
        if (invoc != null) {
      // Wrap it in an Invocation instance
      request.setInvocImpl(invoc);
      return request;
        }
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

     * The status of the new Invocation object is <code>INIT</code>.
     * The URL, type, ID, action, arguments, and data are set to
     * empty arrays, and initialized to require a response.
     */
    public Invocation() {
  invocImpl = new InvocationImpl(this);
    }
View Full Code Here

Examples of com.sun.midp.content.InvocationImpl

     *
     * @see Registry#invoke
     * @see Registry#getResponse
     */
    public Invocation getPrevious() {
  InvocationImpl prev = invocImpl.getPrevious();
  if (prev != null) {
      if (prev.invocation == null) {
    /*
     * An InvocationImpl created by the implementation needs
     * a Invocation to return to the application.
View Full Code Here

Examples of org.apache.cocoon.sitemap.InvocationImpl

            this.version += buildNumber;
        }
    }

    private void invoke(String requestURI, Map<String, Object> parameters, OutputStream outputStream) {
        InvocationImpl invocation = (InvocationImpl) this.beanFactory.getBean(Invocation.class.getName());

        invocation.setBaseURL(this.getBaseURL());
        invocation.setRequestURI(requestURI);
        invocation.setParameters(parameters);
        invocation.setOutputStream(outputStream);
        invocation.setObjectModel(ObjectModelProvider.provide(parameters));

        this.sitemapNode.invoke(invocation);
    }
View Full Code Here

Examples of org.apache.cocoon.sitemap.InvocationImpl

        return response;
    }

    Invocation buildInvocation(String request, Map<String, Object> params) {
        InvocationImpl invocation = new InvocationImpl(this.output);

        invocation.setBaseURL(this.getClass().getResource("/COB-INF/"));
        invocation.setRequestURI(request);
        invocation.setComponentProvider(componentProvider);
        invocation.setObjectModel(new ObjectModel(params));

        return invocation;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.