Package org.springmodules.javaspaces.entry

Examples of org.springmodules.javaspaces.entry.AbstractMethodCallEntry


    assertNotSame(mi, mi2);
    assertEquals(mi.getMethod(), mi2.getMethod());
  }

  public void testSerializeMethodCallEntry() throws Exception {
    AbstractMethodCallEntry mi = new AbstractMethodCallEntry(Object.class.getMethod("hashCode", null), null);
    AbstractMethodCallEntry mi2 = (AbstractMethodCallEntry) SerializationTestUtils.serializeAndDeserialize(mi);
    assertEquals(mi.getMethod(), mi2.getMethod());
  }
View Full Code Here


    AbstractMethodCallEntry mi2 = (AbstractMethodCallEntry) SerializationTestUtils.serializeAndDeserialize(mi);
    assertEquals(mi.getMethod(), mi2.getMethod());
  }

  public void testSerializeTemplateMethodCallEntries() throws Exception {
    AbstractMethodCallEntry mi = new AbstractMethodCallEntry(null, null);
    AbstractMethodCallEntry mi2 = (AbstractMethodCallEntry) SerializationTestUtils.serializeAndDeserialize(mi);
    assertEquals(mi.getMethod(), mi2.getMethod());
  }
View Full Code Here

   * returns a MethodResultEntry in response. The call can be blocking
   * (synchronous) or non-blocking (asynchronous).
   */
  public Object invoke(MethodInvocation mi) throws Throwable {

    AbstractMethodCallEntry call = null;

    Object target = getSerializableTarget(mi);
    // TODO Could also decide whether to serializable target
    // based on a method annotation
    if (target == null) {
View Full Code Here

  public void stop() {
    this.running = false;
  }

  public void run() {
    AbstractMethodCallEntry t = new AbstractMethodCallEntry();
    // Needed for match
    t.uid = null;
    t.className = businessInterface.getName();
    this.methodCallEntryTemplate = jsTemplate.snapshot(t);

    final boolean debug = log.isDebugEnabled();

    if (debug)
      log.debug("Worker " + this + " starting...");

    while (running) {
      if (debug)
        log.debug("Worker " + this + " waiting...");

      // On reading from the space, the result will be computed and
      // written
      // back into the space in one transaction
      jsTemplate.execute(new JavaSpaceCallback() {
        public Object doInSpace(JavaSpace js, Transaction transaction) throws RemoteException,
            TransactionException, UnusableEntryException, InterruptedException {

          // look for method call
          AbstractMethodCallEntry call = (AbstractMethodCallEntry) js.take(methodCallEntryTemplate,
              transaction, waitMillis);

          if (call == null) {
            // TODO is this required?
            if (debug)
View Full Code Here

TOP

Related Classes of org.springmodules.javaspaces.entry.AbstractMethodCallEntry

Copyright © 2018 www.massapicom. 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.