Package org.springmodules.javaspaces

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,int)}
   */
  public Lease write(final Object pojo, final long lease, final int modifiers)
  {
    return (Lease) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        return ((IJSpace)js).write(pojo,tx, lease, Long.MAX_VALUE, modifiers);
      }
    });
View Full Code Here


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

   * @param template the template to use for matching.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#clear(net.jini.core.entry.Entry,net.jini.core.transaction.Transaction)}
   */
  public void clear(final Object pojo)
  {
    execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        ((IJSpace)js).clear(pojo, tx);
        return null;
      }
View Full Code Here

     *
     * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#clean()}
     */
  public void clean()
  {
    execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException,
      TransactionException, UnusableEntryException, InterruptedException {
        ((IJSpace)js).clean();
        return null;
      }
View Full Code Here

   * @return the name of this space.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#getName()}
   */
  public String getName()
  {
    return (String) execute(new JavaSpaceCallback()
    {
      public Object doInSpace(JavaSpace js, Transaction tx)
          throws RemoteException
      {
        return ((IJSpace) js).getName();
View Full Code Here

   * @return {@link SpaceURL} which initialized that specific space instance.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#getUrl()}
   **/
  public SpaceURL getUrl()
  {
    return (SpaceURL) execute(new JavaSpaceCallback()
    {
      public Object doInSpace(JavaSpace js, Transaction tx)
          throws RemoteException
      {
        return ((IJSpace) js).getURL();
View Full Code Here

   * @return the admin object to the remote part of this space.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#getAdmin()}
   */
  public Object getAdmin()
  {
    return execute(new JavaSpaceCallback()
    {
      public Object doInSpace(JavaSpace js, Transaction tx)
          throws RemoteException
      {
        return ((IJSpace) js).getAdmin();
View Full Code Here

   * @return the leases for the written entries.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#writeMultiple(net.jini.core.entry.Entry[],net.jini.core.transaction.Transaction,long)}
   */
  public Lease[] writeMultiple( final Object[] pojos, final long lease)
  {
    return (Lease[]) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException, TransactionException{
        return ((IJSpace)js).writeMultiple(pojos, tx, lease);
      }
    });
  }
View Full Code Here

   * @return array of entry object
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#readMultiple(net.jini.core.entry.Entry[],net.jini.core.transaction.Transaction,int)}
   */
  public Object[] readMultiple(final Object pojo, final int maxEntries)
  {
    return (Object[]) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException, TransactionException, UnusableEntryException{
        return ((IJSpace)js).readMultiple(pojo, tx, maxEntries);
      }
    });
  }
View Full Code Here

   *         if no suitable entry was found.
   * @see {@link http://gigaspaces.com/docs/JavaDoc/com/j_spaces/core/IJSpace.html#takeMultiple(net.jini.core.entry.Entry[],net.jini.core.transaction.Transaction,int)}
   */
  public Object[] takeMultiple(final Object pojo, final int maxEntries)
  {
    return (Object[]) execute(new JavaSpaceCallback() {
      public Object doInSpace(JavaSpace js, Transaction tx) throws RemoteException, TransactionException, UnusableEntryException{
        return ((IJSpace)js).takeMultiple(pojo, tx, maxEntries);
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.springmodules.javaspaces.JavaSpaceCallback

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.