com.j_spaces.jca
Class GSInteraction

java.lang.Object
  extended by com.j_spaces.jca.JSInteraction
      extended by com.j_spaces.jca.GSInteraction
All Implemented Interfaces:
Interaction

public class GSInteraction
extends JSInteraction

JCA Interaction Enhanced Class - contain extended JavaSpaces methods


Field Summary
 
Fields inherited from class com.j_spaces.jca.JSInteraction
CLEAN_OPERATION, CLEAR_OPERATION, COUNT_OPERATION, EXCEPTIONTYPE_REMOTEEXCEPTION, EXCEPTIONTYPE_TX, INSTANCE_COUNT_OPERATION, NOTIFY_OPERATION, READ_OPERATION, SNAPSHOT_OPERATION, TAKE_OPERATION, WRITE_OPERATION
 
Method Summary
 IMap getCache()
          Returns the interface to IMap.
 int instanceCount(String clazz)
          Returns class instance count.
 void ping()
          Checks whether the space is alive and accessible.
 Entry[] readMultiple(Entry template, boolean isTx, int maxEntries)
          Reads all the entries matching the specified template from this space.
 Entry[] readMultiple(Entry template, int maxEntries)
          Reads all the entries matching the specified template from this space.
 void setSecurityContext(SecurityContext sc)
          Set Security Context.
 Entry[] takeMultiple(Entry template, boolean isTx, int maxEntries)
          Takes all the entries matching the specified template from this space.
 Entry[] takeMultiple(Entry template, int maxEntries)
          Takes all the entries matching the specified template from this space.
 Lease update(Entry entry, boolean isTx, long timeout)
          Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }
 Entry update(Entry updatedEntry, boolean isTx, long lease, long timeout)
          Updates the first entry matching the specified template, if found and there is no transaction conflict.
 Object[] update(Entry template, Entry newEntry, boolean isTx, long timeout)
          Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }
 Entry update(Entry template, Entry newEntry, boolean isTx, long lease, long timeout)
          Updates the first entry matching the specified template, if found and there is no transaction conflict.
 Object[] update(Entry template, Entry newEntry, long timeout)
          Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }
 Entry update(Entry template, Entry newEntry, long lease, long timeout)
          Updates the first entry matching the specified template, if found and there is no transaction conflict.
 Lease update(Entry entry, long timeout)
          Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }
 Entry update(Entry updatedEntry, long lease, long timeout)
          Updates the first entry matching the specified template, if found and there is no transaction conflict.
 Object[] updateMultiple(Entry[] entries, boolean isTx, long[] leases)
          Performs batch update for the specified entries
 Object[] updateMultiple(Entry[] entries, long[] leases)
          Performs batch update for the specified entries
 Lease[] writeMultiple(Entry[] entries, boolean isTx, long timeout)
          Writes the specified entries to this space.
 Lease[] writeMultiple(Entry[] entries, long timeout)
          Writes the specified entries to this space.
 
Methods inherited from class com.j_spaces.jca.JSInteraction
clean, clear, clear, clearWarnings, close, count, count, execute, execute, getConnection, getSpaceAdmin, getSpaceURL, getWarnings, isSecured, notify, read, read, readIfExists, readIfExists, snapshot, take, take, takeIfExists, takeIfExists, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readMultiple

public Entry[] readMultiple(Entry template,
                            int maxEntries)
                     throws ResourceException
Reads all the entries matching the specified template from this space.

Parameters:
template - the template to use for matching.
maxEntries - a limit on the number of entries to be read. Use Integer.MAX_VALUE for the maximum value.
Returns:
an array of entries that match the template.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

readMultiple

public Entry[] readMultiple(Entry template,
                            boolean isTx,
                            int maxEntries)
                     throws ResourceException
Reads all the entries matching the specified template from this space.

Parameters:
template - the template to use for matching.
isTx - true indicates method to be done under transaction. false - without transcation
maxEntries - a limit on the number of entries to be read. Use Integer.MAX_VALUE for the maximum value.
Returns:
an array of entries that match the template.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

writeMultiple

public Lease[] writeMultiple(Entry[] entries,
                             long timeout)
                      throws ResourceException
Writes the specified entries to this space.

Parameters:
entries - the entries to write.
timeout - the requested lease time, in milliseconds
Returns:
the leases for the written entries.
Throws:
TransactionException
java.rmi.ResourceException
ResourceException

writeMultiple

public Lease[] writeMultiple(Entry[] entries,
                             boolean isTx,
                             long timeout)
                      throws ResourceException
Writes the specified entries to this space.

Parameters:
entries - the entries to write.
isTx - true indicates method to be done under transaction. false - without transaction
timeout - the requested lease time, in milliseconds
Returns:
the leases for the written entries.
Throws:
TransactionException
java.rmi.ResourceException
ResourceException

takeMultiple

public Entry[] takeMultiple(Entry template,
                            int maxEntries)
                     throws ResourceException
Takes all the entries matching the specified template from this space.

Parameters:
template - the template to use for matching.
maxEntries - a limit on the number of entries to be taken. Use Integer.MAX_VALUE for the maximum value.
Returns:
an array of entries that match the template.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

takeMultiple

public Entry[] takeMultiple(Entry template,
                            boolean isTx,
                            int maxEntries)
                     throws ResourceException
Takes all the entries matching the specified template from this space.

Parameters:
template - the template to use for matching.
isTx - true indicates method to be done under transaction. false - without transcation
maxEntries - a limit on the number of entries to be taken. Use Integer.MAX_VALUE for the maximum value.
Returns:
an array of entries that match the template.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

public Object[] update(Entry template,
                       Entry newEntry,
                       long timeout)
                throws ResourceException
Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }

Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
template - the template to use for matching.
newEntry - the new value of the entry.
timeout - the lease time of the new entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

@Deprecated
public Object[] update(Entry template,
                                  Entry newEntry,
                                  boolean isTx,
                                  long timeout)
                throws ResourceException
Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }

Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
template - the template to use for matching.
newEntry - the new value of the entry.
isTx - true indicates method to be done under transaction. false - without transcation
timeout - the lease time of the new entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

public Entry update(Entry template,
                    Entry newEntry,
                    long lease,
                    long timeout)
             throws ResourceException
Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
template - the template to use for matching.
newEntry - the new value of the entry.
lease - the lease time of the new entry
timeout - the timeout to wait for available entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

public Entry update(Entry template,
                    Entry newEntry,
                    boolean isTx,
                    long lease,
                    long timeout)
             throws ResourceException
Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
template - the template to use for matching.
newEntry - the new value of the entry.
isTx - true indicates method to be done under transaction. false - without transcation
lease - the lease time of the new entry
timeout - the timeout to wait for available entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

public Lease update(Entry entry,
                    long timeout)
             throws ResourceException
Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }

Updates existing entry . If the entry is a new entry it will be written to the space

Parameters:
entry - to update
timeout - - The lease timeout of the new entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
ResourceException

update

public Lease update(Entry entry,
                    boolean isTx,
                    long timeout)
             throws ResourceException
Deprecated. Use instead update(Entry, Entry, long, long) (@link #update(Entry, long, long) }

Updates existing entry . If the entry is a new entry it will be written to the space

Parameters:
entry - to update
isTx - true indicates method to be done under transaction. false - without transcation
timeout - - The lease timeout of the new entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
ResourceException

update

public Entry update(Entry updatedEntry,
                    long lease,
                    long timeout)
             throws ResourceException
Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
updatedEntry - the updated entry.
lease - the lease time of the new entry
timeout - the timeout to wait for available entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

update

public Entry update(Entry updatedEntry,
                    boolean isTx,
                    long lease,
                    long timeout)
             throws ResourceException
Updates the first entry matching the specified template, if found and there is no transaction conflict.

Parameters:
updatedEntry - the updated entry.
lease - the lease time of the new entry
timeout - the timeout to wait for available entry
Returns:
new Entry lease. If not matching entry was found, null is returned.
Throws:
TransactionException
UnusableEntryException
java.rmi.ResourceException
ResourceException

updateMultiple

public Object[] updateMultiple(Entry[] entries,
                               long[] leases)
                        throws ResourceException
Performs batch update for the specified entries

Parameters:
entries - array of updated entries
leases - array of new leases for updated entries
Returns:
array of objects, each member in array can represent ...
Throws:
ResourceException

updateMultiple

public Object[] updateMultiple(Entry[] entries,
                               boolean isTx,
                               long[] leases)
                        throws ResourceException
Performs batch update for the specified entries

Parameters:
entries - array of updated entries
isTx - true indicates method to be done under transaction. false - without transcation
leases - array of new leases for updated entries
Returns:
array of objects, each member in array can represent ...
Throws:
ResourceException

instanceCount

public int instanceCount(String clazz)
                  throws ResourceException
Returns class instance count. This is not transactional method

Parameters:
clazz - Class Name
Returns:
the number of entries for specified class
Throws:
ResourceException

ping

public void ping()
          throws ResourceException
Checks whether the space is alive and accessible.

Throws:
ResourceException

getCache

public IMap getCache()
              throws ResourceException
Returns the interface to IMap.

Returns:
an IMap
Throws:
ResourceException

setSecurityContext

public void setSecurityContext(SecurityContext sc)
                        throws ResourceException
Set Security Context.

Parameters:
sc - The Security Context object.
Throws:
ResourceException