Examples of JavaSpaceCallback


Examples of org.springmodules.javaspaces.JavaSpaceCallback

    try {
      txTemplate.execute(new TransactionCallbackWithoutResult() {

        protected void doInTransactionWithoutResult(TransactionStatus status) {
          spaceTemplate.execute(new JavaSpaceCallback() {
            public Object doInSpace(JavaSpace js, Transaction transaction)
                throws RemoteException, TransactionException, UnusableEntryException,
                InterruptedException {
              // check that we have a tx
              assertNotNull("no tx started", transaction);
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

    try {
      // start tx (REQUIRED)
      txTemplate.execute(new TransactionCallbackWithoutResult() {

        protected void doInTransactionWithoutResult(final TransactionStatus status) {
          spaceTemplate.execute(new JavaSpaceCallback() {
            public Object doInSpace(JavaSpace js, final Transaction transaction)
                throws RemoteException, TransactionException, UnusableEntryException,
                InterruptedException {
              // check that we have a tx
              assertNotNull("no tx started", transaction);
              Object result = js.read(template, transaction, timeout);
              assertNull(result);
              // write
              js.write(template, transaction, Lease.ANY);

              notSupportedTransaction.execute(new TransactionCallbackWithoutResult() {
                protected void doInTransactionWithoutResult(final TransactionStatus status2) {
                  spaceTemplate.execute(new JavaSpaceCallback() {
                    public Object doInSpace(JavaSpace js2, Transaction transaction2)
                        throws RemoteException, TransactionException,
                        UnusableEntryException, InterruptedException {
                      // NOT_SUPPORTED means tx was suspended
                      assertNull(transaction2);
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

    tt.execute(new TransactionCallbackWithoutResult() {
      protected void doInTransactionWithoutResult(TransactionStatus status) {
        assertTrue("Has thread session",
            TransactionSynchronizationManager.hasResource(space));

        spaceTemplate.execute(new JavaSpaceCallback() {

          public Object doInSpace(JavaSpace js,
              Transaction transaction) throws RemoteException,
              TransactionException, UnusableEntryException,
              InterruptedException {
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

        tt.setIsolationLevel(TransactionDefinition.ISOLATION_SERIALIZABLE);
        try {
            tt.execute(new TransactionCallbackWithoutResult() {
                protected void doInTransactionWithoutResult(TransactionStatus status) {
                    assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(space));
                    spaceTemplate.execute(new JavaSpaceCallback() {
                      public Object doInSpace(JavaSpace js, Transaction transaction) throws RemoteException, TransactionException, UnusableEntryException, InterruptedException {
                        return null;
                      }
                    });
                }
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

      assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(space));
       
        tt.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(space));
                spaceTemplate.execute(new JavaSpaceCallback() {
                  public Object doInSpace(JavaSpace js, Transaction transaction) throws RemoteException, TransactionException, UnusableEntryException, InterruptedException {
                  return null;
                }});
            }
        });
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

      assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(space));
       
        tt.execute(new TransactionCallbackWithoutResult() {
            protected void doInTransactionWithoutResult(TransactionStatus status) {
                assertTrue("Has thread session", TransactionSynchronizationManager.hasResource(space));
                spaceTemplate.execute(new JavaSpaceCallback() {
                  public Object doInSpace(JavaSpace js, Transaction transaction) throws RemoteException, TransactionException, UnusableEntryException, InterruptedException {
                  return null;
                }});
                status.setRollbackOnly();
            }
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

    * @param object the object to take a snapshot of.
    * @return a snapshot of the object.
    */
  public Object snapshot(final Object object)
  {
    return (Object) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        return ((IJSpace)js).snapshot(object);
      }
    });
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

   * @return a  from the space
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#take(net.jini.core.entry.Entry,net.jini.core.transaction.Transaction,long)}
   */
  public Object take(final Object template,final long millis)
  {
    return (Object) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        return ((IJSpace)js).take(template,tx, millis);
      }
    });
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

   * @return object from the space.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#takeIfExists(net.jini.core.entry.Entry,net.jini.core.transaction.Transaction,long)}
   */
  public Object takeIfExists(final Object template,final long millis)
  {
    return (Object) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        return ((IJSpace)js).takeIfExists(template,tx, millis);
      }
    });
View Full Code Here

Examples of org.springmodules.javaspaces.JavaSpaceCallback

   * @return an object for the entry that was written to the space
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#write(net.jini.core.entry.Entry,net.jini.core.transaction.Transaction,long)}
   */
  public Lease write(final Object pojo, final long lease)
  {
    return (Lease) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        return ((IJSpace)js).write(pojo,tx, lease);
      }
    });
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.