org.jpos.q2.qbean
Class SpaceLet

java.lang.Object
  extended by org.jpos.q2.QBeanSupport
      extended by org.jpos.q2.qbean.SpaceLet
All Implemented Interfaces:
Configurable, QBean, QBeanSupportMBean, QPersist, Space

public class SpaceLet
extends QBeanSupport
implements Space


Field Summary
 
Fields inherited from class org.jpos.q2.QBeanSupport
cfg, log
 
Fields inherited from interface org.jpos.q2.QBean
DESTROYED, FAILED, STARTED, STARTING, stateString, STOPPED, STOPPING
 
Constructor Summary
SpaceLet()
           
 
Method Summary
 boolean existAny(Object[] keys)
           
 boolean existAny(Object[] keys, long timeout)
           
 Object in(Object key)
          Take an entry from the space, waiting forever until one exists.
 Object in(Object key, long timeout)
          Take an entry from the space, waiting a limited amount of time until one exists.
 void initService()
           
 Object inp(Object key)
          In probe takes an entry from the space if one exists, return null otherwise.
 void out(Object key, Object value)
          Write a new entry into the Space
 void out(Object key, Object value, long timeout)
          Write a new entry into the Space, with an timeout value
 void push(Object key, Object value)
          Write a new entry at the head of a queue.
 void push(Object key, Object value, long timeout)
          Write a new entry at the head of the queue with a timeout value
 void put(Object key, Object value)
          Write a single entry at the head of the queue discarding the other entries
 void put(Object key, Object value, long timeout)
          Write a single entry at the head of the queue discarding the other entries, with timeout.
 Object rd(Object key)
          Read an entry from the space, waiting forever until one exists.
 Object rd(Object key, long timeout)
          Read an entry from the space, waiting a limited amount of time until one exists.
 Object rdp(Object key)
          Read probe reads an entry from the space if one exists, return null otherwise.
 void startService()
           
 void stopService()
           
 
Methods inherited from class org.jpos.q2.QBeanSupport
addAttr, createElement, destroy, destroyService, getAttrs, getAttrs, getConfiguration, getFactory, getLoader, getLoaderURLS, getLog, getLogger, getName, getPersist, getProperties, getProperty, getRealm, getServer, getState, getStateAsString, init, isModified, running, setAttr, setConfiguration, setLogger, setModified, setName, setPersist, setProperty, setRealm, setServer, setState, shutdownQ2, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceLet

public SpaceLet()
Method Detail

initService

public void initService()
                 throws ConfigurationException
Overrides:
initService in class QBeanSupport
Throws:
ConfigurationException

startService

public void startService()
Overrides:
startService in class QBeanSupport

stopService

public void stopService()
Overrides:
stopService in class QBeanSupport

out

public void out(Object key,
                Object value)
Description copied from interface: Space
Write a new entry into the Space

Specified by:
out in interface Space
Parameters:
key - Entry's key
value - Object value

out

public void out(Object key,
                Object value,
                long timeout)
Description copied from interface: Space
Write a new entry into the Space, with an timeout value

Specified by:
out in interface Space
Parameters:
key - Entry's key
value - Object value
timeout - timeout value

push

public void push(Object key,
                 Object value)
Description copied from interface: Space
Write a new entry at the head of a queue.

Specified by:
push in interface Space
Parameters:
key - Entry's key
value - Object value

push

public void push(Object key,
                 Object value,
                 long timeout)
Description copied from interface: Space
Write a new entry at the head of the queue with a timeout value

Specified by:
push in interface Space
Parameters:
key - Entry's key
value - Object value
timeout - timeout value

put

public void put(Object key,
                Object value)
Description copied from interface: Space
Write a single entry at the head of the queue discarding the other entries

Specified by:
put in interface Space
Parameters:
key - Entry's key
value - Object value

put

public void put(Object key,
                Object value,
                long timeout)
Description copied from interface: Space
Write a single entry at the head of the queue discarding the other entries, with timeout.

Specified by:
put in interface Space
Parameters:
key - Entry's key
value - Object value
timeout - timeout value

in

public Object in(Object key)
Description copied from interface: Space
Take an entry from the space, waiting forever until one exists.

Specified by:
in in interface Space
Parameters:
key - Entry's key
Returns:
value

rd

public Object rd(Object key)
Description copied from interface: Space
Read an entry from the space, waiting forever until one exists.

Specified by:
rd in interface Space
Parameters:
key - Entry's key
Returns:
value

in

public Object in(Object key,
                 long timeout)
Description copied from interface: Space
Take an entry from the space, waiting a limited amount of time until one exists.

Specified by:
in in interface Space
Parameters:
key - Entry's key
timeout - millis to wait
Returns:
value or null

rd

public Object rd(Object key,
                 long timeout)
Description copied from interface: Space
Read an entry from the space, waiting a limited amount of time until one exists.

Specified by:
rd in interface Space
Parameters:
key - Entry's key
timeout - millis to wait
Returns:
value or null

inp

public Object inp(Object key)
Description copied from interface: Space
In probe takes an entry from the space if one exists, return null otherwise.

Specified by:
inp in interface Space
Parameters:
key - Entry's key
Returns:
value or null

rdp

public Object rdp(Object key)
Description copied from interface: Space
Read probe reads an entry from the space if one exists, return null otherwise.

Specified by:
rdp in interface Space
Parameters:
key - Entry's key
Returns:
value or null

existAny

public boolean existAny(Object[] keys)
Specified by:
existAny in interface Space
Parameters:
keys - array of keys to check
Returns:
true if one or more keys are available in the space

existAny

public boolean existAny(Object[] keys,
                        long timeout)
Specified by:
existAny in interface Space
Parameters:
keys - array of keys to check
timeout - to wait for any of the entries to become available
Returns:
true if one or more keys are available in the space


Copyright © 1998-2012 jPOS.org. All Rights Reserved.